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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/sources/AddSourceMapURLDialog.js
diff --git a/Source/devtools/front_end/sources/AddSourceMapURLDialog.js b/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d9174969cbcf650214dd36bf98ea128f53c1ac6
--- /dev/null
+++ b/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @constructor
+ * @extends {WebInspector.DialogDelegate}
+ * @param {function(string)} callback
+ */
+WebInspector.AddSourceMapURLDialog = function(callback)
+{
+ WebInspector.DialogDelegate.call(this);
+
+ this.element = document.createElementWithClass("div", "go-to-line-dialog");
+ this.element.createChild("label").textContent = WebInspector.UIString("Source map URL: ");
+
+ this._input = this.element.createChild("input");
+ this._input.setAttribute("type", "text");
+
+ this._callback = callback;
+}
+
+/**
+ * @param {!Element} element
+ * @param {function(string)} callback
+ */
+WebInspector.AddSourceMapURLDialog.show = function(element, callback)
+{
+ WebInspector.Dialog.show(element, new WebInspector.AddSourceMapURLDialog(callback));
+}
+
+WebInspector.AddSourceMapURLDialog.prototype = {
+ focus: function()
+ {
+ WebInspector.setCurrentFocusElement(this._input);
+ this._input.select();
+ },
+
+ onEnter: function()
+ {
+ var value = this._input.value;
+ this._callback(value);
+ },
+
+ __proto__: WebInspector.DialogDelegate.prototype
+}

Powered by Google App Engine
This is Rietveld 408576698