3 function duepuntozero_init(&$a) {
5 $a->theme_info = array();
6 set_template_engine($a, 'smarty3');
8 $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
10 $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";
14 if ($colorset == 'purplezero')
15 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
16 if ($colorset == 'easterbunny')
17 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
18 if ($colorset == 'darkzero')
19 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
20 if ($colorset == 'comix')
21 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
22 if ($colorset == 'slackr')
23 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
25 $a->page['htmlhead'] .= <<< EOT
27 function insertFormatting(comment,BBcode,id) {
29 var tmpStr = $("#comment-edit-text-" + id).val();
30 if(tmpStr == comment) {
32 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
33 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
34 openMenu("comment-edit-submit-wrapper-" + id);
35 $("#comment-edit-text-" + id).val(tmpStr);
38 textarea = document.getElementById("comment-edit-text-" +id);
39 if (document.selection) {
41 selected = document.selection.createRange();
43 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
45 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
46 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
47 var start = textarea.selectionStart;
48 var end = textarea.selectionEnd;
50 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
52 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) {
65 // if($(comment).hasClass('comment-edit-text-empty')) {
66 // $(".comment-edit-bb-" + id).hide();
71 $(document).ready(function() {
73 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
75 $('.group-edit-icon').hover(
77 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
79 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
82 $('.sidebar-group-element').hover(
84 id = $(this).attr('id');
85 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
88 id = $(this).attr('id');
89 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
93 $('.savedsearchdrop').hover(
95 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
97 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
100 $('.savedsearchterm').hover(
102 id = $(this).attr('id');
103 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
106 id = $(this).attr('id');
107 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}