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