diff --git a/core/config_cache.js b/core/config_cache.js index 233157df..1c689f54 100644 --- a/core/config_cache.js +++ b/core/config_cache.js @@ -19,10 +19,9 @@ function ConfigCache() { this.cache = {}; // filePath -> HJSON this.gaze = new Gaze(); - this.reCacheJSONFromFile = function(filePath, cb) { + this.reCacheConfigFromFile = function(filePath, cb) { fs.readFile(filePath, { encoding : 'utf-8' }, function fileRead(err, data) { try { - //self.cache[filePath] = JSON.parse(stripJsonComments(data)); self.cache[filePath] = hjson.parse(data); cb(null, self.cache[filePath]); } catch(e) { @@ -40,11 +39,11 @@ function ConfigCache() { this.gaze.on('changed', function fileChanged(filePath) { assert(filePath in self.cache); - Log.info( { filePath : filePath }, 'JSON file changed; recaching'); + Log.info( { filePath : filePath }, 'Configuration file changed; recaching'); - self.reCacheJSONFromFile(filePath, function reCached(err) { + self.reCacheConfigFromFile(filePath, function reCached(err) { if(err) { - Log.error( { error : err, filePath : filePath } , 'Error recaching JSON'); + Log.error( { error : err, filePath : filePath } , 'Error recaching HJSON config'); } else { self.emit('recached', filePath); } @@ -61,11 +60,11 @@ ConfigCache.prototype.getConfig = function(filePath, cb) { if(filePath in this.cache) { cb(null, this.cache[filePath], false); } else { - this.reCacheJSONFromFile(filePath, function fileCached(err, json) { + this.reCacheConfigFromFile(filePath, function fileCached(err, config) { if(!err) { self.gaze.add(filePath); } - cb(err, json, true); + cb(err, config, true); }); } }; diff --git a/mods/menu.hjson b/mods/menu.hjson index 28e0e38a..446a537b 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -542,25 +542,25 @@ */ // :TODO: Need similar to viewId for actionKeys for specifis, e.g. viewId + index type stuff { - "keys" : [ "p", "shift + p" ], - "action" : "@method:prevMessage" - }, + keys: [ "p", "shift + p" ] + action: @method:prevMessage + } { keys: [ "n", "shift + n" ] action: @method:nextMessage - }, + } { - "keys" : [ "escape", "q", "shift + q" ], - "action" : "@menu:messageArea" - }, + keys: [ "escape", "q", "shift + q" ] + action: @menu:messageArea + } // :TODO: why the fuck is 'r' not working but 'n' for example does? { - keys: : [ "r", "shift + r" ] + keys: [ "r", "shift + r" ] action: @method:replyMessage extraArgs: { menu: messageAreaReplyPost } - }, + } { "keys" : [ "down arrow", "up arrow", "page up", "page down" ], "action" : "@method:movementKeyPressed"