1 $(document).ready(function() {
3 /*$('html').click(function() { $("#nav-notifications-menu" ).hide(); });*/
5 $('.group-edit-icon').hover(
7 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
9 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
12 $('.sidebar-group-element').hover(
14 id = $(this).attr('id');
15 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
18 id = $(this).attr('id');
19 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
23 $('.savedsearchdrop').hover(
25 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
27 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
30 $('.savedsearchterm').hover(
32 id = $(this).attr('id');
33 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
36 id = $(this).attr('id');
37 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
40 $(".popupbox").click(function () {
41 var parent = $( $(this).attr('href') ).parent();
42 if (parent.css('display') == 'none') {
53 function insertFormatting(comment,BBcode,id) {
55 var tmpStr = $("#comment-edit-text-" + id).val();
56 if(tmpStr == comment) {
58 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
59 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
60 openMenu("comment-edit-submit-wrapper-" + id);
61 $("#comment-edit-text-" + id).val(tmpStr);
64 textarea = document.getElementById("comment-edit-text-" +id);
65 if (document.selection) {
67 selected = document.selection.createRange();
69 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
71 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
72 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
73 var start = textarea.selectionStart;
74 var end = textarea.selectionEnd;
76 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
78 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
83 function cmtBbOpen(id) {
84 $(".comment-edit-bb-" + id).show();
86 function cmtBbClose(id) {
87 $(".comment-edit-bb-" + id).hide();
94 // Needs to be in "jot-header.tpl" if the "$editselect" variable is used
98 var plaintext = 'none';//'$editselect';
100 function initEditor(cb){
102 // $("#profile-jot-text-loading").show();
103 if(plaintext == 'none') {
104 // $("#profile-jot-text-loading").hide();
105 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
106 $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
108 /* $("a#jot-perms-icon").fancybox({
109 'transitionIn' : 'none',
110 'transitionOut' : 'none'
112 $("a#jot-perms-icon, a#settings-default-perms-menu").click(function () {
113 var parent = $("#profile-jot-acl-wrapper").parent();
114 if (parent.css('display') == 'none') {
119 // $("#profile-jot-acl-wrapper").parent().toggle();
122 $(".jothidden").show();
123 if (typeof cb!="undefined") cb();
128 mode : "specific_textareas",
129 editor_selector: $editselect,
130 auto_focus: "profile-jot-text",
131 plugins : "bbcode,paste,autoresize, inlinepopups",
132 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
133 theme_advanced_buttons2 : "",
134 theme_advanced_buttons3 : "",
135 theme_advanced_toolbar_location : "top",
136 theme_advanced_toolbar_align : "center",
137 theme_advanced_blockformats : "blockquote,code",
138 gecko_spellcheck : true,
139 paste_text_sticky : true,
140 entity_encoding : "raw",
141 add_unload_trigger : false,
142 remove_linebreaks : false,
143 force_p_newlines : false,
144 force_br_newlines : true,
145 forced_root_block : '',
147 content_css: "$baseurl/view/custom_tinymce.css",
148 theme_advanced_path : false,
149 file_browser_callback : "fcFileBrowser",
150 setup : function(ed) {
152 ed.onKeyDown.add(function(ed,e) {
157 ed.onKeyUp.add(function(ed, e) {
158 var txt = tinyMCE.activeEditor.getContent();
159 match = txt.match(/@([^ \n]+)$/);
161 if(cPopup === null) {
162 cPopup = new ACPopup(this,baseurl+"/acl");
164 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
165 if(! cPopup.ready) cPopup = null;
168 if(cPopup !== null) { cPopup.close(); cPopup = null; }
171 textlen = txt.length;
172 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
173 $('#profile-jot-desc').html(ispublic);
176 $('#profile-jot-desc').html(' ');
182 $('#character-counter').removeClass('red');
183 $('#character-counter').removeClass('orange');
184 $('#character-counter').addClass('grey');
186 if((textlen > 140) && (textlen <= 420)) {
187 $('#character-counter').removeClass('grey');
188 $('#character-counter').removeClass('red');
189 $('#character-counter').addClass('orange');
192 $('#character-counter').removeClass('grey');
193 $('#character-counter').removeClass('orange');
194 $('#character-counter').addClass('red');
196 $('#character-counter').text(textlen);
199 ed.onInit.add(function(ed) {
200 ed.pasteAsPlainText = true;
201 $("#profile-jot-text-loading").hide();
202 $(".jothidden").show();
203 if (typeof cb!="undefined") cb();
210 $("a#jot-perms-icon").fancybox({
211 'transitionIn' : 'elastic',
212 'transitionOut' : 'elastic'
215 if (typeof cb!="undefined") cb();
219 function enableOnUser(){