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