2022-03-07 13:36:28 +00:00
|
|
|
!function(p,v,h,b){p.isFunction=p.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},p.site=p.fn.site=function(e){var s,i=(new Date).getTime(),o=[],r=e,d="string"==typeof r,m=[].slice.call(arguments,1),l=p.isPlainObject(e)?p.extend(!0,{},p.site.settings,e):p.extend({},p.site.settings),a=l.namespace,f=l.error,t="module-"+a,n=p(h),g=this,c=n.data(t),u={initialize:function(){u.instantiate()},instantiate:function(){u.verbose("Storing instance of site",u),c=u,n.data(t,u)},normalize:function(){u.fix.console(),u.fix.requestAnimationFrame()},fix:{console:function(){u.debug("Normalizing window.console"),console!==b&&console.log!==b||(u.verbose("Console not available, normalizing events"),u.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(u.verbose("Console group not available, normalizing events"),v.console.group=function(){},v.console.groupEnd=function(){},v.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(u.verbose("Mark timeline not available, normalizing events"),v.console.markTimeline=function(){})},consoleClear:function(){u.debug("Disabling programmatic console clearing"),v.console.clear=function(){}},requestAnimationFrame:function(){u.debug("Normalizing requestAnimationFrame"),v.requestAnimationFrame===b&&(u.debug("RequestAnimationFrame not available, normalizing event"),v.requestAnimationFrame=v.requestAnimationFrame||v.mozRequestAnimationFrame||v.webkitRequestAnimationFrame||v.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(e){return p.fn[e]!==b&&p.fn[e].settings!==b},enabled:{modules:function(e){var n=[];return e=e||l.modules,p.each(e,function(e,t){u.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(e){var n=[];return e=e||l.modules,p.each(e,function(e,t){u.moduleExists(t)||n.push(t)}),n}},change:{setting:function(o,a,e,r){e="string"==typeof e?"all"===e?l.modules:[e]:e||l.modules,r=r===b||r,p.each(e,function(e,t){var n,i=!u.moduleExists(t)||(p.fn[t].settings.namespace||!1);u.moduleExists(t)&&(u.verbose("Changing default setting",o,a,t),p.fn[t].settings[o]=a,r&&i&&0<(n=p(":data(module-"+i+")")).length&&(u.verbose("Modifying existing settings",n),n[t]("setting",o,a)))})},settings:function(i,e,o){e="string"==typeof e?[e]:e||l.modules,o=o===b||o,p.each(e,function(e,t){var n;u.moduleExists(t)&&(u.verbose("Changing default setting",i,t),p.extend(!0,p.fn[t].settings,i),o&&a&&0<(n=p(":data(module-"+a+")")).length&&(u.verbose("Modifying existing settings",n),n[t]("setting",i)))})}},enable:{console:function(){u.console(!0)},debug:function(e,t){e=e||l.modules,u.debug("Enabling debug for modules",e),u.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||l.modules,u.debug("Enabling verbose debug for modules",e),u.change.setting("verbose",!0,e,t)}},disable:{console:function(){u.console(!1)},debug:function(e,t){e=e||l.modules,u.debug("Disabling debug for modules",e),u.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||l.modules,u.debug("Disabling verbose debug for modules",e),u.change.setting("verbose",!1,e,t)}},console:function(e){e?c.cache.console!==b?(u.debug("Restoring console function"),v.console=c.cache.console):u.error(f.console):(u.debug("Disabling console function"),c.cache.console=v.console,v.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}})},destroy:function(){u.verbose("Destroying previous site for",n),n.removeData(t)},cache:{},setting:function(e,t){if(p.isPlainObject(e))p.extend(!0,l,e);else{if(t===b)return l[e];l[e]=t}},internal:function(e,t){if(p.isPlainObject(e))p.extend(!0,u,e);else{if(t===b)return u[e];u[e]=t}},debug:function(){l.debug&&(l.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,l.name+":"),u.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.i
|