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 var intro = $(data).find('intro').text();
22 var mail = $(data).find('mail').text();
24 console.log(intro,mail);
26 if (notifCount > 0 ) {
27 Tinycon.setBubble(notifCount);
29 Tinycon.setBubble('');
33 $("#nav-introductions-link").addClass("on");
35 $("#nav-introductions-link").removeClass("on");
39 $("#nav-messages-link").addClass("on");
41 $("#nav-messages-link").removeClass("on");
47 function insertFormatting(comment,BBcode,id) {
49 var tmpStr = $("#comment-edit-text-" + id).val();
50 if(tmpStr == comment) {
52 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
53 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
54 openMenu("comment-edit-submit-wrapper-" + id);
55 $("#comment-edit-text-" + id).val(tmpStr);
58 textarea = document.getElementById("comment-edit-text-" +id);
59 if (document.selection) {
61 selected = document.selection.createRange();
63 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
65 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
66 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
67 var start = textarea.selectionStart;
68 var end = textarea.selectionEnd;
70 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
72 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
77 function showThread(id) {
78 $("#collapsed-comments-" + id).show()
79 $("#collapsed-comments-" + id + " .collapsed-comments").show()
81 function hideThread(id) {
82 $("#collapsed-comments-" + id).hide()
83 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
87 function cmtBbOpen(id) {
88 $("#comment-edit-bb-" + id).show();
90 function cmtBbClose(id) {
91 $("#comment-edit-bb-" + id).hide();
93 $(document).ready(function() {
95 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
97 $('.group-edit-icon').hover(
99 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
101 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
104 $('.sidebar-group-element').hover(
106 id = $(this).attr('id');
107 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
110 id = $(this).attr('id');
111 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
115 $('.savedsearchdrop').hover(
117 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
119 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
122 $('.savedsearchterm').hover(
124 id = $(this).attr('id');
125 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
128 id = $(this).attr('id');
129 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}