Ejemplo n.º 1
0
function loadIntoWindow(window) {
    var require = window.require;
    require.setRequirePath("scope-combined/", "chrome://scope-combined/content/");
    var commando = require("commando/commando");
    var system   = require("sdk/system");
    
    try {
        commando.registerScope("scope-combined", {
            name: "Everything",
            description: "Access all scopes at once",
            weight: 100,
            icon: "koicon://ko-svg/chrome/icomoon/skin/search3.svg?size=16",
            handler: "scope-combined/everything",
            quickscope: true
        });
    } catch (e) {
        Cu.reportError("Commando: Exception while registering scope 'Combined - Everything'");
        Cu.reportError(e);
    }

    try {
        commando.registerScope("scope-combined-toolscmds", {
            name: "Tools and Commands",
            icon: "koicon://ko-svg/chrome/icomoon/skin/cogs.svg?size=16",
            handler: "scope-combined/toolscommands",
            accesskey: "l",
            keybindTransit: "cmd_invokeTool"
        });
    } catch (e) {
        Cu.reportError("Commando: Exception while registering scope 'Combined - Tools & Commands'");
        Cu.reportError(e);
    }
}
Ejemplo n.º 2
0
function loadIntoWindow(window) {
    try {
        var require = window.require;
        require.setRequirePath("scope-files/", "chrome://scope-files/content/");
        var commando = require("commando/commando");
        var system   = require("sdk/system");
        commando.registerScope("scope-files", {
            name: "Files",
            description: "Search through your project files",
            icon: "koicon://ko-svg/chrome/fontawesome/skin/file.svg?size=16",
            handler: "scope-files/files",
            keybindTransit: "cmd_goToFile"
        });
    } catch (e) {
        Cu.reportError("Commando: Exception while registering scope 'Files'");
        Cu.reportError(e);
    }

    try {
        var component = startupData.installPath.clone();
        component.append("components");
        component.append("component.manifest");

        var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
        registrar.autoRegister(component);
    } catch (e) {
        Cu.reportError("Commando: Exception while registering component for 'Files' scope");
        Cu.reportError(e);
    }

    window.require("scope-files/files").prepare();
}
Ejemplo n.º 3
0
function loadIntoWindow(window) {
    try {
        var require = window.require;
        require.setRequirePath("scope-openfiles/", "chrome://scope-openfiles/content/");
        var commando = require("commando/commando");
        var system   = require("sdk/system");
        commando.registerScope("scope-openfiles", {
            name: "Open Files",
            description: "Access your opened files",
            icon: "koicon://ko-svg/chrome/icomoon/skin/files.svg",
            handler: "scope-openfiles/openfiles"
        });
    } catch (e) {
        Cu.reportError("Commando: Exception while registering scope 'openfiles'");
        Cu.reportError(e);
    }
}