Changeset 56799 in webkit


Ignore:
Timestamp:
Mar 30, 2010 10:42:12 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-03-30 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Copying from the Content tab in Resources includes line numbers.

https://bugs.webkit.org/show_bug.cgi?id=35104

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56798 r56799  
     12010-03-30  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Copying from the Content tab in Resources includes line numbers.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=35104
     8
     9        * inspector/front-end/TextViewer.js:
     10        (WebInspector.TextViewer):
     11        (WebInspector.TextViewer.prototype._beforeCopy):
     12        (WebInspector.TextViewer.prototype._copy):
     13
    1142010-03-30  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/WebCore/inspector/front-end/TextViewer.js

    r55407 r56799  
    4242    this.element.addEventListener("scroll", this._scroll.bind(this), false);
    4343    this.element.addEventListener("keydown", this._handleKeyDown.bind(this), false);
     44    this.element.addEventListener("beforecopy", this._beforeCopy.bind(this), false);
     45    this.element.addEventListener("copy", this._copy.bind(this), false);
    4446
    4547    this._url = url;
     
    235237            this.element.scrollLeft += scrollValue;
    236238        }
     239    },
     240
     241    _beforeCopy: function(e)
     242    {
     243        e.preventDefault();
     244    },
     245
     246    _copy: function(e)
     247    {
     248        var range = this._getSelection();
     249        var text = this._textModel.copyRange(range);
     250        InspectorFrontendHost.copyText(text);
     251        e.preventDefault();
    237252    },
    238253
Note: See TracChangeset for help on using the changeset viewer.