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

Fix some cleanup issues. Better error pages for bad dactyl: URLs. Remove some dead code. Other cleanup.

This commit is contained in:
Kris Maglione
2011-08-21 10:41:46 -04:00
parent ffe138b4e3
commit 5f42595f65
13 changed files with 99 additions and 86 deletions

View File

@@ -254,12 +254,14 @@ var Styles = Module("Styles", {
this.cleanup();
this.allSheets = {};
services["dactyl:"].providers["style"] = function styleProvider(uri) {
let id = /^\/(\d*)/.exec(uri.path)[1];
if (Set.has(styles.allSheets, id))
return ["text/css", styles.allSheets[id].fullCSS];
return null;
};
update(services["dactyl:"].providers, {
"style": function styleProvider(uri, path) {
let id = parseInt(path);
if (Set.has(styles.allSheets, id))
return ["text/css", styles.allSheets[id].fullCSS];
return null;
}
});
},
cleanup: function cleanup() {