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/
12 function vier_init(&$a) {
13 set_template_engine($a, 'smarty3');
15 $baseurl = $a->get_baseurl();
17 $a->theme_info = array();
19 $style = get_pconfig(local_user(), 'vier', 'style');
22 $style = get_config('vier', 'style');
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";
35 $a->page['htmlhead'] .= <<< EOT
36 <script type="text/javascript">
38 function insertFormatting(comment,BBcode,id) {
40 var tmpStr = $("#comment-edit-text-" + id).val();
41 if(tmpStr == comment) {
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);
49 textarea = document.getElementById("comment-edit-text-" +id);
50 if (document.selection) {
52 selected = document.selection.createRange();
54 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
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;
61 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
63 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
69 function showThread(id) {
70 $("#collapsed-comments-" + id).show()
71 $("#collapsed-comments-" + id + " .collapsed-comments").show()
73 function hideThread(id) {
74 $("#collapsed-comments-" + id).hide()
75 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
79 function cmtBbOpen(id) {
80 $("#comment-edit-bb-" + id).show();
82 function cmtBbClose(id) {
83 $("#comment-edit-bb-" + id).hide();