]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/theme.php
c52a2be82e7c69e8ed646c024af7e88781771865
[friendica.git] / view / theme / vier / theme.php
1 <?php
2 /**
3  * Name: Vier
4  * Version: 1.2
5  * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
6  * Author: Ike <http://pirati.ca/profile/heluecht>
7  * Author: Beanow <https://fc.oscp.info/profile/beanow>
8  * Maintainer: Ike <http://pirati.ca/profile/heluecht>
9  * Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
10  */
11
12 function vier_init(&$a) {
13
14 $a->theme_events_in_profile = false;
15
16 set_template_engine($a, 'smarty3');
17
18 $baseurl = $a->get_baseurl();
19
20 $a->theme_info = array();
21
22 $a->page['htmlhead'] .= <<< EOT
23 <script type="text/javascript">
24
25 function insertFormatting(comment,BBcode,id) {
26
27                 var tmpStr = $("#comment-edit-text-" + id).val();
28                 if(tmpStr == comment) {
29                         tmpStr = "";
30                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
31                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
32                         openMenu("comment-edit-submit-wrapper-" + id);
33                         $("#comment-edit-text-" + id).val(tmpStr);
34                 }
35
36         textarea = document.getElementById("comment-edit-text-" +id);
37         if (document.selection) {
38                 textarea.focus();
39                 selected = document.selection.createRange();
40                 if (BBcode == "url"){
41                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
42                         } else
43                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
44         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
45                 var start = textarea.selectionStart;
46                 var end = textarea.selectionEnd;
47                 if (BBcode == "url"){
48                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
49                         } else
50                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
51         }
52         return true;
53 }
54
55
56 function showThread(id) {
57         $("#collapsed-comments-" + id).show()
58         $("#collapsed-comments-" + id + " .collapsed-comments").show()
59 }
60 function hideThread(id) {
61         $("#collapsed-comments-" + id).hide()
62         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
63 }
64
65
66 function cmtBbOpen(id) {
67         $("#comment-edit-bb-" + id).show();
68 }
69 function cmtBbClose(id) {
70         $("#comment-edit-bb-" + id).hide();
71 }
72 </script>
73 EOT;
74 }
75