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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/tutorial.js

Issue 2480303003: Fix links in tutorial (Closed)
Patch Set: Piggybacking node.url check for images. Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview Introduces users to ChromeVox. 6 * @fileoverview Introduces users to ChromeVox.
7 */ 7 */
8 8
9 goog.provide('Tutorial'); 9 goog.provide('Tutorial');
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 element.setAttribute('tabindex', -1); 171 element.setAttribute('tabindex', -1);
172 if (!focus) 172 if (!focus)
173 focus = element; 173 focus = element;
174 } else if (pageElement.list) { 174 } else if (pageElement.list) {
175 element = document.createElement('ul'); 175 element = document.createElement('ul');
176 this.buildDom_(pageElement.items, element); 176 this.buildDom_(pageElement.items, element);
177 } else if (pageElement.listItem) { 177 } else if (pageElement.listItem) {
178 element = document.createElement('li'); 178 element = document.createElement('li');
179 } else if (pageElement.link) { 179 } else if (pageElement.link) {
180 element = document.createElement('a'); 180 element = document.createElement('a');
181 element.href = pageElement.link; 181 element.onclick = function() {
dmazzoni 2016/11/07 23:55:35 I think you should add href='#' or role="link" and
David Tseng 2016/11/08 02:47:24 Strange it worked for me as I definitely moved to
dmazzoni 2016/11/07 23:55:35 return false, or stopPropagation/preventDefault?
David Tseng 2016/11/08 02:47:24 Ok, explicitly returning false
182 Panel.closeMenusAndRestoreFocus();
183 chrome.windows.create({url: pageElement.link});
184 };
182 element.target = '_blank'; 185 element.target = '_blank';
183 } else { 186 } else {
184 element = document.createElement('p'); 187 element = document.createElement('p');
185 } 188 }
186 if (text) 189 if (text)
187 element.innerText = text; 190 element.innerText = text;
188 container.appendChild(element); 191 container.appendChild(element);
189 } 192 }
190 if (focus) 193 if (focus)
191 focus.focus(); 194 focus.focus();
192 }, 195 },
193 196
194 /** @private */ 197 /** @private */
195 finalizeDom_: function() { 198 finalizeDom_: function() {
196 var disableNext = this.page == (Tutorial.PAGES.length - 1); 199 var disableNext = this.page == (Tutorial.PAGES.length - 1);
197 var disablePrevious = this.page == 0; 200 var disablePrevious = this.page == 0;
198 $('tutorial_next').setAttribute('aria-disabled', disableNext); 201 $('tutorial_next').setAttribute('aria-disabled', disableNext);
199 $('tutorial_previous').setAttribute('aria-disabled', disablePrevious); 202 $('tutorial_previous').setAttribute('aria-disabled', disablePrevious);
200 }, 203 },
201 204
202 get page() { 205 get page() {
203 return this.page_; 206 return this.page_;
204 }, 207 },
205 208
206 set page(val) { 209 set page(val) {
207 this.page_ = val; 210 this.page_ = val;
208 sessionStorage['tutorial_page_pos'] = this.page_; 211 sessionStorage['tutorial_page_pos'] = this.page_;
209 } 212 }
210 }; 213 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698