OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if (userInput === previousContent) | 379 if (userInput === previousContent) |
380 return this.editingCancelled(element, context); // nothing changed,
so cancel | 380 return this.editingCancelled(element, context); // nothing changed,
so cancel |
381 | 381 |
382 this.editingEnded(context); | 382 this.editingEnded(context); |
383 this.applyExpression(userInput, true); | 383 this.applyExpression(userInput, true); |
384 }, | 384 }, |
385 | 385 |
386 _promptKeyDown: function(context, event) | 386 _promptKeyDown: function(context, event) |
387 { | 387 { |
388 if (isEnterKey(event)) { | 388 if (isEnterKey(event)) { |
389 event.consume(); | 389 event.consume(true); |
390 return this.editingCommitted(null, context.elementToEdit.textContent
, context.previousContent, context); | 390 return this.editingCommitted(null, context.elementToEdit.textContent
, context.previousContent, context); |
391 } | 391 } |
392 if (event.keyIdentifier === "U+001B") { // Esc | 392 if (event.keyIdentifier === "U+001B") { // Esc |
393 event.consume(); | 393 event.consume(); |
394 return this.editingCancelled(null, context); | 394 return this.editingCancelled(null, context); |
395 } | 395 } |
396 }, | 396 }, |
397 | 397 |
398 applyExpression: function(expression, updateInterface) | 398 applyExpression: function(expression, updateInterface) |
399 { | 399 { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 WebInspector.ObjectPropertyPrompt = function(commitHandler, cancelHandler, rende
rAsBlock) | 647 WebInspector.ObjectPropertyPrompt = function(commitHandler, cancelHandler, rende
rAsBlock) |
648 { | 648 { |
649 const ExpressionStopCharacters = " =:[({;,!+-*/&|^<>."; // Same as in Consol
eView.js + "." | 649 const ExpressionStopCharacters = " =:[({;,!+-*/&|^<>."; // Same as in Consol
eView.js + "." |
650 WebInspector.TextPrompt.call(this, WebInspector.consoleView.completionsForTe
xtPrompt.bind(WebInspector.consoleView), ExpressionStopCharacters); | 650 WebInspector.TextPrompt.call(this, WebInspector.consoleView.completionsForTe
xtPrompt.bind(WebInspector.consoleView), ExpressionStopCharacters); |
651 this.setSuggestBoxEnabled("generic-suggest"); | 651 this.setSuggestBoxEnabled("generic-suggest"); |
652 if (renderAsBlock) | 652 if (renderAsBlock) |
653 this.renderAsBlock(); | 653 this.renderAsBlock(); |
654 } | 654 } |
655 | 655 |
656 WebInspector.ObjectPropertyPrompt.prototype.__proto__ = WebInspector.TextPrompt.
prototype; | 656 WebInspector.ObjectPropertyPrompt.prototype.__proto__ = WebInspector.TextPrompt.
prototype; |
OLD | NEW |