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 358 matching lines...) Loading... |
369 WebInspector._valueModificationDirection = function(event) | 369 WebInspector._valueModificationDirection = function(event) |
370 { | 370 { |
371 var direction = null; | 371 var direction = null; |
372 if (event.type === "mousewheel") { | 372 if (event.type === "mousewheel") { |
373 // When shift is pressed while spinning mousewheel, delta comes as wheel
DeltaX. | 373 // When shift is pressed while spinning mousewheel, delta comes as wheel
DeltaX. |
374 if (event.wheelDeltaY > 0 || event.wheelDeltaX > 0) | 374 if (event.wheelDeltaY > 0 || event.wheelDeltaX > 0) |
375 direction = "Up"; | 375 direction = "Up"; |
376 else if (event.wheelDeltaY < 0 || event.wheelDeltaX < 0) | 376 else if (event.wheelDeltaY < 0 || event.wheelDeltaX < 0) |
377 direction = "Down"; | 377 direction = "Down"; |
378 } else { | 378 } else { |
379 if (event.keyIdentifier === "Up" || event.keyIdentifier === "PageUp") | 379 if (event.key === "ArrowUp" || event.key === "PageUp") |
380 direction = "Up"; | 380 direction = "Up"; |
381 else if (event.keyIdentifier === "Down" || event.keyIdentifier === "Page
Down") | 381 else if (event.key === "ArrowDown" || event.key === "PageDown") |
382 direction = "Down"; | 382 direction = "Down"; |
383 } | 383 } |
384 return direction; | 384 return direction; |
385 } | 385 } |
386 | 386 |
387 /** | 387 /** |
388 * @param {string} hexString | 388 * @param {string} hexString |
389 * @param {!Event} event | 389 * @param {!Event} event |
390 */ | 390 */ |
391 WebInspector._modifiedHexValue = function(hexString, event) | 391 WebInspector._modifiedHexValue = function(hexString, event) |
(...skipping 128 matching lines...) Loading... |
520 { | 520 { |
521 /** | 521 /** |
522 * @return {?Range} | 522 * @return {?Range} |
523 * @suppressGlobalPropertiesCheck | 523 * @suppressGlobalPropertiesCheck |
524 */ | 524 */ |
525 function createRange() | 525 function createRange() |
526 { | 526 { |
527 return document.createRange(); | 527 return document.createRange(); |
528 } | 528 } |
529 | 529 |
530 var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyId
entifier === "Down" || event.type === "mousewheel"); | 530 var arrowKeyOrMouseWheelEvent = (event.key === "ArrowUp" || event.key === "A
rrowDown" || event.type === "mousewheel"); |
531 var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifie
r === "PageDown"); | 531 var pageKeyPressed = (event.key === "PageUp" || event.key === "PageDown"); |
532 if (!arrowKeyOrMouseWheelEvent && !pageKeyPressed) | 532 if (!arrowKeyOrMouseWheelEvent && !pageKeyPressed) |
533 return false; | 533 return false; |
534 | 534 |
535 var selection = element.getComponentSelection(); | 535 var selection = element.getComponentSelection(); |
536 if (!selection.rangeCount) | 536 if (!selection.rangeCount) |
537 return false; | 537 return false; |
538 | 538 |
539 var selectionRange = selection.getRangeAt(0); | 539 var selectionRange = selection.getRangeAt(0); |
540 if (!selectionRange.commonAncestorContainer.isSelfOrDescendant(element)) | 540 if (!selectionRange.commonAncestorContainer.isSelfOrDescendant(element)) |
541 return false; | 541 return false; |
(...skipping 1045 matching lines...) Loading... |
1587 { | 1587 { |
1588 if (isEnterKey(event)) { | 1588 if (isEnterKey(event)) { |
1589 if (validate(input.value)) | 1589 if (validate(input.value)) |
1590 apply(input.value); | 1590 apply(input.value); |
1591 return; | 1591 return; |
1592 } | 1592 } |
1593 | 1593 |
1594 if (!numeric) | 1594 if (!numeric) |
1595 return; | 1595 return; |
1596 | 1596 |
1597 var increment = event.keyIdentifier === "Up" ? 1 : event.keyIdentifier =
== "Down" ? -1 : 0; | 1597 var increment = event.key === "ArrowUp" ? 1 : event.key === "ArrowDown"
? -1 : 0; |
1598 if (!increment) | 1598 if (!increment) |
1599 return; | 1599 return; |
1600 if (event.shiftKey) | 1600 if (event.shiftKey) |
1601 increment *= 10; | 1601 increment *= 10; |
1602 | 1602 |
1603 var value = input.value; | 1603 var value = input.value; |
1604 if (!validate(value) || !value) | 1604 if (!validate(value) || !value) |
1605 return; | 1605 return; |
1606 | 1606 |
1607 value = (value ? Number(value) : 0) + increment; | 1607 value = (value ? Number(value) : 0) + increment; |
(...skipping 370 matching lines...) Loading... |
1978 * @param {string} title | 1978 * @param {string} title |
1979 * @return {!Element} | 1979 * @return {!Element} |
1980 */ | 1980 */ |
1981 WebInspector.linkifyDocumentationURLAsNode = function(article, title) | 1981 WebInspector.linkifyDocumentationURLAsNode = function(article, title) |
1982 { | 1982 { |
1983 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool
s/chrome-devtools/" + article, title, undefined, true); | 1983 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool
s/chrome-devtools/" + article, title, undefined, true); |
1984 } | 1984 } |
1985 | 1985 |
1986 /** @type {!WebInspector.ThemeSupport} */ | 1986 /** @type {!WebInspector.ThemeSupport} */ |
1987 WebInspector.themeSupport; | 1987 WebInspector.themeSupport; |
OLD | NEW |