uawdijnntqw1x1x1
IP : 216.73.216.110
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
.caldav
/
.
/
..
/
www
/
node_modules
/
array-each
/
..
/
..
/
4d695
/
mohithg-switchery.zip
/
/
PK2[�\�,��##switchery.jsnu�[���/** * Switchery 0.8.2 * http://abpetkov.github.io/switchery/ * * Authored by Alexander Petkov * https://github.com/abpetkov * * Copyright 2013-2015, Alexander Petkov * License: The MIT License (MIT) * http://opensource.org/licenses/MIT * */ /** * External dependencies. */ var transitionize = require('transitionize') , fastclick = require('fastclick') , classes = require('classes') , events = require('events'); /** * Expose `Switchery`. */ module.exports = Switchery; /** * Set Switchery default values. * * @api public */ var defaults = { color : '#64bd63' , secondaryColor : '#dfdfdf' , jackColor : '#fff' , jackSecondaryColor: null , className : 'switchery' , disabled : false , disabledOpacity : 0.5 , speed : '0.4s' , size : 'default' }; /** * Create Switchery object. * * @param {Object} element * @param {Object} options * @api public */ function Switchery(element, options) { if (!(this instanceof Switchery)) return new Switchery(element, options); this.element = element; this.options = options || {}; for (var i in defaults) { if (this.options[i] == null) { this.options[i] = defaults[i]; } } if (this.element != null && this.element.type == 'checkbox') this.init(); if (this.isDisabled() === true) this.disable(); } /** * Hide the target element. * * @api private */ Switchery.prototype.hide = function() { this.element.style.display = 'none'; }; /** * Show custom switch after the target element. * * @api private */ Switchery.prototype.show = function() { var switcher = this.create(); this.insertAfter(this.element, switcher); }; /** * Create custom switch. * * @returns {Object} this.switcher * @api private */ Switchery.prototype.create = function() { this.switcher = document.createElement('span'); this.jack = document.createElement('small'); this.switcher.appendChild(this.jack); this.switcher.className = this.options.className; this.events = events(this.switcher, this); return this.switcher; }; /** * Insert after element after another element. * * @param {Object} reference * @param {Object} target * @api private */ Switchery.prototype.insertAfter = function(reference, target) { reference.parentNode.insertBefore(target, reference.nextSibling); }; /** * Set switch jack proper position. * * @param {Boolean} clicked - we need this in order to uncheck the input when the switch is clicked * @api private */ Switchery.prototype.setPosition = function (clicked) { var checked = this.isChecked() , switcher = this.switcher , jack = this.jack; if (clicked && checked) checked = false; else if (clicked && !checked) checked = true; if (checked === true) { this.element.checked = true; if (window.getComputedStyle) jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + 'px'; else jack.style.left = parseInt(switcher.currentStyle['width']) - parseInt(jack.currentStyle['width']) + 'px'; if (this.options.color) this.colorize(); this.setSpeed(); } else { jack.style.left = 0; this.element.checked = false; this.switcher.style.boxShadow = 'inset 0 0 0 0 ' + this.options.secondaryColor; this.switcher.style.borderColor = this.options.secondaryColor; this.switcher.style.backgroundColor = (this.options.secondaryColor !== defaults.secondaryColor) ? this.options.secondaryColor : '#fff'; this.jack.style.backgroundColor = (this.options.jackSecondaryColor !== this.options.jackColor) ? this.options.jackSecondaryColor : this.options.jackColor; this.setSpeed(); } }; /** * Set speed. * * @api private */ Switchery.prototype.setSpeed = function() { var switcherProp = {} , jackProp = { 'background-color': this.options.speed , 'left': this.options.speed.replace(/[a-z]/, '') / 2 + 's' }; if (this.isChecked()) { switcherProp = { 'border': this.options.speed , 'box-shadow': this.options.speed , 'background-color': this.options.speed.replace(/[a-z]/, '') * 3 + 's' }; } else { switcherProp = { 'border': this.options.speed , 'box-shadow': this.options.speed }; } transitionize(this.switcher, switcherProp); transitionize(this.jack, jackProp); }; /** * Set switch size. * * @api private */ Switchery.prototype.setSize = function() { var small = 'switchery-small' , normal = 'switchery-default' , large = 'switchery-large'; switch (this.options.size) { case 'small': classes(this.switcher).add(small) break; case 'large': classes(this.switcher).add(large) break; default: classes(this.switcher).add(normal) break; } }; /** * Set switch color. * * @api private */ Switchery.prototype.colorize = function() { var switcherHeight = this.switcher.offsetHeight / 2; this.switcher.style.backgroundColor = this.options.color; this.switcher.style.borderColor = this.options.color; this.switcher.style.boxShadow = 'inset 0 0 0 ' + switcherHeight + 'px ' + this.options.color; this.jack.style.backgroundColor = this.options.jackColor; }; /** * Handle the onchange event. * * @param {Boolean} state * @api private */ Switchery.prototype.handleOnchange = function(state) { if (document.dispatchEvent) { var event = document.createEvent('HTMLEvents'); event.initEvent('change', true, true); this.element.dispatchEvent(event); } else { this.element.fireEvent('onchange'); } }; /** * Handle the native input element state change. * A `change` event must be fired in order to detect the change. * * @api private */ Switchery.prototype.handleChange = function() { var self = this , el = this.element; if (el.addEventListener) { el.addEventListener('change', function() { self.setPosition(); }); } else { el.attachEvent('onchange', function() { self.setPosition(); }); } }; /** * Handle the switch click event. * * @api private */ Switchery.prototype.handleClick = function() { var switcher = this.switcher; fastclick = fastclick.bind(this); fastclick(switcher); this.events.bind('click', 'bindClick'); }; /** * Attach all methods that need to happen on switcher click. * * @api private */ Switchery.prototype.bindClick = function() { var parent = this.element.parentNode.tagName.toLowerCase() , labelParent = (parent === 'label') ? false : true; this.setPosition(labelParent); this.handleOnchange(this.element.checked); }; /** * Mark an individual switch as already handled. * * @api private */ Switchery.prototype.markAsSwitched = function() { this.element.setAttribute('data-switchery', true); }; /** * Check if an individual switch is already handled. * * @api private */ Switchery.prototype.markedAsSwitched = function() { return this.element.getAttribute('data-switchery'); }; /** * Initialize Switchery. * * @api private */ Switchery.prototype.init = function() { this.hide(); this.show(); this.setSize(); this.setPosition(); this.markAsSwitched(); this.handleChange(); this.handleClick(); }; /** * See if input is checked. * * @returns {Boolean} * @api public */ Switchery.prototype.isChecked = function() { return this.element.checked; }; /** * See if switcher should be disabled. * * @returns {Boolean} * @api public */ Switchery.prototype.isDisabled = function() { return this.options.disabled || this.element.disabled || this.element.readOnly; }; /** * Destroy all event handlers attached to the switch. * * @api public */ Switchery.prototype.destroy = function() { this.events.unbind(); }; /** * Enable disabled switch element. * * @api public */ Switchery.prototype.enable = function() { if (!this.options.disabled) return; if (this.options.disabled) this.options.disabled = false; if (this.element.disabled) this.element.disabled = false; if (this.element.readOnly) this.element.readOnly = false; this.switcher.style.opacity = 1; this.events.bind('click', 'bindClick'); }; /** * Disable switch element. * * @api public */ Switchery.prototype.disable = function() { if (this.options.disabled) return; if (!this.options.disabled) this.options.disabled = true; if (!this.element.disabled) this.element.disabled = true; if (!this.element.readOnly) this.element.readOnly = true; this.switcher.style.opacity = this.options.disabledOpacity; this.destroy(); }; PK2[�\I�U� package.jsnu�[���// package metadata file for Meteor.js 'use strict'; var packageName = 'abpetkov:switchery'; // https://atmospherejs.com/mediatainment/switchery var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing. Package.describe({ name: packageName, summary: 'Switchery (official) - turns your default HTML checkbox inputs into beautiful iOS 7 style switches.', version: "0.1.0", //packageJson.version, git: 'https://github.com/abpetkov/switchery' }); Package.onUse(function(api) { api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']); api.export('Switchery'); api.addFiles(['dist/switchery.js', 'dist/switchery.css', 'meteor/export.js'], where); }); Package.onTest(function(api) { api.use(packageName, where); api.use('tinytest', where); api.addFiles('meteor/tests.js', where); // testing specific files }); PK2[�\���package.jsonnu�[���{ "_args": [ [ "mohithg-switchery@0.8.4", "C:\\Users\\Ovi-PC\\Downloads\\themekit-master\\themekit" ] ], "_from": "mohithg-switchery@0.8.4", "_id": "mohithg-switchery@0.8.4", "_inBundle": false, "_integrity": "sha512-mHy1FbuB3WqVNHxqz/9u1RZyDiDH9pfR7BTorkina6PPIeITtEvW7ADTYD0wgVqnlkJXuiMPeR+YZm1lUrDfkg==", "_location": "/mohithg-switchery", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "mohithg-switchery@0.8.4", "name": "mohithg-switchery", "escapedName": "mohithg-switchery", "rawSpec": "0.8.4", "saveSpec": null, "fetchSpec": "0.8.4" }, "_requiredBy": [ "/" ], "_resolved": "https://registry.npmjs.org/mohithg-switchery/-/mohithg-switchery-0.8.4.tgz", "_spec": "0.8.4", "_where": "C:\\Users\\Ovi-PC\\Downloads\\themekit-master\\themekit", "author": { "name": "Mohith G" }, "bugs": { "url": "https://github.com/mohithg/switchery/issues" }, "description": "Create iOS 7 styled switches from default input checkboxes", "devDependencies": { "component": "^1.0.0", "grunt-exec": "latest", "spacejam": "latest", "uglify-js": "~2.4.8", "uglifycss": "0.0.7" }, "homepage": "https://github.com/mohithg/switchery#readme", "license": "MIT", "main": "dist/switchery.js", "name": "mohithg-switchery", "repository": { "type": "git", "url": "git://github.com/mohithg/switchery.git" }, "version": "0.8.4" } PK2[�\,¯DDcomponent.jsonnu�[���{ "name": "switchery", "repo": "abpetkov/switchery", "description": "Component to create iOS 7 styled switches from default input checkboxes", "version": "0.8.2", "keywords": [ "checkbox", "input", "switch", "iOS7" ], "license": "MIT", "main": "switchery.js", "scripts": [ "switchery.js" ], "styles": [ "switchery.css" ], "dependencies": { "abpetkov/transitionize": "*", "ftlabs/fastclick": "v0.6.11", "component/classes": "1.2.1", "component/events": "1.0.9" }, "development": {} } PK2[�\�������dist/switchery.jsnu�[��� ;(function(){ /** * Require the module at `name`. * * @param {String} name * @return {Object} exports * @api public */ function require(name) { var module = require.modules[name]; if (!module) throw new Error('failed to require "' + name + '"'); if (!('exports' in module) && typeof module.definition === 'function') { module.client = module.component = true; module.definition.call(this, module.exports = {}, module); delete module.definition; } return module.exports; } /** * Meta info, accessible in the global scope unless you use AMD option. */ require.loader = 'component'; /** * Internal helper object, contains a sorting function for semantiv versioning */ require.helper = {}; require.helper.semVerSort = function(a, b) { var aArray = a.version.split('.'); var bArray = b.version.split('.'); for (var i=0; i<aArray.length; ++i) { var aInt = parseInt(aArray[i], 10); var bInt = parseInt(bArray[i], 10); if (aInt === bInt) { var aLex = aArray[i].substr((""+aInt).length); var bLex = bArray[i].substr((""+bInt).length); if (aLex === '' && bLex !== '') return 1; if (aLex !== '' && bLex === '') return -1; if (aLex !== '' && bLex !== '') return aLex > bLex ? 1 : -1; continue; } else if (aInt > bInt) { return 1; } else { return -1; } } return 0; } /** * Find and require a module which name starts with the provided name. * If multiple modules exists, the highest semver is used. * This function can only be used for remote dependencies. * @param {String} name - module name: `user~repo` * @param {Boolean} returnPath - returns the canonical require path if true, * otherwise it returns the epxorted module */ require.latest = function (name, returnPath) { function showError(name) { throw new Error('failed to find latest module of "' + name + '"'); } // only remotes with semvers, ignore local files conataining a '/' var versionRegexp = /(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/; var remoteRegexp = /(.*)~(.*)/; if (!remoteRegexp.test(name)) showError(name); var moduleNames = Object.keys(require.modules); var semVerCandidates = []; var otherCandidates = []; // for instance: name of the git branch for (var i=0; i<moduleNames.length; i++) { var moduleName = moduleNames[i]; if (new RegExp(name + '@').test(moduleName)) { var version = moduleName.substr(name.length+1); var semVerMatch = versionRegexp.exec(moduleName); if (semVerMatch != null) { semVerCandidates.push({version: version, name: moduleName}); } else { otherCandidates.push({version: version, name: moduleName}); } } } if (semVerCandidates.concat(otherCandidates).length === 0) { showError(name); } if (semVerCandidates.length > 0) { var module = semVerCandidates.sort(require.helper.semVerSort).pop().name; if (returnPath === true) { return module; } return require(module); } // if the build contains more than one branch of the same module // you should not use this funciton var module = otherCandidates.sort(function(a, b) {return a.name > b.name})[0].name; if (returnPath === true) { return module; } return require(module); } /** * Registered modules. */ require.modules = {}; /** * Register module at `name` with callback `definition`. * * @param {String} name * @param {Function} definition * @api private */ require.register = function (name, definition) { require.modules[name] = { definition: definition }; }; /** * Define a module's exports immediately with `exports`. * * @param {String} name * @param {Generic} exports * @api private */ require.define = function (name, exports) { require.modules[name] = { exports: exports }; }; require.register("abpetkov~transitionize@0.0.3", function (exports, module) { /** * Transitionize 0.0.3 * https://github.com/abpetkov/transitionize * * Authored by Alexander Petkov * https://github.com/abpetkov * * Copyright 2013, Alexander Petkov * License: The MIT License (MIT) * http://opensource.org/licenses/MIT * */ /** * Expose `Transitionize`. */ module.exports = Transitionize; /** * Initialize new Transitionize. * * @param {Object} element * @param {Object} props * @api public */ function Transitionize(element, props) { if (!(this instanceof Transitionize)) return new Transitionize(element, props); this.element = element; this.props = props || {}; this.init(); } /** * Detect if Safari. * * @returns {Boolean} * @api private */ Transitionize.prototype.isSafari = function() { return (/Safari/).test(navigator.userAgent) && (/Apple Computer/).test(navigator.vendor); }; /** * Loop though the object and push the keys and values in an array. * Apply the CSS3 transition to the element and prefix with -webkit- for Safari. * * @api private */ Transitionize.prototype.init = function() { var transitions = []; for (var key in this.props) { transitions.push(key + ' ' + this.props[key]); } this.element.style.transition = transitions.join(', '); if (this.isSafari()) this.element.style.webkitTransition = transitions.join(', '); }; }); require.register("ftlabs~fastclick@v0.6.11", function (exports, module) { /** * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. * * @version 0.6.11 * @codingstandard ftlabs-jsv2 * @copyright The Financial Times Limited [All Rights Reserved] * @license MIT License (see LICENSE.txt) */ /*jslint browser:true, node:true*/ /*global define, Event, Node*/ /** * Instantiate fast-clicking listeners on the specificed layer. * * @constructor * @param {Element} layer The layer to listen on */ function FastClick(layer) { 'use strict'; var oldOnClick, self = this; /** * Whether a click is currently being tracked. * * @type boolean */ this.trackingClick = false; /** * Timestamp for when when click tracking started. * * @type number */ this.trackingClickStart = 0; /** * The element being tracked for a click. * * @type EventTarget */ this.targetElement = null; /** * X-coordinate of touch start event. * * @type number */ this.touchStartX = 0; /** * Y-coordinate of touch start event. * * @type number */ this.touchStartY = 0; /** * ID of the last touch, retrieved from Touch.identifier. * * @type number */ this.lastTouchIdentifier = 0; /** * Touchmove boundary, beyond which a click will be cancelled. * * @type number */ this.touchBoundary = 10; /** * The FastClick layer. * * @type Element */ this.layer = layer; if (!layer || !layer.nodeType) { throw new TypeError('Layer must be a document node'); } /** @type function() */ this.onClick = function() { return FastClick.prototype.onClick.apply(self, arguments); }; /** @type function() */ this.onMouse = function() { return FastClick.prototype.onMouse.apply(self, arguments); }; /** @type function() */ this.onTouchStart = function() { return FastClick.prototype.onTouchStart.apply(self, arguments); }; /** @type function() */ this.onTouchMove = function() { return FastClick.prototype.onTouchMove.apply(self, arguments); }; /** @type function() */ this.onTouchEnd = function() { return FastClick.prototype.onTouchEnd.apply(self, arguments); }; /** @type function() */ this.onTouchCancel = function() { return FastClick.prototype.onTouchCancel.apply(self, arguments); }; if (FastClick.notNeeded(layer)) { return; } // Set up event handlers as required if (this.deviceIsAndroid) { layer.addEventListener('mouseover', this.onMouse, true); layer.addEventListener('mousedown', this.onMouse, true); layer.addEventListener('mouseup', this.onMouse, true); } layer.addEventListener('click', this.onClick, true); layer.addEventListener('touchstart', this.onTouchStart, false); layer.addEventListener('touchmove', this.onTouchMove, false); layer.addEventListener('touchend', this.onTouchEnd, false); layer.addEventListener('touchcancel', this.onTouchCancel, false); // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick // layer when they are cancelled. if (!Event.prototype.stopImmediatePropagation) { layer.removeEventListener = function(type, callback, capture) { var rmv = Node.prototype.removeEventListener; if (type === 'click') { rmv.call(layer, type, callback.hijacked || callback, capture); } else { rmv.call(layer, type, callback, capture); } }; layer.addEventListener = function(type, callback, capture) { var adv = Node.prototype.addEventListener; if (type === 'click') { adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) { if (!event.propagationStopped) { callback(event); } }), capture); } else { adv.call(layer, type, callback, capture); } }; } // If a handler is already declared in the element's onclick attribute, it will be fired before // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and // adding it as listener. if (typeof layer.onclick === 'function') { // Android browser on at least 3.2 requires a new reference to the function in layer.onclick // - the old one won't work if passed to addEventListener directly. oldOnClick = layer.onclick; layer.addEventListener('click', function(event) { oldOnClick(event); }, false); layer.onclick = null; } } /** * Android requires exceptions. * * @type boolean */ FastClick.prototype.deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0; /** * iOS requires exceptions. * * @type boolean */ FastClick.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent); /** * iOS 4 requires an exception for select elements. * * @type boolean */ FastClick.prototype.deviceIsIOS4 = FastClick.prototype.deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent); /** * iOS 6.0(+?) requires the target element to be manually derived * * @type boolean */ FastClick.prototype.deviceIsIOSWithBadTarget = FastClick.prototype.deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent); /** * Determine whether a given element requires a native click. * * @param {EventTarget|Element} target Target DOM element * @returns {boolean} Returns true if the element needs a native click */ FastClick.prototype.needsClick = function(target) { 'use strict'; switch (target.nodeName.toLowerCase()) { // Don't send a synthetic click to disabled inputs (issue #62) case 'button': case 'select': case 'textarea': if (target.disabled) { return true; } break; case 'input': // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) if ((this.deviceIsIOS && target.type === 'file') || target.disabled) { return true; } break; case 'label': case 'video': return true; } return (/\bneedsclick\b/).test(target.className); }; /** * Determine whether a given element requires a call to focus to simulate click into element. * * @param {EventTarget|Element} target Target DOM element * @returns {boolean} Returns true if the element requires a call to focus to simulate native click. */ FastClick.prototype.needsFocus = function(target) { 'use strict'; switch (target.nodeName.toLowerCase()) { case 'textarea': return true; case 'select': return !this.deviceIsAndroid; case 'input': switch (target.type) { case 'button': case 'checkbox': case 'file': case 'image': case 'radio': case 'submit': return false; } // No point in attempting to focus disabled inputs return !target.disabled && !target.readOnly; default: return (/\bneedsfocus\b/).test(target.className); } }; /** * Send a click event to the specified element. * * @param {EventTarget|Element} targetElement * @param {Event} event */ FastClick.prototype.sendClick = function(targetElement, event) { 'use strict'; var clickEvent, touch; // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) if (document.activeElement && document.activeElement !== targetElement) { document.activeElement.blur(); } touch = event.changedTouches[0]; // Synthesise a click event, with an extra attribute so it can be tracked clickEvent = document.createEvent('MouseEvents'); clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); clickEvent.forwardedTouchEvent = true; targetElement.dispatchEvent(clickEvent); }; FastClick.prototype.determineEventType = function(targetElement) { 'use strict'; //Issue #159: Android Chrome Select Box does not open with a synthetic click event if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') { return 'mousedown'; } return 'click'; }; /** * @param {EventTarget|Element} targetElement */ FastClick.prototype.focus = function(targetElement) { 'use strict'; var length; // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. if (this.deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') { length = targetElement.value.length; targetElement.setSelectionRange(length, length); } else { targetElement.focus(); } }; /** * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it. * * @param {EventTarget|Element} targetElement */ FastClick.prototype.updateScrollParent = function(targetElement) { 'use strict'; var scrollParent, parentElement; scrollParent = targetElement.fastClickScrollParent; // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the // target element was moved to another parent. if (!scrollParent || !scrollParent.contains(targetElement)) { parentElement = targetElement; do { if (parentElement.scrollHeight > parentElement.offsetHeight) { scrollParent = parentElement; targetElement.fastClickScrollParent = parentElement; break; } parentElement = parentElement.parentElement; } while (parentElement); } // Always update the scroll top tracker if possible. if (scrollParent) { scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; } }; /** * @param {EventTarget} targetElement * @returns {Element|EventTarget} */ FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) { 'use strict'; // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node. if (eventTarget.nodeType === Node.TEXT_NODE) { return eventTarget.parentNode; } return eventTarget; }; /** * On touch start, record the position and scroll offset. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.onTouchStart = function(event) { 'use strict'; var targetElement, touch, selection; // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111). if (event.targetTouches.length > 1) { return true; } targetElement = this.getTargetElementFromEventTarget(event.target); touch = event.targetTouches[0]; if (this.deviceIsIOS) { // Only trusted events will deselect text on iOS (issue #49) selection = window.getSelection(); if (selection.rangeCount && !selection.isCollapsed) { return true; } if (!this.deviceIsIOS4) { // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23): // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched // with the same identifier as the touch event that previously triggered the click that triggered the alert. // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform. if (touch.identifier === this.lastTouchIdentifier) { event.preventDefault(); return false; } this.lastTouchIdentifier = touch.identifier; // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and: // 1) the user does a fling scroll on the scrollable layer // 2) the user stops the fling scroll with another tap // then the event.target of the last 'touchend' event will be the element that was under the user's finger // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42). this.updateScrollParent(targetElement); } } this.trackingClick = true; this.trackingClickStart = event.timeStamp; this.targetElement = targetElement; this.touchStartX = touch.pageX; this.touchStartY = touch.pageY; // Prevent phantom clicks on fast double-tap (issue #36) if ((event.timeStamp - this.lastClickTime) < 200) { event.preventDefault(); } return true; }; /** * Based on a touchmove event object, check whether the touch has moved past a boundary since it started. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.touchHasMoved = function(event) { 'use strict'; var touch = event.changedTouches[0], boundary = this.touchBoundary; if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { return true; } return false; }; /** * Update the last position. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.onTouchMove = function(event) { 'use strict'; if (!this.trackingClick) { return true; } // If the touch has moved, cancel the click tracking if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { this.trackingClick = false; this.targetElement = null; } return true; }; /** * Attempt to find the labelled control for the given label element. * * @param {EventTarget|HTMLLabelElement} labelElement * @returns {Element|null} */ FastClick.prototype.findControl = function(labelElement) { 'use strict'; // Fast path for newer browsers supporting the HTML5 control attribute if (labelElement.control !== undefined) { return labelElement.control; } // All browsers under test that support touch events also support the HTML5 htmlFor attribute if (labelElement.htmlFor) { return document.getElementById(labelElement.htmlFor); } // If no for attribute exists, attempt to retrieve the first labellable descendant element // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea'); }; /** * On touch end, determine whether to send a click event at once. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.onTouchEnd = function(event) { 'use strict'; var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; if (!this.trackingClick) { return true; } // Prevent phantom clicks on fast double-tap (issue #36) if ((event.timeStamp - this.lastClickTime) < 200) { this.cancelNextClick = true; return true; } // Reset to prevent wrong click cancel on input (issue #156). this.cancelNextClick = false; this.lastClickTime = event.timeStamp; trackingClickStart = this.trackingClickStart; this.trackingClick = false; this.trackingClickStart = 0; // On some iOS devices, the targetElement supplied with the event is invalid if the layer // is performing a transition or scroll, and has to be re-detected manually. Note that // for this to function correctly, it must be called *after* the event target is checked! // See issue #57; also filed as rdar://13048589 . if (this.deviceIsIOSWithBadTarget) { touch = event.changedTouches[0]; // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; } targetTagName = targetElement.tagName.toLowerCase(); if (targetTagName === 'label') { forElement = this.findControl(targetElement); if (forElement) { this.focus(targetElement); if (this.deviceIsAndroid) { return false; } targetElement = forElement; } } else if (this.needsFocus(targetElement)) { // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). if ((event.timeStamp - trackingClickStart) > 100 || (this.deviceIsIOS && window.top !== window && targetTagName === 'input')) { this.targetElement = null; return false; } this.focus(targetElement); // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open. if (!this.deviceIsIOS4 || targetTagName !== 'select') { this.targetElement = null; event.preventDefault(); } return false; } if (this.deviceIsIOS && !this.deviceIsIOS4) { // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). scrollParent = targetElement.fastClickScrollParent; if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { return true; } } // Prevent the actual click from going though - unless the target node is marked as requiring // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. if (!this.needsClick(targetElement)) { event.preventDefault(); this.sendClick(targetElement, event); } return false; }; /** * On touch cancel, stop tracking the click. * * @returns {void} */ FastClick.prototype.onTouchCancel = function() { 'use strict'; this.trackingClick = false; this.targetElement = null; }; /** * Determine mouse events which should be permitted. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.onMouse = function(event) { 'use strict'; // If a target element was never set (because a touch event was never fired) allow the event if (!this.targetElement) { return true; } if (event.forwardedTouchEvent) { return true; } // Programmatically generated events targeting a specific element should be permitted if (!event.cancelable) { return true; } // Derive and check the target element to see whether the mouse event needs to be permitted; // unless explicitly enabled, prevent non-touch click events from triggering actions, // to prevent ghost/doubleclicks. if (!this.needsClick(this.targetElement) || this.cancelNextClick) { // Prevent any user-added listeners declared on FastClick element from being fired. if (event.stopImmediatePropagation) { event.stopImmediatePropagation(); } else { // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) event.propagationStopped = true; } // Cancel the event event.stopPropagation(); event.preventDefault(); return false; } // If the mouse event is permitted, return true for the action to go through. return true; }; /** * On actual clicks, determine whether this is a touch-generated click, a click action occurring * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or * an actual click which should be permitted. * * @param {Event} event * @returns {boolean} */ FastClick.prototype.onClick = function(event) { 'use strict'; var permitted; // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early. if (this.trackingClick) { this.targetElement = null; this.trackingClick = false; return true; } // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target. if (event.target.type === 'submit' && event.detail === 0) { return true; } permitted = this.onMouse(event); // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through. if (!permitted) { this.targetElement = null; } // If clicks are permitted, return true for the action to go through. return permitted; }; /** * Remove all FastClick's event listeners. * * @returns {void} */ FastClick.prototype.destroy = function() { 'use strict'; var layer = this.layer; if (this.deviceIsAndroid) { layer.removeEventListener('mouseover', this.onMouse, true); layer.removeEventListener('mousedown', this.onMouse, true); layer.removeEventListener('mouseup', this.onMouse, true); } layer.removeEventListener('click', this.onClick, true); layer.removeEventListener('touchstart', this.onTouchStart, false); layer.removeEventListener('touchmove', this.onTouchMove, false); layer.removeEventListener('touchend', this.onTouchEnd, false); layer.removeEventListener('touchcancel', this.onTouchCancel, false); }; /** * Check whether FastClick is needed. * * @param {Element} layer The layer to listen on */ FastClick.notNeeded = function(layer) { 'use strict'; var metaViewport; var chromeVersion; // Devices that don't support touch don't need FastClick if (typeof window.ontouchstart === 'undefined') { return true; } // Chrome version - zero for other browsers chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; if (chromeVersion) { if (FastClick.prototype.deviceIsAndroid) { metaViewport = document.querySelector('meta[name=viewport]'); if (metaViewport) { // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89) if (metaViewport.content.indexOf('user-scalable=no') !== -1) { return true; } // Chrome 32 and above with width=device-width or less don't need FastClick if (chromeVersion > 31 && window.innerWidth <= window.screen.width) { return true; } } // Chrome desktop doesn't need FastClick (issue #15) } else { return true; } } // IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97) if (layer.style.msTouchAction === 'none') { return true; } return false; }; /** * Factory method for creating a FastClick object * * @param {Element} layer The layer to listen on */ FastClick.attach = function(layer) { 'use strict'; return new FastClick(layer); }; if (typeof define !== 'undefined' && define.amd) { // AMD. Register as an anonymous module. define(function() { 'use strict'; return FastClick; }); } else if (typeof module !== 'undefined' && module.exports) { module.exports = FastClick.attach; module.exports.FastClick = FastClick; } else { window.FastClick = FastClick; } }); require.register("component~indexof@0.0.3", function (exports, module) { module.exports = function(arr, obj){ if (arr.indexOf) return arr.indexOf(obj); for (var i = 0; i < arr.length; ++i) { if (arr[i] === obj) return i; } return -1; }; }); require.register("component~classes@1.2.1", function (exports, module) { /** * Module dependencies. */ var index = require('component~indexof@0.0.3'); /** * Whitespace regexp. */ var re = /\s+/; /** * toString reference. */ var toString = Object.prototype.toString; /** * Wrap `el` in a `ClassList`. * * @param {Element} el * @return {ClassList} * @api public */ module.exports = function(el){ return new ClassList(el); }; /** * Initialize a new ClassList for `el`. * * @param {Element} el * @api private */ function ClassList(el) { if (!el) throw new Error('A DOM element reference is required'); this.el = el; this.list = el.classList; } /** * Add class `name` if not already present. * * @param {String} name * @return {ClassList} * @api public */ ClassList.prototype.add = function(name){ // classList if (this.list) { this.list.add(name); return this; } // fallback var arr = this.array(); var i = index(arr, name); if (!~i) arr.push(name); this.el.className = arr.join(' '); return this; }; /** * Remove class `name` when present, or * pass a regular expression to remove * any which match. * * @param {String|RegExp} name * @return {ClassList} * @api public */ ClassList.prototype.remove = function(name){ if ('[object RegExp]' == toString.call(name)) { return this.removeMatching(name); } // classList if (this.list) { this.list.remove(name); return this; } // fallback var arr = this.array(); var i = index(arr, name); if (~i) arr.splice(i, 1); this.el.className = arr.join(' '); return this; }; /** * Remove all classes matching `re`. * * @param {RegExp} re * @return {ClassList} * @api private */ ClassList.prototype.removeMatching = function(re){ var arr = this.array(); for (var i = 0; i < arr.length; i++) { if (re.test(arr[i])) { this.remove(arr[i]); } } return this; }; /** * Toggle class `name`, can force state via `force`. * * For browsers that support classList, but do not support `force` yet, * the mistake will be detected and corrected. * * @param {String} name * @param {Boolean} force * @return {ClassList} * @api public */ ClassList.prototype.toggle = function(name, force){ // classList if (this.list) { if ("undefined" !== typeof force) { if (force !== this.list.toggle(name, force)) { this.list.toggle(name); // toggle again to correct } } else { this.list.toggle(name); } return this; } // fallback if ("undefined" !== typeof force) { if (!force) { this.remove(name); } else { this.add(name); } } else { if (this.has(name)) { this.remove(name); } else { this.add(name); } } return this; }; /** * Return an array of classes. * * @return {Array} * @api public */ ClassList.prototype.array = function(){ var str = this.el.className.replace(/^\s+|\s+$/g, ''); var arr = str.split(re); if ('' === arr[0]) arr.shift(); return arr; }; /** * Check if class `name` is present. * * @param {String} name * @return {ClassList} * @api public */ ClassList.prototype.has = ClassList.prototype.contains = function(name){ return this.list ? this.list.contains(name) : !! ~index(this.array(), name); }; }); require.register("component~event@0.1.4", function (exports, module) { var bind = window.addEventListener ? 'addEventListener' : 'attachEvent', unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent', prefix = bind !== 'addEventListener' ? 'on' : ''; /** * Bind `el` event `type` to `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.bind = function(el, type, fn, capture){ el[bind](prefix + type, fn, capture || false); return fn; }; /** * Unbind `el` event `type`'s callback `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.unbind = function(el, type, fn, capture){ el[unbind](prefix + type, fn, capture || false); return fn; }; }); require.register("component~query@0.0.3", function (exports, module) { function one(selector, el) { return el.querySelector(selector); } exports = module.exports = function(selector, el){ el = el || document; return one(selector, el); }; exports.all = function(selector, el){ el = el || document; return el.querySelectorAll(selector); }; exports.engine = function(obj){ if (!obj.one) throw new Error('.one callback required'); if (!obj.all) throw new Error('.all callback required'); one = obj.one; exports.all = obj.all; return exports; }; }); require.register("component~matches-selector@0.1.6", function (exports, module) { /** * Module dependencies. */ try { var query = require('component~query@0.0.3'); } catch (err) { var query = require('component~query@0.0.3'); } /** * Element prototype. */ var proto = Element.prototype; /** * Vendor function. */ var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector; /** * Expose `match()`. */ module.exports = match; /** * Match `el` to `selector`. * * @param {Element} el * @param {String} selector * @return {Boolean} * @api public */ function match(el, selector) { if (!el || el.nodeType !== 1) return false; if (vendor) return vendor.call(el, selector); var nodes = query.all(selector, el.parentNode); for (var i = 0; i < nodes.length; ++i) { if (nodes[i] == el) return true; } return false; } }); require.register("component~closest@1.0.1", function (exports, module) { /** * Module Dependencies */ try { var matches = require('component~matches-selector@0.1.6') } catch (err) { var matches = require('component~matches-selector@0.1.6') } /** * Export `closest` */ module.exports = closest /** * Closest * * @param {Element} el * @param {String} selector * @param {Element} scope (optional) */ function closest (el, selector, scope) { scope = scope || document.documentElement; // walk up the dom while (el && el !== scope) { if (matches(el, selector)) return el; el = el.parentNode; } // check scope for match return matches(el, selector) ? el : null; } }); require.register("component~delegate@0.2.3", function (exports, module) { /** * Module dependencies. */ var closest = require('component~closest@1.0.1') , event = require('component~event@0.1.4'); /** * Delegate event `type` to `selector` * and invoke `fn(e)`. A callback function * is returned which may be passed to `.unbind()`. * * @param {Element} el * @param {String} selector * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.bind = function(el, selector, type, fn, capture){ return event.bind(el, type, function(e){ var target = e.target || e.srcElement; e.delegateTarget = closest(target, selector, true, el); if (e.delegateTarget) fn.call(el, e); }, capture); }; /** * Unbind event `type`'s callback `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @api public */ exports.unbind = function(el, type, fn, capture){ event.unbind(el, type, fn, capture); }; }); require.register("component~events@1.0.9", function (exports, module) { /** * Module dependencies. */ var events = require('component~event@0.1.4'); var delegate = require('component~delegate@0.2.3'); /** * Expose `Events`. */ module.exports = Events; /** * Initialize an `Events` with the given * `el` object which events will be bound to, * and the `obj` which will receive method calls. * * @param {Object} el * @param {Object} obj * @api public */ function Events(el, obj) { if (!(this instanceof Events)) return new Events(el, obj); if (!el) throw new Error('element required'); if (!obj) throw new Error('object required'); this.el = el; this.obj = obj; this._events = {}; } /** * Subscription helper. */ Events.prototype.sub = function(event, method, cb){ this._events[event] = this._events[event] || {}; this._events[event][method] = cb; }; /** * Bind to `event` with optional `method` name. * When `method` is undefined it becomes `event` * with the "on" prefix. * * Examples: * * Direct event handling: * * events.bind('click') // implies "onclick" * events.bind('click', 'remove') * events.bind('click', 'sort', 'asc') * * Delegated event handling: * * events.bind('click li > a') * events.bind('click li > a', 'remove') * events.bind('click a.sort-ascending', 'sort', 'asc') * events.bind('click a.sort-descending', 'sort', 'desc') * * @param {String} event * @param {String|function} [method] * @return {Function} callback * @api public */ Events.prototype.bind = function(event, method){ var e = parse(event); var el = this.el; var obj = this.obj; var name = e.name; var method = method || 'on' + name; var args = [].slice.call(arguments, 2); // callback function cb(){ var a = [].slice.call(arguments).concat(args); obj[method].apply(obj, a); } // bind if (e.selector) { cb = delegate.bind(el, e.selector, name, cb); } else { events.bind(el, name, cb); } // subscription for unbinding this.sub(name, method, cb); return cb; }; /** * Unbind a single binding, all bindings for `event`, * or all bindings within the manager. * * Examples: * * Unbind direct handlers: * * events.unbind('click', 'remove') * events.unbind('click') * events.unbind() * * Unbind delegate handlers: * * events.unbind('click', 'remove') * events.unbind('click') * events.unbind() * * @param {String|Function} [event] * @param {String|Function} [method] * @api public */ Events.prototype.unbind = function(event, method){ if (0 == arguments.length) return this.unbindAll(); if (1 == arguments.length) return this.unbindAllOf(event); // no bindings for this event var bindings = this._events[event]; if (!bindings) return; // no bindings for this method var cb = bindings[method]; if (!cb) return; events.unbind(this.el, event, cb); }; /** * Unbind all events. * * @api private */ Events.prototype.unbindAll = function(){ for (var event in this._events) { this.unbindAllOf(event); } }; /** * Unbind all events for `event`. * * @param {String} event * @api private */ Events.prototype.unbindAllOf = function(event){ var bindings = this._events[event]; if (!bindings) return; for (var method in bindings) { this.unbind(event, method); } }; /** * Parse `event`. * * @param {String} event * @return {Object} * @api private */ function parse(event) { var parts = event.split(/ +/); return { name: parts.shift(), selector: parts.join(' ') } } }); require.register("switchery", function (exports, module) { /** * Switchery 0.8.2 * http://abpetkov.github.io/switchery/ * * Authored by Alexander Petkov * https://github.com/abpetkov * * Copyright 2013-2015, Alexander Petkov * License: The MIT License (MIT) * http://opensource.org/licenses/MIT * */ /** * External dependencies. */ var transitionize = require('abpetkov~transitionize@0.0.3') , fastclick = require('ftlabs~fastclick@v0.6.11') , classes = require('component~classes@1.2.1') , events = require('component~events@1.0.9'); /** * Expose `Switchery`. */ module.exports = Switchery; /** * Set Switchery default values. * * @api public */ var defaults = { color : '#64bd63' , secondaryColor : '#dfdfdf' , jackColor : '#fff' , jackSecondaryColor: null , className : 'switchery' , disabled : false , disabledOpacity : 0.5 , speed : '0.4s' , size : 'default' }; /** * Create Switchery object. * * @param {Object} element * @param {Object} options * @api public */ function Switchery(element, options) { if (!(this instanceof Switchery)) return new Switchery(element, options); this.element = element; this.options = options || {}; for (var i in defaults) { if (this.options[i] == null) { this.options[i] = defaults[i]; } } if (this.element != null && this.element.type == 'checkbox') this.init(); if (this.isDisabled() === true) this.disable(); } /** * Hide the target element. * * @api private */ Switchery.prototype.hide = function() { this.element.style.display = 'none'; }; /** * Show custom switch after the target element. * * @api private */ Switchery.prototype.show = function() { var switcher = this.create(); this.insertAfter(this.element, switcher); }; /** * Create custom switch. * * @returns {Object} this.switcher * @api private */ Switchery.prototype.create = function() { this.switcher = document.createElement('span'); this.jack = document.createElement('small'); this.switcher.appendChild(this.jack); this.switcher.className = this.options.className; this.events = events(this.switcher, this); return this.switcher; }; /** * Insert after element after another element. * * @param {Object} reference * @param {Object} target * @api private */ Switchery.prototype.insertAfter = function(reference, target) { reference.parentNode.insertBefore(target, reference.nextSibling); }; /** * Set switch jack proper position. * * @param {Boolean} clicked - we need this in order to uncheck the input when the switch is clicked * @api private */ Switchery.prototype.setPosition = function (clicked) { var checked = this.isChecked() , switcher = this.switcher , jack = this.jack; if (clicked && checked) checked = false; else if (clicked && !checked) checked = true; if (checked === true) { this.element.checked = true; if (window.getComputedStyle) jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + 'px'; else jack.style.left = parseInt(switcher.currentStyle['width']) - parseInt(jack.currentStyle['width']) + 'px'; if (this.options.color) this.colorize(); this.setSpeed(); } else { jack.style.left = 0; this.element.checked = false; this.switcher.style.boxShadow = 'inset 0 0 0 0 ' + this.options.secondaryColor; this.switcher.style.borderColor = this.options.secondaryColor; this.switcher.style.backgroundColor = (this.options.secondaryColor !== defaults.secondaryColor) ? this.options.secondaryColor : '#fff'; this.jack.style.backgroundColor = (this.options.jackSecondaryColor !== this.options.jackColor) ? this.options.jackSecondaryColor : this.options.jackColor; this.setSpeed(); } }; /** * Set speed. * * @api private */ Switchery.prototype.setSpeed = function() { var switcherProp = {} , jackProp = { 'background-color': this.options.speed , 'left': this.options.speed.replace(/[a-z]/, '') / 2 + 's' }; if (this.isChecked()) { switcherProp = { 'border': this.options.speed , 'box-shadow': this.options.speed , 'background-color': this.options.speed.replace(/[a-z]/, '') * 3 + 's' }; } else { switcherProp = { 'border': this.options.speed , 'box-shadow': this.options.speed }; } transitionize(this.switcher, switcherProp); transitionize(this.jack, jackProp); }; /** * Set switch size. * * @api private */ Switchery.prototype.setSize = function() { var small = 'switchery-small' , normal = 'switchery-default' , large = 'switchery-large'; switch (this.options.size) { case 'small': classes(this.switcher).add(small) break; case 'large': classes(this.switcher).add(large) break; default: classes(this.switcher).add(normal) break; } }; /** * Set switch color. * * @api private */ Switchery.prototype.colorize = function() { var switcherHeight = this.switcher.offsetHeight / 2; this.switcher.style.backgroundColor = this.options.color; this.switcher.style.borderColor = this.options.color; this.switcher.style.boxShadow = 'inset 0 0 0 ' + switcherHeight + 'px ' + this.options.color; this.jack.style.backgroundColor = this.options.jackColor; }; /** * Handle the onchange event. * * @param {Boolean} state * @api private */ Switchery.prototype.handleOnchange = function(state) { if (document.dispatchEvent) { var event = document.createEvent('HTMLEvents'); event.initEvent('change', true, true); this.element.dispatchEvent(event); } else { this.element.fireEvent('onchange'); } }; /** * Handle the native input element state change. * A `change` event must be fired in order to detect the change. * * @api private */ Switchery.prototype.handleChange = function() { var self = this , el = this.element; if (el.addEventListener) { el.addEventListener('change', function() { self.setPosition(); }); } else { el.attachEvent('onchange', function() { self.setPosition(); }); } }; /** * Handle the switch click event. * * @api private */ Switchery.prototype.handleClick = function() { var switcher = this.switcher; fastclick = fastclick.bind(this); fastclick(switcher); this.events.bind('click', 'bindClick'); }; /** * Attach all methods that need to happen on switcher click. * * @api private */ Switchery.prototype.bindClick = function() { var parent = this.element.parentNode.tagName.toLowerCase() , labelParent = (parent === 'label') ? false : true; this.setPosition(labelParent); this.handleOnchange(this.element.checked); }; /** * Mark an individual switch as already handled. * * @api private */ Switchery.prototype.markAsSwitched = function() { this.element.setAttribute('data-switchery', true); }; /** * Check if an individual switch is already handled. * * @api private */ Switchery.prototype.markedAsSwitched = function() { return this.element.getAttribute('data-switchery'); }; /** * Initialize Switchery. * * @api private */ Switchery.prototype.init = function() { this.hide(); this.show(); this.setSize(); this.setPosition(); this.markAsSwitched(); this.handleChange(); this.handleClick(); }; /** * See if input is checked. * * @returns {Boolean} * @api public */ Switchery.prototype.isChecked = function() { return this.element.checked; }; /** * See if switcher should be disabled. * * @returns {Boolean} * @api public */ Switchery.prototype.isDisabled = function() { return this.options.disabled || this.element.disabled || this.element.readOnly; }; /** * Destroy all event handlers attached to the switch. * * @api public */ Switchery.prototype.destroy = function() { this.events.unbind(); }; /** * Enable disabled switch element. * * @api public */ Switchery.prototype.enable = function() { if (!this.options.disabled) return; if (this.options.disabled) this.options.disabled = false; if (this.element.disabled) this.element.disabled = false; if (this.element.readOnly) this.element.readOnly = false; this.switcher.style.opacity = 1; this.events.bind('click', 'bindClick'); }; /** * Disable switch element. * * @api public */ Switchery.prototype.disable = function() { if (this.options.disabled) return; if (!this.options.disabled) this.options.disabled = true; if (!this.element.disabled) this.element.disabled = true; if (!this.element.readOnly) this.element.readOnly = true; this.switcher.style.opacity = this.options.disabledOpacity; this.destroy(); }; }); if (typeof exports == "object") { module.exports = require("switchery"); } else if (typeof define == "function" && define.amd) { define("Switchery", [], function(){ return require("switchery"); }); } else { (this || window)["Switchery"] = require("switchery"); } })() PK2[�\q"P[&`&`dist/switchery.min.jsnu�[���(function(){function require(name){var module=require.modules[name];if(!module)throw new Error('failed to require "'+name+'"');if(!("exports"in module)&&typeof module.definition==="function"){module.client=module.component=true;module.definition.call(this,module.exports={},module);delete module.definition}return module.exports}require.loader="component";require.helper={};require.helper.semVerSort=function(a,b){var aArray=a.version.split(".");var bArray=b.version.split(".");for(var i=0;i<aArray.length;++i){var aInt=parseInt(aArray[i],10);var bInt=parseInt(bArray[i],10);if(aInt===bInt){var aLex=aArray[i].substr((""+aInt).length);var bLex=bArray[i].substr((""+bInt).length);if(aLex===""&&bLex!=="")return 1;if(aLex!==""&&bLex==="")return-1;if(aLex!==""&&bLex!=="")return aLex>bLex?1:-1;continue}else if(aInt>bInt){return 1}else{return-1}}return 0};require.latest=function(name,returnPath){function showError(name){throw new Error('failed to find latest module of "'+name+'"')}var versionRegexp=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;var remoteRegexp=/(.*)~(.*)/;if(!remoteRegexp.test(name))showError(name);var moduleNames=Object.keys(require.modules);var semVerCandidates=[];var otherCandidates=[];for(var i=0;i<moduleNames.length;i++){var moduleName=moduleNames[i];if(new RegExp(name+"@").test(moduleName)){var version=moduleName.substr(name.length+1);var semVerMatch=versionRegexp.exec(moduleName);if(semVerMatch!=null){semVerCandidates.push({version:version,name:moduleName})}else{otherCandidates.push({version:version,name:moduleName})}}}if(semVerCandidates.concat(otherCandidates).length===0){showError(name)}if(semVerCandidates.length>0){var module=semVerCandidates.sort(require.helper.semVerSort).pop().name;if(returnPath===true){return module}return require(module)}var module=otherCandidates.sort(function(a,b){return a.name>b.name})[0].name;if(returnPath===true){return module}return require(module)};require.modules={};require.register=function(name,definition){require.modules[name]={definition:definition}};require.define=function(name,exports){require.modules[name]={exports:exports}};require.register("abpetkov~transitionize@0.0.3",function(exports,module){module.exports=Transitionize;function Transitionize(element,props){if(!(this instanceof Transitionize))return new Transitionize(element,props);this.element=element;this.props=props||{};this.init()}Transitionize.prototype.isSafari=function(){return/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)};Transitionize.prototype.init=function(){var transitions=[];for(var key in this.props){transitions.push(key+" "+this.props[key])}this.element.style.transition=transitions.join(", ");if(this.isSafari())this.element.style.webkitTransition=transitions.join(", ")}});require.register("ftlabs~fastclick@v0.6.11",function(exports,module){function FastClick(layer){"use strict";var oldOnClick,self=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(!layer||!layer.nodeType){throw new TypeError("Layer must be a document node")}this.onClick=function(){return FastClick.prototype.onClick.apply(self,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(self,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(self,arguments)};this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(self,arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(self,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(self,arguments)};if(FastClick.notNeeded(layer)){return}if(this.deviceIsAndroid){layer.addEventListener("mouseover",this.onMouse,true);layer.addEventListener("mousedown",this.onMouse,true);layer.addEventListener("mouseup",this.onMouse,true)}layer.addEventListener("click",this.onClick,true);layer.addEventListener("touchstart",this.onTouchStart,false);layer.addEventListener("touchmove",this.onTouchMove,false);layer.addEventListener("touchend",this.onTouchEnd,false);layer.addEventListener("touchcancel",this.onTouchCancel,false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;if(type==="click"){rmv.call(layer,type,callback.hijacked||callback,capture)}else{rmv.call(layer,type,callback,capture)}};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click"){adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped){callback(event)}}),capture)}else{adv.call(layer,type,callback,capture)}}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},false);layer.onclick=null}}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled){return true}break;case"input":if(this.deviceIsIOS&&target.type==="file"||target.disabled){return true}break;case"label":case"video":return true}return/\bneedsclick\b/.test(target.className)};FastClick.prototype.needsFocus=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"textarea":return true;case"select":return!this.deviceIsAndroid;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};FastClick.prototype.sendClick=function(targetElement,event){"use strict";var clickEvent,touch;if(document.activeElement&&document.activeElement!==targetElement){document.activeElement.blur()}touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent(this.determineEventType(targetElement),true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};FastClick.prototype.determineEventType=function(targetElement){"use strict";if(this.deviceIsAndroid&&targetElement.tagName.toLowerCase()==="select"){return"mousedown"}return"click"};FastClick.prototype.focus=function(targetElement){"use strict";var length;if(this.deviceIsIOS&&targetElement.setSelectionRange&&targetElement.type.indexOf("date")!==0&&targetElement.type!=="time"){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else{targetElement.focus()}};FastClick.prototype.updateScrollParent=function(targetElement){"use strict";var scrollParent,parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent){scrollParent.fastClickLastScrollTop=scrollParent.scrollTop}};FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){"use strict";if(eventTarget.nodeType===Node.TEXT_NODE){return eventTarget.parentNode}return eventTarget};FastClick.prototype.onTouchStart=function(event){"use strict";var targetElement,touch,selection;if(event.targetTouches.length>1){return true}targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(this.deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200){event.preventDefault()}return true};FastClick.prototype.touchHasMoved=function(event){"use strict";var touch=event.changedTouches[0],boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary){return true}return false};FastClick.prototype.onTouchMove=function(event){"use strict";if(!this.trackingClick){return true}if(this.targetElement!==this.getTargetElementFromEventTarget(event.target)||this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}return true};FastClick.prototype.findControl=function(labelElement){"use strict";if(labelElement.control!==undefined){return labelElement.control}if(labelElement.htmlFor){return document.getElementById(labelElement.htmlFor)}return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(event){"use strict";var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(!this.trackingClick){return true}if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.cancelNextClick=false;this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(this.deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(this.deviceIsAndroid){return false}targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||this.deviceIsIOS&&window.top!==window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);if(!this.deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(this.deviceIsIOS&&!this.deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop){return true}}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){"use strict";if(!this.targetElement){return true}if(event.forwardedTouchEvent){return true}if(!event.cancelable){return true}if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation){event.stopImmediatePropagation()}else{event.propagationStopped=true}event.stopPropagation();event.preventDefault();return false}return true};FastClick.prototype.onClick=function(event){"use strict";var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0){return true}permitted=this.onMouse(event);if(!permitted){this.targetElement=null}return permitted};FastClick.prototype.destroy=function(){"use strict";var layer=this.layer;if(this.deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchmove",this.onTouchMove,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",this.onTouchCancel,false)};FastClick.notNeeded=function(layer){"use strict";var metaViewport;var chromeVersion;if(typeof window.ontouchstart==="undefined"){return true}chromeVersion=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1];if(chromeVersion){if(FastClick.prototype.deviceIsAndroid){metaViewport=document.querySelector("meta[name=viewport]");if(metaViewport){if(metaViewport.content.indexOf("user-scalable=no")!==-1){return true}if(chromeVersion>31&&window.innerWidth<=window.screen.width){return true}}}else{return true}}if(layer.style.msTouchAction==="none"){return true}return false};FastClick.attach=function(layer){"use strict";return new FastClick(layer)};if(typeof define!=="undefined"&&define.amd){define(function(){"use strict";return FastClick})}else if(typeof module!=="undefined"&&module.exports){module.exports=FastClick.attach;module.exports.FastClick=FastClick}else{window.FastClick=FastClick}});require.register("component~indexof@0.0.3",function(exports,module){module.exports=function(arr,obj){if(arr.indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i){if(arr[i]===obj)return i}return-1}});require.register("component~classes@1.2.1",function(exports,module){var index=require("component~indexof@0.0.3");var re=/\s+/;var toString=Object.prototype.toString;module.exports=function(el){return new ClassList(el)};function ClassList(el){if(!el)throw new Error("A DOM element reference is required");this.el=el;this.list=el.classList}ClassList.prototype.add=function(name){if(this.list){this.list.add(name);return this}var arr=this.array();var i=index(arr,name);if(!~i)arr.push(name);this.el.className=arr.join(" ");return this};ClassList.prototype.remove=function(name){if("[object RegExp]"==toString.call(name)){return this.removeMatching(name)}if(this.list){this.list.remove(name);return this}var arr=this.array();var i=index(arr,name);if(~i)arr.splice(i,1);this.el.className=arr.join(" ");return this};ClassList.prototype.removeMatching=function(re){var arr=this.array();for(var i=0;i<arr.length;i++){if(re.test(arr[i])){this.remove(arr[i])}}return this};ClassList.prototype.toggle=function(name,force){if(this.list){if("undefined"!==typeof force){if(force!==this.list.toggle(name,force)){this.list.toggle(name)}}else{this.list.toggle(name)}return this}if("undefined"!==typeof force){if(!force){this.remove(name)}else{this.add(name)}}else{if(this.has(name)){this.remove(name)}else{this.add(name)}}return this};ClassList.prototype.array=function(){var str=this.el.className.replace(/^\s+|\s+$/g,"");var arr=str.split(re);if(""===arr[0])arr.shift();return arr};ClassList.prototype.has=ClassList.prototype.contains=function(name){return this.list?this.list.contains(name):!!~index(this.array(),name)}});require.register("component~event@0.1.4",function(exports,module){var bind=window.addEventListener?"addEventListener":"attachEvent",unbind=window.removeEventListener?"removeEventListener":"detachEvent",prefix=bind!=="addEventListener"?"on":"";exports.bind=function(el,type,fn,capture){el[bind](prefix+type,fn,capture||false);return fn};exports.unbind=function(el,type,fn,capture){el[unbind](prefix+type,fn,capture||false);return fn}});require.register("component~query@0.0.3",function(exports,module){function one(selector,el){return el.querySelector(selector)}exports=module.exports=function(selector,el){el=el||document;return one(selector,el)};exports.all=function(selector,el){el=el||document;return el.querySelectorAll(selector)};exports.engine=function(obj){if(!obj.one)throw new Error(".one callback required");if(!obj.all)throw new Error(".all callback required");one=obj.one;exports.all=obj.all;return exports}});require.register("component~matches-selector@0.1.6",function(exports,module){try{var query=require("component~query@0.0.3")}catch(err){var query=require("component~query@0.0.3")}var proto=Element.prototype;var vendor=proto.matches||proto.webkitMatchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector;module.exports=match;function match(el,selector){if(!el||el.nodeType!==1)return false;if(vendor)return vendor.call(el,selector);var nodes=query.all(selector,el.parentNode);for(var i=0;i<nodes.length;++i){if(nodes[i]==el)return true}return false}});require.register("component~closest@1.0.1",function(exports,module){try{var matches=require("component~matches-selector@0.1.6")}catch(err){var matches=require("component~matches-selector@0.1.6")}module.exports=closest;function closest(el,selector,scope){scope=scope||document.documentElement;while(el&&el!==scope){if(matches(el,selector))return el;el=el.parentNode}return matches(el,selector)?el:null}});require.register("component~delegate@0.2.3",function(exports,module){var closest=require("component~closest@1.0.1"),event=require("component~event@0.1.4");exports.bind=function(el,selector,type,fn,capture){return event.bind(el,type,function(e){var target=e.target||e.srcElement;e.delegateTarget=closest(target,selector,true,el);if(e.delegateTarget)fn.call(el,e)},capture)};exports.unbind=function(el,type,fn,capture){event.unbind(el,type,fn,capture)}});require.register("component~events@1.0.9",function(exports,module){var events=require("component~event@0.1.4");var delegate=require("component~delegate@0.2.3");module.exports=Events;function Events(el,obj){if(!(this instanceof Events))return new Events(el,obj);if(!el)throw new Error("element required");if(!obj)throw new Error("object required");this.el=el;this.obj=obj;this._events={}}Events.prototype.sub=function(event,method,cb){this._events[event]=this._events[event]||{};this._events[event][method]=cb};Events.prototype.bind=function(event,method){var e=parse(event);var el=this.el;var obj=this.obj;var name=e.name;var method=method||"on"+name;var args=[].slice.call(arguments,2);function cb(){var a=[].slice.call(arguments).concat(args);obj[method].apply(obj,a)}if(e.selector){cb=delegate.bind(el,e.selector,name,cb)}else{events.bind(el,name,cb)}this.sub(name,method,cb);return cb};Events.prototype.unbind=function(event,method){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(event);var bindings=this._events[event];if(!bindings)return;var cb=bindings[method];if(!cb)return;events.unbind(this.el,event,cb)};Events.prototype.unbindAll=function(){for(var event in this._events){this.unbindAllOf(event)}};Events.prototype.unbindAllOf=function(event){var bindings=this._events[event];if(!bindings)return;for(var method in bindings){this.unbind(event,method)}};function parse(event){var parts=event.split(/ +/);return{name:parts.shift(),selector:parts.join(" ")}}});require.register("switchery",function(exports,module){var transitionize=require("abpetkov~transitionize@0.0.3"),fastclick=require("ftlabs~fastclick@v0.6.11"),classes=require("component~classes@1.2.1"),events=require("component~events@1.0.9");module.exports=Switchery;var defaults={color:"#64bd63",secondaryColor:"#dfdfdf",jackColor:"#fff",jackSecondaryColor:null,className:"switchery",disabled:false,disabledOpacity:.5,speed:"0.4s",size:"default"};function Switchery(element,options){if(!(this instanceof Switchery))return new Switchery(element,options);this.element=element;this.options=options||{};for(var i in defaults){if(this.options[i]==null){this.options[i]=defaults[i]}}if(this.element!=null&&this.element.type=="checkbox")this.init();if(this.isDisabled()===true)this.disable()}Switchery.prototype.hide=function(){this.element.style.display="none"};Switchery.prototype.show=function(){var switcher=this.create();this.insertAfter(this.element,switcher)};Switchery.prototype.create=function(){this.switcher=document.createElement("span");this.jack=document.createElement("small");this.switcher.appendChild(this.jack);this.switcher.className=this.options.className;this.events=events(this.switcher,this);return this.switcher};Switchery.prototype.insertAfter=function(reference,target){reference.parentNode.insertBefore(target,reference.nextSibling)};Switchery.prototype.setPosition=function(clicked){var checked=this.isChecked(),switcher=this.switcher,jack=this.jack;if(clicked&&checked)checked=false;else if(clicked&&!checked)checked=true;if(checked===true){this.element.checked=true;if(window.getComputedStyle)jack.style.left=parseInt(window.getComputedStyle(switcher).width)-parseInt(window.getComputedStyle(jack).width)+"px";else jack.style.left=parseInt(switcher.currentStyle["width"])-parseInt(jack.currentStyle["width"])+"px";if(this.options.color)this.colorize();this.setSpeed()}else{jack.style.left=0;this.element.checked=false;this.switcher.style.boxShadow="inset 0 0 0 0 "+this.options.secondaryColor;this.switcher.style.borderColor=this.options.secondaryColor;this.switcher.style.backgroundColor=this.options.secondaryColor!==defaults.secondaryColor?this.options.secondaryColor:"#fff";this.jack.style.backgroundColor=this.options.jackSecondaryColor!==this.options.jackColor?this.options.jackSecondaryColor:this.options.jackColor;this.setSpeed()}};Switchery.prototype.setSpeed=function(){var switcherProp={},jackProp={"background-color":this.options.speed,left:this.options.speed.replace(/[a-z]/,"")/2+"s"};if(this.isChecked()){switcherProp={border:this.options.speed,"box-shadow":this.options.speed,"background-color":this.options.speed.replace(/[a-z]/,"")*3+"s"}}else{switcherProp={border:this.options.speed,"box-shadow":this.options.speed}}transitionize(this.switcher,switcherProp);transitionize(this.jack,jackProp)};Switchery.prototype.setSize=function(){var small="switchery-small",normal="switchery-default",large="switchery-large";switch(this.options.size){case"small":classes(this.switcher).add(small);break;case"large":classes(this.switcher).add(large);break;default:classes(this.switcher).add(normal);break}};Switchery.prototype.colorize=function(){var switcherHeight=this.switcher.offsetHeight/2;this.switcher.style.backgroundColor=this.options.color;this.switcher.style.borderColor=this.options.color;this.switcher.style.boxShadow="inset 0 0 0 "+switcherHeight+"px "+this.options.color;this.jack.style.backgroundColor=this.options.jackColor};Switchery.prototype.handleOnchange=function(state){if(document.dispatchEvent){var event=document.createEvent("HTMLEvents");event.initEvent("change",true,true);this.element.dispatchEvent(event)}else{this.element.fireEvent("onchange")}};Switchery.prototype.handleChange=function(){var self=this,el=this.element;if(el.addEventListener){el.addEventListener("change",function(){self.setPosition()})}else{el.attachEvent("onchange",function(){self.setPosition()})}};Switchery.prototype.handleClick=function(){var switcher=this.switcher;fastclick=fastclick.bind(this);fastclick(switcher);this.events.bind("click","bindClick")};Switchery.prototype.bindClick=function(){var parent=this.element.parentNode.tagName.toLowerCase(),labelParent=parent==="label"?false:true;this.setPosition(labelParent);this.handleOnchange(this.element.checked)};Switchery.prototype.markAsSwitched=function(){this.element.setAttribute("data-switchery",true)};Switchery.prototype.markedAsSwitched=function(){return this.element.getAttribute("data-switchery")};Switchery.prototype.init=function(){this.hide();this.show();this.setSize();this.setPosition();this.markAsSwitched();this.handleChange();this.handleClick()};Switchery.prototype.isChecked=function(){return this.element.checked};Switchery.prototype.isDisabled=function(){return this.options.disabled||this.element.disabled||this.element.readOnly};Switchery.prototype.destroy=function(){this.events.unbind()};Switchery.prototype.enable=function(){if(!this.options.disabled)return;if(this.options.disabled)this.options.disabled=false;if(this.element.disabled)this.element.disabled=false;if(this.element.readOnly)this.element.readOnly=false;this.switcher.style.opacity=1;this.events.bind("click","bindClick")};Switchery.prototype.disable=function(){if(this.options.disabled)return;if(!this.options.disabled)this.options.disabled=true;if(!this.element.disabled)this.element.disabled=true;if(!this.element.readOnly)this.element.readOnly=true;this.switcher.style.opacity=this.options.disabledOpacity;this.destroy()}});if(typeof exports=="object"){module.exports=require("switchery")}else if(typeof define=="function"&&define.amd){define("Switchery",[],function(){return require("switchery")})}else{(this||window)["Switchery"]=require("switchery")}})();PK2[�\* ���dist/switchery.min.cssnu�[���.switchery{background-color:#fff;border:1px solid #dfdfdf;border-radius:20px;cursor:pointer;display:inline-block;height:30px;position:relative;vertical-align:middle;width:50px;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;background-clip:content-box}.switchery>small{background:#fff;border-radius:100%;box-shadow:0 1px 3px rgba(0,0,0,0.4);height:30px;position:absolute;top:0;width:30px}.switchery-small{border-radius:20px;height:20px;width:33px}.switchery-small>small{height:20px;width:20px}.switchery-large{border-radius:40px;height:40px;width:66px}.switchery-large>small{height:40px;width:40px}PK2[�\#��""dist/switchery.cssnu�[���/* * * Main stylesheet for Switchery. * http://abpetkov.github.io/switchery/ * */ /* Switchery defaults. */ .switchery { background-color: #fff; border: 1px solid #dfdfdf; border-radius: 20px; cursor: pointer; display: inline-block; height: 30px; position: relative; vertical-align: middle; width: 50px; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; box-sizing: content-box; background-clip: content-box; } .switchery > small { background: #fff; border-radius: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); height: 30px; position: absolute; top: 0; width: 30px; } /* Switchery sizes. */ .switchery-small { border-radius: 20px; height: 20px; width: 33px; } .switchery-small > small { height: 20px; width: 20px; } .switchery-large { border-radius: 40px; height: 40px; width: 66px; } .switchery-large > small { height: 40px; width: 40px; } PK2[�\��ӢRRMakefilenu�[���# # Variables # NAME = Switchery # # Paths # COMPONENT_BUILD = node_modules/.bin/component-build COMPONENT_INSTALL = node_modules/.bin/component-install UGLIFYJS = node_modules/uglify-js/bin/uglifyjs UGLIFYCSS = node_modules/uglifycss/uglifycss JS_DEST = dist/switchery.js JS_MIN_DEST = dist/switchery.min.js CSS_DEST = dist/switchery.css CSS_MIN_DEST = dist/switchery.min.css # # All # all: install # # Install # install: node_modules components build # # Make a new development build # build: components switchery.js switchery.css @$(COMPONENT_BUILD) --dev # # Install components (+ dev) # components: component.json @$(COMPONENT_INSTALL) --dev # # Make a standalone version that doesn't depend on component etc. # standalone: build components @$(COMPONENT_BUILD) -s $(NAME) -o . @mv build.js $(JS_DEST) @mv build.css $(CSS_DEST) @$(UGLIFYJS) $(JS_DEST) --output $(JS_MIN_DEST) @$(UGLIFYCSS) $(CSS_DEST) > $(CSS_MIN_DEST) # # Install Node.js modules # node_modules: @npm install # # Clean all # clean: clean-components clean-node # # Clean components & build # clean-components: @rm -rf build @rm -rf components # # Clean the installed Node.js modules # clean-node: @rm -rf node_modules # # Instructions # .PHONY: clean build components PK2[�\ S�MM .npmignorenu�[���.DS_STORE build/ components/ bower_components/ node_modules/ test.html PK2[�\U+)��meteor/export.jsnu�[���/*global Switchery:true*/ // Meteor creates a file-scope global for exporting. This comment prevents a potential JSHint warning. Switchery = window.Switchery; delete window.Switchery;PK2[�\<���meteor/tests.jsnu�[���'use strict'; Tinytest.add('Switchery integration', function (test) { var checkbox = document.createElement('input'); checkbox.className = 'js-switch'; var switchy = new Switchery(checkbox); test.instanceOf(switchy, Switchery, 'instantiation OK'); });PK2[�\۵N�.idea/modules.xmlnu�[���<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/switchery.iml" filepath="$PROJECT_DIR$/.idea/switchery.iml" /> </modules> </component> </project>PK2[�\S�M���.idea/switchery.imlnu�[���<?xml version="1.0" encoding="UTF-8"?> <module type="WEB_MODULE" version="4"> <component name="NewModuleRootManager"> <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.tmp" /> <excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/tmp" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module>PK2[�\ud|�4=4=.idea/workspace.xmlnu�[���<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="0d206b09-9d0b-4f93-ac89-cd91523e247b" name="Default" comment=""> <change beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" /> </list> <ignored path="$PROJECT_DIR$/.tmp/" /> <ignored path="$PROJECT_DIR$/temp/" /> <ignored path="$PROJECT_DIR$/tmp/" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="TRACKING_ENABLED" value="true" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="FileEditorManager"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <file leaf-file-name="switchery.js" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="-423"> <caret line="3" column="2" lean-forward="false" selection-start-line="3" selection-start-column="2" selection-end-line="3" selection-end-column="2" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="package.json" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="171"> <caret line="9" column="21" lean-forward="false" selection-start-line="9" selection-start-column="21" selection-end-line="9" selection-end-column="21" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="Makefile" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/Makefile"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="293"> <caret line="51" column="26" lean-forward="false" selection-start-line="51" selection-start-column="19" selection-end-line="51" selection-end-column="26" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="package.js" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/package.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="switchery.js" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/dist/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="73"> <caret line="4" column="12" lean-forward="false" selection-start-line="4" selection-start-column="12" selection-end-line="4" selection-end-column="12" /> <folding> <marker date="1519737588729" expanded="true" signature="13:1510" ph="{...}" /> </folding> </state> </provider> </entry> </file> </leaf> </component> <component name="FindInProjectRecents"> <findStrings> <find>handleclick</find> <find>JS_DEST</find> </findStrings> </component> <component name="Git.Settings"> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> </component> <component name="IdeDocumentHistory"> <option name="CHANGED_PATHS"> <list> <option value="$PROJECT_DIR$/switchery.js" /> <option value="$PROJECT_DIR$/dist/switchery.js" /> <option value="$PROJECT_DIR$/package.json" /> </list> </option> </component> <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" /> <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" /> <component name="JsGulpfileManager"> <detection-done>true</detection-done> <sorting>DEFINITION_ORDER</sorting> </component> <component name="NodeModulesDirectoryManager"> <handled-path value="$PROJECT_DIR$/node_modules" /> </component> <component name="ProjectFrameBounds" extendedState="6" fullScreen="true"> <option name="width" value="1440" /> <option name="height" value="900" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> <flattenPackages /> <showMembers /> <showModules /> <showLibraryContents /> <hideEmptyPackages /> <abbreviatePackageNames /> <autoscrollToSource /> <autoscrollFromSource /> <sortByType /> <manualOrder /> <foldersAlwaysOnTop value="true" /> </navigator> <panes> <pane id="Scratches" /> <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <expand> <path> <item name="switchery" type="b2602c69:ProjectViewProjectNode" /> <item name="switchery" type="462c0819:PsiDirectoryNode" /> </path> <path> <item name="switchery" type="b2602c69:ProjectViewProjectNode" /> <item name="switchery" type="462c0819:PsiDirectoryNode" /> <item name="dist" type="462c0819:PsiDirectoryNode" /> </path> </expand> <select /> </subPane> </pane> </panes> </component> <component name="PropertiesComponent"> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="HbShouldOpenHtmlAsHb" value="" /> </component> <component name="RunDashboard"> <option name="ruleStates"> <list> <RuleState> <option name="name" value="ConfigurationTypeDashboardGroupingRule" /> </RuleState> <RuleState> <option name="name" value="StatusDashboardGroupingRule" /> </RuleState> </list> </option> </component> <component name="ShelveChangesManager" show_recycled="false"> <option name="remove_strategy" value="false" /> </component> <component name="SvnConfiguration"> <configuration /> </component> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="0d206b09-9d0b-4f93-ac89-cd91523e247b" name="Default" comment="" /> <created>1519733549081</created> <option name="number" value="Default" /> <option name="presentableId" value="Default" /> <updated>1519733549081</updated> <workItem from="1519733550620" duration="118000" /> <workItem from="1519737379932" duration="292000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> <option name="totallyTimeSpent" value="410000" /> </component> <component name="ToolWindowManager"> <frame x="0" y="0" width="1440" height="900" extended-state="6" /> <editor active="true" /> <layout> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> </layout> </component> <component name="TypeScriptGeneratedFilesManager"> <option name="version" value="1" /> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> </component> <component name="XDebuggerManager"> <breakpoint-manager /> <watches-manager /> </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="37202"> <caret line="1958" column="0" lean-forward="true" selection-start-line="1958" selection-start-column="0" selection-end-line="1958" selection-end-column="0" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/dist/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="37202"> <caret line="1958" column="0" lean-forward="true" selection-start-line="1958" selection-start-column="0" selection-end-line="1958" selection-end-column="0" /> <folding> <marker date="1519737588729" expanded="true" signature="13:1510" ph="{...}" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="209"> <caret line="11" column="11" lean-forward="true" selection-start-line="11" selection-start-column="11" selection-end-line="11" selection-end-column="11" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/dist/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="73"> <caret line="4" column="12" lean-forward="false" selection-start-line="4" selection-start-column="12" selection-end-line="4" selection-end-column="12" /> <folding> <marker date="1519737588729" expanded="true" signature="13:1510" ph="{...}" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/switchery.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="-423"> <caret line="3" column="2" lean-forward="false" selection-start-line="3" selection-start-column="2" selection-end-line="3" selection-end-column="2" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/Makefile"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="293"> <caret line="51" column="26" lean-forward="false" selection-start-line="51" selection-start-column="19" selection-end-line="51" selection-end-column="26" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="171"> <caret line="9" column="21" lean-forward="false" selection-start-line="9" selection-start-column="21" selection-end-line="9" selection-end-column="21" /> <folding /> </state> </provider> </entry> </component> </project>PK2[�\4;�A�� .idea/vcs.xmlnu�[���<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="VcsDirectoryMappings"> <mapping directory="$PROJECT_DIR$" vcs="Git" /> </component> </project>PK2[�\[�]�;#;# README.mdnu�[��� ## Description Switchery is a simple component that helps you turn your default HTML checkbox inputs into beautiful iOS 7 style switches in just few simple steps. You can easily customize switches, so that they match your design perfectly. Supported by all modern browsers: Chrome, Firefox, Opera, Safari, IE8+  [Live Preview](http://abpetkov.github.io/switchery/) ## Installation ##### Standalone: ```html <link rel="stylesheet" href="dist/switchery.css" /> <script src="dist/switchery.js"></script> ``` ##### Component: ```shell $ component install abpetkov/switchery ``` ##### Bower: ```shell $ bower install switchery ``` ##### Rails To use Switchery in your rails app, add this to your Gemfile: ```rails gem 'switchery-rails' ``` Or go to [Switchery Rails gem page](https://rubygems.org/gems/switchery-rails) for more info, documentation and instructions. ##### Angular JS For thorough installation and usage instructions on how to use Switchery with Angular JS, check out this repo: [servergrove/NgSwitchery](https://github.com/servergrove/NgSwitchery) ##### Meteor You can install Switchery to your Meteor.js app via: ```shell $ meteor add abpetkov:switchery ``` [Switchery on Atmosphere](https://atmospherejs.com/abpetkov/switchery) ## Usage ```js var elem = document.querySelector('.js-switch'); var init = new Switchery(elem); ``` Use the above for the standalone version. ## Settings and Defaults ```js defaults = { color : '#64bd63' , secondaryColor : '#dfdfdf' , jackColor : '#fff' , jackSecondaryColor: null , className : 'switchery' , disabled : false , disabledOpacity : 0.5 , speed : '0.4s' , size : 'default' }; ``` - `color` : color of the switch element (HEX or RGB value) - `secondaryColor` : secondary color for background color and border, when the switch is off - `jackColor` : default color of the jack/handle element - `jackSecondaryColor` : color of unchecked jack/handle element - `className` : class name for the switch element (by default styled in switchery.css) - `disabled` : enable or disable click events and changing the state of the switch (boolean value) - `disabledOpacity` : opacity of the switch when it's disabled (0 to 1) - `speed` : length of time that the transition will take, ex. '0.4s', '1s', '2.2s' (Note: transition speed of the handle is twice shorter) - `size` : size of the switch element (small or large) ## API ##### .destroy() Unbinding all event handlers attached to the switch element to prepare the object for garbage collection. ##### .enable() Enable disabled switch by re-adding event handlers and changing the opacity to 1. ##### .disable() Disable switch by unbinding attached events and changing opacity to `disabledOpacity` value. ##### .isDisabled() Check if switch is currently disabled by checking the `readonly` and `disabled` attributes on the checkbox and the `disabled` option set via JS. If any of those are present, the returned value is `true`. ## Examples ##### Checked Only thing you need is to add a `checked` attribute to your checkbox input. Simple as that. ```html <input type="checkbox" class="js-switch" checked /> ``` ##### Multiple switches You can add as many switches as you like, as long as their corresponding checkboxes have the same class. Select them and make new instance of the Switchery class for every of them. ```js var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch')); elems.forEach(function(html) { var switchery = new Switchery(html); }); ```  ##### Multiple calls You can filter out existing elements that have already been called by looking for `data-switchery="true"`. ##### Disabled Use the `disabled` option to make your switch active or inactive. ```js var switchery = new Switchery(elem, { disabled: true }); ``` Customize the default opacity of the disabled switch, using the `disabledOpacity` option. ```js var switchery = new Switchery(elem, { disabled: true, disabledOpacity: 0.75 }); ``` Adding `disabled` or `readonly` attribute to the native input element will result in the switch being disabled as well. ##### Colored You can change the primary(on) and secondary(off) color of the switch to fit your design perfectly. Accomplish this, changing the `color` and `secondaryColor` options. The jack colors are also customizable via the `jackColor` and the `jackSecondaryColor` options. Below is a good example of what you can accomplish using those. ```js var switchery = new Switchery(elem, { color: '#7c8bc7', jackColor: '#9decff' }); ```  or ```js var switchery = new Switchery(elem, { color: '#faab43', secondaryColor: '#fC73d0', jackColor: '#fcf45e', jackSecondaryColor: '#c8ff77' }); ```  Any other changes regarding colors you want to make, should take place in `switchery.css`. ##### Sizes Since version 0.7.0 you can change the sizes of the switch element via `size`. Giving it a value of `small` or `large` will result in adding `switchery-small` or `switchery-large` classes respectively, which will change the switch size. Not using this property will render the default sized switch element. ```js var switchery = new Switchery(elem, { size: 'small' }); // ... or var switchery = new Switchery(elem, { size: 'large' }); ```  ##### Checking state In many cases, you'll need to have the current state of the checkbox, checked or not. I'll demostrate how to do this in the two most common situations - getting the state on click and on change. On click: ```js var clickCheckbox = document.querySelector('.js-check-click') , clickButton = document.querySelector('.js-check-click-button'); clickButton.addEventListener('click', function() { alert(clickCheckbox.checked); }); ``` On change: ```js var changeCheckbox = document.querySelector('.js-check-change'); changeCheckbox.onchange = function() { alert(changeCheckbox.checked); }; ``` ##### Legacy browsers If you are an adventurer and like to support legacy browsers, like IE8 and IE7, apply your favourite fix for rounded corners and box shadows and try a slightly different approach. ```js var elems = document.querySelectorAll('.js-switch'); for (var i = 0; i < elems.length; i++) { var switchery = new Switchery(elems[i]); } ``` Personally I recommend using [CSS3 PIE](http://css3pie.com/). For working example you can check out the demo page. ## Development If you've decided to go in development mode and tweak all of this a bit, there are few things you should do. After you clone the repository, do this in your terminal ([NPM](http://npmjs.org/) required): ```shell $ npm install ``` Add the following code before the rest: ```js var Switchery = require('switchery'); ``` Make sure you're using the `build/build.js` and `build/build.css` files and you're ready. There are some useful commands you can use. `$ make install` - will install Node.js modules, components etc. `$ make build` - will create a build file `$ make standalone` - will create a standalone and minified files ## Credits Big thanks to: - [Veselin Todorov](https://github.com/vesln) ## Contact If you like this component, share your appreciation by following me in [Twitter](https://twitter.com/abpetkov), [GitHub](https://github.com/abpetkov) or [Dribbble](http://dribbble.com/apetkov). ## License The MIT License (MIT) Copyright (c) 2013-2015 Alexander Petkov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK2[�\�$ﭐ� switchery.cssnu�[���/* * * Main stylesheet for Switchery. * http://abpetkov.github.io/switchery/ * */ /* Switchery defaults. */ .switchery { background-color: #fff; border: 1px solid #dfdfdf; border-radius: 20px; cursor: pointer; display: inline-block; height: 30px; position: relative; vertical-align: middle; width: 50px; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-background-clip: content-box; background-clip: content-box; } .switchery > small { background: #fff; border-radius: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); height: 30px; position: absolute; top: 0; width: 30px; } /* Switchery sizes. */ .switchery-small { border-radius: 20px; height: 20px; width: 33px; } .switchery-small > small { height: 20px; width: 20px; } .switchery-large { border-radius: 40px; height: 40px; width: 66px; } .switchery-large > small { height: 40px; width: 40px; } PK2[�\/}�� bower.jsonnu�[���{ "name": "switchery", "main": [ "dist/switchery.js", "dist/switchery.css" ], "version": "0.8.2", "homepage": "http://abpetkov.github.io/switchery/", "author": [ "Alexander Petkov <abpetkov@gmail.com> (https://github.com/abpetkov)" ], "description": "Component to create iOS 7 styled switches from default input checkboxes", "keywords": [ "checkbox", "input", "switch", "iOS7" ], "license": "MIT", "ignore": [ "build", "components", "node_modules", "bower_components", "component.json", "Makefile", "README.md", ".*" ], "dependencies": { "transitionize": "*", "fastclick": "v0.6.11" }, "devDependencies": {} } PK2[�\�,����CHANGELOG.mdnu�[��� 0.8.2 / 2016-10-31 ================== * Adding semicolon to the end of the distribuition file * Check switchery element state before changing it 0.8.1 / 2015-06-26 ================== * Check disabled values properly, because of `.isDisabled()` method returning improper value 0.8.0 / 2015-04-03 ================== * Secondary jack color functionality * Enable/disable switch dynamically * Destroy event handlers attached to a Switchery instance * Meteor.js integration 0.7.0 / 2014-12-09 ================== * Respect `readonly` attribute on checkbox input * Large and small size switches 0.6.3 / 2014-11-02 ================== * Update component version * Added separate Jack color option * Add the CSS file to bower.json * Fix bug in Hongmi phone * Fixing issue found in IE9+ with change event dispatch 0.6.2 / 2014-08-22 ================== * Prevent text selection on double click 0.6.1 / 2014-07-11 ================== * Fix switch click state when inside label 0.6.0 / 2014-05-22 ================== * Corresponding label with `for` attribute of the native input, to change switch state as well * Do not copy input's `id` and `name` attributes to switch 0.5.5 / 2014-05-14 ================== * Set secondary color to be background color on switch off state 0.5.4 / 2014-04-29 ================== * Fix box-sizing when using Bootstrap 3 0.5.3 / 2014-04-12 ================== * Detect native checkbox state change 0.5.2 / 2014-04-03 ================== * Enable event bubbles 0.5.1 / 2014-03-22 ================== * Fix jack position when switch is hidden 0.5.0 / 2014-02-07 ================== * Removes the internal validation for loaded switches and lets people do it on their own * Sets a data attribute to handle multiple calls for a checkbox 0.4.2 / 2014-01-24 ================== * Resolve property method issues in IE * Disable label checkbox change event * Check if element is null 0.4.1 / 2014-01-18 ================== * Fix Event errors in IE8 0.4.0 / 2014-01-15 ================== * Use ftlabs/fastclick for mobile browser optimization 0.3.6 / 2014-01-04 ================== * Generate new standalone file * Refactor code * Use event constructors to create onchange and click events * Updated standalone to dist in bower.json * Required files * Add development info 0.3.5 / 2013-12-31 ================== * Proper checkbox value with onchange event 0.3.4 / 2013-12-31 ================== * Merge ni-c:master * Refactor onchange 0.3.3 / 2013-12-28 ================== * Merge pull request from tenbits:patch-1 * Leave first line empty * Undefined option's property * Update Readme * Update standalone * Changelog * Standalone -> dist, update Readme, add changelog 0.3.2 / 2013-12-27 ================== * Standalone -> dist, update Readme, add changelog * Merge pull request from vesln:min * Add minified versions * Minify CSS & JS * Fix the standalone build & improve Makefile * Ignore node_modules * Add package.json * Disabled opacity option * Disabled opacity option * Insert switch after target element * Require Transitionize PK2[�\�,��##switchery.jsnu�[���PK2[�\I�U� Q#package.jsnu�[���PK2[�\��� 'package.jsonnu�[���PK2[�\,¯DDH-component.jsonnu�[���PK2[�\��������/dist/switchery.jsnu�[���PK2[�\q"P[&`&`�dist/switchery.min.jsnu�[���PK2[�\* ���nVdist/switchery.min.cssnu�[���PK2[�\#��""^Ydist/switchery.cssnu�[���PK2[�\��ӢRR�]Makefilenu�[���PK2[�\ S�MM Lc.npmignorenu�[���PK2[�\U+)���cmeteor/export.jsnu�[���PK2[�\<����dmeteor/tests.jsnu�[���PK2[�\۵N�"f.idea/modules.xmlnu�[���PK2[�\S�M���xg.idea/switchery.imlnu�[���PK2[�\ud|�4=4=�i.idea/workspace.xmlnu�[���PK2[�\4;�A�� �.idea/vcs.xmlnu�[���PK2[�\[�]�;#;# ��README.mdnu�[���PK2[�\�$ﭐ� q�switchery.cssnu�[���PK2[�\/}�� >�bower.jsonnu�[���PK2[�\�,����a�CHANGELOG.mdnu�[���PK��
/home/emeraadmin/.caldav/./../www/node_modules/array-each/../../4d695/mohithg-switchery.zip