(function() { var __slice = [].slice; (function($, window) { "use strict"; var Switch; Switch = (function() { Switch.prototype.defaults = { state: true, size: null, animate: true, disabled: false, readonly: false, onColor: null, offColor: null, onText: "On", offText: "Off", labelText: " " }; Switch.prototype.name = "switch"; function Switch(element, options) { if (options == null) { options = {}; } this.$element = $(element); this.options = $.extend({}, this.defaults, options, { state: this.$element.is(":checked"), size: this.$element.data("size"), animate: this.$element.data("animate"), disabled: this.$element.is(":disabled"), readonly: this.$element.is("[readonly]"), onColor: this.$element.data("on-color"), offColor: this.$element.data("off-color"), onText: this.$element.data("on-text"), offText: this.$element.data("off-text"), labelText: this.$element.data("label-text") }); this.$on = $("", { "class": "" + this.name + "-handle-on " + this.name + "-" + this.options.onColor, html: this.options.onText }); this.$off = $("", { "class": "" + this.name + "-handle-off " + this.name + "-" + this.options.offColor, html: this.options.offText }); this.$label = $("