1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 16:47:59 +01:00

Replace the *.vimp file extension with config specific extensions.

This commit is contained in:
Doug Kearns
2010-10-01 02:43:02 +10:00
parent 002522c179
commit 725cf1f1f7
12 changed files with 29 additions and 18 deletions

View File

@@ -80,15 +80,21 @@ const ConfigBase = Class(ModuleBase, {
*/
features: [],
/**
* @property {string} The file extension used for command script files.
* This is the name string sans "dactyl".
*/
get fileExtension() this.name.slice(0, -6),
guioptions: {},
hasTabbrowser: false,
/**
* @property {string} The name of the application that hosts the
* “liberated” application. E.g., "Firefox" or "Xulrunner".
* extension. E.g., "Firefox" or "XULRunner".
*/
hostApplication: null,
host: null,
/**
* @property {Object} A map between key names for key events should be ignored,
@@ -109,7 +115,7 @@ const ConfigBase = Class(ModuleBase, {
modes: [],
/**
* @property {string} The name of “liberated” application.
* @property {string} The name of the extension.
* Required.
*/
name: null,

View File

@@ -721,12 +721,12 @@ const Dactyl = Module("dactyl", {
return;
}
dactyl.echomsg('Searching for "plugins/**/*.{js,vimp}" in '
dactyl.echomsg('Searching for "plugins/**/*.{js,' + config.fileExtension + '}" in '
+ [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))]
.join(",").quote(), 2);
dirs.forEach(function (dir) {
dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js,vimp}").quote(), 3);
dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js," + config.fileExtension + "}").quote(), 3);
sourceDirectory(dir);
});
},
@@ -1238,7 +1238,7 @@ const Dactyl = Module("dactyl", {
options.add(["loadplugins", "lpl"],
"A regex list that defines which plugins are loaded at startup and via :loadplugins",
"regexlist", "'\\.(js|vimp)$'");
"regexlist", "'\\.(js|" + config.fileExtension + ")$'");
options.add(["titlestring"],
"Change the title of the window",

View File

@@ -86,8 +86,8 @@ const Events = Module("events", {
for (let file in dir.iterDirectory()) {
if (file.exists() && !file.isDirectory() && file.isReadable() &&
/^[\w_-]+(\.vimp)?$/i.test(file.leafName)) {
let name = file.leafName.replace(/\.vimp$/i, "");
RegExp("^[\\w_-]+(\\." + config.fileExtension + ")?$", "i").test(file.leafName)) {
let name = file.leafName.replace(RegExp("\\." + config.fileExtension + "$", "i"), "");
this._macros.set(name, {
keys: file.read().split("\n")[0],
timeRecorded: file.lastModifiedTime