4 use Friendica\Core\Config;
5 use Friendica\Core\PConfig;
7 function duepuntozero_init(App $a) {
9 $a->set_template_engine('smarty3');
11 $colorset = PConfig::get( local_user(), 'duepuntozero','colorset');
13 $colorset = Config::get('duepuntozero', 'colorset'); // user setting have priority, then node settings
15 if ($colorset == 'greenzero')
16 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
17 if ($colorset == 'purplezero')
18 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
19 if ($colorset == 'easterbunny')
20 $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";
23 if ($colorset == 'comix')
24 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
25 if ($colorset == 'slackr')
26 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
28 $a->page['htmlhead'] .= <<< EOT
30 function insertFormatting(BBcode, id) {
31 var tmpStr = $("#comment-edit-text-" + id).val();
33 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
34 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
35 openMenu("comment-edit-submit-wrapper-" + id);
38 textarea = document.getElementById("comment-edit-text-" +id);
39 if (document.selection) {
41 selected = document.selection.createRange();
42 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
43 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
44 var start = textarea.selectionStart;
45 var end = textarea.selectionEnd;
46 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
52 function cmtBbOpen(comment, id) {
53 if ($(comment).hasClass('comment-edit-text-full')) {
54 $(".comment-edit-bb-" + id).show();
59 function cmtBbClose(comment, id) {
62 $(document).ready(function() {
64 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
66 $('.group-edit-icon').hover(
68 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
70 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
73 $('.sidebar-group-element').hover(
75 id = $(this).attr('id');
76 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
79 id = $(this).attr('id');
80 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
84 $('.savedsearchdrop').hover(
86 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
88 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
91 $('.savedsearchterm').hover(
93 id = $(this).attr('id');
94 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
97 id = $(this).attr('id');
98 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}