1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 10:18:00 +01:00

Only force reload stylesheets if asked. Fix :sty completion for about:blank

This commit is contained in:
Kris Maglione
2008-10-10 18:20:52 +00:00
parent 9e65be3125
commit c5f8f5e581
2 changed files with 17 additions and 10 deletions

View File

@@ -135,13 +135,15 @@ liberator.Buffer = function () //{{{
return matches.length;
}
this.registerSheet = function (uri, doCheckSyntax)
this.registerSheet = function (uri, doCheckSyntax, reload)
{
if (doCheckSyntax)
checkSyntax(uri);
this.unregisterSheet(uri);
if (reload)
this.unregisterSheet(uri);
uri = ios.newURI(uri, null, null);
sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
if (reload || !sss.sheetRegistered(uri, sss.USER_SHEET))
sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
}
this.unregisterSheet = function (uri)
@@ -775,11 +777,17 @@ liberator.Buffer = function () //{{{
}
},
{
completer: function (filter) [0, liberator.completion.filter(
[[content.location.host, ""],
[content.location.href, ""]]
.concat([[s, ""] for each (s in styles.sites)])
, filter)],
completer: function (filter) {
let compl = [];
try
{
compl.push([content.location.host, "Current Host"]);
compl.push([content.location.href, "Current URL"]);
}
catch (e) {}
comp = compl.concat([[s, ""] for each (s in styles.sites)])
return [0, liberator.completion.filter(compl, filter)];
},
hereDoc: true,
bang: true,
});

View File

@@ -778,8 +778,7 @@ lookup:
}
else if (/\.css$/.test(filename))
{
liberator.storage.styles.unregisterSheet("file://" + file.path);
liberator.storage.styles.registerSheet("file://" + file.path, !silent);
liberator.storage.styles.registerSheet("file://" + file.path, !silent, true);
}
else
{