Файловый менеджер - Редактировать - /home/lmsyaran/public_html/media/com_easyblog/scripts/ejax.js
Назад
EasyBlog.module("ejax",function($){var module=this;ejax={http:!1,format:"text",callback:function(e){},error:!1,getHTTPObject:function(){var e=!1;if(typeof ActiveXObject!="undefined")try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(n){e=!1}}else if(XMLHttpRequest)try{e=new XMLHttpRequest}catch(t){e=!1}return e},call:function(e,t,n,r){var i=[{view:e,callback:r},t];i=i.concat(n),ejax.load.apply(this,i)},load:function(view,method){var callback={success:function(){},error:function(){}};typeof view=="object"&&(callback=$.extend(callback,$.isFunction(view.callback)?{success:view.callback}:view.callback),view=view.view),url=eblog_site,url+="&tmpl=component",url+="&no_html=1",url+="&format=ejax",url+="&uid="+(new Date).getTime();var parameters="&view="+view+"&layout="+method;if(arguments.length>2)for(var i=2;i<arguments.length;i++){var myArgument=arguments[i];if($.isArray(myArgument))for(var j=0;j<myArgument.length;j++){var argument=myArgument[j];typeof argument=="string"&&(parameters+="&value"+(i-2)+"[]="+encodeURIComponent(argument))}else{var argument=myArgument;typeof argument=="string"&&(parameters+="&value"+(i-2)+"="+encodeURIComponent(argument))}}var http=this.getHTTPObject();if(!http||!view||!method)return;var ths=this;http.open("POST",url,!0),http.setRequestHeader("Content-type","application/x-www-form-urlencoded"),http.setRequestHeader("Content-length",parameters.length),http.setRequestHeader("Connection","close"),http.onreadystatechange=function(){if(http.readyState==4)if(http.status==200){var result="";http.responseText&&(result=http.responseText),result=result.replace(/[\n\r]/g,"");try{result=eval(result)}catch(e){callback.error&&callback.error("Invalid response.")}ths.process(result,callback)}else ths.error&&(ths.error(http.status),callback.error&&callback.error(http.status))},http.send(parameters)},_string:[],string:function(e){if(ejax._string[e]!=undefined)return ejax._string[e];var t=eblog_site+"&tmpl=component&no_html=1&controller=easyblog&task=ajaxGetSystemString",n=$.ajax({type:"POST",url:t,data:"data="+e,async:!1,cache:!0}).responseText;return ejax._string[e]=n,n},getFormVal:function(e){var t=[],n=null;return $(":input",$(e)).each(function(){n=this.value.replace(/"/g,"""),n=encodeURIComponent(n),$(this).is(":checkbox")||$(this).is(":radio")?$(this).prop("checked")&&t.push(this.name+"="+escape(n)):t.push(this.name+"="+escape(n))}),t},process:function(result,callback){for(var i=0;i<result.length;i++){var action=result[i][0];switch(action){case"script":var data=result[i][1];eval("EasyBlog(function($){"+data+"});");break;case"after":var id=result[i][1],value=result[i][2];$("#"+id).after(value);break;case"append":var id=result[i][1],value=result[i][2];$("#"+id).append(value);break;case"assign":var id=result[i][1],value=result[i][2];$("#"+id).html(value);break;case"value":var id=result[i][1],value=result[i][2];$("#"+id).val(value);break;case"prepend":var id=result[i][1],value=result[i][2];$("#"+id).prepend(value);break;case"destroy":var id=result[i][1];$("#"+id).remove();break;case"dialog":ejax.dialog(result[i][1]);break;case"alert":ejax.alert(result[i][1],result[i][2],result[i][3],result[i][4]);break;case"create":break;case"error":var args=result[i].slice(1);callback.error.apply(this,args);break;case"callback":var args=result[i].slice(1);callback.success.apply(this,args)}}delete result},dialog:function(e){ejax._showPopup(e)},closedlg:function(){var e=$("#eblog-dialog"),t=$("#eblog-overlay"),n=e.data("options");t.hide(),e.fadeOut(function(){n.afterClose.apply(e)}),$(window).unbind(".dialog"),$(document).unbind("keyup",ejax._attachPopupShortcuts)},_attachPopupShortcuts:function(e){e.keyCode==27&&ejax.closedlg()},alert:function(e,t,n,r){var i=ejax.string("COM_EASYBLOG_OK"),s='<div class="dialog-actions"><input type="button" value="'+i+'" class="button" id="edialog-cancel" name="edialog-cancel" onclick="ejax.closedlg();" /></div>',o={title:t,content:e+s,width:n,height:r};ejax._showPopup(o)},_showPopup:function(e){var t={width:"500",height:"auto",type:"dialog",beforeDisplay:function(){},afterDisplay:function(){},afterClose:function(){}},e=$.extend({},t,e),n=$("#eblog-overlay");n.length<1&&(n='<div id="eblog-overlay"></div>',n=$(n).appendTo("body"),n.click(function(){ejax.closedlg()}));var r=$("#eblog-dialog");r.length<1&&(dialogTemplate='<div id="eblog-dialog">',dialogTemplate+=' <div class="dialog">',dialogTemplate+=' <div class="dialog-wrap">',dialogTemplate+=' <div class="dialog-top">',dialogTemplate+=" <h3></h3>",dialogTemplate+=' <a href="javascript:void(0);" onclick="ejax.closedlg();" class="closeme">Close</a>',dialogTemplate+=" </div>",dialogTemplate+=' <div class="dialog-middle clearfix">',dialogTemplate+=' <div class="dialog-middle-content"></div>',dialogTemplate+=" </div>",dialogTemplate+=" </div>",dialogTemplate+=" </div>",dialogTemplate+="</div>",r=$(dialogTemplate).appendTo("body")),r.data("options",e);var i=r.find(".dialog-top h3");e.title=e.title!=null?e.title:" ",i.html(unescape(e.title));var s=$("#eblog-dialog .dialog-middle-content");s.css({width:e.width=="auto"?"auto":parseInt(e.width),height:e.height=="auto"?"auto":parseInt(e.height)}).html(e.content),e.beforeDisplay.apply(r);var o=function(){r.css({top:0,left:0}).position({my:"center",at:"center",of:window}),n.css({width:$(document).width(),height:$(document).height()}).show()};r.show(0,function(){o();var e;$(window).bind("resize.dialog scroll.dialog",function(){clearTimeout(e),e=setTimeout(o,50)})}),r.fadeOut(0,function(){r.fadeIn(function(){e.afterDisplay.apply(r)})}),$("#edialog-cancel, #edialog-submit").live("mouseup",function(){ejax.closedlg()}),$(document).bind("keyup",ejax._attachPopupShortcuts)}},module.resolve()});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.13 |
proxy
|
phpinfo
|
Настройка