OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * | 10 * |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code |
| event.keyIdentifier === "U+001B") | 348 else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code |
| event.keyIdentifier === "U+001B") |
349 return "cancel"; | 349 return "cancel"; |
350 else if (event.keyIdentifier === "U+0009") // Tab key | 350 else if (event.keyIdentifier === "U+0009") // Tab key |
351 return "move-" + (event.shiftKey ? "backward" : "forward"); | 351 return "move-" + (event.shiftKey ? "backward" : "forward"); |
352 } | 352 } |
353 | 353 |
354 function handleEditingResult(result, event) | 354 function handleEditingResult(result, event) |
355 { | 355 { |
356 if (result === "commit") { | 356 if (result === "commit") { |
357 editingCommitted.call(element); | 357 editingCommitted.call(element); |
358 event.consume(); | 358 event.consume(true); |
359 } else if (result === "cancel") { | 359 } else if (result === "cancel") { |
360 editingCancelled.call(element); | 360 editingCancelled.call(element); |
361 event.consume(); | 361 event.consume(true); |
362 } else if (result && result.indexOf("move-") === 0) { | 362 } else if (result && result.indexOf("move-") === 0) { |
363 moveDirection = result.substring(5); | 363 moveDirection = result.substring(5); |
364 if (event.keyIdentifier !== "U+0009") | 364 if (event.keyIdentifier !== "U+0009") |
365 blurEventListener(); | 365 blurEventListener(); |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 function pasteEventListener(event) | 369 function pasteEventListener(event) |
370 { | 370 { |
371 var result = pasteCallback(event); | 371 var result = pasteCallback(event); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 { | 699 { |
700 window.addEventListener("focus", WebInspector._windowFocused, false); | 700 window.addEventListener("focus", WebInspector._windowFocused, false); |
701 window.addEventListener("blur", WebInspector._windowBlurred, false); | 701 window.addEventListener("blur", WebInspector._windowBlurred, false); |
702 document.addEventListener("focus", WebInspector._focusChanged.bind(this), tr
ue); | 702 document.addEventListener("focus", WebInspector._focusChanged.bind(this), tr
ue); |
703 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 703 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
704 } | 704 } |
705 | 705 |
706 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 706 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
707 | 707 |
708 })(); | 708 })(); |
OLD | NEW |