5 * Description: Theme based on Testbubble and optimized for Tablets.
6 * Version: Version 2013-05-08
7 * Author: Anne Walk, Devlon Duthied
8 * Author: Alex <https://red.pixelbits.de/channel/alex>
9 * Maintainer: Nomen Nominandum
10 * Screenshot: <a href="screenshot.png">Screenshot</a>
13 function smoothly_init(&$a) {
14 set_template_engine($a, 'smarty3');
18 $baseurl = App::get_baseurl($ssl_state);
19 $a->page['htmlhead'] .= <<< EOT
22 function insertFormatting(BBcode, id) {
23 var tmpStr = $("#comment-edit-text-" + id).val();
25 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
26 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
27 openMenu("comment-edit-submit-wrapper-" + id);
28 $("#comment-edit-text-" + id).val(tmpStr);
31 textarea = document.getElementById("comment-edit-text-" +id);
32 if (document.selection) {
34 selected = document.selection.createRange();
35 if (BBcode == "url") {
36 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
38 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
40 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
41 var start = textarea.selectionStart;
42 var end = textarea.selectionEnd;
43 if (BBcode == "url") {
44 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
46 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
53 function cmtBbOpen(id) {
54 $(".comment-edit-bb-" + id).show();
56 function cmtBbClose(comment, id) {
57 $(".comment-edit-bb-" + id).hide();
59 $(document).ready(function() {
61 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
63 $('.group-edit-icon').hover(
65 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
67 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
70 $('.sidebar-group-element').hover(
72 id = $(this).attr('id');
73 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
76 id = $(this).attr('id');
77 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
81 $('.savedsearchdrop').hover(
83 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
85 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
88 $('.savedsearchterm').hover(
90 id = $(this).attr('id');
91 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
94 id = $(this).attr('id');
95 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
104 if (!is_null($cssFile)) {
105 $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
112 if (! function_exists('_js_in_foot')) {
113 function _js_in_foot() {
114 /** @purpose insert stuff in bottom of page
118 $baseurl = App::get_baseurl($ssl_state);
119 $bottom['$baseurl'] = $baseurl;
120 $tpl = get_markup_template('bottom.tpl');
122 return $a->page['bottom'] = replace_macros($tpl, $bottom);