* Fixed double extra view redraws

* Redraw views when all of them are ready @ MCI init
* Moved a lot of properties of views to menu.json/prompts
* Allow scrolling editor for EditTextView
* New @config:path.to.property for menu.json view properties/etc.
This commit is contained in:
Bryan Ashby 2015-04-26 20:46:16 -06:00
parent 5288643189
commit 7a643150e7
10 changed files with 233 additions and 71 deletions

View file

@ -8,6 +8,7 @@ var assert = require('assert');
exports.parseAsset = parseAsset;
exports.getArtAsset = getArtAsset;
exports.resolveConfigAsset = resolveConfigAsset;
var ALL_ASSETS = [
'art',
@ -15,6 +16,7 @@ var ALL_ASSETS = [
'method',
'systemMethod',
'prompt',
'config',
];
var ASSET_RE = new RegExp('\\@(' + ALL_ASSETS.join('|') + ')\\:([\\w\\d\\.]*)(?:\\/([\\w\\d\\_]+))*');
@ -36,7 +38,7 @@ function parseAsset(s) {
}
}
function getArtAsset(art, cb) {
function getArtAsset(art) {
if(!_.isString(art)) {
return null;
}
@ -53,3 +55,22 @@ function getArtAsset(art, cb) {
};
}
}
function resolveConfigAsset(from) {
var asset = parseAsset(from);
if(asset) {
assert('config' === asset.type);
var path = asset.asset.split('.');
var conf = Config;
for(var i = 0; i < path.length; ++i) {
if(_.isUndefined(conf[path[i]])) {
return from;
}
conf = conf[path[i]];
}
return conf;
} else {
return from;
}
}