1 $(document).ready(function(){
2 $('nav').bind('nav-update', function(e,data){
3 var notifCount = $(data).find('notif').attr('count');
4 var intro = $(data).find('intro').text();
5 var mail = $(data).find('mail').text();
7 $(".tool .notify").removeClass("on");
8 $(data).find("group").each(function() {
10 var gcount = this.innerHTML;
11 $(".group-"+gid+" .notify").addClass("on").text(gcount);
14 $(".forum-widget-entry .notify").removeClass("on");
15 $(data).find("forum").each(function() {
17 var fcount = this.innerHTML;
18 $(".forum-"+fid+" .notify").addClass("on").text(fcount);
21 console.log(intro,mail);
23 if (notifCount > 0 ) {
24 Tinycon.setBubble(notifCount);
26 Tinycon.setBubble('');
30 $("#nav-introductions-link").addClass("on");
32 $("#nav-introductions-link").removeClass("on");
36 $("#nav-messages-link").addClass("on");
38 $("#nav-messages-link").removeClass("on");
44 * show and hide contact action buttons in
45 * contacts page on contacts' checkbox selection
47 $('.contact-select').bind('click', function(e) {
49 var elm = $("#contacts-actions");
52 if (y+elm.height() > $("html").height()) y=$("html").height()-elm.height();
53 elm.css('top', y+"px");
54 if ($(".contact-select:checked").length > 0) {
62 function insertFormatting(BBcode, id) {
63 var tmpStr = $("#comment-edit-text-" + id).val();
65 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
66 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
67 openMenu("comment-edit-submit-wrapper-" + id);
70 textarea = document.getElementById("comment-edit-text-" +id);
71 if (document.selection) {
73 selected = document.selection.createRange();
74 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
75 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
76 var start = textarea.selectionStart;
77 var end = textarea.selectionEnd;
78 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
84 function showThread(id) {
85 $("#collapsed-comments-" + id).show()
86 $("#collapsed-comments-" + id + " .collapsed-comments").show()
88 function hideThread(id) {
89 $("#collapsed-comments-" + id).hide()
90 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
94 function cmtBbOpen(id) {
95 $("#comment-edit-bb-" + id).show();
97 function cmtBbClose(id) {
98 $("#comment-edit-bb-" + id).hide();
101 $(document).ready(function() {
103 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
105 $('.group-edit-icon').hover(
107 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
109 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
112 $('.sidebar-group-element').hover(
114 id = $(this).attr('id');
115 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
118 id = $(this).attr('id');
119 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
123 $('.savedsearchdrop').hover(
125 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
127 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
130 $('.savedsearchterm').hover(
132 id = $(this).attr('id');
133 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
136 id = $(this).attr('id');
137 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}