5 function duepuntozero_init(App $a) {
7 set_template_engine($a, 'smarty3');
9 $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
11 $colorset = get_config('duepuntozero', 'colorset'); // user setting have priority, then node settings
13 if ($colorset == 'greenzero')
14 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
15 if ($colorset == 'purplezero')
16 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
17 if ($colorset == 'easterbunny')
18 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
19 if ($colorset == 'darkzero')
20 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
21 if ($colorset == 'comix')
22 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
23 if ($colorset == 'slackr')
24 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
26 $a->page['htmlhead'] .= <<< EOT
28 function insertFormatting(BBcode, id) {
29 var tmpStr = $("#comment-edit-text-" + id).val();
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);
36 textarea = document.getElementById("comment-edit-text-" +id);
37 if (document.selection) {
39 selected = document.selection.createRange();
40 if (BBcode == "url") {
41 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
43 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
45 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
46 var start = textarea.selectionStart;
47 var end = textarea.selectionEnd;
48 if (BBcode == "url") {
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);
58 function cmtBbOpen(comment, id) {
59 if ($(comment).hasClass('comment-edit-text-full')) {
60 $(".comment-edit-bb-" + id).show();
65 function cmtBbClose(comment, id) {
68 $(document).ready(function() {
70 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
72 $('.group-edit-icon').hover(
74 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
76 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
79 $('.sidebar-group-element').hover(
81 id = $(this).attr('id');
82 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
85 id = $(this).attr('id');
86 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
90 $('.savedsearchdrop').hover(
92 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
94 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
97 $('.savedsearchterm').hover(
99 id = $(this).attr('id');
100 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
103 id = $(this).attr('id');
104 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}