CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/cgarvis/angular-toggle-switch/master/angular-toggle-switch.min.js
accept-ranges: bytes
age: 0
date: Sat, 26 Jul 2025 01:20:07 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210035-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753492807.600076,VS0,VE1221
vary: Accept-Encoding
x-fastly-request-id: f21ab97c39335f66704c3aeb42c100cd0a83e0f9
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"5bc78f71319c0a105e8e208470f97d58f0b38c1ec25d28a329892a641da06880"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 6017:243198:C71C:43A59:68842D41
content-encoding: gzip
accept-ranges: bytes
date: Sat, 26 Jul 2025 01:20:08 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210041-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753492808.879963,VS0,VE262
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 8e29f0d1f3b7fa984046bb7e92800420d179628a
expires: Sat, 26 Jul 2025 01:25:08 GMT
source-age: 0
content-length: 669
!function(){var module=angular.module("toggle-switch",["ng"]);module.provider("toggleSwitchConfig",[function(){this.onLabel="On",this.offLabel="Off",this.knobLabel=" ";var self=this;this.$get=function(){return{onLabel:self.onLabel,offLabel:self.offLabel,knobLabel:self.knobLabel}}}]),module.directive("toggleSwitch",["toggleSwitchConfig",function(toggleSwitchConfig){return{restrict:"EA",replace:!0,require:"ngModel",scope:{disabled:"@",onLabel:"@",offLabel:"@",knobLabel:"@"},template:'',compile:function(element,attrs){return attrs.onLabel||(attrs.onLabel=toggleSwitchConfig.onLabel),attrs.offLabel||(attrs.offLabel=toggleSwitchConfig.offLabel),attrs.knobLabel||(attrs.knobLabel=toggleSwitchConfig.knobLabel),this.link},link:function(scope,element,attrs,ngModelCtrl){var KEY_SPACE=32;element.on("click",function(){scope.$apply(scope.toggle)}),element.on("keydown",function(e){var key=e.which?e.which:e.keyCode;key===KEY_SPACE&&scope.$apply(scope.toggle)}),ngModelCtrl.$formatters.push(function(modelValue){return modelValue}),ngModelCtrl.$parsers.push(function(viewValue){return viewValue}),ngModelCtrl.$viewChangeListeners.push(function(){scope.$eval(attrs.ngChange)}),ngModelCtrl.$render=function(){scope.model=ngModelCtrl.$viewValue},scope.toggle=function(){scope.disabled||(scope.model=!scope.model,ngModelCtrl.$setViewValue(scope.model))}}}}])}();