]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/theme.php
7c94f001aa2ac9570980b027a3daa7915647baa2
[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 set_template_engine($a, 'smarty3');
14
15 $baseurl = $a->get_baseurl();
16
17 $a->theme_info = array();
18
19 $a->page['htmlhead'] .= <<< EOT
20 <script type="text/javascript">
21
22 function insertFormatting(comment,BBcode,id) {
23
24                 var tmpStr = $("#comment-edit-text-" + id).val();
25                 if(tmpStr == comment) {
26                         tmpStr = "";
27                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
28                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
29                         openMenu("comment-edit-submit-wrapper-" + id);
30                         $("#comment-edit-text-" + id).val(tmpStr);
31                 }
32
33         textarea = document.getElementById("comment-edit-text-" +id);
34         if (document.selection) {
35                 textarea.focus();
36                 selected = document.selection.createRange();
37                 if (BBcode == "url"){
38                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
39                         } else
40                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
41         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
42                 var start = textarea.selectionStart;
43                 var end = textarea.selectionEnd;
44                 if (BBcode == "url"){
45                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
46                         } else
47                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
48         }
49         return true;
50 }
51
52
53 function showThread(id) {
54         $("#collapsed-comments-" + id).show()
55         $("#collapsed-comments-" + id + " .collapsed-comments").show()
56 }
57 function hideThread(id) {
58         $("#collapsed-comments-" + id).hide()
59         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
60 }
61
62
63 function cmtBbOpen(id) {
64         $("#comment-edit-bb-" + id).show();
65 }
66 function cmtBbClose(id) {
67         $("#comment-edit-bb-" + id).hide();
68 }
69 </script>
70 EOT;
71 }
72