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