5 * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
6 * Maintainer: Fabio <http://kirgroup.com/profile/fabrixxm>
7 * Maintainer: Tobias <https://diekershoff.homeunix.net/friendica/profile/tobias>
10 function quattro_init(&$a) {
11 $a->theme_info = array();
12 set_template_engine($a, 'smarty3');
15 $a->page['htmlhead'] .= '<script src="'.$a->get_baseurl().'/view/theme/quattro/tinycon.min.js"></script>';
16 $a->page['htmlhead'] .= <<< EOT
18 $(document).ready(function(){
19 $('nav').bind('nav-update', function(e,data){
20 var notifCount = $(data).find('notif').attr('count');
21 if (notifCount > 0 ) {
22 Tinycon.setBubble(notifCount);
24 Tinycon.setBubble('');
29 function insertFormatting(comment,BBcode,id) {
31 var tmpStr = $("#comment-edit-text-" + id).val();
32 if(tmpStr == comment) {
34 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
35 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
36 openMenu("comment-edit-submit-wrapper-" + id);
37 $("#comment-edit-text-" + id).val(tmpStr);
40 textarea = document.getElementById("comment-edit-text-" +id);
41 if (document.selection) {
43 selected = document.selection.createRange();
45 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
47 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
48 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
49 var start = textarea.selectionStart;
50 var end = textarea.selectionEnd;
52 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
54 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
59 function showThread(id) {
60 $("#collapsed-comments-" + id).show()
61 $("#collapsed-comments-" + id + " .collapsed-comments").show()
63 function hideThread(id) {
64 $("#collapsed-comments-" + id).hide()
65 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
69 function cmtBbOpen(id) {
70 $("#comment-edit-bb-" + id).show();
72 function cmtBbClose(id) {
73 $("#comment-edit-bb-" + id).hide();
75 $(document).ready(function() {
77 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
79 $('.group-edit-icon').hover(
81 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
83 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
86 $('.sidebar-group-element').hover(
88 id = $(this).attr('id');
89 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
92 id = $(this).attr('id');
93 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
97 $('.savedsearchdrop').hover(
99 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
101 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
104 $('.savedsearchterm').hover(
106 id = $(this).attr('id');
107 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
110 id = $(this).attr('id');
111 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}