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(BBcode, id) {
27 var tmpStr = $("#comment-edit-text-" + id).val();
29 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
30 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
31 openMenu("comment-edit-submit-wrapper-" + id);
32 $("#comment-edit-text-" + id).val(tmpStr);
35 textarea = document.getElementById("comment-edit-text-" +id);
36 if (document.selection) {
38 selected = document.selection.createRange();
39 if (BBcode == "url") {
40 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
42 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
44 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
45 var start = textarea.selectionStart;
46 var end = textarea.selectionEnd;
47 if (BBcode == "url") {
48 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
50 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
57 function cmtBbOpen(comment, id) {
58 if ($(comment).hasClass('comment-edit-text-full')) {
59 $(".comment-edit-bb-" + id).show();
64 function cmtBbClose(comment, id) {
67 $(document).ready(function() {
69 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
71 $('.group-edit-icon').hover(
73 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
75 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
78 $('.sidebar-group-element').hover(
80 id = $(this).attr('id');
81 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
84 id = $(this).attr('id');
85 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
89 $('.savedsearchdrop').hover(
91 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
93 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
96 $('.savedsearchterm').hover(
98 id = $(this).attr('id');
99 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
102 id = $(this).attr('id');
103 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}