diff --git a/dist/ng-accessibility-bar.js b/dist/ng-accessibility-bar.js index 6ceb336..7ed6fbf 100644 --- a/dist/ng-accessibility-bar.js +++ b/dist/ng-accessibility-bar.js @@ -1,2 +1,2 @@ -!function(){"use strict";angular.module("ng-accessibility-bar",[])}(),function(){"use strict";function t(){return{templateUrl:"ng-accessibility-bar.template.html",controller:i,controllerAs:"vm",bindings:{contrast:"<",contrastClass:"@",fontAdjust:"<",fontAdjustMaxSize:"<",fontAdjustMinSize:"<",fontAdjustIncrementRate:"<",libras:"<",title:"@"}}}function i(){function t(){i(),n(r.config)}function i(){r.config={contrast:{"class":r.contrastClass||"color-inverter",visibility:r.contrast!==!1},fontAdjust:{incrementRate:r.fontAdjustIncrementRate||2,maxSize:r.fontAdjustMaxSize||20,minSize:r.fontAdjustMinSize||16,visibility:r.fontAdjust!==!1},libras:{visibility:r.libras!==!1},title:r.title||"Acessibilidade:"}}function s(t,i){var s=document.querySelector(t);s.classList.contains(i)?s.classList.remove(i):s.classList.add(i)}function n(t){"true"===localStorage.getItem("accessibility-contrast")&&t.contrast.visibility&&l(t)}function e(){var t=window.getComputedStyle(document.body).getPropertyValue("font-size");return t=t.replace(/\D/g,""),t=+t}function c(t){var i,s=document.querySelector("html");i="-"===t?u>r.config.fontAdjust.minSize:uhandcontrast
{{ vm.config.title }}
')}]); +!function(){"use strict";angular.module("ng-accessibility-bar",[])}(),function(){"use strict";function t(){return{templateUrl:"ng-accessibility-bar.template.html",controller:i,controllerAs:"vm",bindings:{contrast:"<",contrastClass:"@",fontAdjust:"<",fontAdjustMaxSize:"<",fontAdjustMinSize:"<",fontAdjustIncrementRate:"<",libras:"<",title:"@"}}}function i(){function t(){i(),n(r.config)}function i(){r.config={contrast:{"class":r.contrastClass||"color-inverter",visibility:r.contrast!==!1},fontAdjust:{incrementRate:r.fontAdjustIncrementRate||2,maxSize:r.fontAdjustMaxSize||20,minSize:r.fontAdjustMinSize||16,visibility:r.fontAdjust!==!1},libras:{visibility:r.libras!==!1},title:r.title||"Acessibilidade:"}}function s(t,i){var s=document.querySelector(t);s.classList.contains(i)?s.classList.remove(i):s.classList.add(i)}function n(t){"true"===localStorage.getItem("accessibility-contrast")&&t.contrast.visibility&&l(t)}function e(){var t=window.getComputedStyle(document.documentElement).getPropertyValue("font-size");return t=t.replace(/\D/g,""),t=+t}function c(t){var i,s=document.querySelector("html");i="-"===t?u>r.config.fontAdjust.minSize:uhandcontrast
{{ vm.config.title }}
')}]); //# sourceMappingURL=ng-accessibility-bar.js.map diff --git a/dist/ng-accessibility-bar.js.map b/dist/ng-accessibility-bar.js.map index 0ebeab2..4cb42e3 100644 --- a/dist/ng-accessibility-bar.js.map +++ b/dist/ng-accessibility-bar.js.map @@ -1 +1 @@ -{"version":3,"sources":["ng-accessibility-bar.module.js","ng-accessibility-bar.component.js","ng-accessibility-bar.templates.js"],"names":["angular","module","AccessibilityBar","templateUrl","controller","AccessibilityBarComponentController","controllerAs","bindings","contrast","contrastClass","fontAdjust","fontAdjustMaxSize","fontAdjustMinSize","fontAdjustIncrementRate","libras","title","onInit","_setDefaultValues","_verifyContrast","vm","config","class","visibility","incrementRate","maxSize","minSize","_toggleClass","element","classe","$element","document","querySelector","classList","contains","remove","add","localStorage","getItem","setContrast","_getDefaultWindowFontSize","fontSize","window","getComputedStyle","body","getPropertyValue","replace","_adjustFontSize","operator","isInFontSizeLimit","$html","defaultFontSize","setAttribute","increaseFontSize","decreaseFontSize","$body","setItem","this","$onInit","component","run","$templateCache","put"],"mappings":"CAAA,WACA,YAEAA,SACAC,OAAA,8BCJA,WACA,YAKA,SAAAC,KACA,OACAC,YAAA,qCACAC,WAAAC,EACAC,aAAA,KACAC,UACAC,SAAA,IACAC,cAAA,IACAC,WAAA,IACAC,kBAAA,IACAC,kBAAA,IACAC,wBAAA,IACAC,OAAA,IACAC,MAAA,MAMA,QAAAV,KAWA,QAAAW,KACAC,IACAC,EAAAC,EAAAC,QAGA,QAAAH,KACAE,EAAAC,QACAZ,UACAa,QAAA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AA,EA/BAtC,QAAAC,OAAA,wBACAyD,UAAA,qBAAAxD,QCJAF,QAAAC,OAAA,wBAAA0D,KAAA,iBAAA,SAAAC,GAAAA,EAAAC,IAAA,qCAAA","file":"ng-accessibility-bar.js","sourcesContent":["(function() {\r\n 'use strict';\r\n\r\n angular\r\n .module('ng-accessibility-bar', []);\r\n}());\r\n","(function() {\r\n 'use strict';\r\n\r\n angular.module('ng-accessibility-bar')\r\n .component('ngAccessibilityBar', AccessibilityBar());\r\n\r\n function AccessibilityBar() {\r\n return {\r\n templateUrl: 'ng-accessibility-bar.template.html',\r\n controller: AccessibilityBarComponentController,\r\n controllerAs: 'vm',\r\n bindings:{\r\n contrast: '<',\r\n contrastClass: '@',\r\n fontAdjust: '<',\r\n fontAdjustMaxSize: '<',\r\n fontAdjustMinSize: '<',\r\n fontAdjustIncrementRate: '<',\r\n libras: '<',\r\n title: '@',\r\n }\r\n };\r\n }\r\n\r\n /* @ngInject */\r\n function AccessibilityBarComponentController() {\r\n var vm = this,\r\n defaultFontSize = _getDefaultWindowFontSize();\r\n\r\n vm.config = {};\r\n\r\n vm.$onInit = onInit;\r\n vm.decreaseFontSize = decreaseFontSize;\r\n vm.increaseFontSize = increaseFontSize;\r\n vm.setContrast = setContrast;\r\n\r\n function onInit() {\r\n _setDefaultValues();\r\n _verifyContrast(vm.config);\r\n }\r\n\r\n function _setDefaultValues() {\r\n vm.config = {\r\n contrast: {\r\n class: vm.contrastClass || 'color-inverter',\r\n visibility: vm.contrast !== false\r\n },\r\n fontAdjust: {\r\n incrementRate: vm.fontAdjustIncrementRate || 2,\r\n maxSize: vm.fontAdjustMaxSize || 20,\r\n minSize: vm.fontAdjustMinSize || 16,\r\n visibility: vm.fontAdjust !== false\r\n },\r\n libras: {\r\n visibility: vm.libras !== false\r\n },\r\n title: vm.title || 'Acessibilidade:'\r\n };\r\n }\r\n\r\n function _toggleClass(element, classe) {\r\n var $element = document.querySelector(element);\r\n\r\n if ($element.classList.contains(classe)) {\r\n $element.classList.remove(classe);\r\n } else {\r\n $element.classList.add(classe);\r\n }\r\n }\r\n\r\n function _verifyContrast(config) {\r\n if (localStorage.getItem('accessibility-contrast') === 'true' && config.contrast.visibility) {\r\n setContrast(config);\r\n }\r\n }\r\n\r\n function _getDefaultWindowFontSize() {\r\n var fontSize = window.getComputedStyle(document.body).getPropertyValue('font-size');\r\n fontSize = fontSize.replace(/\\D/g, '');\r\n fontSize = +fontSize;\r\n\r\n return fontSize;\r\n }\r\n\r\n function _adjustFontSize(operator) {\r\n var $html = document.querySelector('html'),\r\n isInFontSizeLimit;\r\n\r\n if (operator === '-') {\r\n isInFontSizeLimit = defaultFontSize > vm.config.fontAdjust.minSize;\r\n } else {\r\n isInFontSizeLimit = defaultFontSize < vm.config.fontAdjust.maxSize;\r\n }\r\n\r\n if (isInFontSizeLimit) {\r\n operator === '+' ? defaultFontSize += vm.config.fontAdjust.incrementRate : defaultFontSize -= vm.config.fontAdjust.incrementRate;\r\n $html.setAttribute('style', 'font-size: ' + defaultFontSize + 'px;');\r\n }\r\n }\r\n\r\n function increaseFontSize() {\r\n _adjustFontSize('+');\r\n }\r\n\r\n function decreaseFontSize() {\r\n _adjustFontSize('-');\r\n }\r\n\r\n function setContrast(config) {\r\n var $body = document.querySelector('body');\r\n\r\n _toggleClass('body', config.contrast.class);\r\n\r\n localStorage.setItem('accessibility-contrast', $body.classList.contains(config.contrast.class));\r\n }\r\n }\r\n})();\r\n","angular.module('ng-accessibility-bar').run(['$templateCache', function($templateCache) {$templateCache.put('ng-accessibility-bar.template.html','handcontrast
{{ vm.config.title }}
');}]);"]} \ No newline at end of file +{"version":3,"sources":["ng-accessibility-bar.module.js","ng-accessibility-bar.component.js","ng-accessibility-bar.templates.js"],"names":["angular","module","AccessibilityBar","templateUrl","controller","AccessibilityBarComponentController","controllerAs","bindings","contrast","contrastClass","fontAdjust","fontAdjustMaxSize","fontAdjustMinSize","fontAdjustIncrementRate","libras","title","onInit","_setDefaultValues","_verifyContrast","vm","config","class","visibility","incrementRate","maxSize","minSize","_toggleClass","element","classe","$element","document","querySelector","classList","contains","remove","add","localStorage","getItem","setContrast","_getDefaultWindowFontSize","fontSize","window","getComputedStyle","documentElement","getPropertyValue","replace","_adjustFontSize","operator","isInFontSizeLimit","$html","defaultFontSize","setAttribute","increaseFontSize","decreaseFontSize","$body","setItem","this","$onInit","component","run","$templateCache","put"],"mappings":"CAAA,WACA,YAEAA,SACAC,OAAA,8BCJA,WACA,YAKA,SAAAC,KACA,OACAC,YAAA,qCACAC,WAAAC,EACAC,aAAA,KACAC,UACAC,SAAA,IACAC,cAAA,IACAC,WAAA,IACAC,kBAAA,IACAC,kBAAA,IACAC,wBAAA,IACAC,OAAA,IACAC,MAAA,MAMA,QAAAV,KAWA,QAAAW,KACAC,IACAC,EAAAC,EAAAC,QAGA,QAAAH,KACAE,EAAAC,QACAZ,UACAa,QAAAF,EAAAV,eAAA,iBACAa,WAAAH,EAAAX,YAAA,GAEAE,YACAa,cAAAJ,EAAAN,yBAAA,EACAW,QAAAL,EAAAR,mBAAA,GACAc,QAAAN,EAAAP,mBAAA,GACAU,WAAAH,EAAAT,cAAA,GAEAI,QACAQ,WAAAH,EAAAL,UAAA,GAEAC,MAAAI,EAAAJ,OAAA,mBAIA,QAAAW,GAAAC,EAAAC,GACA,GAAAC,GAAAC,SAAAC,cAAAJ,EAEAE,GAAAG,UAAAC,SAAAL,GACAC,EAAAG,UAAAE,OAAAN,GAEAC,EAAAG,UAAAG,IAAAP,GAIA,QAAAV,GAAAE,GACA,SAAAgB,aAAAC,QAAA,2BAAAjB,EAAAZ,SAAAc,YACAgB,EAAAlB,GAIA,QAAAmB,KACA,GAAAC,GAAAC,OAAAC,iBAAAZ,SAAAa,iBAAAC,iBAAA,YAIA,OAHAJ,GAAAA,EAAAK,QAAA,MAAA,IACAL,GAAAA,EAKA,QAAAM,GAAAC,GACA,GACAC,GADAC,EAAAnB,SAAAC,cAAA,OAIAiB,GADA,MAAAD,EACAG,EAAA/B,EAAAC,OAAAV,WAAAe,QAEAyB,EAAA/B,EAAAC,OAAAV,WAAAc,QAGAwB,IACA,MAAAD,EAAAG,GAAA/B,EAAAC,OAAAV,WAAAa,cAAA2B,GAAA/B,EAAAC,OAAAV,WAAAa,cACA0B,EAAAE,aAAA,QAAA,cAAAD,EAAA,QAIA,QAAAE,KACAN,EAAA,KAGA,QAAAO,KACAP,EAAA,KAGA,QAAAR,GAAAlB,GACA,GAAAkC,GAAAxB,SAAAC,cAAA,OAEAL,GAAA,OAAAN,EAAAZ,SAAAY,UAEAgB,aAAAmB,QAAA,yBAAAD,EAAAtB,UAAAC,SAAAb,EAAAZ,SAAAY,WAvFA,GAAAD,GAAAqC,KACAN,EAAAX,GAEApB,GAAAC,UAEAD,EAAAsC,QAAAzC,EACAG,EAAAkC,iBAAAA,EACAlC,EAAAiC,iBAAAA,EACAjC,EAAAmB,YAAAA,EA/BAtC,QAAAC,OAAA,wBACAyD,UAAA,qBAAAxD,QCJAF,QAAAC,OAAA,wBAAA0D,KAAA,iBAAA,SAAAC,GAAAA,EAAAC,IAAA,qCAAA","file":"ng-accessibility-bar.js","sourcesContent":["(function() {\r\n 'use strict';\r\n\r\n angular\r\n .module('ng-accessibility-bar', []);\r\n}());\r\n","(function() {\r\n 'use strict';\r\n\r\n angular.module('ng-accessibility-bar')\r\n .component('ngAccessibilityBar', AccessibilityBar());\r\n\r\n function AccessibilityBar() {\r\n return {\r\n templateUrl: 'ng-accessibility-bar.template.html',\r\n controller: AccessibilityBarComponentController,\r\n controllerAs: 'vm',\r\n bindings:{\r\n contrast: '<',\r\n contrastClass: '@',\r\n fontAdjust: '<',\r\n fontAdjustMaxSize: '<',\r\n fontAdjustMinSize: '<',\r\n fontAdjustIncrementRate: '<',\r\n libras: '<',\r\n title: '@',\r\n }\r\n };\r\n }\r\n\r\n /* @ngInject */\r\n function AccessibilityBarComponentController() {\r\n var vm = this,\r\n defaultFontSize = _getDefaultWindowFontSize();\r\n\r\n vm.config = {};\r\n\r\n vm.$onInit = onInit;\r\n vm.decreaseFontSize = decreaseFontSize;\r\n vm.increaseFontSize = increaseFontSize;\r\n vm.setContrast = setContrast;\r\n\r\n function onInit() {\r\n _setDefaultValues();\r\n _verifyContrast(vm.config);\r\n }\r\n\r\n function _setDefaultValues() {\r\n vm.config = {\r\n contrast: {\r\n class: vm.contrastClass || 'color-inverter',\r\n visibility: vm.contrast !== false\r\n },\r\n fontAdjust: {\r\n incrementRate: vm.fontAdjustIncrementRate || 2,\r\n maxSize: vm.fontAdjustMaxSize || 20,\r\n minSize: vm.fontAdjustMinSize || 16,\r\n visibility: vm.fontAdjust !== false\r\n },\r\n libras: {\r\n visibility: vm.libras !== false\r\n },\r\n title: vm.title || 'Acessibilidade:'\r\n };\r\n }\r\n\r\n function _toggleClass(element, classe) {\r\n var $element = document.querySelector(element);\r\n\r\n if ($element.classList.contains(classe)) {\r\n $element.classList.remove(classe);\r\n } else {\r\n $element.classList.add(classe);\r\n }\r\n }\r\n\r\n function _verifyContrast(config) {\r\n if (localStorage.getItem('accessibility-contrast') === 'true' && config.contrast.visibility) {\r\n setContrast(config);\r\n }\r\n }\r\n\r\n function _getDefaultWindowFontSize() {\r\n var fontSize = window.getComputedStyle(document.documentElement).getPropertyValue('font-size');\r\n fontSize = fontSize.replace(/\\D/g, '');\r\n fontSize = +fontSize;\r\n\r\n return fontSize;\r\n }\r\n\r\n function _adjustFontSize(operator) {\r\n var $html = document.querySelector('html'),\r\n isInFontSizeLimit;\r\n\r\n if (operator === '-') {\r\n isInFontSizeLimit = defaultFontSize > vm.config.fontAdjust.minSize;\r\n } else {\r\n isInFontSizeLimit = defaultFontSize < vm.config.fontAdjust.maxSize;\r\n }\r\n\r\n if (isInFontSizeLimit) {\r\n operator === '+' ? defaultFontSize += vm.config.fontAdjust.incrementRate : defaultFontSize -= vm.config.fontAdjust.incrementRate;\r\n $html.setAttribute('style', 'font-size: ' + defaultFontSize + 'px;');\r\n }\r\n }\r\n\r\n function increaseFontSize() {\r\n _adjustFontSize('+');\r\n }\r\n\r\n function decreaseFontSize() {\r\n _adjustFontSize('-');\r\n }\r\n\r\n function setContrast(config) {\r\n var $body = document.querySelector('body');\r\n\r\n _toggleClass('body', config.contrast.class);\r\n\r\n localStorage.setItem('accessibility-contrast', $body.classList.contains(config.contrast.class));\r\n }\r\n }\r\n})();\r\n","angular.module('ng-accessibility-bar').run(['$templateCache', function($templateCache) {$templateCache.put('ng-accessibility-bar.template.html','handcontrast
{{ vm.config.title }}
');}]);"]} \ No newline at end of file diff --git a/package.json b/package.json index e3ce0a0..18fe7b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-accessibility-bar", - "version": "1.1.3", + "version": "1.1.4", "description": "Accessibility bar component with high contrast, font adjust and libras", "main": "index.js", "scripts": {