From b420ecaa9586375c7d1f0d49bfea71f8b7b6002e Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Wed, 9 Aug 2017 15:28:42 +0200 Subject: [PATCH] Bug 1388368 - Fix the Console panel in Launchpad; r=nchevobbe MozReview-Commit-ID: 4AAs8Mre3bt --HG-- extra : rebase_source : 2719f5231656625b4ba9f9b408d774d04d6ea1f0 --- devtools/client/webconsole/local-dev/index.js | 5 ++++- .../client/webconsole/local-dev/jsterm-stub.js | 6 ++++++ .../client/webconsole/local-dev/system-stub.js | 17 +++++++++++++++++ devtools/client/webconsole/package.json | 2 +- devtools/client/webconsole/webpack.config.js | 9 ++++++--- 5 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 devtools/client/webconsole/local-dev/system-stub.js diff --git a/devtools/client/webconsole/local-dev/index.js b/devtools/client/webconsole/local-dev/index.js index a23726b77e17..d2b84830adfb 100644 --- a/devtools/client/webconsole/local-dev/index.js +++ b/devtools/client/webconsole/local-dev/index.js @@ -21,7 +21,10 @@ try { EventEmitter.decorate(window); -require("../../themes/new-webconsole.css"); +require("../../themes/widgets.css"); +require("../../themes/webconsole.css"); +require("../../themes/components-frame.css"); +require("../../themes/light-theme.css"); require("../../shared/components/reps/reps.css"); pref("devtools.debugger.remote-timeout", 10000); diff --git a/devtools/client/webconsole/local-dev/jsterm-stub.js b/devtools/client/webconsole/local-dev/jsterm-stub.js index 2fb0f912a66a..422f090a9bf3 100644 --- a/devtools/client/webconsole/local-dev/jsterm-stub.js +++ b/devtools/client/webconsole/local-dev/jsterm-stub.js @@ -171,6 +171,12 @@ JSTerm.prototype = { return grip ? grip.actor : null; }, + + focus() { + if (this.inputNode) { + this.inputNode.focus(); + } + }, }; module.exports.JSTerm = JSTerm; diff --git a/devtools/client/webconsole/local-dev/system-stub.js b/devtools/client/webconsole/local-dev/system-stub.js new file mode 100644 index 000000000000..f4342a003706 --- /dev/null +++ b/devtools/client/webconsole/local-dev/system-stub.js @@ -0,0 +1,17 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +var platform = ""; + +if (/Mac OS X/.test(window.navigator.userAgent)) { + platform = "macosx"; +} + +module.exports = { + constants: { + platform: platform + } +}; diff --git a/devtools/client/webconsole/package.json b/devtools/client/webconsole/package.json index 288cc05f7d84..dfdb3fa43a0e 100644 --- a/devtools/client/webconsole/package.json +++ b/devtools/client/webconsole/package.json @@ -16,7 +16,7 @@ "cross-env": "^3.1.3", "devtools-config": "0.0.12", "devtools-launchpad": "0.0.67", - "devtools-modules": "0.0.24", + "devtools-modules": "0.0.28", "enzyme": "^2.4.1", "expect": "^1.16.0", "file-loader": "^0.10.1", diff --git a/devtools/client/webconsole/webpack.config.js b/devtools/client/webconsole/webpack.config.js index 760c965143fb..91dffa400548 100644 --- a/devtools/client/webconsole/webpack.config.js +++ b/devtools/client/webconsole/webpack.config.js @@ -43,7 +43,7 @@ let webpackConfig = { webpackConfig.resolve = { alias: { - "Services": "devtools-modules/client/shared/shim/Services", + "Services": "devtools-modules/src/Services", "devtools/client/webconsole/jsterm": path.join(projectPath, "jsterm-stub"), "devtools/client/webconsole/utils": path.join(__dirname, "new-console-output/test/fixtures/WebConsoleUtils"), @@ -63,9 +63,10 @@ webpackConfig.resolve = { "devtools/shared/locales": path.join(__dirname, "../../shared/locales/en-US"), "devtools/shared/plural-form": path.join(__dirname, "../../shared/plural-form"), "devtools/shared/l10n": path.join(__dirname, "../../shared/l10n"), + "devtools/shared/system": path.join(projectPath, "system-stub"), "devtools/client/framework/devtools": path.join(__dirname, "../../client/shims/devtools"), - "devtools/client/framework/menu": "devtools-modules/client/framework/menu", + "devtools/client/framework/menu": "devtools-modules/src/menu", "devtools/client/framework/menu-item": path.join(__dirname, "../../client/framework/menu-item"), "devtools/client/shared/components/reps/reps": path.join(__dirname, "../../client/shared/components/reps/reps"), @@ -74,9 +75,11 @@ webpackConfig.resolve = { "devtools/client/shared/components/stack-trace": path.join(__dirname, "../../client/shared/components/stack-trace"), "devtools/client/shared/source-utils": path.join(__dirname, "../../client/shared/source-utils"), "devtools/client/shared/components/frame": path.join(__dirname, "../../client/shared/components/frame"), + "devtools/client/shared/key-shortcuts": "devtools-modules/src/key-shortcuts", + "devtools/client/shared/zoom-keys": "devtools-modules/src/zoom-keys", "devtools/shared/defer": path.join(__dirname, "../../shared/defer"), - "devtools/shared/event-emitter": "devtools-modules/shared/event-emitter", + "devtools/shared/event-emitter": "devtools-modules/src/utils/event-emitter", "devtools/shared/client/main": path.join(__dirname, "new-console-output/test/fixtures/ObjectClient"), "devtools/shared/platform/clipboard": path.join(__dirname, "../../shared/platform/content/clipboard"), }