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 console.log(intro,mail);
16 if (notifCount > 0 ) {
17 Tinycon.setBubble(notifCount);
19 Tinycon.setBubble('');
23 $("#nav-introductions-link").addClass("on");
25 $("#nav-introductions-link").removeClass("on");
29 $("#nav-messages-link").addClass("on");
31 $("#nav-messages-link").removeClass("on");
37 * show and hide contact action buttons in
38 * contacts page on contacts' checkbox selection
40 $('.contact-select').bind('click', function(e) {
42 var elm = $("#contacts-actions");
45 if (y+elm.height() > $("html").height()) y=$("html").height()-elm.height();
46 elm.css('top', y+"px");
47 if ($(".contact-select:checked").length > 0) {
55 function insertFormatting(comment,BBcode,id) {
57 var tmpStr = $("#comment-edit-text-" + id).val();
58 if(tmpStr == comment) {
60 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
61 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
62 openMenu("comment-edit-submit-wrapper-" + id);
63 $("#comment-edit-text-" + id).val(tmpStr);
66 textarea = document.getElementById("comment-edit-text-" +id);
67 if (document.selection) {
69 selected = document.selection.createRange();
71 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
73 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
74 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
75 var start = textarea.selectionStart;
76 var end = textarea.selectionEnd;
78 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
80 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');}