3 function duepuntozero_init(&$a) {
5 set_template_engine($a, 'smarty3');
7 $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
9 $colorset = get_config('duepuntozero', 'colorset'); // user setting have priority, then node settings
11 if ($colorset == 'greenzero')
12 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
13 if ($colorset == 'purplezero')
14 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
15 if ($colorset == 'easterbunny')
16 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
17 if ($colorset == 'darkzero')
18 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
19 if ($colorset == 'comix')
20 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
21 if ($colorset == 'slackr')
22 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
24 $a->page['htmlhead'] .= <<< EOT
26 function insertFormatting(comment,BBcode,id) {
28 var tmpStr = $("#comment-edit-text-" + id).val();
29 if(tmpStr == comment) {
31 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
32 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
33 openMenu("comment-edit-submit-wrapper-" + id);
34 $("#comment-edit-text-" + id).val(tmpStr);
37 textarea = document.getElementById("comment-edit-text-" +id);
38 if (document.selection) {
40 selected = document.selection.createRange();
42 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
44 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
45 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
46 var start = textarea.selectionStart;
47 var end = textarea.selectionEnd;
49 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
51 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
56 function cmtBbOpen(comment, id) {
57 if($(comment).hasClass('comment-edit-text-full')) {
58 $(".comment-edit-bb-" + id).show();
63 function cmtBbClose(comment, id) {
64 // if($(comment).hasClass('comment-edit-text-empty')) {
65 // $(".comment-edit-bb-" + id).hide();
70 $(document).ready(function() {
72 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
74 $('.group-edit-icon').hover(
76 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
78 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
81 $('.sidebar-group-element').hover(
83 id = $(this).attr('id');
84 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
87 id = $(this).attr('id');
88 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
92 $('.savedsearchdrop').hover(
94 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
96 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
99 $('.savedsearchterm').hover(
101 id = $(this).attr('id');
102 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
105 id = $(this).attr('id');
106 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}