From 002eb44eee98dc838bc854b945ab0cbf4884dd57 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 14 Dec 2020 23:29:56 -0800 Subject: :star: --- semantic/dist/components/toast.js | 872 -------------------------------------- 1 file changed, 872 deletions(-) delete mode 100644 semantic/dist/components/toast.js (limited to 'semantic/dist/components/toast.js') diff --git a/semantic/dist/components/toast.js b/semantic/dist/components/toast.js deleted file mode 100644 index 02064ff..0000000 --- a/semantic/dist/components/toast.js +++ /dev/null @@ -1,872 +0,0 @@ -/*! - * # Fomantic-UI - Toast - * http://github.com/fomantic/Fomantic-UI/ - * - * - * Released under the MIT license - * http://opensource.org/licenses/MIT - * - */ - -;(function ($, window, document, undefined) { - -'use strict'; - -$.isFunction = $.isFunction || function(obj) { - return typeof obj === "function" && typeof obj.nodeType !== "number"; -}; - -window = (typeof window != 'undefined' && window.Math == Math) - ? window - : (typeof self != 'undefined' && self.Math == Math) - ? self - : Function('return this')() -; - -$.fn.toast = function(parameters) { - var - $allModules = $(this), - moduleSelector = $allModules.selector || '', - - time = new Date().getTime(), - performance = [], - - query = arguments[0], - methodInvoked = (typeof query == 'string'), - queryArguments = [].slice.call(arguments, 1), - returnedValue - ; - $allModules - .each(function() { - var - settings = ( $.isPlainObject(parameters) ) - ? $.extend(true, {}, $.fn.toast.settings, parameters) - : $.extend({}, $.fn.toast.settings), - - className = settings.className, - selector = settings.selector, - error = settings.error, - namespace = settings.namespace, - fields = settings.fields, - - eventNamespace = '.' + namespace, - moduleNamespace = namespace + '-module', - - $module = $(this), - $toastBox, - $toast, - $actions, - $progress, - $progressBar, - $animationObject, - $close, - $context = (settings.context) - ? $(settings.context) - : $('body'), - - isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'), - - element = this, - instance = isToastComponent ? $module.data(moduleNamespace) : undefined, - - module - ; - module = { - - initialize: function() { - module.verbose('Initializing element'); - if (!module.has.container()) { - module.create.container(); - } - if(isToastComponent || settings.message !== '' || settings.title !== '' || module.get.iconClass() !== '' || settings.showImage || module.has.configActions()) { - if(typeof settings.showProgress !== 'string' || [className.top,className.bottom].indexOf(settings.showProgress) === -1 ) { - settings.showProgress = false; - } - module.create.toast(); - if(settings.closeOnClick && (settings.closeIcon || $($toast).find(selector.input).length > 0 || module.has.configActions())){ - settings.closeOnClick = false; - } - if(!settings.closeOnClick) { - $toastBox.addClass(className.unclickable); - } - module.bind.events(); - } - module.instantiate(); - if($toastBox) { - module.show(); - } - }, - - instantiate: function() { - module.verbose('Storing instance of toast'); - instance = module; - $module - .data(moduleNamespace, instance) - ; - }, - - destroy: function() { - if($toastBox) { - module.debug('Removing toast', $toastBox); - module.unbind.events(); - $toastBox.remove(); - $toastBox = undefined; - $toast = undefined; - $animationObject = undefined; - settings.onRemove.call($toastBox, element); - $progress = undefined; - $progressBar = undefined; - $close = undefined; - } - $module - .removeData(moduleNamespace) - ; - }, - - show: function(callback) { - callback = callback || function(){}; - module.debug('Showing toast'); - if(settings.onShow.call($toastBox, element) === false) { - module.debug('onShow callback returned false, cancelling toast animation'); - return; - } - module.animate.show(callback); - }, - - close: function(callback) { - callback = callback || function(){}; - module.remove.visible(); - module.unbind.events(); - module.animate.close(callback); - - }, - - create: { - container: function() { - module.verbose('Creating container'); - $context.append($('
',{class: settings.position + ' ' + className.container})); - }, - toast: function() { - $toastBox = $('
', {class: className.box}); - if (!isToastComponent) { - module.verbose('Creating toast'); - $toast = $('
'); - var $content = $('
', {class: className.content}); - var iconClass = module.get.iconClass(); - if (iconClass !== '') { - $toast.append($('', {class: iconClass + ' ' + className.icon})); - } - - if (settings.showImage) { - $toast.append($('', { - class: className.image + ' ' + settings.classImage, - src: settings.showImage - })); - } - if (settings.title !== '') { - $content.append($('
', { - class: className.title, - text: settings.title - })); - } - - $content.append($('
', {html: module.helpers.escape(settings.message, settings.preserveHTML)})); - - $toast - .addClass(settings.class + ' ' + className.toast) - .append($content) - ; - $toast.css('opacity', settings.opacity); - if (settings.closeIcon) { - $close = $('', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')}); - if($close.hasClass(className.left)) { - $toast.prepend($close); - } else { - $toast.append($close); - } - } - } else { - $toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module; - $close = $toast.find('> i'+module.helpers.toClass(className.close)); - settings.closeIcon = ($close.length > 0); - } - if ($toast.hasClass(className.compact)) { - settings.compact = true; - } - if ($toast.hasClass('card')) { - settings.compact = false; - } - $actions = $toast.find('.actions'); - if (module.has.configActions()) { - if ($actions.length === 0) { - $actions = $('
', {class: className.actions + ' ' + (settings.classActions || '')}).appendTo($toast); - } - if($toast.hasClass('card') && !$actions.hasClass(className.attached)) { - $actions.addClass(className.extraContent); - if($actions.hasClass(className.vertical)) { - $actions.removeClass(className.vertical); - module.error(error.verticalCard); - } - } - settings.actions.forEach(function (el) { - var icon = el[fields.icon] ? '' : '', - text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML), - cls = module.helpers.deQuote(el[fields.class] || ''), - click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {}; - $actions.append($('