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(comment,BBcode,id) {
64 var tmpStr = $("#comment-edit-text-" + id).val();
65 if(tmpStr == comment) {
67 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
68 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
69 openMenu("comment-edit-submit-wrapper-" + id);
70 $("#comment-edit-text-" + id).val(tmpStr);
73 textarea = document.getElementById("comment-edit-text-" +id);
74 if (document.selection) {
76 selected = document.selection.createRange();
78 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
80 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
81 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
82 var start = textarea.selectionStart;
83 var end = textarea.selectionEnd;
85 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
87 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
92 function showThread(id) {
93 $("#collapsed-comments-" + id).show()
94 $("#collapsed-comments-" + id + " .collapsed-comments").show()
96 function hideThread(id) {
97 $("#collapsed-comments-" + id).hide()
98 $("#collapsed-comments-" + id + " .collapsed-comments").hide()
102 function cmtBbOpen(id) {
103 $("#comment-edit-bb-" + id).show();
105 function cmtBbClose(id) {
106 $("#comment-edit-bb-" + id).hide();
109 $(document).ready(function() {
111 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
113 $('.group-edit-icon').hover(
115 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
117 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
120 $('.sidebar-group-element').hover(
122 id = $(this).attr('id');
123 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
126 id = $(this).attr('id');
127 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
131 $('.savedsearchdrop').hover(
133 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
135 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
138 $('.savedsearchterm').hover(
140 id = $(this).attr('id');
141 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
144 id = $(this).attr('id');
145 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}