OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 return this._joinNodes(keyName.split(" + ").map(this._createSpan.bind(th
is, "help-key")), plus); | 182 return this._joinNodes(keyName.split(" + ").map(this._createSpan.bind(th
is, "help-key")), plus); |
183 }, | 183 }, |
184 | 184 |
185 /** | 185 /** |
186 * @param {string} className | 186 * @param {string} className |
187 * @param {string} textContent | 187 * @param {string} textContent |
188 * @return {!Element} | 188 * @return {!Element} |
189 */ | 189 */ |
190 _createSpan: function(className, textContent) | 190 _createSpan: function(className, textContent) |
191 { | 191 { |
192 var node = document.createElement("span"); | 192 var node = createElement("span"); |
193 node.className = className; | 193 node.className = className; |
194 node.textContent = textContent; | 194 node.textContent = textContent; |
195 return node; | 195 return node; |
196 }, | 196 }, |
197 | 197 |
198 /** | 198 /** |
199 * @param {!Array.<!Element>} nodes | 199 * @param {!Array.<!Element>} nodes |
200 * @param {!Element} delimiter | 200 * @param {!Element} delimiter |
201 * @return {!Node} | 201 * @return {!Node} |
202 */ | 202 */ |
203 _joinNodes: function(nodes, delimiter) | 203 _joinNodes: function(nodes, delimiter) |
204 { | 204 { |
205 var result = document.createDocumentFragment(); | 205 var result = createDocumentFragment(); |
206 for (var i = 0; i < nodes.length; ++i) { | 206 for (var i = 0; i < nodes.length; ++i) { |
207 if (i > 0) | 207 if (i > 0) |
208 result.appendChild(delimiter.cloneNode(true)); | 208 result.appendChild(delimiter.cloneNode(true)); |
209 result.appendChild(nodes[i]); | 209 result.appendChild(nodes[i]); |
210 } | 210 } |
211 return result; | 211 return result; |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 WebInspector.ShortcutsScreen.registerShortcuts = function() | 215 WebInspector.ShortcutsScreen.registerShortcuts = function() |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 Left: [ | 540 Left: [ |
541 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left), | 541 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left), |
542 WebInspector.KeyboardShortcut.makeDescriptor("a") | 542 WebInspector.KeyboardShortcut.makeDescriptor("a") |
543 ], | 543 ], |
544 | 544 |
545 Right: [ | 545 Right: [ |
546 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right), | 546 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right), |
547 WebInspector.KeyboardShortcut.makeDescriptor("d") | 547 WebInspector.KeyboardShortcut.makeDescriptor("d") |
548 ] | 548 ] |
549 } | 549 } |
OLD | NEW |