]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/theme.php
Added Beanow as author, since he did most of the last changes.
[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 $style = get_pconfig(local_user(), 'vier', 'style');
20
21 if ($style == "")
22         $style = get_config('vier', 'style');
23
24 if ($style == "flat")
25         $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/flat.css" type="text/css" media="screen"/>'."\n";
26 else if ($style == "netcolour")
27         $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>'."\n";
28 else if ($style == "breathe")
29         $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/breathe.css" type="text/css" media="screen"/>'."\n";
30 else if ($style == "plus")
31         $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/plus.css" type="text/css" media="screen"/>'."\n";
32 else if ($style == "dark")
33         $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/dark.css" type="text/css" media="screen"/>'."\n";
34
35 $a->page['htmlhead'] .= <<< EOT
36 <script type="text/javascript">
37
38 function insertFormatting(comment,BBcode,id) {
39
40                 var tmpStr = $("#comment-edit-text-" + id).val();
41                 if(tmpStr == comment) {
42                         tmpStr = "";
43                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
44                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
45                         openMenu("comment-edit-submit-wrapper-" + id);
46                         $("#comment-edit-text-" + id).val(tmpStr);
47                 }
48
49         textarea = document.getElementById("comment-edit-text-" +id);
50         if (document.selection) {
51                 textarea.focus();
52                 selected = document.selection.createRange();
53                 if (BBcode == "url"){
54                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
55                         } else
56                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
57         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
58                 var start = textarea.selectionStart;
59                 var end = textarea.selectionEnd;
60                 if (BBcode == "url"){
61                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
62                         } else
63                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
64         }
65         return true;
66 }
67
68
69 function showThread(id) {
70         $("#collapsed-comments-" + id).show()
71         $("#collapsed-comments-" + id + " .collapsed-comments").show()
72 }
73 function hideThread(id) {
74         $("#collapsed-comments-" + id).hide()
75         $("#collapsed-comments-" + id + " .collapsed-comments").hide()
76 }
77
78
79 function cmtBbOpen(id) {
80         $("#comment-edit-bb-" + id).show();
81 }
82 function cmtBbClose(id) {
83         $("#comment-edit-bb-" + id).hide();
84 }
85 </script>
86 EOT;
87 }
88