1 $j(document).ready(function() {
3 window.navMenuTimeout = {
4 '#network-menu-list-timeout': null,
5 '#contacts-menu-list-timeout': null,
6 '#system-menu-list-timeout': null,
7 '#network-menu-list-opening': false,
8 '#contacts-menu-list-opening': false,
9 '#system-menu-list-opening': false,
10 '#network-menu-list-closing': false,
11 '#contacts-menu-list-closing': false,
12 '#system-menu-list-closing': false
20 if(typeof acl=="undefined"){
23 [ window.allowCID,window.allowGID,window.denyCID,window.denyGID ]
27 /* enable tinymce on focus and click */
28 $j("#profile-jot-text").focus(enableOnUser);
29 $j("#profile-jot-text").click(enableOnUser);
32 $j('.nav-menu-link').hover(function() {
33 showNavMenu($j(this).attr('rel'));
35 hideNavMenu($j(this).attr('rel'));
38 /* $j('html').click(function() { $j("#nav-notifications-menu" ).hide(); });*/
40 $j('.group-edit-icon').hover(
42 $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
44 $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
47 $j('.sidebar-group-element').hover(
49 id = $j(this).attr('id');
50 $j('#edit-' + id).addClass('icon'); $j('#edit-' + id).removeClass('iconspacer');},
53 id = $j(this).attr('id');
54 $j('#edit-' + id).removeClass('icon');$j('#edit-' + id).addClass('iconspacer');}
58 $j('.savedsearchdrop').hover(
60 $j(this).addClass('drop'); $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
62 $j(this).removeClass('drop'); $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
65 $j('.savedsearchterm').hover(
67 id = $j(this).attr('id');
68 $j('#drop-' + id).addClass('icon'); $j('#drop-' + id).addClass('drophide'); $j('#drop-' + id).removeClass('iconspacer');},
71 id = $j(this).attr('id');
72 $j('#drop-' + id).removeClass('icon');$j('#drop-' + id).removeClass('drophide'); $j('#drop-' + id).addClass('iconspacer');}
75 /* $j('.nav-load-page-link').click(function() {
76 getPageContent( $j(this).attr('href') );
77 hideNavMenu( '#' + $j(this).closest('ul').attr('id') );
81 if(window.aclType == "event_head") {
82 $j('#events-calendar').fullCalendar({
83 events: baseurl + '/events/json/',
85 left: 'prev,next today',
87 right: 'month,agendaWeek,agendaDay'
90 eventClick: function(calEvent, jsEvent, view) {
91 showEvent(calEvent.id);
94 eventRender: function(event, element, view) {
95 //console.log(view.name);
96 if (event.item['author-name']==null) return;
99 element.find(".fc-event-title").html(
100 "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
101 event.item['author-avatar'],
102 event.item['author-name'],
107 element.find(".fc-event-title").html(
108 "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
109 event.item['author-avatar'],
110 event.item['author-name'],
116 element.find(".fc-event-title").html(
117 "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
118 event.item['author-avatar'],
119 event.item['author-name'],
130 var args=location.href.replace(baseurl,"").split("/");
131 if (args.length>=4) {
132 $j("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
136 var hash = location.hash.split("-")
137 if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
140 $j('#event-share-checkbox').change(function() {
142 if ($j('#event-share-checkbox').is(':checked')) {
143 $j('#acl-wrapper').show();
146 $j('#acl-wrapper').hide();
148 }).trigger('change');
151 if(window.aclType == "settings-head" || window.aclType == "photos_head" || window.aclType == "event_head") {
152 $j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
154 $j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
155 selstr = $j(this).text();
156 $j('#jot-perms-icon').removeClass('unlock').addClass('lock');
157 $j('#jot-public').hide();
160 $j('#jot-perms-icon').removeClass('lock').addClass('unlock');
161 $j('#jot-public').show();
164 }).trigger('change');
167 /* $j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
169 $j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
170 selstr = $j(this).text();
171 $j('#jot-public').hide();
174 $j('#jot-public').show();
177 }).trigger('change');*/
180 switch(window.autocompleteType) {
182 var a = $j("#recip").autocomplete({
183 serviceUrl: baseurl + '/acl',
186 onSelect: function(value,data) {
187 $j("#recip-complete").val(data);
191 case 'contacts-head':
192 var a = $j("#contacts-search").autocomplete({
193 serviceUrl: baseurl + '/acl',
197 a.setOptions({ params: { type: 'a' }});
204 if(typeof window.AjaxUpload != "undefined") {
205 switch(window.ajaxType) {
207 var uploader = new window.AjaxUpload(
209 { action: 'wall_upload/'+window.nickname,
211 onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
212 onComplete: function(file,response) {
213 addeditortext(response);
214 $j('#profile-rotator').hide();
219 var file_uploader = new window.AjaxUpload(
221 { action: 'wall_attach/'+window.nickname,
223 onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
224 onComplete: function(file,response) {
225 addeditortext(response);
226 $j('#profile-rotator').hide();
232 var uploader = new window.AjaxUpload(
234 { action: 'wall_upload/' + window.nickname,
236 onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
237 onComplete: function(file,response) {
238 tinyMCE.execCommand('mceInsertRawHTML',false,response);
239 $j('#profile-rotator').hide();
252 // update pending count //
255 $j("nav").bind('nav-update', function(e,data){
256 var elm = $j('#pending-update');
257 var register = $j(data).find('register').text();
258 if (register=="0") { register=""; elm.hide();} else { elm.show(); }
266 $j("#cnftheme").fancybox({
268 autoDimensions: false,
270 var theme = $j("#id_theme :selected").val();
271 $j("#cnftheme").attr('href', baseurl + "/admin/themes/"+theme);
273 onComplete: function(){
274 $j("div#fancybox-content form").submit(function(e){
275 var url = $j(this).attr('action');
276 // can't get .serialize() to work...
278 $j(this).find("input").each(function(){
279 data[$j(this).attr('name')] = $j(this).val();
281 $j(this).find("select").each(function(){
282 data[$j(this).attr('name')] = $j(this).children(":selected").val();
284 console.log(":)", url, data);
286 $j.post(url, data, function(data) {
287 if(timer) clearTimeout(timer);
300 if(typeof window.photoEdit != 'undefined') {
302 $j(document).keydown(function(event) {
304 if(window.prevLink != '') { if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = window.prevLink; }}
305 if(window.nextLink != '') { if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = window.nextLink; }}
310 switch(window.ajaxType) {
312 function jotGetLink() {
313 reply = prompt(window.linkURL);
314 if(reply && reply.length) {
315 reply = bin2hex(reply);
316 $j('#profile-rotator').show();
317 $j.get('parse_url?binurl=' + reply, function(data) {
319 $j('#profile-rotator').hide();
324 function linkdrop(event) {
325 var reply = event.dataTransfer.getData("text/uri-list");
326 event.target.textContent = reply;
327 event.preventDefault();
328 if(reply && reply.length) {
329 reply = bin2hex(reply);
330 $j('#profile-rotator').show();
331 $j.get('parse_url?binurl=' + reply, function(data) {
332 if (!editor) $j("#profile-jot-text").val("");
333 initEditor(function(){
335 $j('#profile-rotator').hide();
342 case 'wallmsg-header':
343 function jotGetLink() {
344 reply = prompt(window.linkURL);
345 if(reply && reply.length) {
346 $j('#profile-rotator').show();
347 $j.get('parse_url?url=' + reply, function(data) {
348 tinyMCE.execCommand('mceInsertRawHTML',false,data);
349 $j('#profile-rotator').hide();
354 function linkdrop(event) {
355 var reply = event.dataTransfer.getData("text/uri-list");
356 event.target.textContent = reply;
357 event.preventDefault();
358 if(reply && reply.length) {
359 $j('#profile-rotator').show();
360 $j.get('parse_url?url=' + reply, function(data) {
361 tinyMCE.execCommand('mceInsertRawHTML',false,data);
362 $j('#profile-rotator').hide();
373 function showEvent(eventid) {
375 baseurl + '/events/?id='+eventid,
382 function initCrop() {
383 function onEndCrop( coords, dimensions ) {
384 $( 'x1' ).value = coords.x1;
385 $( 'y1' ).value = coords.y1;
386 $( 'x2' ).value = coords.x2;
387 $( 'y2' ).value = coords.y2;
388 $( 'width' ).value = dimensions.width;
389 $( 'height' ).value = dimensions.height;
392 Event.observe( window, 'load', function() {
393 new Cropper.ImgWithPreview(
396 previewWrap: 'previewWrap',
401 ratioDim: { x: 100, y:100 },
410 $j(document).mouseup(function (clickPos) {
412 var sysMenu = $j("#system-menu-list");
413 var sysMenuLink = $j(".system-menu-link");
414 var contactsMenu = $j("#contacts-menu-list");
415 var contactsMenuLink = $j(".contacts-menu-link");
416 var networkMenu = $j("#network-menu-list");
417 var networkMenuLink = $j(".network-menu-link");
419 if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
420 hideNavMenu("#system-menu-list");
422 if( !contactsMenu.is(clickPos.target) && !contactsMenuLink.is(clickPos.target) && contactsMenu.has(clickPos.target).length === 0) {
423 hideNavMenu("#contacts-menu-list");
425 if( !networkMenu.is(clickPos.target) && !networkMenuLink.is(clickPos.target) && networkMenu.has(clickPos.target).length === 0) {
426 hideNavMenu("#network-menu-list");
431 function getPageContent(url) {
433 var pos = $j('.main-container').position();
435 $j('.main-container').css('margin-left', pos.left);
436 $j('.main-content-container').hide(0, function () {
437 $j('.main-content-loading').show(0);
440 $j.get(url, function(html) {
441 console.log($j('.main-content-container').html());
442 $j('.main-content-container').html( $j('.main-content-container', html).html() );
443 console.log($j('.main-content-container').html());
444 $j('.main-content-loading').hide(function() {
445 $j('.main-content-container').fadeIn(800,function() {
446 $j('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
453 function showNavMenu(menuID) {
455 if(window.navMenuTimeout[menuID + '-closing']) {
456 window.navMenuTimeout[menuID + '-closing'] = false;
457 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
460 window.navMenuTimeout[menuID + '-opening'] = true;
462 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
463 $j(menuID).slideDown('fast').show();
464 window.navMenuTimeout[menuID + '-opening'] = false;
469 function hideNavMenu(menuID) {
471 if(window.navMenuTimeout[menuID + '-opening']) {
472 window.navMenuTimeout[menuID + '-opening'] = false;
473 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
476 window.navMenuTimeout[menuID + '-closing'] = true;
478 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
479 $j(menuID).slideUp('fast');
480 window.navMenuTimeout[menuID + '-closing'] = false;
487 function insertFormatting(comment,BBcode,id) {
489 var tmpStr = $j("#comment-edit-text-" + id).val();
490 if(tmpStr == comment) {
492 $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
493 $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
494 openMenu("comment-edit-submit-wrapper-" + id);
495 $j("#comment-edit-text-" + id).val(tmpStr);
498 textarea = document.getElementById("comment-edit-text-" +id);
499 if (document.selection) {
501 selected = document.selection.createRange();
502 if (BBcode == "url"){
503 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
505 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
506 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
507 var start = textarea.selectionStart;
508 var end = textarea.selectionEnd;
509 if (BBcode == "url"){
510 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
512 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
517 function cmtBbOpen(id) {
518 $j(".comment-edit-bb-" + id).show();
520 function cmtBbClose(id) {
521 $j(".comment-edit-bb-" + id).hide();
524 function confirmDelete() { return confirm(window.delItem); }
526 function commentOpen(obj,id) {
527 if(obj.value == window.commentEmptyText) {
529 $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
530 $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
531 $j("#mod-cmnt-wrap-" + id).show();
532 openMenu("comment-edit-submit-wrapper-" + id);
535 function commentClose(obj,id) {
536 if(obj.value == "") {
537 obj.value = window.commentEmptyText;
538 $j("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
539 $j("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
540 $j("#mod-cmnt-wrap-" + id).hide();
541 closeMenu("comment-edit-submit-wrapper-" + id);
546 function commentInsert(obj,id) {
547 var tmpStr = $j("#comment-edit-text-" + id).val();
548 if(tmpStr == window.commentEmptyText) {
550 $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
551 $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
552 openMenu("comment-edit-submit-wrapper-" + id);
554 var ins = $j(obj).html();
555 ins = ins.replace("<","<");
556 ins = ins.replace(">",">");
557 ins = ins.replace("&","&");
558 ins = ins.replace(""",'"');
559 $j("#comment-edit-text-" + id).val(tmpStr + ins);
562 function qCommentInsert(obj,id) {
563 var tmpStr = $j("#comment-edit-text-" + id).val();
564 if(tmpStr == window.commentEmptyText) {
566 $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
567 $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
568 openMenu("comment-edit-submit-wrapper-" + id);
570 var ins = $j(obj).val();
571 ins = ins.replace("<","<");
572 ins = ins.replace(">",">");
573 ins = ins.replace("&","&");
574 ins = ins.replace(""",'"');
575 $j("#comment-edit-text-" + id).val(tmpStr + ins);
579 function showHideComments(id) {
580 if( $j("#collapsed-comments-" + id).is(":visible")) {
581 $j("#collapsed-comments-" + id).hide();
582 $j("#hide-comments-" + id).html(window.showMore);
585 $j("#collapsed-comments-" + id).show();
586 $j("#hide-comments-" + id).html(window.showFewer);
592 function enableOnUser(){
601 var plaintext = window.editSelect;
602 var ispublic = window.isPublic;
604 function initEditor(cb){
606 $j("#profile-jot-text-loading").show();
607 if(plaintext == 'none') {
608 $j("#profile-jot-text-loading").hide();
609 $j("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
610 $j("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
612 $j("a#jot-perms-icon").fancybox({
613 'transitionIn' : 'elastic',
614 'transitionOut' : 'elastic'
616 $j(".jothidden").show();
617 if (typeof cb!="undefined") cb();
622 mode : "specific_textareas",
623 editor_selector: window.editSelect,
624 auto_focus: "profile-jot-text",
625 plugins : "bbcode,paste,autoresize, inlinepopups",
626 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
627 theme_advanced_buttons2 : "",
628 theme_advanced_buttons3 : "",
629 theme_advanced_toolbar_location : "top",
630 theme_advanced_toolbar_align : "center",
631 theme_advanced_blockformats : "blockquote,code",
632 gecko_spellcheck : true,
633 paste_text_sticky : true,
634 entity_encoding : "raw",
635 add_unload_trigger : false,
636 remove_linebreaks : false,
637 force_p_newlines : false,
638 force_br_newlines : true,
639 forced_root_block : '',
641 content_css: window.baseURL + "/view/custom_tinymce.css",
642 theme_advanced_path : false,
643 file_browser_callback : "fcFileBrowser",
644 setup : function(ed) {
646 ed.onKeyDown.add(function(ed,e) {
651 ed.onKeyUp.add(function(ed, e) {
652 var txt = tinyMCE.activeEditor.getContent();
653 match = txt.match(/@([^ \n]+)$/);
655 if(cPopup === null) {
656 cPopup = new ACPopup(this,baseurl+"/acl");
658 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
659 if(! cPopup.ready) cPopup = null;
662 if(cPopup !== null) { cPopup.close(); cPopup = null; }
665 textlen = txt.length;
666 if(textlen != 0 && $j('#jot-perms-icon').is('.unlock')) {
667 $j('#profile-jot-desc').html(ispublic);
670 $j('#profile-jot-desc').html(' ');
676 $j('#character-counter').removeClass('red');
677 $j('#character-counter').removeClass('orange');
678 $j('#character-counter').addClass('grey');
680 if((textlen > 140) && (textlen <= 420)) {
681 $j('#character-counter').removeClass('grey');
682 $j('#character-counter').removeClass('red');
683 $j('#character-counter').addClass('orange');
686 $j('#character-counter').removeClass('grey');
687 $j('#character-counter').removeClass('orange');
688 $j('#character-counter').addClass('red');
690 $j('#character-counter').text(textlen);
693 ed.onInit.add(function(ed) {
694 ed.pasteAsPlainText = true;
695 $j("#profile-jot-text-loading").hide();
696 $j(".jothidden").show();
697 if (typeof cb!="undefined") cb();
704 $j("a#jot-perms-icon").fancybox({
705 'transitionIn' : 'none',
706 'transitionOut' : 'none'
709 if (typeof cb!="undefined") cb();
714 function msgInitEditor() {
715 if(plaintext != 'none') {
718 mode : "specific_textareas",
719 editor_selector: /(profile-jot-text|prvmail-text)/,
720 plugins : "bbcode,paste",
721 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
722 theme_advanced_buttons2 : "",
723 theme_advanced_buttons3 : "",
724 theme_advanced_toolbar_location : "top",
725 theme_advanced_toolbar_align : "center",
726 theme_advanced_blockformats : "blockquote,code",
727 gecko_spellcheck : true,
728 paste_text_sticky : true,
729 entity_encoding : "raw",
730 add_unload_trigger : false,
731 remove_linebreaks : false,
732 force_p_newlines : false,
733 force_br_newlines : true,
734 forced_root_block : '',
736 content_css: baseurl + "/view/custom_tinymce.css",
738 theme_advanced_path : false,
739 setup : function(ed) {
740 ed.onInit.add(function(ed) {
741 ed.pasteAsPlainText = true;
742 var editorId = ed.editorId;
743 var textarea = $j('#'+editorId);
744 if (typeof(textarea.attr('tabindex')) != "undefined") {
745 $j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
746 textarea.attr('tabindex', null);
753 $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
757 function profInitEditor() {
760 mode : window.editSelect,
761 plugins : "bbcode,paste",
762 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
763 theme_advanced_buttons2 : "",
764 theme_advanced_buttons3 : "",
765 theme_advanced_toolbar_location : "top",
766 theme_advanced_toolbar_align : "center",
767 theme_advanced_blockformats : "blockquote,code",
768 gecko_spellcheck : true,
769 paste_text_sticky : true,
770 entity_encoding : "raw",
771 add_unload_trigger : false,
772 remove_linebreaks : false,
773 force_p_newlines : false,
774 force_br_newlines : true,
775 forced_root_block : '',
776 content_css: baseurl + "/view/custom_tinymce.css",
777 theme_advanced_path : false,
778 setup : function(ed) {
779 ed.onInit.add(function(ed) {
780 ed.pasteAsPlainText = true;
787 function eventInitEditor() {
791 plugins : "bbcode,paste",
792 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
793 theme_advanced_buttons2 : "",
794 theme_advanced_buttons3 : "",
795 theme_advanced_toolbar_location : "top",
796 theme_advanced_toolbar_align : "center",
797 theme_advanced_blockformats : "blockquote,code",
798 gecko_spellcheck : true,
799 paste_text_sticky : true,
800 entity_encoding : "raw",
801 add_unload_trigger : false,
802 remove_linebreaks : false,
803 force_p_newlines : false,
804 force_br_newlines : true,
805 forced_root_block : '',
806 content_css: baseurl + "/view/custom_tinymce.css",
807 theme_advanced_path : false,
808 setup : function(ed) {
809 ed.onInit.add(function(ed) {
810 ed.pasteAsPlainText = true;
817 function contactInitEditor () {
820 mode : window.editSelect,
821 elements: "contact-edit-info",
823 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
824 theme_advanced_buttons2 : "",
825 theme_advanced_buttons3 : "",
826 theme_advanced_toolbar_location : "top",
827 theme_advanced_toolbar_align : "center",
828 theme_advanced_styles : "blockquote,code",
829 gecko_spellcheck : true,
830 entity_encoding : "raw",
831 add_unload_trigger : false,
832 remove_linebreaks : false,
833 force_p_newlines : false,
834 force_br_newlines : true,
835 forced_root_block : '',
836 content_css: baseurl + "/view/custom_tinymce.css"
842 function wallInitEditor() {
843 var plaintext = window.editSelect;
845 if(plaintext != 'none') {
848 mode : "specific_textareas",
849 editor_selector: /(profile-jot-text|prvmail-text)/,
850 plugins : "bbcode,paste",
851 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
852 theme_advanced_buttons2 : "",
853 theme_advanced_buttons3 : "",
854 theme_advanced_toolbar_location : "top",
855 theme_advanced_toolbar_align : "center",
856 theme_advanced_blockformats : "blockquote,code",
857 gecko_spellcheck : true,
858 paste_text_sticky : true,
859 entity_encoding : "raw",
860 add_unload_trigger : false,
861 remove_linebreaks : false,
862 force_p_newlines : false,
863 force_br_newlines : true,
864 forced_root_block : '',
866 content_css: baseurl + "/view/custom_tinymce.css",
868 theme_advanced_path : false,
869 setup : function(ed) {
870 ed.onInit.add(function(ed) {
871 ed.pasteAsPlainText = true;
872 var editorId = ed.editorId;
873 var textarea = $j('#'+editorId);
874 if (typeof(textarea.attr('tabindex')) != "undefined") {
875 $j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
876 textarea.attr('tabindex', null);
883 $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
886 function deleteCheckedItems() {
889 $j('.item-select').each( function() {
890 if($j(this).is(':checked')) {
891 if(checkedstr.length != 0) {
892 checkedstr = checkedstr + ',' + $j(this).val();
895 checkedstr = $j(this).val();
899 $j.post('item', { dropitems: checkedstr }, function(data) {
900 window.location.reload();
905 function jotVideoURL() {
906 reply = prompt(window.vidURL);
907 if(reply && reply.length) {
908 addeditortext('[video]' + reply + '[/video]');
912 function jotAudioURL() {
913 reply = prompt(window.audURL);
914 if(reply && reply.length) {
915 addeditortext('[audio]' + reply + '[/audio]');
920 function jotGetLocation() {
921 reply = prompt(window.whereAreU, $j('#jot-location').val());
922 if(reply && reply.length) {
923 $j('#jot-location').val(reply);
927 function jotShare(id) {
928 if ($j('#jot-popup').length != 0) $j('#jot-popup').show();
930 $j('#like-rotator-' + id).show();
931 $j.get('share/' + id, function(data) {
932 if (!editor) $j("#profile-jot-text").val("");
933 initEditor(function(){
935 $j('#like-rotator-' + id).hide();
936 $j(window).scrollTop(0);
942 function linkdropper(event) {
943 var linkFound = event.dataTransfer.types.contains("text/uri-list");
945 event.preventDefault();
948 function itemTag(id) {
949 reply = prompt(window.term);
950 if(reply && reply.length) {
951 reply = reply.replace('#','');
955 $j('body').css('cursor', 'wait');
957 $j.get('tagger/' + id + '?term=' + reply, NavUpdate);
958 /*if(timer) clearTimeout(timer);
959 timer = setTimeout(NavUpdate,3000);*/
965 function itemFiler(id) {
967 var bordercolor = $j("input").css("border-color");
969 $j.get('filer/', function(data){
971 $j("#id_term").keypress(function(){
972 $j(this).css("border-color",bordercolor);
974 $j("#select_term").change(function(){
975 $j("#id_term").css("border-color",bordercolor);
978 $j("#filer_save").click(function(e){
980 reply = $j("#id_term").val();
981 if(reply && reply.length) {
983 $j('body').css('cursor', 'wait');
984 $j.get('filer/' + id + '?term=' + reply, NavUpdate);
985 /* if(timer) clearTimeout(timer);
986 timer = setTimeout(NavUpdate,3000);*/
990 $j("#id_term").css("border-color","#FF0000");
998 function jotClearLocation() {
999 $j('#jot-coord').val('');
1000 $j('#profile-nolocation-wrapper').hide();
1003 function addeditortext(data) {
1004 if(plaintext == 'none') {
1005 var currentText = $j("#profile-jot-text").val();
1006 $j("#profile-jot-text").val(currentText + data);
1009 tinyMCE.execCommand('mceInsertRawHTML',false,data);
1012 if(typeof window.geoTag === 'function') window.geoTag();