From ba989e497ed3fa13d0b27f9bb34ca987dcadf455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinicius=20Lag=C3=AAdo?= Date: Sat, 25 Nov 2017 16:24:44 -0200 Subject: [PATCH] v1.1.3 --- dist/ng-accessibility-bar.js | 2 +- dist/ng-accessibility-bar.js.map | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/ng-accessibility-bar.js b/dist/ng-accessibility-bar.js index 854aeff..6ceb336 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",["ngTouch"])}(),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.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 }}
')}]); //# sourceMappingURL=ng-accessibility-bar.js.map diff --git a/dist/ng-accessibility-bar.js.map b/dist/ng-accessibility-bar.js.map index b761dc7..0ebeab2 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,wBACA,eCLA,WACA,YAKA,SAAAC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,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() {\n 'use strict';\n\n angular\n .module('ng-accessibility-bar', [\n 'ngTouch'\n ]);\n}());\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","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,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,MAAAC,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.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 diff --git a/package.json b/package.json index f31f3cb..e3ce0a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-accessibility-bar", - "version": "1.1.2", + "version": "1.1.3", "description": "Accessibility bar component with high contrast, font adjust and libras", "main": "index.js", "scripts": {