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