/*======================================================================*\ || #################################################################### || || # vBulletin 4.2.5 || # ---------------------------------------------------------------- # || || # Copyright ©2000-2019 vBulletin Solutions Inc. All Rights Reserved. || || # This file may not be redistributed in whole or significant part. # || || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # || || # www.vbulletin.com | www.vbulletin.com/license.html # || || #################################################################### || \*======================================================================*/ function vB_AJAX_QuickEdit_Init(C){if(AJAX_Compatible){if(typeof C=="string"){C=fetch_object(C)}var B=fetch_tags(C,"a");for(var A=0;A0){return true}var C=A.substr(A.lastIndexOf("::")+2);if(YAHOO.util.Connect.isCallInProgress(this.ajax_req)){return false}else{if(!this.ready()){if(this.postid==C){this.full_edit();return false}this.abort()}}this.editorcounter++;this.editorid="vB_Editor_QE_"+this.editorcounter;this.postid=C;this.messageobj=fetch_object("post_message_"+this.postid);this.originalhtml=this.messageobj.innerHTML;this.unchanged=null;this.unchanged_reason=null;var B=YAHOO.util.Dom.get("return_node");if(B){this.return_node=parseInt(B.value,10)}this.fetch_editor();this.editstate=true;return false};vB_AJAX_QuickEditor.prototype.fetch_editor=function(){if(YAHOO.util.Dom.get("progress_"+this.postid)){this.editimgsrc=YAHOO.util.Dom.get("editimg_"+this.postid).getAttribute("src");YAHOO.util.Dom.get("editimg_"+this.postid).setAttribute("src",YAHOO.util.Dom.get("progress_"+this.postid).getAttribute("src"))}document.body.style.cursor="wait";YAHOO.util.Connect.asyncRequest("POST",fetch_ajax_url("ajax.php?do=quickedit&p="+this.postid),{success:this.display_editor,failure:this.error_opening_editor,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=quickedit&p="+this.postid+"&editorid="+PHP.urlencode(this.editorid)+(this.return_node?"&return_node="+this.return_node:""))};vB_AJAX_QuickEditor.prototype.error_opening_editor=function(A){vBulletin_AJAX_Error_Handler(A);window.location="editpost.php?"+SESSIONURL+"do=editpost&postid="+this.postid};vB_AJAX_QuickEditor.prototype.handle_save_error=function(A){vBulletin_AJAX_Error_Handler(A);this.show_advanced=false;this.full_edit()};vB_AJAX_QuickEditor.prototype.display_editor=function(ajax){if(ajax.responseXML){if(YAHOO.util.Dom.get("progress_"+vB_QuickEditor.postid)){YAHOO.util.Dom.get("editimg_"+this.postid).setAttribute("src",vB_QuickEditor.editimgsrc)}document.body.style.cursor="auto";if(fetch_tag_count(ajax.responseXML,"disabled")){window.location="editpost.php?"+SESSIONURL+"do=editpost&postid="+this.postid}else{if(fetch_tag_count(ajax.responseXML,"error")){alert(ajax.responseXML.getElementsByTagName("error")[0].firstChild.nodeValue);return }else{if(ajax.responseXML.getElementsByTagName("contenttypeid").length>0){vBulletin.attachinfo={contenttypeid:ajax.responseXML.getElementsByTagName("contenttypeid")[0].firstChild.nodeValue,userid:ajax.responseXML.getElementsByTagName("userid")[0].firstChild.nodeValue,attachlimit:ajax.responseXML.getElementsByTagName("attachlimit")[0].firstChild.nodeValue,max_file_size:ajax.responseXML.getElementsByTagName("max_file_size")[0].firstChild.nodeValue,auth_type:ajax.responseXML.getElementsByTagName("auth_type")[0].firstChild.nodeValue,asset_enable:ajax.responseXML.getElementsByTagName("asset_enable")[0].firstChild.nodeValue,posthash:ajax.responseXML.getElementsByTagName("posthash")[0].firstChild.nodeValue,poststarttime:ajax.responseXML.getElementsByTagName("poststarttime")[0].firstChild.nodeValue};var values=ajax.responseXML.getElementsByTagName("values");if(values.length>0&&values[0].childNodes.length){vBulletin.attachinfo.values="";for(var i=0;i0){vBulletin.attachinfo.values="&"}vBulletin.attachinfo.values+="values["+values[0].childNodes[i].nodeName+"]="+values[0].childNodes[i].childNodes[0].nodeValue}}}var phrases=ajax.responseXML.getElementsByTagName("phrases");if(phrases.length>0&&phrases[0].childNodes.length){for(var i=0;i"+D[B].firstChild.nodeValue+""}A+="";vB_QuickEditor.show_errors(A)}else{vB_QuickEditor.restore(C.responseXML.getElementsByTagName("postbit")[0].firstChild.nodeValue,"tableobj");PostBit_Init(fetch_object("post_"+vB_QuickEditor.postid),vB_QuickEditor.postid)}}return false};vB_AJAX_QuickEditor.prototype.show_errors=function(A){set_unselectable("quick_edit_errors_hide");YAHOO.util.Dom.get("ajax_post_errors_message").innerHTML=A;var B=YAHOO.util.Dom.get("ajax_post_errors");var C=(is_saf?"body":"documentElement");B.style.left=(is_ie?document.documentElement.clientWidth:self.innerWidth)/2-200+document[C].scrollLeft+"px";B.style.top=(is_ie?document.documentElement.clientHeight:self.innerHeight)/2-150+document[C].scrollTop+"px";YAHOO.util.Dom.removeClass(B,"hidden")};vB_AJAX_QuickEditor.prototype.hide_errors=function(A){this.errors=false;YAHOO.util.Dom.addClass("ajax_post_errors","hidden");if(A!=true){vB_Editor[this.editorid].check_focus()}};function vB_AJAX_QuickEditor_Events(){}vB_AJAX_QuickEditor_Events.prototype.editbutton_click=function(A){return vB_QuickEditor.edit(this.name)};vB_AJAX_QuickEditor_Events.prototype.delete_button_handler=function(A){if(this.id=="rb_del_leave"&&this.checked){vB_QuickEditor.deletebutton.disabled=true}else{vB_QuickEditor.deletebutton.disabled=false}};vB_AJAX_QuickEditor_Events.prototype.reason_key_trap=function(A){A=A?A:window.event;switch(A.keyCode){case 9:fetch_object(vB_QuickEditor.editorid+"_save").focus();return false;break;case 13:vB_QuickEditor.save();return false;break;default:return true}};vB_AJAX_QuickEditor_Events.prototype.delete_items_key_trap=function(A){A=A?A:window.event;if(A.keyCode==13){if(vB_QuickEditor.deletebutton.disabled==false){vB_QuickEditor.delete_post()}return false}return true};var vB_QuickEditor=new vB_AJAX_QuickEditor();