Файл: templates/backend/default/assets/plugins/ios-switch/ios7-switch.min.js
Строк: 257
<?php
function require(e,t,n){var i=require.resolve(e);if(null==i){n=n||e,t=t||"root";var o=new Error('Failed to require "'+n+'" from "'+t+'"');throw o.path=n,o.parent=t,o.require=!0,o}var a=require.modules[i];return a.exports||(a.exports={},a.client=a.component=!0,a.call(this,a.exports,require.relative(i),a)),a.exports}require.modules={},require.aliases={},require.resolve=function(e){"/"===e.charAt(0)&&(e=e.slice(1));for(var t=[e,e+".js",e+".json",e+"/index.js",e+"/index.json"],n=0;n<t.length;n++){var e=t[n];if(require.modules.hasOwnProperty(e))return e;if(require.aliases.hasOwnProperty(e))return require.aliases[e]}},require.normalize=function(e,t){var n=[];if("."!=t.charAt(0))return t;e=e.split("/"),t=t.split("/");for(var i=0;i<t.length;++i)".."==t[i]?e.pop():"."!=t[i]&&""!=t[i]&&n.push(t[i]);return e.concat(n).join("/")},require.register=function(e,t){require.modules[e]=t},require.alias=function(e,t){if(!require.modules.hasOwnProperty(e))throw new Error('Failed to alias "'+e+'", it does not exist');require.aliases[t]=e},require.relative=function(e){function t(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function n(t){var i=n.resolve(t);return require(i,e,t)}var i=require.normalize(e,"..");return n.resolve=function(n){var o=n.charAt(0);if("/"==o)return n.slice(1);if("."==o)return require.normalize(i,n);var a=e.split("/"),r=t(a,"deps")+1;return r||(r=0),n=a.slice(0,r+1).join("/")+"/deps/"+n},n.exists=function(e){return require.modules.hasOwnProperty(n.resolve(e))},n},require.register("ios7-switch/index.js",Function("exports, require, module","module.exports = Switch;nnfunction Switch(input) {n if ('checkbox' !== input.type) throw new Error('You can\'t make Switch out of non-checkbox input');nn this.input = input;n this.input.style.display = 'none';nn this.el = document.createElement('div');n this.el.className = 'ios-switch';n this._prepareDOM();nn this.input.parentElement.insertBefore(this.el, this.input);n}nnSwitch.prototype.toggle = function() {n if(this.el.classList.contains('on')){n this.turnOff();n } else {n this.turnOn();n }nn this.triggerChange();n};nnSwitch.prototype.turnOn = function() {n this.el.classList.add('on');n this.el.classList.remove('off');n this.input.checked = true;n};nnSwitch.prototype.turnOff = function() {n this.el.classList.remove('on');n this.el.classList.add('off');n this.input.checked = false;n}nnSwitch.prototype._prepareDOM = function() {nn var onBackground = document.createElement('div');n onBackground.className = 'on-background background-fill';nn var stateBackground = document.createElement('div');n stateBackground.className = 'state-background background-fill';n n var handle = document.createElement('div');n handle.className = 'handle';n n this.el.appendChild(onBackground);n this.el.appendChild(stateBackground);n this.el.appendChild(handle);nn};nnSwitch.prototype.triggerChange = function() {n if ("fireEvent" in this.input){n this.input.fireEvent("onchange");n } else {n var evt = document.createEvent("HTMLEvents");n evt.initEvent("change", false, true);n this.input.dispatchEvent(evt);n }n};n//@ sourceURL=ios7-switch/index.js")),require.register("ios7-switch/template.js",Function("exports, require, module","module.exports = '<div class=\'ios-switch\'>\n <div class=\'on-background background-fill\'></div>\n <div class=\'state-background background-fill\'></div>\n <div class=\'handle\'></div>\n</div>\n';//@ sourceURL=ios7-switch/template.js")),require.alias("ios7-switch/index.js","ios7-switch/index.js");
?>