11 lines
No EOL
6.2 KiB
JavaScript
11 lines
No EOL
6.2 KiB
JavaScript
/*
|
|
* # Fomantic UI - 2.8.8
|
|
* https://github.com/fomantic/Fomantic-UI
|
|
* http://fomantic-ui.com/
|
|
*
|
|
* Copyright 2022 Contributors
|
|
* Released under the MIT license
|
|
* http://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(b,p,v,h){b.isFunction=b.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},b.site=b.fn.site=function(e){var a,i=(new Date).getTime(),t=[],r=e,m="string"==typeof r,d=[].slice.call(arguments,1),c=b.isPlainObject(e)?b.extend(!0,{},b.site.settings,e):b.extend({},b.site.settings),s=c.namespace,f=c.error,n="module-"+s,o=b(v),g=this,l=o.data(n),u={initialize:function(){u.instantiate()},instantiate:function(){u.verbose("Storing instance of site",u),l=u,o.data(n,u)},normalize:function(){u.fix.console(),u.fix.requestAnimationFrame()},fix:{console:function(){u.debug("Normalizing window.console"),console!==h&&console.log!==h||(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"),p.console.group=function(){},p.console.groupEnd=function(){},p.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(u.verbose("Mark timeline not available, normalizing events"),p.console.markTimeline=function(){})},consoleClear:function(){u.debug("Disabling programmatic console clearing"),p.console.clear=function(){}},requestAnimationFrame:function(){u.debug("Normalizing requestAnimationFrame"),p.requestAnimationFrame===h&&(u.debug("RequestAnimationFrame not available, normalizing event"),p.requestAnimationFrame=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(e){return b.fn[e]!==h&&b.fn[e].settings!==h},enabled:{modules:function(e){var o=[];return e=e||c.modules,b.each(e,function(e,n){u.moduleExists(n)&&o.push(n)}),o}},disabled:{modules:function(e){var o=[];return e=e||c.modules,b.each(e,function(e,n){u.moduleExists(n)||o.push(n)}),o}},change:{setting:function(t,s,e,r){e="string"==typeof e?"all"===e?c.modules:[e]:e||c.modules,r=r===h||r,b.each(e,function(e,n){var o,i=!u.moduleExists(n)||(b.fn[n].settings.namespace||!1);u.moduleExists(n)&&(u.verbose("Changing default setting",t,s,n),b.fn[n].settings[t]=s,r&&i&&0<(o=b(":data(module-"+i+")")).length&&(u.verbose("Modifying existing settings",o),o[n]("setting",t,s)))})},settings:function(i,e,t){e="string"==typeof e?[e]:e||c.modules,t=t===h||t,b.each(e,function(e,n){var o;u.moduleExists(n)&&(u.verbose("Changing default setting",i,n),b.extend(!0,b.fn[n].settings,i),t&&s&&0<(o=b(":data(module-"+s+")")).length&&(u.verbose("Modifying existing settings",o),o[n]("setting",i)))})}},enable:{console:function(){u.console(!0)},debug:function(e,n){e=e||c.modules,u.debug("Enabling debug for modules",e),u.change.setting("debug",!0,e,n)},verbose:function(e,n){e=e||c.modules,u.debug("Enabling verbose debug for modules",e),u.change.setting("verbose",!0,e,n)}},disable:{console:function(){u.console(!1)},debug:function(e,n){e=e||c.modules,u.debug("Disabling debug for modules",e),u.change.setting("debug",!1,e,n)},verbose:function(e,n){e=e||c.modules,u.debug("Disabling verbose debug for modules",e),u.change.setting("verbose",!1,e,n)}},console:function(e){e?l.cache.console!==h?(u.debug("Restoring console function"),p.console=l.cache.console):u.error(f.console):(u.debug("Disabling console function"),l.cache.console=p.console,p.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",o),o.removeData(n)},cache:{},setting:function(e,n){if(b.isPlainObject(e))b.extend(!0,c,e);else{if(n===h)return c[e];c[e]=n}},internal:function(e,n){if(b.isPlainObject(e))b.extend(!0,u,e);else{if(n===h)return u[e];u[e]=n}},debug:function(){c.debug&&(c.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,c.name+":"),u.debug.apply(console,arguments)))},verbose:function(){c.verbose&&c.debug&&(c.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),u.verbose.apply(console,arguments)))},error:function(){u.error=Function.prototype.bind.call(console.error,console,c.name+":"),u.error.apply(console,arguments)},performance:{log:function(e){var n,o;c.performance&&(o=(n=(new Date).getTime())-(i||n),i=n,t.push({Element:g,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":o})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,500)},display:function(){var e=c.name+":",o=0;i=!1,clearTimeout(u.performance.timer),b.each(t,function(e,n){o+=n["Execution Time"]}),e+=" "+o+"ms",(console.group!==h||console.table!==h)&&0<t.length&&(console.groupCollapsed(e),console.table?console.table(t):b.each(t,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),t=[]}},invoke:function(i,e,n){var t,s,o,r=l;return e=e||d,n=g||n,"string"==typeof i&&r!==h&&(i=i.split(/[\. ]/),t=i.length-1,b.each(i,function(e,n){var o=e!=t?n+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(b.isPlainObject(r[o])&&e!=t)r=r[o];else{if(r[o]!==h)return s=r[o],!1;{if(!b.isPlainObject(r[n])||e==t)return r[n]!==h?s=r[n]:u.error(f.method,i),!1;r=r[n]}}})),b.isFunction(s)?o=s.apply(n,e):s!==h&&(o=s),Array.isArray(a)?a.push(o):a!==h?a=[a,o]:o!==h&&(a=o),s}};return m?(l===h&&u.initialize(),u.invoke(r)):(l!==h&&u.destroy(),u.initialize()),a!==h?a:this},b.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","calendar","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","slider","rating","shape","sidebar","state","sticky","tab","toast","transition","visibility","visit"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(n){return function(e){return!!b.data(e,n)}}):function(e,n,o){return!!b.data(e,o[3])}})}(jQuery,window,document); |