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