wishthis/node_modules/fomantic-ui/dist/components/site.min.js

11 lines
6.3 KiB
JavaScript
Raw Normal View History

2022-01-13 13:00:31 +00:00
/*
2022-05-29 09:24:36 +00:00
* # Fomantic UI - 2.8.8
2022-01-13 13:00:31 +00:00
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
2022-05-29 09:24:36 +00:00
* Copyright 2021 Contributors
2022-01-13 13:00:31 +00:00
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
2022-05-29 09:24:36 +00:00
!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,c,i=(new Date).getTime(),t=[],n=e,o="string"==typeof n,l=[].slice.call(arguments,1),u=b.isPlainObject(e)?b.extend(!0,{},b.site.settings,e):b.extend({},b.site.settings),s=u.namespace,d=u.error,r="module-"+s,m=b(v),f=this,g=m.data(r);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),g=a,m.data(r,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),console!==h&&console.log!==h||(a.verbose("Console not available, normalizing events"),a.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(a.verbose("Console group not available, normalizing events"),p.console.group=function(){},p.console.groupEnd=function(){},p.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),p.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),p.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),p.requestAnimationFrame===h&&(a.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||u.modules,b.each(e,function(e,n){a.moduleExists(n)&&o.push(n)}),o}},disabled:{modules:function(e){var o=[];return e=e||u.modules,b.each(e,function(e,n){a.moduleExists(n)||o.push(n)}),o}},change:{setting:function(t,s,e,r){e="string"==typeof e?"all"===e?u.modules:[e]:e||u.modules,r=r===h||r,b.each(e,function(e,n){var o,i=!a.moduleExists(n)||(b.fn[n].settings.namespace||!1);a.moduleExists(n)&&(a.verbose("Changing default setting",t,s,n),b.fn[n].settings[t]=s,r&&i&&0<(o=b(":data(module-"+i+")")).length&&(a.verbose("Modifying existing settings",o),o[n]("setting",t,s)))})},settings:function(i,e,t){e="string"==typeof e?[e]:e||u.modules,t=t===h||t,b.each(e,function(e,n){var o;a.moduleExists(n)&&(a.verbose("Changing default setting",i,n),b.extend(!0,b.fn[n].settings,i),t&&s&&0<(o=b(":data(module-"+s+")")).length&&(a.verbose("Modifying existing settings",o),o[n]("setting",i)))})}},enable:{console:function(){a.console(!0)},debug:function(e,n){e=e||u.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,n)},verbose:function(e,n){e=e||u.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,n)}},disable:{console:function(){a.console(!1)},debug:function(e,n){e=e||u.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,n)},verbose:function(e,n){e=e||u.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,n)}},console:function(e){if(e){if(g.cache.console===h)return void a.error(d.console);a.debug("Restoring console function"),p.console=g.cache.console}else a.debug("Disabling console function"),g.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(){a.verbose("Destroying previous site for",m),m.removeData(r)},cache:{},setting:function(e,n){if(b.isPlainObject(e))b.extend(!0,u,e);else{if(n===h)return u[e];u[e]=n}},internal:function(e,n){if(b.isPlainObject(e))b.extend(!0,a,e);else{if(n===h)return a[e];a[e]=n}},debug:function(){u.debug&&(u.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,u.name+":"),a.debug.apply(console,arguments)))},verbose:function(){u.verbose&&u.debug&&(u.performance?a.performance.log(arguments):(a.verbose=Function.