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.
7 * @extends {WebInspector.DialogDelegate}
8 * @param {function(string)} callback
10 WebInspector.AddSourceMapURLDialog = function(callback)
12 WebInspector.DialogDelegate.call(this);
14 this.element = document.createElementWithClass("div", "go-to-line-dialog");
15 this.element.createChild("label").textContent = WebInspector.UIString("Source map URL: ");
17 this._input = this.element.createChild("input");
18 this._input.setAttribute("type", "text");
20 this._goButton = this.element.createChild("button");
21 this._goButton.textContent = WebInspector.UIString("Go");
22 this._goButton.addEventListener("click", this._onGoClick.bind(this), false);
24 this._callback = callback;
28 * @param {!Element} element
29 * @param {function(string)} callback
31 WebInspector.AddSourceMapURLDialog.show = function(element, callback)
33 WebInspector.Dialog.show(element, new WebInspector.AddSourceMapURLDialog(callback));
36 WebInspector.AddSourceMapURLDialog.prototype = {
39 WebInspector.setCurrentFocusElement(this._input);
43 _onGoClick: function()
46 WebInspector.Dialog.hide();
51 var value = this._input.value;
52 this._callback(value);
60 __proto__: WebInspector.DialogDelegate.prototype