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