]> git.mxchange.org Git - friendica.git/blob - view/theme/slackr/theme.php
Implement Smarty3
[friendica.git] / view / theme / slackr / theme.php
1 <?php
2 $a->theme_info = array(
3   'extends' => 'duepuntozero',
4 );
5 $a->theme['template_engine'] = 'smarty3';
6
7 function slackr_init(&$a) {
8 $a->page['htmlhead'] .= <<< EOT
9 <script>
10 function insertFormatting(comment,BBcode,id) {
11         
12                 var tmpStr = $("#comment-edit-text-" + id).val();
13                 if(tmpStr == comment) {
14                         tmpStr = "";
15                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
16                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
17                         openMenu("comment-edit-submit-wrapper-" + id);
18                         $("#comment-edit-text-" + id).val(tmpStr);
19
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(comment, id) {
42         if($(comment).hasClass('comment-edit-text-full')) {
43                 $(".comment-edit-bb-" + id).show();
44                 return true;
45         }
46         return false;
47 }
48 function cmtBbClose(comment, id) {
49 //      if($(comment).hasClass('comment-edit-text-empty')) {
50 //              $(".comment-edit-bb-" + id).hide();
51 //              return true;
52 //      }
53         return false;
54 }
55
56
57 function hidecal() {
58         if(editor) return;
59         $('.fc').hide();
60 }
61
62 $(document).ready(function() {
63
64         $("#profile-jot-text").focus(hidecal);
65         $("#profile-jot-text").click(hidecal);
66
67 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
68
69 $('.group-edit-icon').hover(
70         function() {
71                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
72         function() {
73                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
74         );
75
76 $('.sidebar-group-element').hover(
77         function() {
78                 id = $(this).attr('id');
79                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
80
81         function() {
82                 id = $(this).attr('id');
83                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
84         );
85
86
87 $('.savedsearchdrop').hover(
88         function() {
89                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
90         function() {
91                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
92         );
93
94 $('.savedsearchterm').hover(
95         function() {
96                 id = $(this).attr('id');
97                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
98
99         function() {
100                 id = $(this).attr('id');
101                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
102         );
103
104 });
105
106
107 </script>
108 EOT;
109 }