From 7682f1b68c29e891a3929afcf31853661f292dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinicius=20Lag=C3=AAdo?= Date: Tue, 21 Nov 2017 13:19:44 -0200 Subject: [PATCH 1/3] Change component tag with ng prefix --- src/index.html | 2 +- src/ng-accessibility-bar.component.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index 7e46514..b3e3953 100644 --- a/src/index.html +++ b/src/index.html @@ -10,7 +10,7 @@ - + diff --git a/src/ng-accessibility-bar.component.js b/src/ng-accessibility-bar.component.js index 765388a..b74713d 100644 --- a/src/ng-accessibility-bar.component.js +++ b/src/ng-accessibility-bar.component.js @@ -2,7 +2,7 @@ 'use strict'; angular.module('ng-accessibility-bar') - .component('accessibilityBar', AccessibilityBar()); + .component('ngAccessibilityBar', AccessibilityBar()); function AccessibilityBar() { return { From e6dd66f62473ef2bad6d5ba9d71afe233189f99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinicius=20Lag=C3=AAdo?= Date: Tue, 21 Nov 2017 13:19:58 -0200 Subject: [PATCH 2/3] Refresh dist --- dist/ng-accessibility-bar.js | 2 +- dist/ng-accessibility-bar.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/ng-accessibility-bar.js b/dist/ng-accessibility-bar.js index d9bec58..2d17a2c 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",["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 }}
')}]); //# sourceMappingURL=ng-accessibility-bar.js.map diff --git a/dist/ng-accessibility-bar.js.map b/dist/ng-accessibility-bar.js.map index 76ae619..75bf1e7 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,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,mBAAAxD,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() {\n 'use strict';\n\n angular.module('ng-accessibility-bar')\n .component('accessibilityBar', AccessibilityBar());\n\n function AccessibilityBar() {\n return {\n templateUrl: 'ng-accessibility-bar.template.html',\n controller: AccessibilityBarComponentController,\n controllerAs: 'vm',\n bindings:{\n contrast: '<',\n contrastClass: '@',\n fontAdjust: '<',\n fontAdjustMaxSize: '<',\n fontAdjustMinSize: '<',\n fontAdjustIncrementRate: '<',\n libras: '<',\n title: '@',\n }\n };\n }\n\n /* @ngInject */\n function AccessibilityBarComponentController() {\n var vm = this,\n defaultFontSize = _getDefaultWindowFontSize();\n\n vm.config = {};\n\n vm.$onInit = onInit;\n vm.decreaseFontSize = decreaseFontSize;\n vm.increaseFontSize = increaseFontSize;\n vm.setContrast = setContrast;\n\n function onInit() {\n _setDefaultValues();\n _verifyContrast(vm.config);\n }\n\n function _setDefaultValues() {\n vm.config = {\n contrast: {\n class: vm.contrastClass || 'color-inverter',\n visibility: vm.contrast !== false\n },\n fontAdjust: {\n incrementRate: vm.fontAdjustIncrementRate || 2,\n maxSize: vm.fontAdjustMaxSize || 20,\n minSize: vm.fontAdjustMinSize || 16,\n visibility: vm.fontAdjust !== false\n },\n libras: {\n visibility: vm.libras !== false\n },\n title: vm.title || 'Acessibilidade:'\n };\n }\n\n function _toggleClass(element, classe) {\n var $element = document.querySelector(element);\n\n if ($element.classList.contains(classe)) {\n $element.classList.remove(classe);\n } else {\n $element.classList.add(classe);\n }\n }\n\n function _verifyContrast(config) {\n if (localStorage.getItem('accessibility-contrast') === 'true' && config.contrast.visibility) {\n setContrast(config);\n }\n }\n\n function _getDefaultWindowFontSize() {\n var fontSize = window.getComputedStyle(document.body).getPropertyValue('font-size');\n fontSize = fontSize.replace(/\\D/g, '');\n fontSize = +fontSize;\n\n return fontSize;\n }\n\n function _adjustFontSize(operator) {\n var $html = document.querySelector('html'),\n isInFontSizeLimit;\n\n if (operator === '-') {\n isInFontSizeLimit = defaultFontSize > vm.config.fontAdjust.minSize;\n } else {\n isInFontSizeLimit = defaultFontSize < vm.config.fontAdjust.maxSize;\n }\n\n if (isInFontSizeLimit) {\n operator === '+' ? defaultFontSize += vm.config.fontAdjust.incrementRate : defaultFontSize -= vm.config.fontAdjust.incrementRate;\n $html.setAttribute('style', 'font-size: ' + defaultFontSize + 'px;');\n }\n }\n\n function increaseFontSize() {\n _adjustFontSize('+');\n }\n\n function decreaseFontSize() {\n _adjustFontSize('-');\n }\n\n function setContrast(config) {\n var $body = document.querySelector('body');\n\n _toggleClass('body', config.contrast.class);\n\n localStorage.setItem('accessibility-contrast', $body.classList.contains(config.contrast.class));\n }\n }\n})();\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,wBACA,eCLA,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,QACA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\n\n angular\n .module('ng-accessibility-bar', [\n 'ngTouch'\n ]);\n}());\n","(function() {\n 'use strict';\n\n angular.module('ng-accessibility-bar')\n .component('ngAccessibilityBar', AccessibilityBar());\n\n function AccessibilityBar() {\n return {\n templateUrl: 'ng-accessibility-bar.template.html',\n controller: AccessibilityBarComponentController,\n controllerAs: 'vm',\n bindings:{\n contrast: '<',\n contrastClass: '@',\n fontAdjust: '<',\n fontAdjustMaxSize: '<',\n fontAdjustMinSize: '<',\n fontAdjustIncrementRate: '<',\n libras: '<',\n title: '@',\n }\n };\n }\n\n /* @ngInject */\n function AccessibilityBarComponentController() {\n var vm = this,\n defaultFontSize = _getDefaultWindowFontSize();\n\n vm.config = {};\n\n vm.$onInit = onInit;\n vm.decreaseFontSize = decreaseFontSize;\n vm.increaseFontSize = increaseFontSize;\n vm.setContrast = setContrast;\n\n function onInit() {\n _setDefaultValues();\n _verifyContrast(vm.config);\n }\n\n function _setDefaultValues() {\n vm.config = {\n contrast: {\n class: vm.contrastClass || 'color-inverter',\n visibility: vm.contrast !== false\n },\n fontAdjust: {\n incrementRate: vm.fontAdjustIncrementRate || 2,\n maxSize: vm.fontAdjustMaxSize || 20,\n minSize: vm.fontAdjustMinSize || 16,\n visibility: vm.fontAdjust !== false\n },\n libras: {\n visibility: vm.libras !== false\n },\n title: vm.title || 'Acessibilidade:'\n };\n }\n\n function _toggleClass(element, classe) {\n var $element = document.querySelector(element);\n\n if ($element.classList.contains(classe)) {\n $element.classList.remove(classe);\n } else {\n $element.classList.add(classe);\n }\n }\n\n function _verifyContrast(config) {\n if (localStorage.getItem('accessibility-contrast') === 'true' && config.contrast.visibility) {\n setContrast(config);\n }\n }\n\n function _getDefaultWindowFontSize() {\n var fontSize = window.getComputedStyle(document.body).getPropertyValue('font-size');\n fontSize = fontSize.replace(/\\D/g, '');\n fontSize = +fontSize;\n\n return fontSize;\n }\n\n function _adjustFontSize(operator) {\n var $html = document.querySelector('html'),\n isInFontSizeLimit;\n\n if (operator === '-') {\n isInFontSizeLimit = defaultFontSize > vm.config.fontAdjust.minSize;\n } else {\n isInFontSizeLimit = defaultFontSize < vm.config.fontAdjust.maxSize;\n }\n\n if (isInFontSizeLimit) {\n operator === '+' ? defaultFontSize += vm.config.fontAdjust.incrementRate : defaultFontSize -= vm.config.fontAdjust.incrementRate;\n $html.setAttribute('style', 'font-size: ' + defaultFontSize + 'px;');\n }\n }\n\n function increaseFontSize() {\n _adjustFontSize('+');\n }\n\n function decreaseFontSize() {\n _adjustFontSize('-');\n }\n\n function setContrast(config) {\n var $body = document.querySelector('body');\n\n _toggleClass('body', config.contrast.class);\n\n localStorage.setItem('accessibility-contrast', $body.classList.contains(config.contrast.class));\n }\n }\n})();\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 From d0e8065870e71b6740fe27487151a07bea14d3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinicius=20Lag=C3=AAdo?= Date: Tue, 21 Nov 2017 13:20:12 -0200 Subject: [PATCH 3/3] Update version 1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99852d9..2056dfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-accessibility-bar", - "version": "1.0.5", + "version": "1.1.0", "description": "Accessibility bar component with high contrast, font adjust and libras", "main": "index.js", "scripts": {