Changeset 35785 in webkit


Ignore:
Timestamp:
Aug 15, 2008 10:02:44 AM (16 years ago)
Author:
timothy@apple.com
Message:

Cmd-F on Mac or Ctrl-F on other platforms now focus the search field.

Platform distinction and modifier key matching adjusted
by Daniel Jalkut <jalkut@red-sweater.com>

Bug 16313: text search (find) keybindings should work in the Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=16313

Reviewed by Tim Hatcher.

  • page/inspector/inspector.js: Added a case for the F key
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r35784 r35785  
     12008-08-15  Anthony Ricaud  <rik24d@gmail.com>
     2
     3        Cmd-F on Mac or Ctrl-F on other platforms now focus the search field.
     4
     5        Platform distinction and modifier key matching adjusted
     6        by Daniel Jalkut <jalkut@red-sweater.com>
     7
     8        Bug 16313: text search (find) keybindings should work in the Web Inspector
     9        https://bugs.webkit.org/show_bug.cgi?id=16313
     10
     11        Reviewed by Tim Hatcher.
     12
     13        * page/inspector/inspector.js: Added a case for the F key
     14
    1152008-08-15  Keishi Hattori  <casey.hattori@gmail.com>
    216
  • trunk/WebCore/page/inspector/inspector.js

    r35784 r35785  
    463463                this.console.visible = !this.console.visible;
    464464                event.preventDefault();
     465                break;
     466            case "U+0046": // F key
     467                var isMac = InspectorController.platform().indexOf("mac-") === 0;
     468                var isFindKey;
     469                // We want cmd-F for Mac, or ctrl-F for non-Mac
     470                if (isMac)
     471                    isFindKey = event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey;
     472                else
     473                    isFindKey = event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey;
     474
     475                if (isFindKey) {
     476                    document.getElementById("search").focus();
     477                    event.preventDefault();
     478                }
    465479                break;
    466480        }
Note: See TracChangeset for help on using the changeset viewer.