6 * Author: Fabio Communi <fabrix.xm@gmail.com>
7 * Maintainer: Fabio Communi <fabrix.xm@gmail.com>
8 * Maintainer: Mike Macgirvin <mike@macgirvin.com>
11 function darkzero_init(&$a) {
12 $a->theme_info = array(
13 'extends' => 'duepuntozero',
15 set_template_engine($a, 'smarty3');
17 $a->page['htmlhead'] .= <<< EOT
19 function insertFormatting(comment,BBcode,id) {
21 var tmpStr = $("#comment-edit-text-" + id).val();
22 if(tmpStr == comment) {
24 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
25 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
26 openMenu("comment-edit-submit-wrapper-" + id);
27 $("#comment-edit-text-" + id).val(tmpStr);
30 textarea = document.getElementById("comment-edit-text-" +id);
31 if (document.selection) {
33 selected = document.selection.createRange();
35 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
37 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
38 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
39 var start = textarea.selectionStart;
40 var end = textarea.selectionEnd;
42 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
44 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
49 function cmtBbOpen(comment, id) {
50 if($(comment).hasClass('comment-edit-text-full')) {
51 $(".comment-edit-bb-" + id).show();
56 function cmtBbClose(comment, id) {
57 if($(comment).hasClass('comment-edit-text-empty')) {
58 $(".comment-edit-bb-" + id).hide();
64 $(document).ready(function() {
66 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
68 $('.group-edit-icon').hover(
70 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
72 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
75 $('.sidebar-group-element').hover(
77 id = $(this).attr('id');
78 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
81 id = $(this).attr('id');
82 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
86 $('.savedsearchdrop').hover(
88 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
90 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
93 $('.savedsearchterm').hover(
95 id = $(this).attr('id');
96 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
99 id = $(this).attr('id');
100 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}