1 $(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 /* enable tinymce on focus and click */
21 $("#profile-jot-text").focus(enableOnUser);
22 $("#profile-jot-text").click(enableOnUser);
24 $('.nav-menu-list, .nav-menu-icon').hover(function() {
25 showNavMenu($(this).attr('point'));
27 hideNavMenu($(this).attr('point'));
30 /* $('html').click(function() { $("#nav-notifications-menu" ).hide(); });*/
32 $('.group-edit-icon').hover(
34 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
36 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
39 $('.sidebar-group-element').hover(
41 id = $(this).attr('id');
42 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
45 id = $(this).attr('id');
46 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
50 $('.savedsearchdrop').hover(
52 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
54 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
57 $('.savedsearchterm').hover(
59 id = $(this).attr('id');
60 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
63 id = $(this).attr('id');
64 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
67 /* $('.nav-load-page-link').click(function() {
68 getPageContent( $(this).attr('href') );
69 hideNavMenu( '#' + $(this).closest('ul').attr('id') );
73 $('#event-share-checkbox').change(function() {
75 if ($('#event-share-checkbox').is(':checked')) {
76 $('#acl-wrapper').show();
79 $('#acl-wrapper').hide();
84 /* $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
86 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
87 selstr = $(this).text();
88 $('#jot-public').hide();
91 $('#jot-public').show();
94 }).trigger('change');*/
97 if(typeof window.AjaxUpload != "undefined") {
98 var uploader = new window.AjaxUpload(
99 window.imageUploadButton,
100 { action: 'wall_upload/'+window.nickname,
102 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
103 onComplete: function(file,response) {
104 addeditortext(window.jotId, response);
105 $('#profile-rotator').hide();
110 if($('#wall-file-upload').length) {
111 var file_uploader = new window.AjaxUpload(
113 { action: 'wall_attach/'+window.nickname,
115 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
116 onComplete: function(file,response) {
117 addeditortext(window.jotId, response);
118 $('#profile-rotator').hide();
126 if(typeof window.aclInit !="undefined" && typeof acl=="undefined"){
129 [ window.allowCID,window.allowGID,window.denyCID,window.denyGID ]
134 if(window.aclType == "settings-head" || window.aclType == "photos_head" || window.aclType == "event_head") {
135 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
137 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
138 selstr = $(this).text();
139 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
140 $('#jot-public').hide();
143 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
144 $('#jot-public').show();
147 }).trigger('change');
150 if(window.aclType == "event_head") {
151 $('#events-calendar').fullCalendar({
152 events: baseurl + '/events/json/',
154 left: 'prev,next today',
156 right: 'month,agendaWeek,agendaDay'
158 timeFormat: 'H(:mm)',
159 eventClick: function(calEvent, jsEvent, view) {
160 showEvent(calEvent.id);
163 eventRender: function(event, element, view) {
164 //console.log(view.name);
165 if (event.item['author-name']==null) return;
168 element.find(".fc-event-title").html(
169 "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
170 event.item['author-avatar'],
171 event.item['author-name'],
176 element.find(".fc-event-title").html(
177 "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
178 event.item['author-avatar'],
179 event.item['author-name'],
185 element.find(".fc-event-title").html(
186 "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
187 event.item['author-avatar'],
188 event.item['author-name'],
199 var args=location.href.replace(baseurl,"").split("/");
200 if (args.length>=4) {
201 $("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
205 var hash = location.hash.split("-")
206 if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
210 switch(window.autocompleteType) {
212 var a = $("#recip").autocomplete({
213 serviceUrl: baseurl + '/acl',
216 onSelect: function(value,data) {
217 $("#recip-complete").val(data);
221 case 'contacts-head':
222 var a = $("#contacts-search").autocomplete({
223 serviceUrl: baseurl + '/acl',
227 a.setOptions({ params: { type: 'a' }});
230 $(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
236 /* if(window.autoCompleteType == "display-head") {
237 //$(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
238 // make auto-complete work in more places
239 //$(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl");
240 $(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
243 // Add Colorbox for viewing Network page images
244 //var cBoxClasses = new Array();
245 $(".wall-item-body a img").each(function(){
246 var aElem = $(this).parent();
247 var imgHref = aElem.attr("href");
249 // We need to make sure we only put a Colorbox on links to Friendica images
250 // We'll try to do this by looking for links of the form
251 // .../photo/ab803d8eg08daf85023adfec08 (with nothing more following), in hopes
252 // that that will be unique enough
253 if(imgHref.match(/\/photo\/[a-fA-F0-9]+(-[0-9]\.[\w]+?)?$/)) {
255 // Add a unique class to all the images of a certain post, to allow scrolling through
256 var cBoxClass = $(this).closest(".wall-item-body").attr("id") + "-lightbox";
257 $(this).addClass(cBoxClass);
259 // if( $.inArray(cBoxClass, cBoxClasses) < 0 ) {
260 // cBoxClasses.push(cBoxClass);
265 photo: true, // Colorbox doesn't recognize a URL that don't end in .jpg, etc. as a photo
266 rel: cBoxClass //$(this).attr("class").match(/wall-item-body-[\d]+-lightbox/)[0]
270 /*$.each(cBoxClasses, function(){
271 $('.'+this).colorbox({
281 // update pending count //
284 $("nav").bind('nav-update', function(e,data){
285 var elm = $('#pending-update');
286 var register = $(data).find('register').text();
287 if (register=="0") { register=""; elm.hide();} else { elm.show(); }
295 $("#cnftheme").click(function(){
299 href: baseurl + "/admin/themes/" + $("#id_theme :selected").val(),
300 onComplete: function(){
301 $("div#fancybox-content form").submit(function(e){
302 var url = $(this).attr('action');
303 // can't get .serialize() to work...
305 $(this).find("input").each(function(){
306 data[$(this).attr('name')] = $(this).val();
308 $(this).find("select").each(function(){
309 data[$(this).attr('name')] = $(this).children(":selected").val();
311 console.log(":)", url, data);
313 $.post(url, data, function(data) {
314 if(timer) clearTimeout(timer);
329 function homeRedirect() {
330 $('html').fadeOut('slow', function(){
331 window.location = baseurl + "/login";
336 if(typeof window.photoEdit != 'undefined') {
338 $(document).keydown(function(event) {
340 if(window.prevLink != '') { if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = window.prevLink; }}
341 if(window.nextLink != '') { if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = window.nextLink; }}
346 function showEvent(eventid) {
348 baseurl + '/events/?id='+eventid,
350 $.colorbox({html:data});
356 function doEventPreview() {
357 $('#event-edit-preview').val(1);
358 $.post('events',$('#event-edit-form').serialize(), function(data) {
359 $.colorbox({ html: data });
361 $('#event-edit-preview').val(0);
364 function initCrop() {
365 function onEndCrop( coords, dimensions ) {
366 $PR( 'x1' ).value = coords.x1;
367 $PR( 'y1' ).value = coords.y1;
368 $PR( 'x2' ).value = coords.x2;
369 $PR( 'y2' ).value = coords.y2;
370 $PR( 'width' ).value = dimensions.width;
371 $PR( 'height' ).value = dimensions.height;
374 Event.observe( window, 'load', function() {
375 new Cropper.ImgWithPreview(
378 previewWrap: 'previewWrap',
383 ratioDim: { x: 100, y:100 },
392 $(document).mouseup(function (clickPos) {
394 var sysMenu = $("#system-menu-list");
395 var sysMenuLink = $(".system-menu-link");
396 var contactsMenu = $("#contacts-menu-list");
397 var contactsMenuLink = $(".contacts-menu-link");
398 var networkMenu = $("#network-menu-list");
399 var networkMenuLink = $(".network-menu-link");
401 if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
402 hideNavMenu("#system-menu-list");
404 if( !contactsMenu.is(clickPos.target) && !contactsMenuLink.is(clickPos.target) && contactsMenu.has(clickPos.target).length === 0) {
405 hideNavMenu("#contacts-menu-list");
407 if( !networkMenu.is(clickPos.target) && !networkMenuLink.is(clickPos.target) && networkMenu.has(clickPos.target).length === 0) {
408 hideNavMenu("#network-menu-list");
413 function getPageContent(url) {
415 var pos = $('.main-container').position();
417 $('.main-container').css('margin-left', pos.left);
418 $('.main-content-container').hide(0, function () {
419 $('.main-content-loading').show(0);
422 $.get(url, function(html) {
423 console.log($('.main-content-container').html());
424 $('.main-content-container').html( $('.main-content-container', html).html() );
425 console.log($('.main-content-container').html());
426 $('.main-content-loading').hide(function() {
427 $('.main-content-container').fadeIn(800,function() {
428 $('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
435 function showNavMenu(menuID) {
437 if(window.navMenuTimeout[menuID + '-closing']) {
438 window.navMenuTimeout[menuID + '-closing'] = false;
439 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
442 window.navMenuTimeout[menuID + '-opening'] = true;
444 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
445 $(menuID).slideDown('fast').show();
446 window.navMenuTimeout[menuID + '-opening'] = false;
451 function hideNavMenu(menuID) {
453 if(window.navMenuTimeout[menuID + '-opening']) {
454 window.navMenuTimeout[menuID + '-opening'] = false;
455 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
458 window.navMenuTimeout[menuID + '-closing'] = true;
460 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
461 $(menuID).slideUp('fast');
462 window.navMenuTimeout[menuID + '-closing'] = false;
473 function InitMCEEditor(editorData) {
474 var tinyMCEInitConfig = {
477 //editor_selector: // SPECIFIC
478 //elements: // SPECIFIC
479 plugins : "bbcode,paste,autoresize,inlinepopups",
480 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
481 theme_advanced_buttons2 : "",
482 theme_advanced_buttons3 : "",
483 theme_advanced_toolbar_location : "top",
484 theme_advanced_toolbar_align : "center",
485 theme_advanced_blockformats : "blockquote,code",
486 gecko_spellcheck : true,
487 paste_text_sticky : true, // COUPLED WITH paste PLUGIN
488 entity_encoding : "raw",
489 add_unload_trigger : false,
490 remove_linebreaks : false,
491 //force_p_newlines : false,
492 //force_br_newlines : true,
493 forced_root_block : 'div',
494 //convert_urls: false, //SPECIFIC?
495 content_css: baseurl + "/view/custom_tinymce.css",
496 theme_advanced_path : false,
497 file_browser_callback : "fcFileBrowser",
498 //setup : // SPECIFIC
501 if(window.editSelect != 'none') {
502 $.extend(tinyMCEInitConfig, editorData);
503 tinyMCE.init(tinyMCEInitConfig);
505 else if(typeof editorData.plaintextFn == 'function') {
506 (editorData.plaintextFn)();
513 function initEditor(cb){
516 $("#profile-jot-text-loading").show();
519 mode : "specific_textareas",
520 editor_selector : "profile-jot-text",
521 auto_focus : "profile-jot-text",
522 //plugins : "bbcode,paste,autoresize,inlinepopups",
523 //paste_text_sticky : true,
524 convert_urls : false,
525 setup : function(ed) {
527 ed.onKeyDown.add(function(ed,e) {
532 ed.onKeyUp.add(function(ed, e) {
533 var txt = tinyMCE.activeEditor.getContent();
534 match = txt.match(/@([^ \n]+)$/);
536 if(cPopup === null) {
537 cPopup = new ACPopup(this,baseurl+"/acl");
539 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
540 if(! cPopup.ready) cPopup = null;
543 if(cPopup !== null) { cPopup.close(); cPopup = null; }
546 textlen = txt.length;
547 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
548 $('#profile-jot-desc').html(window.isPublic);
551 $('#profile-jot-desc').html(' ');
557 $('#character-counter').removeClass('red');
558 $('#character-counter').removeClass('orange');
559 $('#character-counter').addClass('grey');
561 if((textlen > 140) && (textlen <= 420)) {
562 $('#character-counter').removeClass('grey');
563 $('#character-counter').removeClass('red');
564 $('#character-counter').addClass('orange');
567 $('#character-counter').removeClass('grey');
568 $('#character-counter').removeClass('orange');
569 $('#character-counter').addClass('red');
571 $('#character-counter').text(textlen);
574 ed.onInit.add(function(ed) {
575 ed.pasteAsPlainText = true;
576 $("#profile-jot-text-loading").hide();
577 $(".jothidden").show();
578 if (typeof cb!="undefined") cb();
582 plaintextFn : function() {
583 $("#profile-jot-text-loading").hide();
584 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
585 $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
586 $(".jothidden").show();
587 if (typeof cb!="undefined") cb();
590 InitMCEEditor(editorData);
593 $("a#jot-perms-icon").colorbox({
595 'transition' : 'elastic'
598 if (typeof cb!="undefined") cb();
602 function enableOnUser(){
609 function msgInitEditor() {
611 mode : "specific_textareas",
612 editor_selector : "prvmail-text",
613 //plugins : "bbcode,paste",
614 //paste_text_sticky : true,
615 convert_urls : false,
616 //theme_advanced_path : false,
617 setup : function(ed) {
619 ed.onKeyDown.add(function(ed,e) {
624 ed.onKeyUp.add(function(ed, e) {
625 var txt = tinyMCE.activeEditor.getContent();
626 match = txt.match(/@([^ \n]+)$/);
628 if(cPopup === null) {
629 cPopup = new ACPopup(this,baseurl+"/acl");
631 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
632 if(! cPopup.ready) cPopup = null;
635 if(cPopup !== null) { cPopup.close(); cPopup = null; }
638 textlen = txt.length;
639 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
640 $('#profile-jot-desc').html(window.isPublic);
643 $('#profile-jot-desc').html(' ');
647 ed.onInit.add(function(ed) {
648 ed.pasteAsPlainText = true;
649 var editorId = ed.editorId;
650 var textarea = $('#'+editorId);
651 if (typeof(textarea.attr('tabindex')) != "undefined") {
652 $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
653 textarea.attr('tabindex', null);
657 plaintextFn : function() {
658 $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
661 InitMCEEditor(editorData);
665 function contactInitEditor() {
668 elements : "contact-edit-info",
671 InitMCEEditor(editorData);
675 function eventInitEditor() {
678 //plugins : "bbcode,paste",
679 //paste_text_sticky : true,
680 //theme_advanced_path : false,
681 setup : function(ed) {
682 ed.onInit.add(function(ed) {
683 ed.pasteAsPlainText = true;
687 InitMCEEditor(editorData);
691 function profInitEditor() {
694 //plugins : "bbcode,paste",
695 //paste_text_sticky : true,
696 //theme_advanced_path : false,
697 setup : function(ed) {
698 ed.onInit.add(function(ed) {
699 ed.pasteAsPlainText = true;
703 InitMCEEditor(editorData);
711 function addeditortext(textElem, data) {
712 if(window.editSelect == 'none') {
713 var currentText = $(textElem).val();
714 $(textElem).val(currentText + data);
717 tinyMCE.execCommand('mceInsertRawHTML',false,data);
720 function jotVideoURL() {
721 reply = prompt(window.vidURL);
722 if(reply && reply.length) {
723 addeditortext("#profile-jot-text", '[video]' + reply + '[/video]');
727 function jotAudioURL() {
728 reply = prompt(window.audURL);
729 if(reply && reply.length) {
730 addeditortext("#profile-jot-text", '[audio]' + reply + '[/audio]');
735 function jotGetLocation() {
737 /* if(navigator.geolocation) {
739 navigator.geolocation.getCurrentPosition(function(position) {
740 var lat = position.coords.latitude;
741 var lng = position.coords.longitude;
745 url: 'http://nominatim.openstreetmap.org/reverse?format=json&lat='+lat+'&lon='+lng,
746 jsonp: 'json_callback',
747 contentType: 'application/json',
749 success: function(json) {
751 var locationDisplay = json.address.building+', '+json.address.city+', '+json.address.state;
752 $('#jot-location').val(locationDisplay);
753 $('#jot-display-location').html('Location: '+locationDisplay);
754 $('#jot-display-location').show();
761 reply = prompt(window.whereAreU, $('#jot-location').val());
762 if(reply && reply.length) {
763 $('#jot-location').val(reply);
767 reply = prompt(window.whereAreU, $('#jot-location').val());
768 if(reply && reply.length) {
769 $('#jot-location').val(reply);
773 function jotShare(id) {
774 if ($('#jot-popup').length != 0) $('#jot-popup').show();
776 $('#like-rotator-' + id).show();
777 $.get('share/' + id, function(data) {
778 if (!editor) $("#profile-jot-text").val("");
779 initEditor(function(){
780 addeditortext("#profile-jot-text", data);
781 $('#like-rotator-' + id).hide();
782 $(window).scrollTop(0);
788 function jotClearLocation() {
789 $('#jot-coord').val('');
790 $('#profile-nolocation-wrapper').hide();
794 function jotGetLink() {
795 reply = prompt(window.linkURL);
796 if(reply && reply.length) {
797 reply = bin2hex(reply);
798 $('#profile-rotator').show();
799 $.get('parse_url?binurl=' + reply, function(data) {
800 addeditortext(window.jotId, data);
801 $('#profile-rotator').hide();
807 function linkdropper(event) {
808 var linkFound = event.dataTransfer.types.contains("text/uri-list");
810 event.preventDefault();
814 function linkdrop(event) {
815 var reply = event.dataTransfer.getData("text/uri-list");
816 //event.target.textContent = reply;
817 event.preventDefault();
818 if(reply && reply.length) {
819 reply = bin2hex(reply);
820 $('#profile-rotator').show();
821 $.get('parse_url?binurl=' + reply, function(data) {
822 /* if(window.jotId == "#profile-jot-text") {
823 if (!editor) $("#profile-jot-text").val("");
824 initEditor(function(){
825 addeditortext(window.jotId, data);
826 $('#profile-rotator').hide();
830 addeditortext(window.jotId, data);
831 $('#profile-rotator').hide();
838 if(typeof window.geoTag === 'function') window.geoTag();
845 function confirmDelete() { return confirm(window.delItem); }
847 function deleteCheckedItems(delID) {
848 if(confirm(window.delItems)) {
852 $(delID + '-rotator').show();
853 $('.item-select').each( function() {
854 if($(this).is(':checked')) {
855 if(checkedstr.length != 0) {
856 checkedstr = checkedstr + ',' + $(this).val();
859 checkedstr = $(this).val();
863 $.post('item', { dropitems: checkedstr }, function(data) {
864 window.location.reload();
869 function itemTag(id) {
870 reply = prompt(window.term);
871 if(reply && reply.length) {
872 reply = reply.replace('#','');
876 $('body').css('cursor', 'wait');
878 $.get('tagger/' + id + '?term=' + reply, NavUpdate);
879 /*if(timer) clearTimeout(timer);
880 timer = setTimeout(NavUpdate,3000);*/
886 function itemFiler(id) {
888 var bordercolor = $("input").css("border-color");
890 $.get('filer/', function(data){
891 $.colorbox({html:data});
893 $("#id_term").keypress(function(){
894 $(this).css("border-color",bordercolor);
896 $("#select_term").change(function(){
897 $("#id_term").css("border-color",bordercolor);
900 $("#filer_save").click(function(e){
902 reply = $("#id_term").val();
903 if(reply && reply.length) {
905 $('body').css('cursor', 'wait');
906 $.get('filer/' + id + '?term=' + reply, NavUpdate);
907 /* if(timer) clearTimeout(timer);
908 timer = setTimeout(NavUpdate,3000);*/
912 $("#id_term").css("border-color","#FF0000");
925 function insertFormatting(comment,BBcode,id) {
927 var tmpStr = $("#comment-edit-text-" + id).val();
928 if(tmpStr == comment) {
930 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
931 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
932 openMenu("comment-edit-submit-wrapper-" + id);
933 $("#comment-edit-text-" + id).val(tmpStr);
936 textarea = document.getElementById("comment-edit-text-" +id);
937 if (document.selection) {
939 selected = document.selection.createRange();
940 if (BBcode == "url"){
941 selected.text = "["+BBcode+"=http://]" + selected.text + "[/"+BBcode+"]";
943 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
944 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
945 var start = textarea.selectionStart;
946 var end = textarea.selectionEnd;
947 if (BBcode == "url"){
948 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"=http://]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
950 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
955 function cmtBbOpen(id) {
956 $("#comment-edit-bb-" + id).show();
958 function cmtBbClose(id) {
959 $("#comment-edit-bb-" + id).hide();
962 function commentOpen(obj,id) {
963 if(obj.value == window.commentEmptyText) {
965 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
966 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
967 $("#mod-cmnt-wrap-" + id).show();
968 openMenu("comment-edit-submit-wrapper-" + id);
971 function commentClose(obj,id) {
972 if(obj.value == "") {
973 obj.value = window.commentEmptyText;
974 $("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
975 $("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
976 $("#mod-cmnt-wrap-" + id).hide();
977 closeMenu("comment-edit-submit-wrapper-" + id);
982 function commentInsert(obj,id) {
983 var tmpStr = $("#comment-edit-text-" + id).val();
984 if(tmpStr == window.commentEmptyText) {
986 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
987 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
988 openMenu("comment-edit-submit-wrapper-" + id);
990 var ins = $(obj).html();
991 ins = ins.replace("<","<");
992 ins = ins.replace(">",">");
993 ins = ins.replace("&","&");
994 ins = ins.replace(""",'"');
995 $("#comment-edit-text-" + id).val(tmpStr + ins);
998 function qCommentInsert(obj,id) {
999 var tmpStr = $("#comment-edit-text-" + id).val();
1000 if(tmpStr == window.commentEmptyText) {
1002 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
1003 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
1004 openMenu("comment-edit-submit-wrapper-" + id);
1006 var ins = $(obj).val();
1007 ins = ins.replace("<","<");
1008 ins = ins.replace(">",">");
1009 ins = ins.replace("&","&");
1010 ins = ins.replace(""",'"');
1011 $("#comment-edit-text-" + id).val(tmpStr + ins);
1015 /*function showHideCommentBox(id) {
1016 if( $('#comment-edit-form-' + id).is(':visible')) {
1017 $('#comment-edit-form-' + id).hide();
1020 $('#comment-edit-form-' + id).show();