browser/devtools/styleeditor/styleeditor-commands.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/styleeditor/styleeditor-commands.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +const gcli = require("gcli/index");
    1.11 +
    1.12 +exports.items = [{
    1.13 +  name: "edit",
    1.14 +  description: gcli.lookup("editDesc"),
    1.15 +  manual: gcli.lookup("editManual2"),
    1.16 +  params: [
    1.17 +     {
    1.18 +       name: 'resource',
    1.19 +       type: {
    1.20 +         name: 'resource',
    1.21 +         include: 'text/css'
    1.22 +       },
    1.23 +       description: gcli.lookup("editResourceDesc")
    1.24 +     },
    1.25 +     {
    1.26 +       name: "line",
    1.27 +       defaultValue: 1,
    1.28 +       type: {
    1.29 +         name: "number",
    1.30 +         min: 1,
    1.31 +         step: 10
    1.32 +       },
    1.33 +       description: gcli.lookup("editLineToJumpToDesc")
    1.34 +     }
    1.35 +   ],
    1.36 +   exec: function(args, context) {
    1.37 +     let target = context.environment.target;
    1.38 +     let gDevTools = require("resource:///modules/devtools/gDevTools.jsm").gDevTools;
    1.39 +     return gDevTools.showToolbox(target, "styleeditor").then(function(toolbox) {
    1.40 +       let styleEditor = toolbox.getCurrentPanel();
    1.41 +       styleEditor.selectStyleSheet(args.resource.element, args.line);
    1.42 +       return null;
    1.43 +     });
    1.44 +   }
    1.45 +}];

mercurial