1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
2 $(document).ready(function(){
3 $('nav').bind('nav-update', function(e,data){
4 var notifCount = $(data).find('notif').attr('count');
5 var intro = $(data).find('intro').text();
6 var mail = $(data).find('mail').text();
8 $(".tool .notify").removeClass("on");
9 $(data).find("group").each(function() {
11 var gcount = this.innerHTML;
12 $(".group-"+gid+" .notify").addClass("on").text(gcount);
15 $(".forum-widget-entry .notify").removeClass("on");
16 $(data).find("forum").each(function() {
18 var fcount = this.innerHTML;
19 $(".forum-"+fid+" .notify").addClass("on").text(fcount);
22 console.log(intro,mail);
24 if (notifCount > 0 ) {
25 Tinycon.setBubble(notifCount);
27 Tinycon.setBubble('');
31 $("#nav-introductions-link").addClass("on");
33 $("#nav-introductions-link").removeClass("on");
37 $("#nav-messages-link").addClass("on");
39 $("#nav-messages-link").removeClass("on");
45 * show and hide contact action buttons in
46 * contacts page on contacts' checkbox selection
48 $('.contact-select').bind('click', function(e) {
50 var elm = $("#contacts-actions");
53 if (y+elm.height() > $("html").height()) y=$("html").height()-elm.height();
54 elm.css('top', y+"px");
55 if ($(".contact-select:checked").length > 0) {
63 function insertFormatting(BBcode, id) {
64 var tmpStr = $("#comment-edit-text-" + id).val();
66 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
67 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
68 openMenu("comment-edit-submit-wrapper-" + id);
71 textarea = document.getElementById("comment-edit-text-" +id);
72 if (document.selection) {
74 selected = document.selection.createRange();
75 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
76 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
77 var start = textarea.selectionStart;
78 var end = textarea.selectionEnd;
79 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
85 function showThread(id) {
86 $("#collapsed-comments-" + id).show()
87 $("#collapsed-comments-" + id + " .collapsed-comments").show()
89 function hideThread(id) {
90 $("#collapsed-comments-" + id).hide()
91 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
95 function cmtBbOpen(id) {
96 $("#comment-edit-bb-" + id).show();
98 function cmtBbClose(id) {
99 $("#comment-edit-bb-" + id).hide();
102 $(document).ready(function() {
104 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
106 $('.group-edit-icon').hover(
108 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
110 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
113 $('.sidebar-group-element').hover(
115 id = $(this).attr('id');
116 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
119 id = $(this).attr('id');
120 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
124 $('.savedsearchdrop').hover(
126 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
128 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
131 $('.savedsearchterm').hover(
133 id = $(this).attr('id');
134 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
137 id = $(this).attr('id');
138 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}