]> git.mxchange.org Git - friendica.git/blob - view/theme/duepuntozero/theme.php
Merge branch 'rewrites/app_get_baseurl_static' into develop
[friendica.git] / view / theme / duepuntozero / theme.php
1 <?php
2
3 function duepuntozero_init(App &$a) {
4
5 set_template_engine($a, 'smarty3');
6
7     $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
8     if (!$colorset)
9        $colorset = get_config('duepuntozero', 'colorset');          // user setting have priority, then node settings
10     if ($colorset) {
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";
23     }
24 $a->page['htmlhead'] .= <<< EOT
25 <script>
26 function insertFormatting(comment,BBcode,id) {
27         
28                 var tmpStr = $("#comment-edit-text-" + id).val();
29                 if(tmpStr == comment) {
30                         tmpStr = "";
31                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
32                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
33                         openMenu("comment-edit-submit-wrapper-" + id);
34                         $("#comment-edit-text-" + id).val(tmpStr);
35                 }
36
37         textarea = document.getElementById("comment-edit-text-" +id);
38         if (document.selection) {
39                 textarea.focus();
40                 selected = document.selection.createRange();
41                 if (BBcode == "url"){
42                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
43                         } else                  
44                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
45         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
46                 var start = textarea.selectionStart;
47                 var end = textarea.selectionEnd;
48                 if (BBcode == "url"){
49                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
50                         } else
51                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
52         }
53         return true;
54 }
55
56 function cmtBbOpen(comment, id) {
57         if($(comment).hasClass('comment-edit-text-full')) {
58                 $(".comment-edit-bb-" + id).show();
59                 return true;
60         }
61         return false;
62 }
63 function cmtBbClose(comment, id) {
64 //      if($(comment).hasClass('comment-edit-text-empty')) {
65 //              $(".comment-edit-bb-" + id).hide();
66 //              return true;
67 //      }
68         return false;
69 }
70 $(document).ready(function() {
71
72 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
73
74 $('.group-edit-icon').hover(
75         function() {
76                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
77         function() {
78                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
79         );
80
81 $('.sidebar-group-element').hover(
82         function() {
83                 id = $(this).attr('id');
84                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
85
86         function() {
87                 id = $(this).attr('id');
88                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
89         );
90
91
92 $('.savedsearchdrop').hover(
93         function() {
94                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
95         function() {
96                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
97         );
98
99 $('.savedsearchterm').hover(
100         function() {
101                 id = $(this).attr('id');
102                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
103
104         function() {
105                 id = $(this).attr('id');
106                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
107         );
108
109 });
110
111
112 </script>
113 EOT;
114 }