]> git.mxchange.org Git - friendica.git/blob - theme.php
first files - move to Version 0.1
[friendica.git] / theme.php
1 <?php
2 /*
3  * Name: frio
4  * Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the <a href="https://github.com/rabuzarus/frio/blob/master/README.md">ReadMe</a> and <a href="https://github.com/rabuzarus/frio">GitHub</a>.
5  * Version: V.0.1 Alpha
6  * Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus>
7  * 
8  */
9
10 $frio = "view/theme/frio";
11
12 global $frio;
13
14 function frio_init(&$a) {
15         set_template_engine($a, 'smarty3');
16
17         $baseurl = $a->get_baseurl();
18
19         $style = get_pconfig(local_user(), 'frio', 'style');
20
21         $frio = "view/theme/frio";
22
23         global $frio;
24         
25         
26
27
28         if ($style == "")
29                 $style = get_config('frio', 'style');
30
31 $a->page['htmlhead'] .= <<< EOT
32 <script type="text/javascript">
33
34 function insertFormatting(comment,BBcode,id) {
35
36                 var tmpStr = $("#comment-edit-text-" + id).val();
37                 if(tmpStr == comment) {
38                         tmpStr = "";
39                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
40                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
41                         openMenu("comment-edit-submit-wrapper-" + id);
42                         $("#comment-edit-text-" + id).val(tmpStr);
43                 }
44
45         textarea = document.getElementById("comment-edit-text-" +id);
46         if (document.selection) {
47                 textarea.focus();
48                 selected = document.selection.createRange();
49                 if (BBcode == "url"){
50                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
51                         } else
52                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
53         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
54                 var start = textarea.selectionStart;
55                 var end = textarea.selectionEnd;
56                 if (BBcode == "url"){
57                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
58                         } else
59                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
60         }
61         return true;
62 }
63
64
65 function showThread(id) {
66         $("#collapsed-comments-" + id).show()
67         $("#collapsed-comments-" + id + " .collapsed-comments").show()
68 }
69 function hideThread(id) {
70         $("#collapsed-comments-" + id).hide()
71         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
72 }
73
74
75 function cmtBbOpen(id) {
76         $("#comment-edit-bb-" + id).show();
77 }
78 function cmtBbClose(id) {
79         $("#comment-edit-bb-" + id).hide();
80 }
81 </script>
82 EOT;
83 }
84
85 function frio_install() {
86
87         logger("installed theme frio");
88 }
89
90 function frio_uninstall() {
91
92         logger("uninstalled theme frio");
93 }