Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1756)

Unified Diff: ui/accessibility/extensions/colorenhancer/src/popup.js

Issue 1102033005: Fix i18n for the color enhancer extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix setup button and css style Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/accessibility/extensions/colorenhancer/src/popup.js
diff --git a/ui/accessibility/extensions/colorenhancer/src/popup.js b/ui/accessibility/extensions/colorenhancer/src/popup.js
index 07037147b8d416983c37bf9b432e899bfde3cee3..4dd692d725a163d643f5c8fc2b74567d224b2962 100644
--- a/ui/accessibility/extensions/colorenhancer/src/popup.js
+++ b/ui/accessibility/extensions/colorenhancer/src/popup.js
@@ -107,7 +107,7 @@ function createTestRow(type) {
var toCssColor = function(rgb) {
return 'rgb(' + rgb.join(',') + ')';
};
- var row = document.createElement('div');
+ var row = document.createElement('label');
row.classList.add('row');
var button = document.createElement('input');
@@ -120,6 +120,7 @@ function createTestRow(type) {
button.addEventListener('change', function() {
onTypeChange(this.value);
});
+ button.setAttribute('aria-label', type);
SWATCH_COLORS.forEach(function(data) {
var swatch = document.querySelector('.swatch.template').cloneNode(true);
@@ -320,7 +321,15 @@ function onReset() {
* currently visible tab.
*/
function initialize() {
+ var i18nElements = document.querySelectorAll('*[i18n-content]');
+ for (var i = 0; i < i18nElements.length; i++) {
+ var elem = i18nElements[i];
+ var msg = elem.getAttribute('i18n-content');
+ elem.innerHTML = chrome.i18n.getMessage(msg);
kevers 2015/04/27 13:57:36 Thanks for fixing i18n! Would it be safer to use
dmazzoni 2015/04/27 19:47:47 Done.
+ }
+
$('setup').onclick = function() {
+ console.log('Click setup');
kevers 2015/04/27 13:57:36 Please remove console.log here and below or switch
dmazzoni 2015/04/27 19:47:47 Done.
$('setup-panel').classList.remove('collapsed');
// Store current settings in the event of a canceled setup.
restoreSettings = {
@@ -333,6 +342,8 @@ function initialize() {
updateControls();
};
+ console.log('init 5');
+
$('delta').addEventListener('input', function() {
onDeltaChange(parseFloat(this.value));
});

Powered by Google App Engine
This is Rietveld 408576698