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);
68 $("#comment-edit-text-" + id).val(tmpStr);
71 textarea = document.getElementById("comment-edit-text-" +id);
72 if (document.selection) {
74 selected = document.selection.createRange();
75 if (BBcode == "url") {
76 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
78 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
80 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
81 var start = textarea.selectionStart;
82 var end = textarea.selectionEnd;
83 if (BBcode == "url") {
84 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
86 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
93 function showThread(id) {
94 $("#collapsed-comments-" + id).show()
95 $("#collapsed-comments-" + id + " .collapsed-comments").show()
97 function hideThread(id) {
98 $("#collapsed-comments-" + id).hide()
99 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
103 function cmtBbOpen(id) {
104 $("#comment-edit-bb-" + id).show();
106 function cmtBbClose(id) {
107 $("#comment-edit-bb-" + id).hide();
110 $(document).ready(function() {
112 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
114 $('.group-edit-icon').hover(
116 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
118 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
121 $('.sidebar-group-element').hover(
123 id = $(this).attr('id');
124 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
127 id = $(this).attr('id');
128 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
132 $('.savedsearchdrop').hover(
134 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
136 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
139 $('.savedsearchterm').hover(
141 id = $(this).attr('id');
142 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
145 id = $(this).attr('id');
146 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}