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