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" 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');
20 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/flat.css" type="text/css" media="screen"/>'."\n";
21 else if ($style == "netcolour")
22 $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>'."\n";
24 $a->page['htmlhead'] .= <<< EOT
25 <script type="text/javascript" src="$baseurl/view/theme/vier/js/jquery.divgrow-1.3.1.f1.min.js"></script>
28 function collapseHeight(elems) {
29 var elemName = '.wall-item-body:not(.divmore)';
30 if(typeof elems != 'undefined') {
31 elemName = elems + ' ' + elemName;
33 $(elemName).each(function() {
34 if($(this).height() > 450) {
35 $('html').height($('html').height());
36 $(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 0 });
37 $(this).addClass('divmore');
38 $('html').height('auto');
43 function insertFormatting(comment,BBcode,id) {
45 var tmpStr = $("#comment-edit-text-" + id).val();
46 if(tmpStr == comment) {
48 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
49 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
50 openMenu("comment-edit-submit-wrapper-" + id);
51 $("#comment-edit-text-" + id).val(tmpStr);
54 textarea = document.getElementById("comment-edit-text-" +id);
55 if (document.selection) {
57 selected = document.selection.createRange();
59 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
61 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
62 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
63 var start = textarea.selectionStart;
64 var end = textarea.selectionEnd;
66 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
68 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
74 function showThread(id) {
75 $("#collapsed-comments-" + id).show()
76 $("#collapsed-comments-" + id + " .collapsed-comments").show()
78 function hideThread(id) {
79 $("#collapsed-comments-" + id).hide()
80 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
84 function cmtBbOpen(id) {
85 $("#comment-edit-bb-" + id).show();
87 function cmtBbClose(id) {
88 $("#comment-edit-bb-" + id).hide();