]> git.mxchange.org Git - friendica.git/blob - view/theme/slackr/theme.php
Merge remote branch 'upstream/master'
[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                                                                 }
18
19         textarea = document.getElementById("comment-edit-text-" +id);
20         if (document.selection) {
21                 textarea.focus();
22                 selected = document.selection.createRange();
23                 if (BBcode == "url"){
24                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
25                         } else                  
26                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
27         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
28                 var start = textarea.selectionStart;
29                 var end = textarea.selectionEnd;
30                 if (BBcode == "url"){
31                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
32                         } else
33                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
34         }
35         return true;
36 }
37
38 function cmtBbOpen(id) {
39         $(".comment-edit-bb-" + id).show();
40 }
41 function cmtBbClose(id) {
42         $(".comment-edit-bb-" + id).hide();
43 }
44 $(document).ready(function() {
45
46 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
47
48 $('.group-edit-icon').hover(
49         function() {
50                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
51         function() {
52                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
53         );
54
55 $('.sidebar-group-element').hover(
56         function() {
57                 id = $(this).attr('id');
58                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
59
60         function() {
61                 id = $(this).attr('id');
62                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
63         );
64
65
66 $('.savedsearchdrop').hover(
67         function() {
68                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
69         function() {
70                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
71         );
72
73 $('.savedsearchterm').hover(
74         function() {
75                 id = $(this).attr('id');
76                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
77
78         function() {
79                 id = $(this).attr('id');
80                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
81         );
82
83 });
84
85
86 </script>
87 EOT;
88 }