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

Side by Side Diff: native_client_sdk/src/examples/api/var_dictionary/example.js

Issue 111833002: Add missing argument to Element.setAttribute() calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function attachListeners() { 5 function attachListeners() {
6 var radioEls = document.querySelectorAll('input[type="radio"]'); 6 var radioEls = document.querySelectorAll('input[type="radio"]');
7 for (var i = 0; i < radioEls.length; ++i) { 7 for (var i = 0; i < radioEls.length; ++i) {
8 radioEls[i].addEventListener('click', onRadioClicked); 8 radioEls[i].addEventListener('click', onRadioClicked);
9 } 9 }
10 10
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 function onRadioClicked(e) { 24 function onRadioClicked(e) {
25 var divId = this.id.slice(5); // skip "radio" 25 var divId = this.id.slice(5); // skip "radio"
26 var functionEls = document.querySelectorAll('.function'); 26 var functionEls = document.querySelectorAll('.function');
27 for (var i = 0; i < functionEls.length; ++i) { 27 for (var i = 0; i < functionEls.length; ++i) {
28 var visible = functionEls[i].id === divId; 28 var visible = functionEls[i].id === divId;
29 if (functionEls[i].id === divId) 29 if (functionEls[i].id === divId)
30 functionEls[i].removeAttribute('hidden'); 30 functionEls[i].removeAttribute('hidden');
31 else 31 else
32 functionEls[i].setAttribute('hidden'); 32 functionEls[i].setAttribute('hidden', '');
33 } 33 }
34 } 34 }
35 35
36 function getButtonClicked(e) { 36 function getButtonClicked(e) {
37 var key = document.getElementById('getKey').value; 37 var key = document.getElementById('getKey').value;
38 common.naclModule.postMessage({cmd: 'Get', key: key}); 38 common.naclModule.postMessage({cmd: 'Get', key: key});
39 } 39 }
40 40
41 function setButtonClicked(e) { 41 function setButtonClicked(e) {
42 var key = document.getElementById('setKey').value; 42 var key = document.getElementById('setKey').value;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Note that cmd is a String object, not a primitive, so the comparison cmd 80 // Note that cmd is a String object, not a primitive, so the comparison cmd
81 // !== '' will always fail. 81 // !== '' will always fail.
82 if (cmd != '') { 82 if (cmd != '') {
83 common.logMessage( 83 common.logMessage(
84 'Function ' + cmd + ' returned ' + JSON.stringify(result)); 84 'Function ' + cmd + ' returned ' + JSON.stringify(result));
85 } 85 }
86 86
87 var dictEl = document.getElementById('dict'); 87 var dictEl = document.getElementById('dict');
88 dictEl.textContent = JSON.stringify(newDict, null, ' '); 88 dictEl.textContent = JSON.stringify(newDict, null, ' ');
89 } 89 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/api/file_io/example.js ('k') | native_client_sdk/src/examples/demo/drive/example.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698