网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
"use strict";var Webdiyer=Webdiyer||{};Webdiyer.MvcCorePagers=[];Webdiyer.MvcCorePagers.getById=function(n){for(var t=0;t<=this.length;t++)if(typeof this[t]!="undefined"&&this[t].id===n)return this[t];return null};Webdiyer.__ajaxPages={};Webdiyer.MvcCorePager=function(n){this.wrapper=n};Webdiyer.MvcCorePager.prototype={wrapper:null,id:null,urlFormat:null,pageIndexName:null,updateTarget:null,onBegin:null,onComplete:null,onFailure:null,onSuccess:null,httpMethod:null,confirm:null,loadingElementId:null,loadingDuration:0,partialLoading:null,currentPageIndex:null,searchForm:null,allowCache:!0,enableHistorySupport:null,searchCriteria:null,pageCount:null,invalidPageErrMsg:null,outOfRangeErrMsg:null,firstPageUrl:null,pageIndexBox:null,goToButton:null,maxPageIndexItems:20,isAjaxPager:null,onError:null,isFirstLoading:!0,allowReload:!1,init:function(){var t=$(this.wrapper),r=1,f,n,u,e,i,o;if(this.id=t.attr("id"),this.isAjaxPager=t.data("ajax")||!1,this.pageCount=t.data("pageCount"),this.invalidPageErrMsg=t.data("invalidPageError"),this.outOfRangeErrMsg=t.data("outRangeError"),this.firstPageUrl=t.data("firstPage"),this.urlFormat=t.data("urlFormat"),this.pageIndexName=t.data("pageParameter"),this.currentPageIndex=t.data("currentPage")||1,this.pageIndexBox=t.data("pageIndexBox"),this.goToButton=t.data("gotoButton"),this.maxPageIndexItems=t.data("maxItems")||20,this.onError=t.data("onerror")||"alert(errMsg)",n=this,this.isAjaxPager){this.updateTarget=t.data("ajaxUpdate");this.onBegin=t.data("ajaxBegin");this.onComplete=t.data("ajaxComplete");this.onFailure=t.data("ajaxFailure");this.onSuccess=t.data("ajaxSuccess");this.confirm=t.data("ajaxConfirm")||undefined;this.httpMethod=t.data("ajaxMethod")||"GET";this.loadingElementId=t.data("ajaxLoading")||undefined;this.searchForm=t.data("ajaxSearchForm")||undefined;this.allowCache=t.data("ajaxCache")||!0;u=t.data("ajaxHistory");this.enableHistorySupport=typeof u=="undefined"?!0:u;this.loadingDuration=t.data("ajaxLoadingDuration")||0;this.partialLoading=t.data("ajaxPartialLoading")||!1;f=this.currentPageIndex;e="[data-pager-type='Webdiyer.MvcCorePager']";i=this.__getPageIndex(this.pageIndexName);i!==this.currentPageIndex&&i>0&&this.__ajax(i,{type:this.httpMethod,data:[]});typeof this.searchForm!="undefined"&&(o=$(n.searchForm).data("ajax")||!1,$(n.searchForm).submit(function(t){n.searchCriteria=$(n.searchForm).serializeArray();o?n.currentPageIndex!==1?(n.currentPageIndex=1,n.enableHistorySupport?(n.__setPageIndex(n.pageIndexName,-1),n.allowReload=!0):n.__ajax(1,{type:n.httpMethod,data:[]})):typeof Webdiyer.__ajaxPages[n.pageIndexName]=="undefined"&&(n.allowReload=!0):(typeof Webdiyer.__ajaxPages[n.pageIndexName]=="undefined"&&(n.allowReload=!0),n.currentPageIndex===1?n.__ajax(1,{type:n.httpMethod,data:[]}):(n.enableHistorySupport?n.__setPageIndex(n.pageIndexName,1):n.__ajax(1,{type:n.httpMethod,data:[]}),n.currentPageIndex=1),n.allowReload=!0,t.preventDefault())}));this.enableHistorySupport&&this.__initHashChange(f);$(this.updateTarget).on("click",e+" a[data-page-index]",function(t){r=$(this).data("pageIndex");t.preventDefault();n.enableHistorySupport?n.__setPageIndex(n.pageIndexName,r):n.__ajax(r,{type:n.httpMethod,data:[]})})}return this.__bindPageIndexBox(),this},__bindPageIndexBox:function(){var n=this;if(n.isAjaxPager){if($.trim(n.pageIndexBox)!=="")if($(n.updateTarget).find(n.pageIndexBox).length>0){if(n.__fillPageIndexBox(),$(n.pageIndexBox).is("input:text")){$(n.pageIndexBox).val(n.currentPageIndex);$(n.updateTarget).on("keydown",n.pageIndexBox,function(){n.__validateInput(event)})}if($.trim(n.goToButton)!=="")$(n.updateTarget).on("click",n.goToButton,function(){var t=$(n.pageIndexBox).val();n.goToPage(t)});else $(n.updateTarget).on("change",n.pageIndexBox,function(){var t=$(n.pageIndexBox).val();n.goToPage(t)})}else n.__bindBoxEvents()}else $.trim(n.pageIndexBox)!==""&&n.__bindBoxEvents()},__bindBoxEvents:function(){var n=this;n.__fillPageIndexBox();$(n.pageIndexBox).is("input:text")&&($(n.pageIndexBox).val(n.currentPageIndex),$(n.pageIndexBox).keydown(function(){n.__validateInput(event)}));$.trim(n.goToButton)!==""?$(n.goToButton).click(function(){var t=$(n.pageIndexBox).val();n.goToPage(t)}):$(n.pageIndexBox).change(function(){var t=$(n.pageIndexBox).val();n.goToPage(t)})},__fillPageIndexBox:function(){var i=$(this.pageIndexBox),n,r,t;if(i.prop("type")==="select-one")for(i.empty(),n=this.currentPageIndex-this.maxPageIndexItems/2,n+this.maxPageIndexItems>this.pageCount&&(n=this.pageCount+1-this.maxPageIndexItems),n<1&&(n=1),r=n+this.maxPageIndexItems-1,r>this.pageCount&&(r=this.pageCount),t=n;t<=r;t++)i.append('<option value="'+t+'">'+t+"<\/option>");i.val(this.currentPageIndex)},__initHashChange:function(n){var t=this,r=document.documentMode,i;"onhashchange"in window&&(r===undefined||r>7)?$(window).bind("hashchange",function(){var i=t.__getPageIndex(t.pageIndexName);i===0&&(i=n);t.__ajax(i,{type:t.httpMethod,data:[]})}):(i=window.location.hash,setInterval(function(){var r=t.__getPageIndex(t.pageIndexName);window.location.hash!==i&&(i=window.location.hash,r===0&&(r=n),t.__ajax(r,{type:t.httpMethod,data:[]}))},200))},__getPageIndex:function(n){var u=window.location.hash.substring(1),i,t,r;if($.trim(u)!=="")for(i=u.split("&"),t=0;t<i.length;t++)if(r=i[t].split("="),r[0].toString().toLowerCase()===n.toString().toLowerCase())return parseInt(r[1])||1;return 0},__setPageIndex:function(n,t){var i=window.location.hash.substring(1),r,u;$.trim(i)===""?window.location.hash=n+"="+t:(r=new RegExp(n+"=[^&]*","i"),r.test(i)?(u=i.replace(r,n+"="+t),window.location.hash=u):window.location.hash+="&"+n+"="+t)},goToPage:function(n){var t=new RegExp("^\\s*(\\d+)\\s*$");if(t.test(n)){if(RegExp.$1<1||RegExp.$1>this.pageCount){this.__getFunction(this.onError,["errType","errMsg"]).apply(this,[1,this.outOfRangeErrMsg]);return}}else{this.__getFunction(this.onError,["errType","errMsg"]).apply(this,[0,this.invalidPageErrMsg]);return}this.isAjaxPager?this.enableHistorySupport?this.__setPageIndex(this.pageIndexName,n):this.__ajax(n,{type:this.httpMethod,data:[]}):window.self.location.href=typeof this.firstPageUrl!="undefined"&&this.firstPageUrl!==!1&&parseInt(n)===1?this.firstPageUrl:decodeURI(this.urlFormat).replace("__"+this.pageIndexName+"__",n)},__ajax:function(n,t){var i=this,r;if(typeof Webdiyer.__ajaxPages[i.pageIndexName]=="undefined"||Webdiyer.__ajaxPages[i.pageIndexName]!==n||i.allowReload){if(n===-1||n===0&&i.isFirstLoading||n===i.currentPageIndex&&!i.allowReload)return;if(i.confirm&&!window.confirm(i.confirm))return;$.extend(t,{url:this.urlFormat.replace("__"+i.pageIndexName+"__",n),cache:this.allowCache,beforeSend:function(n){var r=t.type.toUpperCase(),u;return r==="GET"||r==="POST"||n.setRequestHeader("X-HTTP-Method-Override",r),u=i.__getFunction(i.onBegin,["xhr"]).apply(this,arguments),u!==!1&&typeof i.loadingElementId!="undefined"&&$(i.loadingElementId).show(i.loadingDuration),u},complete:function(){typeof i.loadingElementId!="undefined"&&$(i.loadingElementId).hide(i.loadingDuration);i.__fillPageIndexBox();i.__getFunction(i.onComplete,["xhr","status"]).apply(this,arguments)},success:function(t){i.partialLoading?$(i.updateTarget).html($(i.updateTarget,t).html()):$(i.updateTarget).html(t);i.currentPageIndex=n;i.isFirstLoading=!1;i.__getFunction(i.onSuccess,["data","status","xhr"]).apply(this,arguments)},error:i.__getFunction(i.onFailure,["xhr","status","error"])});typeof i.searchForm!="undefined"&&i.__pushData(t.data,i.searchCriteria);t.data.push({name:"X-Requested-With",value:"XMLHttpRequest"});r=t.type.toUpperCase();r==="GET"||r==="POST"||(t.type="POST",t.data.push({name:"X-HTTP-Method-Override",value:r}));$.ajax(t);Webdiyer.__ajaxPages[i.pageIndexName]=n}},__pushData:function(n,t){if(t!==null&&typeof t!="undefined")for(var i=0;i<t.length;i++)n.push({name:t[i].name,value:t[i].value})},__getFunction:function(n,t){for(var i=window,r=(n||"").split(".");i&&r.length;)i=i[r.shift()];if(typeof i=="function")return i;if($.trim(n).toLowerCase().indexOf("function")===0)return new Function("return ("+n+").apply(this,arguments);");t.push(n);try{return Function.constructor.apply(null,t)}catch(u){alert("Error:\r\n"+n+"\r\n is not a valid callback function")}},__validateInput:function(n){var t,i;window.event?t=n.keyCode:n.which&&(t=n.which);i=[8,37,39,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];t!==null&&i.indexOf(t)<0&&(n.preventDefault?n.preventDefault():event.returnValue=!1)}},function(n){n.fn.initMvcCorePagers=function(){return this.each(function(){Webdiyer.MvcCorePagers.push(new Webdiyer.MvcCorePager(this).init())})}}(jQuery);$(function(){$("[data-pager-type='Webdiyer.MvcCorePager']").initMvcCorePagers()});
loading