| Index: third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
|
| index a7ef73adb3683c2beed2431b13c5a06c73f7304d..f121ef8633aeaaa95fff29a5dc57f92687dd6eae 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
|
| @@ -1,36 +1,35 @@
|
| // 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.HBox}
|
| - * @param {function(string)} callback
|
| + * @unrestricted
|
| */
|
| -WebInspector.AddSourceMapURLDialog = function(callback)
|
| -{
|
| - WebInspector.HBox.call(this, true);
|
| - this.registerRequiredCSS("ui_lazy/dialog.css");
|
| - this.contentElement.createChild("label").textContent = WebInspector.UIString("Source map URL: ");
|
| -
|
| - this._input = this.contentElement.createChild("input");
|
| - this._input.setAttribute("type", "text");
|
| - this._input.addEventListener("keydown", this._onKeyDown.bind(this), false);
|
| -
|
| - var addButton = this.contentElement.createChild("button");
|
| - addButton.textContent = WebInspector.UIString("Add");
|
| - addButton.addEventListener("click", this._apply.bind(this), false);
|
| +WebInspector.AddSourceMapURLDialog = class extends WebInspector.HBox {
|
| + /**
|
| + * @param {function(string)} callback
|
| + */
|
| + constructor(callback) {
|
| + super(true);
|
| + this.registerRequiredCSS('ui_lazy/dialog.css');
|
| + this.contentElement.createChild('label').textContent = WebInspector.UIString('Source map URL: ');
|
| +
|
| + this._input = this.contentElement.createChild('input');
|
| + this._input.setAttribute('type', 'text');
|
| + this._input.addEventListener('keydown', this._onKeyDown.bind(this), false);
|
| +
|
| + var addButton = this.contentElement.createChild('button');
|
| + addButton.textContent = WebInspector.UIString('Add');
|
| + addButton.addEventListener('click', this._apply.bind(this), false);
|
|
|
| this.setDefaultFocusedElement(this._input);
|
| this._callback = callback;
|
| this.contentElement.tabIndex = 0;
|
| -};
|
| + }
|
|
|
| -/**
|
| - * @param {function(string)} callback
|
| - */
|
| -WebInspector.AddSourceMapURLDialog.show = function(callback)
|
| -{
|
| + /**
|
| + * @param {function(string)} callback
|
| + */
|
| + static show(callback) {
|
| var dialog = new WebInspector.Dialog();
|
| var addSourceMapURLDialog = new WebInspector.AddSourceMapURLDialog(done);
|
| addSourceMapURLDialog.show(dialog.element);
|
| @@ -40,29 +39,25 @@ WebInspector.AddSourceMapURLDialog.show = function(callback)
|
| /**
|
| * @param {string} value
|
| */
|
| - function done(value)
|
| - {
|
| - dialog.detach();
|
| - callback(value);
|
| + function done(value) {
|
| + dialog.detach();
|
| + callback(value);
|
| }
|
| + }
|
| +
|
| + _apply() {
|
| + this._callback(this._input.value);
|
| + }
|
| +
|
| + /**
|
| + * @param {!Event} event
|
| + */
|
| + _onKeyDown(event) {
|
| + if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) {
|
| + event.preventDefault();
|
| + this._apply();
|
| + }
|
| + }
|
| };
|
|
|
| -WebInspector.AddSourceMapURLDialog.prototype = {
|
| - _apply: function()
|
| - {
|
| - this._callback(this._input.value);
|
| - },
|
|
|
| - /**
|
| - * @param {!Event} event
|
| - */
|
| - _onKeyDown: function(event)
|
| - {
|
| - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) {
|
| - event.preventDefault();
|
| - this._apply();
|
| - }
|
| - },
|
| -
|
| - __proto__: WebInspector.HBox.prototype
|
| -};
|
|
|