3 function duepuntozero_init(App $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
12 if ($colorset == 'greenzero') {
13 $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";
18 if ($colorset == 'easterbunny') {
19 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
21 if ($colorset == 'darkzero') {
22 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
24 if ($colorset == 'comix') {
25 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
27 if ($colorset == 'slackr') {
28 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
31 $a->page['htmlhead'] .= <<< EOT
33 function insertFormatting(BBcode, id) {
34 var tmpStr = $("#comment-edit-text-" + id).val();
36 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
37 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
38 openMenu("comment-edit-submit-wrapper-" + id);
41 textarea = document.getElementById("comment-edit-text-" +id);
42 if (document.selection) {
44 selected = document.selection.createRange();
45 if (BBcode == "url") {
46 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
48 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
50 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
51 var start = textarea.selectionStart;
52 var end = textarea.selectionEnd;
53 if (BBcode == "url") {
54 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
56 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
63 function cmtBbOpen(comment, id) {
64 if ($(comment).hasClass('comment-edit-text-full')) {
65 $(".comment-edit-bb-" + id).show();
70 function cmtBbClose(comment, id) {
73 $(document).ready(function() {
75 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
77 $('.group-edit-icon').hover(
79 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
81 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
84 $('.sidebar-group-element').hover(
86 id = $(this).attr('id');
87 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
90 id = $(this).attr('id');
91 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
95 $('.savedsearchdrop').hover(
97 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
99 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
102 $('.savedsearchterm').hover(
104 id = $(this).attr('id');
105 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
108 id = $(this).attr('id');
109 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}