1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 01:24:11 +01:00

Add 'Copy File Path' MOW context menu item. Fix some bugs.

This commit is contained in:
Kris Maglione
2011-01-17 00:43:40 -05:00
parent f17fb77bcb
commit 32daed5095
6 changed files with 31 additions and 25 deletions

View File

@@ -4,8 +4,6 @@
// given in the LICENSE.txt file included with this file.
"use strict";
dump(" ======================= bootstrap.jsm " + (typeof JSMLoader) + " ======================= \n");
var EXPORTED_SYMBOLS = ["JSMLoader"];
let global = this;

View File

@@ -29,7 +29,7 @@ var Download = Class("Download", {
<li highlight="Download" key="row" xmlns:dactyl={NS} xmlns={XHTML}>
<span highlight="DownloadTitle">
<span highlight="Link">
<a key="title" href={self.target.spec}>{self.displayName}</a>
<a key="title" href={self.target.spec} path={self.targetFile.path}>{self.displayName}</a>
<span highlight="LinkInfo">{self.targetFile.path}</span>
</span>
</span>

View File

@@ -114,10 +114,11 @@ var Services = Module("Services", {
}
["aboutURL", "creator", "description", "developers",
"homepageURL", "iconURL", "installDate",
"optionsURL", "releaseNotesURI", "updateDate", "version"].forEach(function (item) {
addon[item] = getRdfProperty(addon, item);
"homepageURL", "installDate", "optionsURL",
"releaseNotesURI", "updateDate"].forEach(function (item) {
memoize(addon, item, function (item) getRdfProperty(this, item));
});
update(addon, {
appDisabled: false,
@@ -148,7 +149,7 @@ var Services = Module("Services", {
for (let [, item] in Iterator(services.extensionManager
.getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {})))
res.push(this.getAddonByID(item));
callback(res);
return (callback || util.identity)(res);
},
getInstallForFile: function (file, callback, mimetype) {
callback({
@@ -207,14 +208,7 @@ var Services = Module("Services", {
const self = this;
if (name in this && ifaces && !this.__lookupGetter__(name) && !(this[name] instanceof Ci.nsISupports))
throw TypeError();
this.__defineGetter__(name, function () {
let res = self._create(class_, ifaces, meth);
if (!res)
return null;
delete this[name];
return this[name] = res;
});
memoize(this, name, function () self._create(class_, ifaces, meth));
},
/**

View File

@@ -262,12 +262,13 @@ var Template = Module("Template", {
sourceLink: function (frame) {
let url = (frame.filename || "unknown").replace(/.* -> /, "");
let path = util.urlPath(url);
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
return <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource"
href={url} line={frame.lineNumber}
href={url} path={path} line={frame.lineNumber}
highlight="URL">{
util.urlPath(url) + ":" + frame.lineNumber
path + ":" + frame.lineNumber
}</a>
},