4 use Friendica\Core\Config;
5 use Friendica\Core\PConfig;
6 use Friendica\Core\Renderer;
8 function duepuntozero_init(App $a) {
10 Renderer::setActiveTemplateEngine('smarty3');
12 $colorset = PConfig::get( local_user(), 'duepuntozero','colorset');
14 $colorset = Config::get('duepuntozero', 'colorset'); // user setting have priority, then node settings
16 if ($colorset == 'greenzero')
17 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
18 if ($colorset == 'purplezero')
19 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
20 if ($colorset == 'easterbunny')
21 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
22 if ($colorset == 'darkzero')
23 $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";
26 if ($colorset == 'slackr')
27 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
29 $a->page['htmlhead'] .= <<< EOT
31 function insertFormatting(BBcode, id) {
32 var tmpStr = $("#comment-edit-text-" + id).val();
34 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
35 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
36 openMenu("comment-edit-submit-wrapper-" + id);
39 textarea = document.getElementById("comment-edit-text-" +id);
40 if (document.selection) {
42 selected = document.selection.createRange();
43 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 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
53 function cmtBbOpen(comment, id) {
54 if ($(comment).hasClass('comment-edit-text-full')) {
55 $(".comment-edit-bb-" + id).show();
60 function cmtBbClose(comment, id) {
63 $(document).ready(function() {
65 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
67 $('.group-edit-icon').hover(
69 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
71 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
74 $('.sidebar-group-element').hover(
76 id = $(this).attr('id');
77 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
80 id = $(this).attr('id');
81 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
85 $('.savedsearchdrop').hover(
87 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
89 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
92 $('.savedsearchterm').hover(
94 id = $(this).attr('id');
95 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
98 id = $(this).attr('id');
99 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}