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 $a->page['htmlhead'] .= <<< EOT
19 <script type="text/javascript" src="$baseurl/view/theme/vier/js/jquery.divgrow-1.3.1.f1.min.js"></script>
22 function collapseHeight(elems) {
23 var elemName = '.wall-item-body:not(.divmore)';
24 if(typeof elems != 'undefined') {
25 elemName = elems + ' ' + elemName;
27 $(elemName).each(function() {
28 if($(this).height() > 450) {
29 $('html').height($('html').height());
30 $(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 0 });
31 $(this).addClass('divmore');
32 $('html').height('auto');
37 function insertFormatting(comment,BBcode,id) {
39 var tmpStr = $("#comment-edit-text-" + id).val();
40 if(tmpStr == comment) {
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);
48 textarea = document.getElementById("comment-edit-text-" +id);
49 if (document.selection) {
51 selected = document.selection.createRange();
53 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
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;
60 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
62 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
68 function showThread(id) {
69 $("#collapsed-comments-" + id).show()
70 $("#collapsed-comments-" + id + " .collapsed-comments").show()
72 function hideThread(id) {
73 $("#collapsed-comments-" + id).hide()
74 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
78 function cmtBbOpen(id) {
79 $("#comment-edit-bb-" + id).show();
81 function cmtBbClose(id) {
82 $("#comment-edit-bb-" + id).hide();