]> git.mxchange.org Git - friendica.git/blob - view/theme/darkzero/theme.php
Implement Smarty3
[friendica.git] / view / theme / darkzero / theme.php
1 <?php
2
3 /*
4  * Name: Darkzero
5  * Version: 1.0
6  * Author: Fabio Communi <fabrix.xm@gmail.com>
7  * Maintainer: Fabio Communi <fabrix.xm@gmail.com>
8  * Maintainer: Mike Macgirvin <mike@macgirvin.com>
9  */
10
11 $a->theme_info = array(
12   'extends' => 'duepuntozero',
13 );
14 $a->theme['template_engine'] = 'smarty3';
15
16 function darkzero_init(&$a) {
17 $a->page['htmlhead'] .= <<< EOT
18 <script>
19 function insertFormatting(comment,BBcode,id) {
20         
21                 var tmpStr = $("#comment-edit-text-" + id).val();
22                 if(tmpStr == comment) {
23                         tmpStr = "";
24                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
25                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
26                         openMenu("comment-edit-submit-wrapper-" + id);
27                         $("#comment-edit-text-" + id).val(tmpStr);
28                 }
29
30         textarea = document.getElementById("comment-edit-text-" +id);
31         if (document.selection) {
32                 textarea.focus();
33                 selected = document.selection.createRange();
34                 if (BBcode == "url"){
35                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
36                         } else                  
37                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
38         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
39                 var start = textarea.selectionStart;
40                 var end = textarea.selectionEnd;
41                 if (BBcode == "url"){
42                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
43                         } else
44                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
45         }
46         return true;
47 }
48
49 function cmtBbOpen(comment, id) {
50         if($(comment).hasClass('comment-edit-text-full')) {
51                 $(".comment-edit-bb-" + id).show();
52                 return true;
53         }
54         return false;
55 }
56 function cmtBbClose(comment, id) {
57         if($(comment).hasClass('comment-edit-text-empty')) {
58                 $(".comment-edit-bb-" + id).hide();
59                 return true;
60         }
61         return false;
62 }
63
64 $(document).ready(function() {
65
66 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
67
68 $('.group-edit-icon').hover(
69         function() {
70                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
71         function() {
72                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
73         );
74
75 $('.sidebar-group-element').hover(
76         function() {
77                 id = $(this).attr('id');
78                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
79
80         function() {
81                 id = $(this).attr('id');
82                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
83         );
84
85
86 $('.savedsearchdrop').hover(
87         function() {
88                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
89         function() {
90                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
91         );
92
93 $('.savedsearchterm').hover(
94         function() {
95                 id = $(this).attr('id');
96                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
97
98         function() {
99                 id = $(this).attr('id');
100                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
101         );
102
103 });
104
105
106 </script>
107 EOT;
108 }