]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/theme.php
af7cd0275f605f8aea8ea0ed5c11b3ad3d7ebf65
[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 <link rel='stylesheet' media='screen and (max-width: 1100px)' href='view/theme/vier/narrow.css' />
24 <script type="text/javascript">
25
26 function insertFormatting(comment,BBcode,id) {
27
28                 var tmpStr = $("#comment-edit-text-" + id).val();
29                 if(tmpStr == comment) {
30                         tmpStr = "";
31                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
32                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
33                         openMenu("comment-edit-submit-wrapper-" + id);
34                         $("#comment-edit-text-" + id).val(tmpStr);
35                 }
36
37         textarea = document.getElementById("comment-edit-text-" +id);
38         if (document.selection) {
39                 textarea.focus();
40                 selected = document.selection.createRange();
41                 if (BBcode == "url"){
42                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
43                         } else
44                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
45         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
46                 var start = textarea.selectionStart;
47                 var end = textarea.selectionEnd;
48                 if (BBcode == "url"){
49                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
50                         } else
51                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
52         }
53         return true;
54 }
55
56
57 function showThread(id) {
58         $("#collapsed-comments-" + id).show()
59         $("#collapsed-comments-" + id + " .collapsed-comments").show()
60 }
61 function hideThread(id) {
62         $("#collapsed-comments-" + id).hide()
63         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
64 }
65
66
67 function cmtBbOpen(id) {
68         $("#comment-edit-bb-" + id).show();
69 }
70 function cmtBbClose(id) {
71         $("#comment-edit-bb-" + id).hide();
72 }
73 </script>
74 EOT;
75 }
76