]> git.mxchange.org Git - friendica.git/blob - view/theme/slackr/theme.php
Merge remote branch 'friendica/master' into quattro-fontsoptions
[friendica.git] / view / theme / slackr / theme.php
1 <?php
2 $a->theme_info = array(
3   'extends' => 'duepuntozero',
4 );
5
6 function slackr_init(&$a) {
7 $a->page['htmlhead'] .= <<< EOT
8 <script>
9 function insertFormatting(comment,BBcode,id) {
10         
11                 var tmpStr = $("#comment-edit-text-" + id).val();
12                 if(tmpStr == comment) {
13                         tmpStr = "";
14                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
15                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
16                         openMenu("comment-edit-submit-wrapper-" + id);
17                         $("#comment-edit-text-" + id).val(tmpStr);
18
19                 }
20
21         textarea = document.getElementById("comment-edit-text-" +id);
22         if (document.selection) {
23                 textarea.focus();
24                 selected = document.selection.createRange();
25                 if (BBcode == "url"){
26                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
27                         } else                  
28                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
29         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
30                 var start = textarea.selectionStart;
31                 var end = textarea.selectionEnd;
32                 if (BBcode == "url"){
33                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
34                         } else
35                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
36         }
37         return true;
38 }
39
40 function cmtBbOpen(comment, id) {
41         if($(comment).hasClass('comment-edit-text-full')) {
42                 $(".comment-edit-bb-" + id).show();
43                 return true;
44         }
45         return false;
46 }
47 function cmtBbClose(comment, id) {
48 //      if($(comment).hasClass('comment-edit-text-empty')) {
49 //              $(".comment-edit-bb-" + id).hide();
50 //              return true;
51 //      }
52         return false;
53 }
54
55
56 function hidecal() {
57         if(editor) return;
58         $('.fc').hide();
59 }
60
61 $(document).ready(function() {
62
63         $("#profile-jot-text").focus(hidecal);
64         $("#profile-jot-text").click(hidecal);
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 }