优化了一些问题
This commit is contained in:
1 parent
e54228d509
commit
41da33bb13
38 files changed
+7
-1138
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
jQuery.cookie=function(e,o,t){if(o===void 0){var i=null;if(document.cookie&&document.cookie!="")for(var r=document.cookie.split(";"),n=0;n<r.length;n++){var c=jQuery.trim(r[n]);if(c.substring(0,e.length+1)==e+"="){i=decodeURIComponent(c.substring(e.length+1));break}}return i}t=t||{},o===null&&(o="",t.expires=-1);var a="";if(t.expires&&(typeof t.expires=="number"||t.expires.toUTCString)){var l2;typeof t.expires=="number"?(l2=new Date,l2.setTime(l2.getTime()+24*t.expires*60*60*1e3)):l2=t.expires,a="; expires="+l2.toUTCString()}var u=t.path?"; path="+t.path:"",s=t.domain?"; domain="+t.domain:"",m=t.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(o),a,u,s,m].join("")};var lcs={get:function(e){return window.localStorage?localStorage.getItem(e):jQuery.cookie(e)},set:function(e,o){window.localStorage?localStorage[e]=o:jQuery.cookie(e,o)},remove:function(e){window.localStorage?localStorage.removeItem(e):jQuery.cookie(e,"")}};function aksrt__(key){var map=window._win&&window._win.i18n;return map&&Object.prototype.hasOwnProperty.call(map,key)?map[key]:key}function aksrt_is_fatal_error_response(text){return text&&(text.indexOf("Fatal error")>-1||text.indexOf("致命错误")>-1)}function aksrt_sprintf(key){var args=Array.prototype.slice.call(arguments,1),str=aksrt__(key),autoIndex=0;return str.replace(/%(\d+\$)?s/g,function(match,num){var idx=num?parseInt(num,10)-1:autoIndex++;return args[idx]!==void 0&&args[idx]!==null?args[idx]:match})}(function(window2,factory){var lazySizes=factory(window2,window2.document,Date);window2.lazySizes=lazySizes,typeof module=="object"&&module.exports&&(module.exports=lazySizes)})(typeof window<"u"?window:{},function(window2,document2,Date2){"use strict";var lazysizes,lazySizesCfg;if((function(){var prop,lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",loadafterClass:"lazyloadafter",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults)prop in lazySizesCfg||(lazySizesCfg[prop]=lazySizesDefaults[prop])})(),!document2||!document2.getElementsByClassName)return{init:function(){},cfg:lazySizesCfg,noSupport:!0};var docElem=document2.documentElement,supportPicture=window2.HTMLPictureElement,_addEventListener="addEventListener",_getAttribute="getAttribute",addEventListener=window2[_addEventListener].bind(window2),setTimeout2=window2.setTimeout,requestAnimationFrame2=window2.requestAnimationFrame||setTimeout2,requestIdleCallback=window2.requestIdleCallback,regPicture=/^picture$/i,loadEvents=["load","error","lazyincluded","_lazyloaded"],regClassCache={},forEach=Array.prototype.forEach,hasClass=function(ele,cls){return regClassCache[cls]||(regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")),regClassCache[cls].test(ele[_getAttribute]("class")||"")&®ClassCache[cls]},addClass=function(ele,cls){hasClass(ele,cls)||ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)},removeClass=function(ele,cls){var reg2;(reg2=hasClass(ele,cls))&&ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg2," "))},addRemoveLoadEvents=function(dom,fn,add){var action=add?_addEventListener:"removeEventListener";add&&addRemoveLoadEvents(dom,fn),loadEvents.forEach(function(evt){dom[action](evt,fn)})},triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event=document2.createEvent("Event");return detail||(detail={}),detail.instance=lazysizes,event.initEvent(name,!noBubbles,!noCancelable),event.detail=detail,elem.dispatchEvent(event),event},updatePolyfill=function(el,full){var polyfill;!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)?(full&&full.src&&!el[_getAttribute]("srcset")&&el.setAttribute("srcset",full.src),polyfill({reevaluate:!0,elements:[el]})):full&&full.src&&(el.src=full.src)},getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]},getWidth=function(elem,parent,width){for(width=width||elem.offsetWidth;width<lazySizesCfg.minSize&&parent&&!elem._lazysizesWidth;)width=parent.offsetWidth,parent=parent.parentNode;return width},rAF=(function(){var running,waiting,firstFns=[],secondFns=[],fns=firstFns,run=function(){var runFns=fns;for(fns=firstFns.length?secondFns:firstFns,running=!0,waiting=!1;runFns.length;)runFns.shift()();running=!1},rafBatch=function(fn,queue){running&&!queue?fn.apply(this,arguments):(fns.push(fn),waiting||(waiting=!0,(document2.hidden?setTimeout2:requestAnimationFrame2)(run)))};return rafBatch._lsFlush=run,rafBatch})(),rAFIt=function(fn,simple){return simple?function(){rAF(fn)}:function(){var that=this,args=arguments;rAF(function(){fn.apply(that,args)})}},throttle2=function(fn){var running,lastTime=0,gDelay=lazySizesCfg.throttleDelay,rICTimeout=lazySizesCfLine truncated
|
||||
jQuery.cookie=function(e,o,t){if(o===void 0){var i=null;if(document.cookie&&document.cookie!="")for(var r=document.cookie.split(";"),n=0;n<r.length;n++){var c=jQuery.trim(r[n]);if(c.substring(0,e.length+1)==e+"="){i=decodeURIComponent(c.substring(e.length+1));break}}return i}t=t||{},o===null&&(o="",t.expires=-1);var a="";if(t.expires&&(typeof t.expires=="number"||t.expires.toUTCString)){var l2;typeof t.expires=="number"?(l2=new Date,l2.setTime(l2.getTime()+24*t.expires*60*60*1e3)):l2=t.expires,a="; expires="+l2.toUTCString()}var u=t.path?"; path="+t.path:"",s=t.domain?"; domain="+t.domain:"",m=t.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(o),a,u,s,m].join("")};var lcs={get:function(e){return window.localStorage?localStorage.getItem(e):jQuery.cookie(e)},set:function(e,o){window.localStorage?localStorage[e]=o:jQuery.cookie(e,o)},remove:function(e){window.localStorage?localStorage.removeItem(e):jQuery.cookie(e,"")}};function aksrt__(key){var map=window._win&&window._win.i18n;return map&&Object.prototype.hasOwnProperty.call(map,key)?map[key]:key}function aksrt_is_fatal_error_response(text){return text&&(text.indexOf("Fatal error")>-1||text.indexOf("致命错误")>-1)}function aksrt_sprintf(key){var args=Array.prototype.slice.call(arguments,1),str=aksrt__(key),autoIndex=0;return str.replace(/%(\d+\$)?s/g,function(match,num){var idx=num?parseInt(num,10)-1:autoIndex++;return args[idx]!==void 0&&args[idx]!==null?args[idx]:match})}(function(window2,factory){var lazySizes=factory(window2,window2.document,Date);window2.lazySizes=lazySizes,typeof module=="object"&&module.exports&&(module.exports=lazySizes)})(typeof window<"u"?window:{},function(window2,document2,Date2){"use strict";var lazysizes,lazySizesCfg;if((function(){var prop,lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",loadafterClass:"lazyloadafter",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults)prop in lazySizesCfg||(lazySizesCfg[prop]=lazySizesDefaults[prop])})(),!document2||!document2.getElementsByClassName)return{init:function(){},cfg:lazySizesCfg,noSupport:!0};var docElem=document2.documentElement,supportPicture=window2.HTMLPictureElement,_addEventListener="addEventListener",_getAttribute="getAttribute",addEventListener=window2[_addEventListener].bind(window2),setTimeout2=window2.setTimeout,requestAnimationFrame2=window2.requestAnimationFrame||setTimeout2,requestIdleCallback=window2.requestIdleCallback,regPicture=/^picture$/i,loadEvents=["load","error","lazyincluded","_lazyloaded"],regClassCache={},forEach=Array.prototype.forEach,hasClass=function(ele,cls){return regClassCache[cls]||(regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")),regClassCache[cls].test(ele[_getAttribute]("class")||"")&®ClassCache[cls]},addClass=function(ele,cls){hasClass(ele,cls)||ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)},removeClass=function(ele,cls){var reg2;(reg2=hasClass(ele,cls))&&ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg2," "))},addRemoveLoadEvents=function(dom,fn,add){var action=add?_addEventListener:"removeEventListener";add&&addRemoveLoadEvents(dom,fn),loadEvents.forEach(function(evt){dom[action](evt,fn)})},triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event=document2.createEvent("Event");return detail||(detail={}),detail.instance=lazysizes,event.initEvent(name,!noBubbles,!noCancelable),event.detail=detail,elem.dispatchEvent(event),event},updatePolyfill=function(el,full){var polyfill;!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)?(full&&full.src&&!el[_getAttribute]("srcset")&&el.setAttribute("srcset",full.src),polyfill({reevaluate:!0,elements:[el]})):full&&full.src&&(el.src=full.src)},getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]},getWidth=function(elem,parent,width){for(width=width||elem.offsetWidth;width<lazySizesCfg.minSize&&parent&&!elem._lazysizesWidth;)width=parent.offsetWidth,parent=parent.parentNode;return width},rAF=(function(){var running,waiting,firstFns=[],secondFns=[],fns=firstFns,run=function(){var runFns=fns;for(fns=firstFns.length?secondFns:firstFns,running=!0,waiting=!1;runFns.length;)runFns.shift()();running=!1},rafBatch=function(fn,queue){running&&!queue?fn.apply(this,arguments):(fns.push(fn),waiting||(waiting=!0,(document2.hidden?setTimeout2:requestAnimationFrame2)(run)))};return rafBatch._lsFlush=run,rafBatch})(),rAFIt=function(fn,simple){return simple?function(){rAF(fn)}:function(){var that=this,args=arguments;rAF(function(){fn.apply(that,args)})}},throttle2=function(fn){var running,lastTime=0,gDelay=lazySizesCfg.throttleDelay,rICTimeout=lazySizesCfLine truncated
|
||||
Reference in new issue
Block a user