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

Side by Side Diff: Source/devtools/front_end/ui/KeyboardShortcut.js

Issue 1293793004: Devtools: Update Mac shortcut symbols usability (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 /** 281 /**
282 * @param {number|undefined} modifiers 282 * @param {number|undefined} modifiers
283 * @return {string} 283 * @return {string}
284 */ 284 */
285 WebInspector.KeyboardShortcut._modifiersToString = function(modifiers) 285 WebInspector.KeyboardShortcut._modifiersToString = function(modifiers)
286 { 286 {
287 var isMac = WebInspector.isMac(); 287 var isMac = WebInspector.isMac();
288 var m = WebInspector.KeyboardShortcut.Modifiers; 288 var m = WebInspector.KeyboardShortcut.Modifiers;
289 var modifierNames = new Map([ 289 var modifierNames = new Map([
290 [m.Ctrl, isMac ? "\u2303" : "Ctrl\u200A+\u200A"], 290 [m.Ctrl, isMac ? "Ctrl\u2004" : "Ctrl\u200A+\u200A"],
291 [m.Alt, isMac ? "\u2325" : "Alt\u200A+\u200A"], 291 [m.Alt, isMac ? "opt\u2004" : "Alt\u200A+\u200A"],
292 [m.Shift, isMac ? "\u21e7" : "Shift\u200A+\u200A"], 292 [m.Shift, isMac ? "\u21e7\u2004" : "Shift\u200A+\u200A"],
293 [m.Meta, isMac ? "\u2318" : "Win\u200A+\u200A"] 293 [m.Meta, isMac ? "\u2318\u2004" : "Win\u200A+\u200A"]
294 ]); 294 ]);
295 return [m.Ctrl, m.Alt, m.Shift, m.Meta].map(mapModifiers).join(""); 295 return [m.Meta, m.Ctrl, m.Alt, m.Shift].map(mapModifiers).join("");
296 296
297 /** 297 /**
298 * @param {number} m 298 * @param {number} m
299 * @return {string} 299 * @return {string}
300 */ 300 */
301 function mapModifiers(m) 301 function mapModifiers(m)
302 { 302 {
303 return modifiers & m ? /** @type {string} */ (modifierNames.get(m)) : "" ; 303 return modifiers & m ? /** @type {string} */ (modifierNames.get(m)) : "" ;
304 } 304 }
305 }; 305 };
306 306
307 WebInspector.KeyboardShortcut.SelectAll = WebInspector.KeyboardShortcut.makeKey( "a", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); 307 WebInspector.KeyboardShortcut.SelectAll = WebInspector.KeyboardShortcut.makeKey( "a", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698