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/
11 function vier_init(&$a) {
12 set_template_engine($a, 'smarty3');
14 $baseurl = $a->get_baseurl();
16 $a->theme_info = array();
18 $style = get_pconfig(local_user(), 'vier', 'style');
21 $style = get_config('vier', 'style');
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";
32 $a->page['htmlhead'] .= <<< EOT
33 <script type="text/javascript">
35 function collapseHeight(elems) {
36 var elemName = '.wall-item-body:not(.divmore)';
37 if(typeof elems != 'undefined') {
38 elemName = elems + ' ' + elemName;
40 $(elemName).each(function() {
41 if($(this).height() > 450) {
42 $('html').height($('html').height());
43 $(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 0 });
44 $(this).addClass('divmore');
45 $('html').height('auto');
50 function insertFormatting(comment,BBcode,id) {
52 var tmpStr = $("#comment-edit-text-" + id).val();
53 if(tmpStr == comment) {
55 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
56 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
57 openMenu("comment-edit-submit-wrapper-" + id);
58 $("#comment-edit-text-" + id).val(tmpStr);
61 textarea = document.getElementById("comment-edit-text-" +id);
62 if (document.selection) {
64 selected = document.selection.createRange();
66 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
68 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
69 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
70 var start = textarea.selectionStart;
71 var end = textarea.selectionEnd;
73 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
75 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
81 function showThread(id) {
82 $("#collapsed-comments-" + id).show()
83 $("#collapsed-comments-" + id + " .collapsed-comments").show()
85 function hideThread(id) {
86 $("#collapsed-comments-" + id).hide()
87 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
91 function cmtBbOpen(id) {
92 $("#comment-edit-bb-" + id).show();
94 function cmtBbClose(id) {
95 $("#comment-edit-bb-" + id).hide();