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