Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/devtools/front_end/sources/AddSourceMapURLDialog.js

Issue 373743003: DevTools: Add support for adding source map to a script from the DevTools window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @constructor
7 * @extends {WebInspector.DialogDelegate}
8 * @param {function(string)} callback
9 */
10 WebInspector.AddSourceMapURLDialog = function(callback)
11 {
12 WebInspector.DialogDelegate.call(this);
13
14 this.element = document.createElementWithClass("div", "go-to-line-dialog");
15 this.element.createChild("label").textContent = WebInspector.UIString("Sourc e map URL: ");
16
17 this._input = this.element.createChild("input");
18 this._input.setAttribute("type", "text");
19
20 this._goButton = this.element.createChild("button");
21 this._goButton.textContent = WebInspector.UIString("Go");
22 this._goButton.addEventListener("click", this._onGoClick.bind(this), false);
23
24 this._callback = callback;
25 }
26
27 /**
28 * @param {!Element} element
29 * @param {function(string)} callback
30 */
31 WebInspector.AddSourceMapURLDialog.show = function(element, callback)
32 {
33 WebInspector.Dialog.show(element, new WebInspector.AddSourceMapURLDialog(cal lback));
34 }
35
36 WebInspector.AddSourceMapURLDialog.prototype = {
37 focus: function()
38 {
39 WebInspector.setCurrentFocusElement(this._input);
40 this._input.select();
41 },
42
43 _onGoClick: function()
44 {
45 this._apply();
46 WebInspector.Dialog.hide();
47 },
48
49 _apply: function()
50 {
51 var value = this._input.value;
52 this._callback(value);
53 },
54
55 onEnter: function()
56 {
57 this._apply();
58 },
59
60 __proto__: WebInspector.DialogDelegate.prototype
61 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/UISourceCode.js ('k') | Source/devtools/front_end/sources/JavaScriptSourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698