1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-20 22:51:27 +02:00

Make INFO work from *.penta files.

This commit is contained in:
Kris Maglione
2011-06-06 17:27:16 -04:00
parent 84ca292262
commit 5c89527d3f
2 changed files with 27 additions and 12 deletions
+15 -5
View File
@@ -413,7 +413,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
({ file: fileName, line: lineNumber, context: ctxt }) = info;
if (!context && fileName && fileName[0] !== "[")
context = _userContext || ctxt;
context = ctxt || _userContext;
if (isinstance(context, ["Sandbox"]))
return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber);
@@ -668,8 +668,14 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let body = XML();
for (let [, context] in Iterator(plugins.contexts))
if (context && context.INFO instanceof XML) {
let info = context.INFO;
try {
let info;
if (isinstance(context, ["Sandbox"]))
info = "INFO" in context && XML(dactyl.userEval("this.INFO instanceof XML && this.INFO.toXMLString()", context));
else if (context && context.INFO instanceof XML)
info = context.INFO;
if (info) {
if (info.*.@lang.length()) {
let lang = config.bestLocale(String(a) for each (a in info.*.@lang));
@@ -680,8 +686,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
if (elem[attr].length())
info[attr] = elem[attr];
}
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
context.INFO;
body += <h2 xmlns={NS.uri} tag={info.@name + '-plugin'}>{info.@summary}</h2> +
info;
}
}
catch (e) {
util.reportError(e);
}
let help =
+5
View File
@@ -316,6 +316,11 @@ var File = Class("File", {
return self;
},
/**
* @property {nsIFileURL} Returns the nsIFileURL object for this file.
*/
get URI() services.io.newFileURI(this),
/**
* Iterates over the objects in this directory.
*/