mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 22:37:58 +01:00
Merge changes from bootstrapped.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const Abbreviation = Class("Abbreviation", {
|
||||
var Abbreviation = Class("Abbreviation", {
|
||||
init: function (modes, lhs, rhs) {
|
||||
this.modes = modes.sort();
|
||||
this.lhs = lhs;
|
||||
@@ -41,7 +41,7 @@ const Abbreviation = Class("Abbreviation", {
|
||||
}
|
||||
});
|
||||
|
||||
const Abbreviations = Module("abbreviations", {
|
||||
var Abbreviations = Module("abbreviations", {
|
||||
init: function () {
|
||||
this.abbrevs = {};
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const AutoCommand = Struct("event", "pattern", "command");
|
||||
var AutoCommand = Struct("event", "pattern", "command");
|
||||
|
||||
/**
|
||||
* @instance autocommands
|
||||
*/
|
||||
const AutoCommands = Module("autocommands", {
|
||||
var AutoCommands = Module("autocommands", {
|
||||
init: function () {
|
||||
this._store = [];
|
||||
},
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
|
||||
var DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
|
||||
|
||||
// also includes methods for dealing with keywords and search engines
|
||||
const Bookmarks = Module("bookmarks", {
|
||||
var Bookmarks = Module("bookmarks", {
|
||||
init: function () {
|
||||
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
||||
if (["add", "change", "remove"].indexOf(event) >= 0)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @instance browser
|
||||
*/
|
||||
const Browser = Module("browser", {
|
||||
var Browser = Module("browser", {
|
||||
}, {
|
||||
climbUrlPath: function (count) {
|
||||
let url = util.newURI(buffer.URL);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const Point = Struct("x", "y");
|
||||
var Point = Struct("x", "y");
|
||||
|
||||
/**
|
||||
* A class to manage the primary web content buffer. The name comes
|
||||
@@ -16,7 +16,7 @@ const Point = Struct("x", "y");
|
||||
* files.
|
||||
* @instance buffer
|
||||
*/
|
||||
const Buffer = Module("buffer", {
|
||||
var Buffer = Module("buffer", {
|
||||
init: function () {
|
||||
this.evaluateXPath = util.evaluateXPath;
|
||||
this.pageInfo = {};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const CommandWidgets = Class("CommandWidgets", {
|
||||
var CommandWidgets = Class("CommandWidgets", {
|
||||
init: function () {
|
||||
this.elements = {};
|
||||
this.addElement({
|
||||
@@ -200,7 +200,7 @@ const CommandWidgets = Class("CommandWidgets", {
|
||||
* It consists of a prompt and command field be sure to only create objects of
|
||||
* this class when the chrome is ready.
|
||||
*/
|
||||
const CommandLine = Module("commandline", {
|
||||
var CommandLine = Module("commandline", {
|
||||
init: function () {
|
||||
const self = this;
|
||||
|
||||
@@ -1766,7 +1766,7 @@ const CommandLine = Module("commandline", {
|
||||
* must be in its own container element, whose height it will update as
|
||||
* necessary.
|
||||
*/
|
||||
const ItemList = Class("ItemList", {
|
||||
var ItemList = Class("ItemList", {
|
||||
init: function (id) {
|
||||
this._completionElements = [];
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
* @property {string} description A description of the option
|
||||
*/
|
||||
|
||||
const CommandOption = Struct("names", "type", "validator", "completer", "multiple", "description", "default");
|
||||
var CommandOption = Struct("names", "type", "validator", "completer", "multiple", "description", "default");
|
||||
CommandOption.defaultValue("description", function () "");
|
||||
CommandOption.defaultValue("type", function () CommandOption.NOARG);
|
||||
CommandOption.defaultValue("multiple", function () false);
|
||||
|
||||
const ArgType = Struct("description", "parse");
|
||||
var ArgType = Struct("description", "parse");
|
||||
update(CommandOption, {
|
||||
/**
|
||||
* @property {object} The option argument is unspecified. Any argument
|
||||
@@ -108,7 +108,7 @@ update(CommandOption, {
|
||||
* @optional
|
||||
* @private
|
||||
*/
|
||||
const Command = Class("Command", {
|
||||
var Command = Class("Command", {
|
||||
init: function (specs, description, action, extraInfo) {
|
||||
specs = Array.concat(specs); // XXX
|
||||
let parsedSpecs = Command.parseSpecs(specs);
|
||||
@@ -377,7 +377,7 @@ const Command = Class("Command", {
|
||||
});
|
||||
|
||||
// Prototype.
|
||||
const ex = {
|
||||
var ex = {
|
||||
_args: function (cmd, args) {
|
||||
args = Array.slice(args);
|
||||
|
||||
@@ -427,7 +427,7 @@ const ex = {
|
||||
/**
|
||||
* @instance commands
|
||||
*/
|
||||
const Commands = Module("commands", {
|
||||
var Commands = Module("commands", {
|
||||
init: function () {
|
||||
this._exCommands = [];
|
||||
this._exMap = {};
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* @author Kris Maglione <maglione.k@gmail.com>
|
||||
* @constructor
|
||||
*/
|
||||
const CompletionContext = Class("CompletionContext", {
|
||||
var CompletionContext = Class("CompletionContext", {
|
||||
init: function (editor, name, offset) {
|
||||
if (!name)
|
||||
name = "";
|
||||
@@ -825,7 +825,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
/**
|
||||
* @instance completion
|
||||
*/
|
||||
const Completion = Module("completion", {
|
||||
var Completion = Module("completion", {
|
||||
init: function () {
|
||||
},
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
const ConfigBase = Class(ModuleBase, {
|
||||
var ConfigBase = Class(ModuleBase, {
|
||||
/**
|
||||
* Called on dactyl startup to allow for any arbitrary application-specific
|
||||
* initialization code. Must call superclass's init function.
|
||||
|
||||
@@ -12,14 +12,14 @@ default xml namespace = XHTML;
|
||||
XML.ignoreWhitespace = false;
|
||||
XML.prettyPrinting = false;
|
||||
|
||||
const plugins = { __proto__: modules };
|
||||
const userContext = newContext(modules);
|
||||
var plugins = { __proto__: modules };
|
||||
var userContext = newContext(modules);
|
||||
|
||||
const EVAL_ERROR = "__dactyl_eval_error";
|
||||
const EVAL_RESULT = "__dactyl_eval_result";
|
||||
const EVAL_STRING = "__dactyl_eval_string";
|
||||
var EVAL_ERROR = "__dactyl_eval_error";
|
||||
var EVAL_RESULT = "__dactyl_eval_result";
|
||||
var EVAL_STRING = "__dactyl_eval_string";
|
||||
|
||||
const Dactyl = Module("dactyl", {
|
||||
var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
init: function () {
|
||||
window.dactyl = this;
|
||||
// cheap attempt at compatibility
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// http://developer.mozilla.org/en/docs/Editor_Embedding_Guide
|
||||
|
||||
/** @instance editor */
|
||||
const Editor = Module("editor", {
|
||||
var Editor = Module("editor", {
|
||||
get isCaret() modes.getStack(1).main == modes.CARET,
|
||||
get isTextEdit() modes.getStack(1).main == modes.TEXT_EDIT,
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @instance events
|
||||
*/
|
||||
const Events = Module("events", {
|
||||
var Events = Module("events", {
|
||||
init: function () {
|
||||
this._fullscreen = window.fullScreen;
|
||||
this._lastFocus = null;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/** @scope modules */
|
||||
|
||||
/** @instance rangefinder */
|
||||
const RangeFinder = Module("rangefinder", {
|
||||
var RangeFinder = Module("rangefinder", {
|
||||
init: function () {
|
||||
this.lastFindPattern = "";
|
||||
},
|
||||
@@ -251,7 +251,7 @@ const RangeFinder = Module("rangefinder", {
|
||||
* documents, and represents a major detriment to productivity where
|
||||
* large amounts of data are concerned (e.g., for API documents).
|
||||
*/
|
||||
const RangeFind = Class("RangeFind", {
|
||||
var RangeFind = Class("RangeFind", {
|
||||
init: function (matchCase, backward, elementPath, regexp) {
|
||||
this.window = Cu.getWeakReference(window);
|
||||
this.baseDocument = Cu.getWeakReference(content.document);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/** @scope modules */
|
||||
/** @instance hints */
|
||||
|
||||
const Hints = Module("hints", {
|
||||
var Hints = Module("hints", {
|
||||
init: function init() {
|
||||
const self = this;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
const History = Module("history", {
|
||||
var History = Module("history", {
|
||||
get format() bookmarks.format,
|
||||
|
||||
get service() services.history,
|
||||
|
||||
@@ -38,7 +38,7 @@ function Script(file) {
|
||||
* Provides a basic interface to common system I/O operations.
|
||||
* @instance io
|
||||
*/
|
||||
const IO = Module("io", {
|
||||
var IO = Module("io", {
|
||||
init: function () {
|
||||
this._processDir = services.directory.get("CurWorkD", Ci.nsIFile);
|
||||
this._cwd = this._processDir.path;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
// TODO: Clean this up.
|
||||
|
||||
const JavaScript = Module("javascript", {
|
||||
var JavaScript = Module("javascript", {
|
||||
init: function () {
|
||||
this._stack = [];
|
||||
this._functions = [];
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* @optional
|
||||
* @private
|
||||
*/
|
||||
const Map = Class("Map", {
|
||||
var Map = Class("Map", {
|
||||
init: function (modes, keys, description, action, extraInfo) {
|
||||
modes = Array.concat(modes).map(function (m) isObject(m) ? m.mask : m);
|
||||
if (!modes.every(util.identity))
|
||||
@@ -127,7 +127,7 @@ const Map = Class("Map", {
|
||||
/**
|
||||
* @instance mappings
|
||||
*/
|
||||
const Mappings = Module("mappings", {
|
||||
var Mappings = Module("mappings", {
|
||||
init: function () {
|
||||
this._main = []; // default mappings
|
||||
this._user = []; // user created mappings
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* @scope modules
|
||||
* @instance marks
|
||||
*/
|
||||
const Marks = Module("marks", {
|
||||
var Marks = Module("marks", {
|
||||
init: function init() {
|
||||
function replacer(key, val) val instanceof Ci.nsISupports ? null : val;
|
||||
this._localMarks = storage.newMap("local-marks", { privateData: true, replacer: replacer, store: true });
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const Modes = Module("modes", {
|
||||
var Modes = Module("modes", {
|
||||
init: function () {
|
||||
this.modeChars = {};
|
||||
this._main = 1; // NORMAL
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @class ModuleBase
|
||||
* The base class for all modules.
|
||||
*/
|
||||
const ModuleBase = Class("ModuleBase", {
|
||||
var ModuleBase = Class("ModuleBase", {
|
||||
/**
|
||||
* @property {[string]} A list of module prerequisites which
|
||||
* must be initialized before this module is loaded.
|
||||
|
||||
@@ -34,7 +34,7 @@ let ValueError = Class("ValueError", ErrorBase);
|
||||
* @optional
|
||||
* @private
|
||||
*/
|
||||
const Option = Class("Option", {
|
||||
var Option = Class("Option", {
|
||||
init: function (names, description, type, defaultValue, extraInfo) {
|
||||
this.name = names[0];
|
||||
this.names = names;
|
||||
@@ -618,7 +618,7 @@ const Option = Class("Option", {
|
||||
/**
|
||||
* @instance options
|
||||
*/
|
||||
const Options = Module("options", {
|
||||
var Options = Module("options", {
|
||||
init: function () {
|
||||
this.needInit = [];
|
||||
this._options = [];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @instance quickmarks
|
||||
*/
|
||||
const QuickMarks = Module("quickmarks", {
|
||||
var QuickMarks = Module("quickmarks", {
|
||||
init: function () {
|
||||
this._qmarks = storage.newMap("quickmarks", { store: true });
|
||||
storage.addObserver("quickmarks", function () {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
const StatusLine = Module("statusline", {
|
||||
var StatusLine = Module("statusline", {
|
||||
init: function () {
|
||||
this._statusLine = document.getElementById("status-bar");
|
||||
this.statusBar = document.getElementById("addon-bar") || this._statusLine;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/**
|
||||
* @instance tabs
|
||||
*/
|
||||
const Tabs = Module("tabs", {
|
||||
var Tabs = Module("tabs", {
|
||||
init: function () {
|
||||
this._alternates = [config.tabbrowser.mCurrentTab, null];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user