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