PageSourceSearch

https://www.ilincs.org/ilincs/vendor/angular-bootstrap-toggle/dist/angular-bootstrap-toggle.min.js

js ilincs.org collected 2026-09-28 05:50:40 UTC 2,801 bytes, 1 lines download raw bytes

1!function(){"use strict";angular.module("ui.toggle",[]).value("$toggleSuppressError",!1).constant("toggleConfig",{btnCheckboxFalse:!1,btnCheckboxTrue:!0,on:"On",off:"Off",size:"",onstyle:"btn-primary",offstyle:"btn-default",toggleStyle:"",width:"",height:"",disabled:!1}).controller("ToggleController",["$scope","$attrs","$interpolate","$log","toggleConfig","$toggleSuppressError",function(e,t,l,n,a,s){var o,i,r,g=this,f={$setViewValue:angular.noop},c=Object.keys(a);angular.forEach(c,function(n,s){if(angular.isDefined(t[n]))switch(typeof a[n]){case"string":g[n]=l(t[n])(e.$parent);break;case"function":break;default:g[n]=e.$parent.$eval(t[n])}else g[n]=a[n]}),this.init=function(l){f=l,o=g.element.find("label"),i=g.element.find("span"),r=g.element.find("div"),angular.element(o[0]).html(g.on),angular.element(o[1]).html(g.off),g.computeStyle(),f.$render=function(){g.toggle()},angular.isDefined(t.ngChange)&&f.$viewChangeListeners.push(function(){e.$eval(t.ngChange)})},this.computeStyle=function(){if(angular.element(o[0]).attr("disabled",g.disabled),angular.element(o[1]).attr("disabled",g.disabled),angular.element(i[0]).attr("disabled",g.disabled),e.wrapperStyle=g.toggleStyle?e.$parent.$eval(g.toggleStyle):{},g.width)e.wrapperStyle.width=g.width;else{var t=Math.max(o[0].offsetWidth,o[1].offsetWidth),l=r[0].offsetWidth;e.wrapperStyle.width=l<t?t+"px":l+"px"}if(g.height)e.wrapperStyle.height=g.height;else{var n=Math.max(o[0].offsetHeight,o[1].offsetHeight),a=r[1].offsetHeight;a<n&&"btn-xs"!==g.size&&"btn-sm"!==g.size?e.wrapperStyle.height=n+"px":e.wrapperStyle.height=a+"px"}e.onClass=[g.onstyle,g.size,"toggle-on"],e.offClass=[g.offstyle,g.size,"toggle-off"],e.handleClass=[g.size,"toggle-handle"]},this.toggle=function(){angular.isDefined(f.$viewValue)&&f.$viewValue?e.wrapperClass=[g.onstyle,g.size,g.style]:e.wrapperClass=[g.offstyle,"off ",g.size,g.style]},e.onSwitch=function(e){return!g.disabled&&(f.$setViewValue(!f.$viewValue),f.$render(),!0)},angular.forEach(["ngModel"],function(l){var n=e.$parent.$watch(t[l],function(e){f.$render()});e.$parent.$on("$destroy",function(){n()})}),angular.forEach(c,function(e,l){t.$observe(e,function(t){g[e]!==t&&(g[e]=t,g.computeStyle())})})}]).directive("toggle",function(){return{restrict:"E",transclude:!0,template:'<div class="toggle btn" ng-class="wrapperClass" ng-style="wrapperStyle" ng-click="onSwitch($event)"><div class="toggle-group"><label class="btn" ng-class="onClass"></label><label class="btn active" ng-class="offClass"></label><span class="btn btn-default" ng-class="handleClass"></span></div></div>',scope:{ngModel:"="},require:["toggle","ngModel"],controller:"ToggleController",controllerAs:"toggle",compile:function(e,t,l){return{pre:function(e,t,l,n){var a=n[0],s=n[1];a.element=t,a.init(s)},post:function(){}}}}})}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.