michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const gcli = require("gcli/index"); michael@0: michael@0: exports.items = [{ michael@0: name: "edit", michael@0: description: gcli.lookup("editDesc"), michael@0: manual: gcli.lookup("editManual2"), michael@0: params: [ michael@0: { michael@0: name: 'resource', michael@0: type: { michael@0: name: 'resource', michael@0: include: 'text/css' michael@0: }, michael@0: description: gcli.lookup("editResourceDesc") michael@0: }, michael@0: { michael@0: name: "line", michael@0: defaultValue: 1, michael@0: type: { michael@0: name: "number", michael@0: min: 1, michael@0: step: 10 michael@0: }, michael@0: description: gcli.lookup("editLineToJumpToDesc") michael@0: } michael@0: ], michael@0: exec: function(args, context) { michael@0: let target = context.environment.target; michael@0: let gDevTools = require("resource:///modules/devtools/gDevTools.jsm").gDevTools; michael@0: return gDevTools.showToolbox(target, "styleeditor").then(function(toolbox) { michael@0: let styleEditor = toolbox.getCurrentPanel(); michael@0: styleEditor.selectStyleSheet(args.resource.element, args.line); michael@0: return null; michael@0: }); michael@0: } michael@0: }];