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