mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 08:37:59 +01:00
Fix deleting files after viewing them from source links in :list*.
This commit is contained in:
@@ -8,7 +8,7 @@ GOOGLE_PROJ = dactyl
|
||||
GOOGLE = https://$(GOOGLE_PROJ).googlecode.com/files
|
||||
VERSION ?= $(shell sed -n 's/.*em:version\(>\|="\)\(.*\)["<].*/\2/p' $(TOP)/install.rdf | sed 1q)
|
||||
UUID := $(shell sed -n 's/.*em:id\(>\|="\)\(.*\)["<].*/\2/p' $(TOP)/install.rdf | sed 1q)
|
||||
MANGLE := $(shell date | md5sum - | awk '{ print $$1 }')
|
||||
MANGLE := $(shell date '+%s' | awk '{ printf "%x", $$1 }')
|
||||
|
||||
LOCALEDIR = locale
|
||||
DOC_FILES = $(wildcard $(LOCALEDIR)/*/*.xml)
|
||||
@@ -163,7 +163,7 @@ $(XPI): $(CHROME)
|
||||
@echo "Building XPI..."
|
||||
mkdir -p $(XPI_PATH)
|
||||
|
||||
$(AWK) -v 'name=$(NAME)' -v 'chrome=$(MANGLE)' \
|
||||
$(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \
|
||||
-f $(BASE)/process_manifest.awk \
|
||||
$(TOP)/chrome.manifest >$(XPI_PATH)/chrome.manifest
|
||||
|
||||
|
||||
16
common/bootstrap.js
vendored
16
common/bootstrap.js
vendored
@@ -47,7 +47,6 @@ let basePath = null;
|
||||
let components = {};
|
||||
let getURI = null;
|
||||
storage.set("dactyl.bootstrap", this);
|
||||
var JSMLoader = storage.get("dactyl.JSMLoader", { get load() Cu.import });
|
||||
|
||||
function startup(data, reason) {
|
||||
dump("dactyl: bootstrap: startup " + reasonToString(reason) + "\n");
|
||||
@@ -62,7 +61,7 @@ function startup(data, reason) {
|
||||
AddonManager.getAddonByID(addon.id, function (a) { addon = a; });
|
||||
|
||||
// Temporary hack.
|
||||
if (basePath.isDirectory() && JSMLoader.bump == null)
|
||||
if (basePath.isDirectory() && false && JSMLoader.bump == null)
|
||||
JSMLoader.bump = 1;
|
||||
|
||||
if (basePath.isDirectory())
|
||||
@@ -147,17 +146,26 @@ function init() {
|
||||
break;
|
||||
|
||||
case "resource":
|
||||
let str = "dactyl-";
|
||||
if (fields[1].indexOf(str) == 0)
|
||||
var prefix = fields[1].substr(str.length);
|
||||
|
||||
resourceProto.setSubstitution(fields[1], getURI(fields[2]));
|
||||
}
|
||||
}
|
||||
|
||||
JSMLoader.load("resource://dactyl/base.jsm", global);
|
||||
if (typeof JSMLoader === "undefined")
|
||||
Cu.import("resource://dactyl/bootstrap.jsm", global);
|
||||
else {
|
||||
Cu.import("resource://dactyl/bootstrap.jsm", {}).JSMLoader = JSMLoader;
|
||||
JSMLoader.load("resource://dactyl/bootstrap.jsm", global);
|
||||
}
|
||||
|
||||
for each (let component in components)
|
||||
component.register();
|
||||
|
||||
Services.obs.notifyObservers(null, "dactyl-rehash", null);
|
||||
JSMLoader.load("resource://dactyl/base.jsm", global);
|
||||
JSMLoader.load("resource://dactyl/bootstrap.jsm", global);
|
||||
|
||||
require(global, "services");
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ var Buffer = Module("buffer", {
|
||||
* buffer. Only returns style sheets for the 'screen' media type.
|
||||
*/
|
||||
get alternateStyleSheets() {
|
||||
let stylesheets = window.getAllStyleSheets(buffer.focusedFrame);
|
||||
let stylesheets = window.getAllStyleSheets(this.focusedFrame);
|
||||
|
||||
return stylesheets.filter(
|
||||
function (stylesheet) /^(screen|all|)$/i.test(stylesheet.media.mediaText) && !/^\s*$/.test(stylesheet.title)
|
||||
@@ -362,9 +362,9 @@ var Buffer = Module("buffer", {
|
||||
* @property {number} True when the buffer is fully loaded.
|
||||
*/
|
||||
get loaded() Math.min.apply(null,
|
||||
buffer.allFrames()
|
||||
.map(function (frame) ["loading", "interactive", "complete"]
|
||||
.indexOf(frame.document.readyState))),
|
||||
this.allFrames()
|
||||
.map(function (frame) ["loading", "interactive", "complete"]
|
||||
.indexOf(frame.document.readyState))),
|
||||
|
||||
/**
|
||||
* @property {Object} The local state store for the currently selected
|
||||
@@ -425,7 +425,7 @@ var Buffer = Module("buffer", {
|
||||
* @property {number} The buffer's horizontal scroll percentile.
|
||||
*/
|
||||
get scrollXPercent() {
|
||||
let elem = buffer.findScrollable(0, true);
|
||||
let elem = this.findScrollable(0, true);
|
||||
if (elem.scrollWidth - elem.clientWidth === 0)
|
||||
return 0;
|
||||
return elem.scrollLeft * 100 / (elem.scrollWidth - elem.clientWidth);
|
||||
@@ -435,7 +435,7 @@ var Buffer = Module("buffer", {
|
||||
* @property {number} The buffer's vertical scroll percentile.
|
||||
*/
|
||||
get scrollYPercent() {
|
||||
let elem = buffer.findScrollable(0, false);
|
||||
let elem = this.findScrollable(0, false);
|
||||
if (elem.scrollHeight - elem.clientHeight === 0)
|
||||
return 0;
|
||||
return elem.scrollTop * 100 / (elem.scrollHeight - elem.clientHeight);
|
||||
@@ -491,7 +491,7 @@ var Buffer = Module("buffer", {
|
||||
* @returns {string}
|
||||
*/
|
||||
getCurrentWord: function (win) {
|
||||
win = win || buffer.focusedFrame || content;
|
||||
win = win || this.focusedFrame || content;
|
||||
let selection = win.getSelection();
|
||||
if (selection.rangeCount == 0)
|
||||
return "";
|
||||
@@ -545,7 +545,7 @@ var Buffer = Module("buffer", {
|
||||
|
||||
if (elem instanceof HTMLInputElement && elem.type == "file") {
|
||||
Buffer.openUploadPrompt(elem);
|
||||
buffer.lastInputField = elem;
|
||||
this.lastInputField = elem;
|
||||
}
|
||||
else {
|
||||
if (isinstance(elem, [HTMLInputElement, XULTextBoxElement]))
|
||||
@@ -635,11 +635,11 @@ var Buffer = Module("buffer", {
|
||||
}
|
||||
}
|
||||
|
||||
for (let frame in values(buffer.allFrames(null, true)))
|
||||
for (let frame in values(this.allFrames(null, true)))
|
||||
for (let elem in followFrame(frame))
|
||||
if (count-- === 0) {
|
||||
if (follow)
|
||||
buffer.followLink(elem, dactyl.CURRENT_TAB);
|
||||
this.followLink(elem, dactyl.CURRENT_TAB);
|
||||
return elem;
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ var Buffer = Module("buffer", {
|
||||
let { left: offsetX, top: offsetY } = elem.getBoundingClientRect();
|
||||
|
||||
if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement]))
|
||||
return buffer.focusElement(elem);
|
||||
return this.focusElement(elem);
|
||||
if (isinstance(elem, HTMLLinkElement))
|
||||
return dactyl.open(elem.href, where);
|
||||
|
||||
@@ -690,7 +690,7 @@ var Buffer = Module("buffer", {
|
||||
dactyl.log("Invalid where argument for followLink()", 0);
|
||||
}
|
||||
|
||||
buffer.focusElement(elem);
|
||||
this.focusElement(elem);
|
||||
|
||||
prefs.withContext(function () {
|
||||
prefs.set("browser.tabs.loadInBackground", true);
|
||||
@@ -758,7 +758,7 @@ var Buffer = Module("buffer", {
|
||||
_scrollByScrollSize: function _scrollByScrollSize(count, direction) {
|
||||
if (count > 0)
|
||||
options["scroll"] = count;
|
||||
buffer.scrollByScrollSize(direction);
|
||||
this.scrollByScrollSize(direction);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -774,7 +774,7 @@ var Buffer = Module("buffer", {
|
||||
count = count || 1;
|
||||
|
||||
if (options["scroll"] > 0)
|
||||
this.scrollLines(options["scroll"] * direction);
|
||||
this.scrollVertical("lines", options["scroll"] * direction);
|
||||
else
|
||||
this.scrollVertical("pages", direction / 2);
|
||||
},
|
||||
@@ -790,14 +790,14 @@ var Buffer = Module("buffer", {
|
||||
}
|
||||
|
||||
try {
|
||||
var elem = buffer.focusedFrame.document.activeElement;
|
||||
var elem = this.focusedFrame.document.activeElement;
|
||||
if (elem == elem.ownerDocument.body)
|
||||
elem = null;
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
try {
|
||||
var sel = buffer.focusedFrame.getSelection();
|
||||
var sel = this.focusedFrame.getSelection();
|
||||
}
|
||||
catch (e) {}
|
||||
if (!elem && sel && sel.rangeCount)
|
||||
@@ -806,11 +806,11 @@ var Buffer = Module("buffer", {
|
||||
elem = find(elem);
|
||||
|
||||
if (!(elem instanceof Element)) {
|
||||
let doc = buffer.findScrollableWindow().document;
|
||||
let doc = this.findScrollableWindow().document;
|
||||
elem = find(doc.body || doc.getElementsByTagName("body")[0] ||
|
||||
doc.documentElement);
|
||||
}
|
||||
let doc = buffer.focusedFrame.document;
|
||||
let doc = this.focusedFrame.document;
|
||||
return elem || doc.body || doc.documentElement;
|
||||
},
|
||||
|
||||
@@ -846,7 +846,7 @@ var Buffer = Module("buffer", {
|
||||
if (!(content.document instanceof HTMLDocument))
|
||||
return;
|
||||
|
||||
let frames = buffer.allFrames();
|
||||
let frames = this.allFrames();
|
||||
|
||||
if (frames.length == 0) // currently top is always included
|
||||
return;
|
||||
@@ -858,7 +858,7 @@ var Buffer = Module("buffer", {
|
||||
rect.width && rect.height);
|
||||
|
||||
// find the currently focused frame index
|
||||
let current = Math.max(0, frames.indexOf(buffer.focusedFrame));
|
||||
let current = Math.max(0, frames.indexOf(this.focusedFrame));
|
||||
|
||||
// calculate the next frame to focus
|
||||
let next = current + count;
|
||||
@@ -921,7 +921,7 @@ var Buffer = Module("buffer", {
|
||||
|
||||
let option = sections || options["pageinfo"];
|
||||
let list = template.map(option, function (option) {
|
||||
let opt = buffer.pageInfo[option];
|
||||
let opt = this.pageInfo[option];
|
||||
return opt ? template.table(opt[1], opt[0](true)) : undefined;
|
||||
}, <br/>);
|
||||
dactyl.echo(list, commandline.FORCE_MULTILINE);
|
||||
@@ -945,7 +945,7 @@ var Buffer = Module("buffer", {
|
||||
// copied (and tuned somewhat) from browser.jar -> nsContextMenu.js
|
||||
let win = document.commandDispatcher.focusedWindow;
|
||||
if (win == window)
|
||||
win = buffer.focusedFrame;
|
||||
win = this.focusedFrame;
|
||||
|
||||
let charset = win ? "charset=" + win.document.characterSet : null;
|
||||
|
||||
@@ -964,7 +964,7 @@ var Buffer = Module("buffer", {
|
||||
* @param {boolean} useExternalEditor View the source in the external editor.
|
||||
*/
|
||||
viewSource: function (url, useExternalEditor) {
|
||||
let doc = buffer.focusedFrame.document;
|
||||
let doc = this.focusedFrame.document;
|
||||
|
||||
if (isArray(url)) {
|
||||
if (options.get("editor").has("line"))
|
||||
@@ -1006,9 +1006,9 @@ var Buffer = Module("buffer", {
|
||||
XPCOM([Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference]), {
|
||||
init: function (doc, callback) {
|
||||
this.callback = callable(callback) ? callback :
|
||||
function (file) {
|
||||
function (file, temp) {
|
||||
editor.editFileExternally({ file: file.path, line: callback },
|
||||
function () { file.remove(false); });
|
||||
function () { temp && file.remove(false); });
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -1019,12 +1019,12 @@ var Buffer = Module("buffer", {
|
||||
let encoder = services.HtmlEncoder();
|
||||
encoder.init(doc, "text/unicode", encoder.OutputRaw|encoder.OutputPreformatted);
|
||||
temp.write(encoder.encodeToString(), ">");
|
||||
return this.callback(temp);
|
||||
return this.callback(temp, true);
|
||||
}, this, true);
|
||||
|
||||
let file = util.getFile(uri);
|
||||
if (file)
|
||||
this.callback(file);
|
||||
this.callback(file, false);
|
||||
else {
|
||||
this.file = io.createTempFile();
|
||||
var persist = services.Persist();
|
||||
@@ -1038,7 +1038,7 @@ var Buffer = Module("buffer", {
|
||||
onStateChange: function (progress, request, flag, status) {
|
||||
if ((flag & Ci.nsIWebProgressListener.STATE_STOP) && status == 0) {
|
||||
try {
|
||||
var ok = this.callback(this.file);
|
||||
var ok = this.callback(this.file, true);
|
||||
}
|
||||
finally {
|
||||
if (ok !== true)
|
||||
@@ -1056,7 +1056,7 @@ var Buffer = Module("buffer", {
|
||||
* @param {boolean} fullZoom Whether to use full zoom or text zoom.
|
||||
*/
|
||||
zoomIn: function (steps, fullZoom) {
|
||||
buffer.bumpZoomLevel(steps, fullZoom);
|
||||
this.bumpZoomLevel(steps, fullZoom);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1066,7 +1066,7 @@ var Buffer = Module("buffer", {
|
||||
* @param {boolean} fullZoom Whether to use full zoom or text zoom.
|
||||
*/
|
||||
zoomOut: function (steps, fullZoom) {
|
||||
buffer.bumpZoomLevel(-steps, fullZoom);
|
||||
this.bumpZoomLevel(-steps, fullZoom);
|
||||
},
|
||||
|
||||
setZoom: function setZoom(value, fullZoom) {
|
||||
@@ -1099,11 +1099,12 @@ var Buffer = Module("buffer", {
|
||||
if (i == cur && fullZoom == ZoomManager.useFullZoom)
|
||||
dactyl.beep();
|
||||
|
||||
buffer.setZoom(Math.round(values[i] * 100), fullZoom);
|
||||
this.setZoom(Math.round(values[i] * 100), fullZoom);
|
||||
}
|
||||
}, {
|
||||
ZOOM_MIN: Class.memoize(function () prefs.get("zoom.minPercent")),
|
||||
ZOOM_MAX: Class.memoize(function () prefs.get("zoom.maxPercent")),
|
||||
|
||||
setZoom: deprecated("Please use buffer.setZoom instead", function setZoom() buffer.setZoom.apply(buffer, arguments)),
|
||||
bumpZoomLevel: deprecated("Please use buffer.bumpZoomLevel instead", function bumpZoomLevel() buffer.bumpZoomLevel.apply(buffer, arguments)),
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ var StatusLine = Module("statusline", {
|
||||
if (progress <= 0)
|
||||
progressStr = "[ Loading... ]";
|
||||
else if (progress < 1) {
|
||||
progress = Math.floor(progress * 20);
|
||||
progress = Math.round(progress * 20);
|
||||
progressStr = "["
|
||||
+ "===================> "
|
||||
.substr(20 - progress, 20)
|
||||
|
||||
@@ -1,76 +1,14 @@
|
||||
// Copyright (c) 2009-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||
// Copyright (c) 2009-2011 by Kris Maglione <maglione.k@gmail.com>
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
if (!JSMLoader || JSMLoader.bump != 1)
|
||||
var JSMLoader = {
|
||||
bump: 1,
|
||||
builtin: Components.utils.Sandbox(this),
|
||||
canonical: {},
|
||||
factories: [],
|
||||
globals: {},
|
||||
io: Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService),
|
||||
manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar),
|
||||
stale: {},
|
||||
getTarget: function getTarget(url) {
|
||||
let chan = this.io.newChannel(url, null, null);
|
||||
chan.cancel(Components.results.NS_BINDING_ABORTED);
|
||||
return chan.name;
|
||||
},
|
||||
load: function load(url, target) {
|
||||
let stale = this.stale[url];
|
||||
if (stale) {
|
||||
delete this.stale[url];
|
||||
|
||||
let global = this.globals[url];
|
||||
for each (let prop in Object.getOwnPropertyNames(global))
|
||||
try {
|
||||
if (!(prop in this.builtin) &&
|
||||
[this, set].indexOf(Object.getOwnPropertyDescriptor(global, prop).value) < 0 &&
|
||||
!global.__lookupGetter__(prop))
|
||||
global[prop] = undefined;
|
||||
}
|
||||
catch (e) {
|
||||
dump("Deleting property " + prop + " on " + url + ":\n " + e + "\n");
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
|
||||
if (stale === this.getTarget(url))
|
||||
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader)
|
||||
.loadSubScript(url, global);
|
||||
}
|
||||
|
||||
let global = Components.utils.import(url, target);
|
||||
return this.globals[url] = global;
|
||||
},
|
||||
cleanup: function unregister() {
|
||||
for each (let factory in this.factories.splice(0))
|
||||
this.manager.unregisterFactory(factory.classID, factory);
|
||||
},
|
||||
purge: function purge() {
|
||||
for (let [url, global] in Iterator(this.globals))
|
||||
this.stale[url] = this.getTarget(url);
|
||||
},
|
||||
registerFactory: function registerFactory(factory) {
|
||||
this.manager.registerFactory(factory.classID,
|
||||
String(factory.classID),
|
||||
factory.contractID,
|
||||
factory);
|
||||
this.factories.push(factory);
|
||||
}
|
||||
};
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cr = Components.results;
|
||||
var Cu = Components.utils;
|
||||
|
||||
Cc["@mozilla.org/fuel/application;1"].getService(Ci.fuelIApplication)
|
||||
.storage.set("dactyl.JSMLoader", JSMLoader);
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
try {
|
||||
var ctypes;
|
||||
@@ -161,8 +99,10 @@ if (!Object.keys)
|
||||
let use = {};
|
||||
let loaded = {};
|
||||
let currentModule;
|
||||
function defineModule(name, params) {
|
||||
let module = Cu.getGlobalForObject ? Cu.getGlobalForObject(params) : params.__parent__;
|
||||
let global = this;
|
||||
function defineModule(name, params, module) {
|
||||
if (!module)
|
||||
module = Cu.getGlobalForObject ? Cu.getGlobalForObject(params) : params.__parent__;
|
||||
|
||||
module.NAME = name;
|
||||
module.EXPORTED_SYMBOLS = params.exports || [];
|
||||
@@ -230,7 +170,7 @@ function endModule() {
|
||||
function require(obj, name, from) {
|
||||
try {
|
||||
defineModule.loadLog.push((from || "require") + ": loading " + name + " into " + obj.NAME);
|
||||
JSMLoader.load("resource://dactyl/" + name + ".jsm", obj);
|
||||
JSMLoader.load(name + ".jsm", obj);
|
||||
}
|
||||
catch (e) {
|
||||
defineModule.dump("loading " + String.quote("resource://dactyl/" + name + ".jsm") + "\n");
|
||||
@@ -252,7 +192,7 @@ defineModule("base", {
|
||||
"require", "set", "update", "values", "withCallerGlobal"
|
||||
],
|
||||
use: ["config", "services", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
function Runnable(self, func, args) {
|
||||
return {
|
||||
@@ -329,12 +269,14 @@ function deprecated(reason, fn) {
|
||||
|
||||
function deprecatedMethod() {
|
||||
let frame = Components.stack.caller;
|
||||
let obj = this.className || this.constructor.className;
|
||||
let obj = this.className ? this.className + "#" :
|
||||
this.constructor.className ? this.constructor.className + "#" :
|
||||
"";
|
||||
let filename = frame.filename.replace(/.* -> /, "");
|
||||
if (!set.add(deprecatedMethod.seen, filename))
|
||||
util.dactyl(fn).echoerr(
|
||||
util.urlPath(filename || "unknown") + ":" + frame.lineNumber + ": " +
|
||||
(obj ? obj + "." : "") + (fn.name || name) + " is deprecated: " + reason);
|
||||
obj + (fn.name || name) + " is deprecated: " + reason);
|
||||
return func.apply(this, arguments);
|
||||
}
|
||||
deprecatedMethod.seen = {
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("bookmarkcache", {
|
||||
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
||||
require: ["services", "storage", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var Bookmark = Struct("url", "title", "icon", "post", "keyword", "tags", "charset", "id");
|
||||
var Keyword = Struct("keyword", "title", "icon", "url");
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("completion", {
|
||||
exports: ["CompletionContext", "Completion", "completion"],
|
||||
use: ["config", "template", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
/**
|
||||
* Creates a new completion context.
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("config", {
|
||||
exports: ["ConfigBase", "Config", "config"],
|
||||
require: ["highlight", "services", "storage", "util", "template"],
|
||||
use: ["io"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var ConfigBase = Class("ConfigBase", {
|
||||
/**
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("finder", {
|
||||
exports: ["RangeFind", "RangeFinder", "rangefinder"],
|
||||
use: ["prefs", "services", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
/** @instance rangefinder */
|
||||
var RangeFinder = Module("rangefinder", {
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("highlight", {
|
||||
exports: ["Highlight", "Highlights", "highlight"],
|
||||
require: ["services", "styles", "util"],
|
||||
use: ["template"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var Highlight = Struct("class", "selector", "sites",
|
||||
"defaultExtends", "defaultValue",
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("io", {
|
||||
exports: ["IO", "io"],
|
||||
require: ["services"],
|
||||
use: ["config", "storage", "styles", "template", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
// TODO: why are we passing around strings rather than file objects?
|
||||
/**
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("javascript", {
|
||||
exports: ["JavaScript", "javascript"],
|
||||
use: ["services", "template", "util"],
|
||||
});
|
||||
}, this);
|
||||
|
||||
// TODO: Clean this up.
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("overlay", {
|
||||
exports: ["ModuleBase"],
|
||||
require: ["config", "sanitizer", "services", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
/**
|
||||
* @class ModuleBase
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("prefs", {
|
||||
exports: ["Prefs", "localPrefs", "prefs"],
|
||||
require: ["services", "util"],
|
||||
use: ["config", "template"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
|
||||
SAVED: "extensions.dactyl.saved.",
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("sanitizer", {
|
||||
exports: ["Range", "Sanitizer", "sanitizer"],
|
||||
require: ["prefs", "services", "storage", "template", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
let tmp = {};
|
||||
services.subscriptLoader.loadSubScript("chrome://browser/content/sanitize.js", tmp);
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
try {
|
||||
|
||||
var global = this;
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("services", {
|
||||
exports: ["AddonManager", "services"],
|
||||
use: ["util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
/**
|
||||
* A lazily-instantiated XPCOM class and service cache.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
"use strict";
|
||||
|
||||
var myObject = Object;
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("storage", {
|
||||
exports: ["File", "storage"],
|
||||
require: ["services", "util"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var win32 = /^win(32|nt)$/i.test(services.runtime.OS);
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("styles", {
|
||||
exports: ["Style", "Styles", "styles"],
|
||||
require: ["services", "util"],
|
||||
use: ["template"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
function cssUri(css) "chrome-data:text/css," + encodeURI(css);
|
||||
var namespace = "@namespace html " + XHTML.uri.quote() + ";\n" +
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("template", {
|
||||
exports: ["Template", "template"],
|
||||
require: ["util"],
|
||||
use: ["services"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
default xml namespace = XHTML;
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
try {
|
||||
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("util", {
|
||||
exports: ["FailedAssertion", "Math", "NS", "Point", "Util", "XBL", "XHTML", "XUL", "util"],
|
||||
require: ["services"],
|
||||
use: ["config", "highlight", "storage", "template"]
|
||||
});
|
||||
}, this);
|
||||
|
||||
var XBL = Namespace("xbl", "http://www.mozilla.org/xbl");
|
||||
var XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
BEGIN { if (!chrome) chrome = "chrome" }
|
||||
BEGIN {
|
||||
chrome = "chrome"
|
||||
if (suffix)
|
||||
chrome = suffix
|
||||
}
|
||||
{ content = $1 ~ /^(content|skin|locale|resource)$/ }
|
||||
content && $NF ~ /^[a-z]/ { $NF = "/" name "/" $NF }
|
||||
content {
|
||||
@@ -11,5 +15,10 @@ content {
|
||||
{
|
||||
sub("^\\.\\./common/", "", $NF)
|
||||
print
|
||||
if (content && suffix && $1 == "resource") {
|
||||
$2 = $2 "-" suffix
|
||||
print
|
||||
}
|
||||
}
|
||||
|
||||
# vim:se sts=4 sw=4 et ft=awk:
|
||||
|
||||
Reference in New Issue
Block a user