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 initCrop() {
357 function onEndCrop( coords, dimensions ) {
358 $PR( 'x1' ).value = coords.x1;
359 $PR( 'y1' ).value = coords.y1;
360 $PR( 'x2' ).value = coords.x2;
361 $PR( 'y2' ).value = coords.y2;
362 $PR( 'width' ).value = dimensions.width;
363 $PR( 'height' ).value = dimensions.height;
366 Event.observe( window, 'load', function() {
367 new Cropper.ImgWithPreview(
370 previewWrap: 'previewWrap',
375 ratioDim: { x: 100, y:100 },
384 $(document).mouseup(function (clickPos) {
386 var sysMenu = $("#system-menu-list");
387 var sysMenuLink = $(".system-menu-link");
388 var contactsMenu = $("#contacts-menu-list");
389 var contactsMenuLink = $(".contacts-menu-link");
390 var networkMenu = $("#network-menu-list");
391 var networkMenuLink = $(".network-menu-link");
393 if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
394 hideNavMenu("#system-menu-list");
396 if( !contactsMenu.is(clickPos.target) && !contactsMenuLink.is(clickPos.target) && contactsMenu.has(clickPos.target).length === 0) {
397 hideNavMenu("#contacts-menu-list");
399 if( !networkMenu.is(clickPos.target) && !networkMenuLink.is(clickPos.target) && networkMenu.has(clickPos.target).length === 0) {
400 hideNavMenu("#network-menu-list");
405 function getPageContent(url) {
407 var pos = $('.main-container').position();
409 $('.main-container').css('margin-left', pos.left);
410 $('.main-content-container').hide(0, function () {
411 $('.main-content-loading').show(0);
414 $.get(url, function(html) {
415 console.log($('.main-content-container').html());
416 $('.main-content-container').html( $('.main-content-container', html).html() );
417 console.log($('.main-content-container').html());
418 $('.main-content-loading').hide(function() {
419 $('.main-content-container').fadeIn(800,function() {
420 $('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
427 function showNavMenu(menuID) {
429 if(window.navMenuTimeout[menuID + '-closing']) {
430 window.navMenuTimeout[menuID + '-closing'] = false;
431 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
434 window.navMenuTimeout[menuID + '-opening'] = true;
436 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
437 $(menuID).slideDown('fast').show();
438 window.navMenuTimeout[menuID + '-opening'] = false;
443 function hideNavMenu(menuID) {
445 if(window.navMenuTimeout[menuID + '-opening']) {
446 window.navMenuTimeout[menuID + '-opening'] = false;
447 clearTimeout(window.navMenuTimeout[menuID + '-timeout']);
450 window.navMenuTimeout[menuID + '-closing'] = true;
452 window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
453 $(menuID).slideUp('fast');
454 window.navMenuTimeout[menuID + '-closing'] = false;
465 function InitMCEEditor(editorData) {
466 var tinyMCEInitConfig = {
469 //editor_selector: // SPECIFIC
470 //elements: // SPECIFIC
471 plugins : "bbcode,paste,autoresize,inlinepopups",
472 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
473 theme_advanced_buttons2 : "",
474 theme_advanced_buttons3 : "",
475 theme_advanced_toolbar_location : "top",
476 theme_advanced_toolbar_align : "center",
477 theme_advanced_blockformats : "blockquote,code",
478 gecko_spellcheck : true,
479 paste_text_sticky : true, // COUPLED WITH paste PLUGIN
480 entity_encoding : "raw",
481 add_unload_trigger : false,
482 remove_linebreaks : false,
483 //force_p_newlines : false,
484 //force_br_newlines : true,
485 forced_root_block : 'div',
486 //convert_urls: false, //SPECIFIC?
487 content_css: baseurl + "/view/custom_tinymce.css",
488 theme_advanced_path : false,
489 file_browser_callback : "fcFileBrowser",
490 //setup : // SPECIFIC
493 if(window.editSelect != 'none') {
494 $.extend(tinyMCEInitConfig, editorData);
495 tinyMCE.init(tinyMCEInitConfig);
497 else if(typeof editorData.plaintextFn == 'function') {
498 (editorData.plaintextFn)();
505 function initEditor(cb){
508 $("#profile-jot-text-loading").show();
511 mode : "specific_textareas",
512 editor_selector : "profile-jot-text",
513 auto_focus : "profile-jot-text",
514 //plugins : "bbcode,paste,autoresize,inlinepopups",
515 //paste_text_sticky : true,
516 convert_urls : false,
517 setup : function(ed) {
519 ed.onKeyDown.add(function(ed,e) {
524 ed.onKeyUp.add(function(ed, e) {
525 var txt = tinyMCE.activeEditor.getContent();
526 match = txt.match(/@([^ \n]+)$/);
528 if(cPopup === null) {
529 cPopup = new ACPopup(this,baseurl+"/acl");
531 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
532 if(! cPopup.ready) cPopup = null;
535 if(cPopup !== null) { cPopup.close(); cPopup = null; }
538 textlen = txt.length;
539 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
540 $('#profile-jot-desc').html(window.isPublic);
543 $('#profile-jot-desc').html(' ');
549 $('#character-counter').removeClass('red');
550 $('#character-counter').removeClass('orange');
551 $('#character-counter').addClass('grey');
553 if((textlen > 140) && (textlen <= 420)) {
554 $('#character-counter').removeClass('grey');
555 $('#character-counter').removeClass('red');
556 $('#character-counter').addClass('orange');
559 $('#character-counter').removeClass('grey');
560 $('#character-counter').removeClass('orange');
561 $('#character-counter').addClass('red');
563 $('#character-counter').text(textlen);
566 ed.onInit.add(function(ed) {
567 ed.pasteAsPlainText = true;
568 $("#profile-jot-text-loading").hide();
569 $(".jothidden").show();
570 if (typeof cb!="undefined") cb();
574 plaintextFn : function() {
575 $("#profile-jot-text-loading").hide();
576 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
577 $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
578 $(".jothidden").show();
579 if (typeof cb!="undefined") cb();
582 InitMCEEditor(editorData);
585 $("a#jot-perms-icon").colorbox({
587 'transition' : 'elastic'
590 if (typeof cb!="undefined") cb();
594 function enableOnUser(){
601 function msgInitEditor() {
603 mode : "specific_textareas",
604 editor_selector : "prvmail-text",
605 //plugins : "bbcode,paste",
606 //paste_text_sticky : true,
607 convert_urls : false,
608 //theme_advanced_path : false,
609 setup : function(ed) {
611 ed.onKeyDown.add(function(ed,e) {
616 ed.onKeyUp.add(function(ed, e) {
617 var txt = tinyMCE.activeEditor.getContent();
618 match = txt.match(/@([^ \n]+)$/);
620 if(cPopup === null) {
621 cPopup = new ACPopup(this,baseurl+"/acl");
623 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
624 if(! cPopup.ready) cPopup = null;
627 if(cPopup !== null) { cPopup.close(); cPopup = null; }
630 textlen = txt.length;
631 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
632 $('#profile-jot-desc').html(window.isPublic);
635 $('#profile-jot-desc').html(' ');
639 ed.onInit.add(function(ed) {
640 ed.pasteAsPlainText = true;
641 var editorId = ed.editorId;
642 var textarea = $('#'+editorId);
643 if (typeof(textarea.attr('tabindex')) != "undefined") {
644 $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
645 textarea.attr('tabindex', null);
649 plaintextFn : function() {
650 $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
653 InitMCEEditor(editorData);
657 function contactInitEditor() {
660 elements : "contact-edit-info",
663 InitMCEEditor(editorData);
667 function eventInitEditor() {
670 //plugins : "bbcode,paste",
671 //paste_text_sticky : true,
672 //theme_advanced_path : false,
673 setup : function(ed) {
674 ed.onInit.add(function(ed) {
675 ed.pasteAsPlainText = true;
679 InitMCEEditor(editorData);
683 function profInitEditor() {
686 //plugins : "bbcode,paste",
687 //paste_text_sticky : true,
688 //theme_advanced_path : false,
689 setup : function(ed) {
690 ed.onInit.add(function(ed) {
691 ed.pasteAsPlainText = true;
695 InitMCEEditor(editorData);
703 function addeditortext(textElem, data) {
704 if(window.editSelect == 'none') {
705 var currentText = $(textElem).val();
706 $(textElem).val(currentText + data);
709 tinyMCE.execCommand('mceInsertRawHTML',false,data);
712 function jotVideoURL() {
713 reply = prompt(window.vidURL);
714 if(reply && reply.length) {
715 addeditortext("#profile-jot-text", '[video]' + reply + '[/video]');
719 function jotAudioURL() {
720 reply = prompt(window.audURL);
721 if(reply && reply.length) {
722 addeditortext("#profile-jot-text", '[audio]' + reply + '[/audio]');
727 function jotGetLocation() {
729 /* if(navigator.geolocation) {
731 navigator.geolocation.getCurrentPosition(function(position) {
732 var lat = position.coords.latitude;
733 var lng = position.coords.longitude;
737 url: 'http://nominatim.openstreetmap.org/reverse?format=json&lat='+lat+'&lon='+lng,
738 jsonp: 'json_callback',
739 contentType: 'application/json',
741 success: function(json) {
743 var locationDisplay = json.address.building+', '+json.address.city+', '+json.address.state;
744 $('#jot-location').val(locationDisplay);
745 $('#jot-display-location').html('Location: '+locationDisplay);
746 $('#jot-display-location').show();
753 reply = prompt(window.whereAreU, $('#jot-location').val());
754 if(reply && reply.length) {
755 $('#jot-location').val(reply);
759 reply = prompt(window.whereAreU, $('#jot-location').val());
760 if(reply && reply.length) {
761 $('#jot-location').val(reply);
765 function jotShare(id) {
766 if ($('#jot-popup').length != 0) $('#jot-popup').show();
768 $('#like-rotator-' + id).show();
769 $.get('share/' + id, function(data) {
770 if (!editor) $("#profile-jot-text").val("");
771 initEditor(function(){
772 addeditortext("#profile-jot-text", data);
773 $('#like-rotator-' + id).hide();
774 $(window).scrollTop(0);
780 function jotClearLocation() {
781 $('#jot-coord').val('');
782 $('#profile-nolocation-wrapper').hide();
786 function jotGetLink() {
787 reply = prompt(window.linkURL);
788 if(reply && reply.length) {
789 reply = bin2hex(reply);
790 $('#profile-rotator').show();
791 $.get('parse_url?binurl=' + reply, function(data) {
792 addeditortext(window.jotId, data);
793 $('#profile-rotator').hide();
799 function linkdropper(event) {
800 var linkFound = event.dataTransfer.types.contains("text/uri-list");
802 event.preventDefault();
806 function linkdrop(event) {
807 var reply = event.dataTransfer.getData("text/uri-list");
808 //event.target.textContent = reply;
809 event.preventDefault();
810 if(reply && reply.length) {
811 reply = bin2hex(reply);
812 $('#profile-rotator').show();
813 $.get('parse_url?binurl=' + reply, function(data) {
814 /* if(window.jotId == "#profile-jot-text") {
815 if (!editor) $("#profile-jot-text").val("");
816 initEditor(function(){
817 addeditortext(window.jotId, data);
818 $('#profile-rotator').hide();
822 addeditortext(window.jotId, data);
823 $('#profile-rotator').hide();
830 if(typeof window.geoTag === 'function') window.geoTag();
837 function confirmDelete() { return confirm(window.delItem); }
839 function deleteCheckedItems(delID) {
840 if(confirm(window.delItems)) {
844 $(delID + '-rotator').show();
845 $('.item-select').each( function() {
846 if($(this).is(':checked')) {
847 if(checkedstr.length != 0) {
848 checkedstr = checkedstr + ',' + $(this).val();
851 checkedstr = $(this).val();
855 $.post('item', { dropitems: checkedstr }, function(data) {
856 window.location.reload();
861 function itemTag(id) {
862 reply = prompt(window.term);
863 if(reply && reply.length) {
864 reply = reply.replace('#','');
868 $('body').css('cursor', 'wait');
870 $.get('tagger/' + id + '?term=' + reply, NavUpdate);
871 /*if(timer) clearTimeout(timer);
872 timer = setTimeout(NavUpdate,3000);*/
878 function itemFiler(id) {
880 var bordercolor = $("input").css("border-color");
882 $.get('filer/', function(data){
883 $.colorbox({html:data});
885 $("#id_term").keypress(function(){
886 $(this).css("border-color",bordercolor);
888 $("#select_term").change(function(){
889 $("#id_term").css("border-color",bordercolor);
892 $("#filer_save").click(function(e){
894 reply = $("#id_term").val();
895 if(reply && reply.length) {
897 $('body').css('cursor', 'wait');
898 $.get('filer/' + id + '?term=' + reply, NavUpdate);
899 /* if(timer) clearTimeout(timer);
900 timer = setTimeout(NavUpdate,3000);*/
904 $("#id_term").css("border-color","#FF0000");
917 function insertFormatting(comment,BBcode,id) {
919 var tmpStr = $("#comment-edit-text-" + id).val();
920 if(tmpStr == comment) {
922 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
923 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
924 openMenu("comment-edit-submit-wrapper-" + id);
925 $("#comment-edit-text-" + id).val(tmpStr);
928 textarea = document.getElementById("comment-edit-text-" +id);
929 if (document.selection) {
931 selected = document.selection.createRange();
932 if (BBcode == "url"){
933 selected.text = "["+BBcode+"=http://]" + selected.text + "[/"+BBcode+"]";
935 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
936 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
937 var start = textarea.selectionStart;
938 var end = textarea.selectionEnd;
939 if (BBcode == "url"){
940 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"=http://]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
942 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
947 function cmtBbOpen(id) {
948 $("#comment-edit-bb-" + id).show();
950 function cmtBbClose(id) {
951 $("#comment-edit-bb-" + id).hide();
954 function commentOpen(obj,id) {
955 if(obj.value == window.commentEmptyText) {
957 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
958 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
959 $("#mod-cmnt-wrap-" + id).show();
960 openMenu("comment-edit-submit-wrapper-" + id);
963 function commentClose(obj,id) {
964 if(obj.value == "") {
965 obj.value = window.commentEmptyText;
966 $("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
967 $("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
968 $("#mod-cmnt-wrap-" + id).hide();
969 closeMenu("comment-edit-submit-wrapper-" + id);
974 function commentInsert(obj,id) {
975 var tmpStr = $("#comment-edit-text-" + id).val();
976 if(tmpStr == window.commentEmptyText) {
978 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
979 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
980 openMenu("comment-edit-submit-wrapper-" + id);
982 var ins = $(obj).html();
983 ins = ins.replace("<","<");
984 ins = ins.replace(">",">");
985 ins = ins.replace("&","&");
986 ins = ins.replace(""",'"');
987 $("#comment-edit-text-" + id).val(tmpStr + ins);
990 function qCommentInsert(obj,id) {
991 var tmpStr = $("#comment-edit-text-" + id).val();
992 if(tmpStr == window.commentEmptyText) {
994 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
995 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
996 openMenu("comment-edit-submit-wrapper-" + id);
998 var ins = $(obj).val();
999 ins = ins.replace("<","<");
1000 ins = ins.replace(">",">");
1001 ins = ins.replace("&","&");
1002 ins = ins.replace(""",'"');
1003 $("#comment-edit-text-" + id).val(tmpStr + ins);
1007 /*function showHideCommentBox(id) {
1008 if( $('#comment-edit-form-' + id).is(':visible')) {
1009 $('#comment-edit-form-' + id).hide();
1012 $('#comment-edit-form-' + id).show();