mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-09 22:24:35 +02:00
+ asset.getModuleAsset()
* Menus can specify built in menu modules: @systemModule:XXXXX
This commit is contained in:
parent
b8d4741c18
commit
dbb3e04166
4 changed files with 28 additions and 8 deletions
|
@ -9,6 +9,7 @@ var assert = require('assert');
|
|||
|
||||
exports.parseAsset = parseAsset;
|
||||
exports.getArtAsset = getArtAsset;
|
||||
exports.getModuleAsset = getModuleAsset;
|
||||
exports.resolveConfigAsset = resolveConfigAsset;
|
||||
exports.getViewPropertyAsset = getViewPropertyAsset;
|
||||
|
||||
|
@ -17,6 +18,7 @@ var ALL_ASSETS = [
|
|||
'menu',
|
||||
'method',
|
||||
'systemMethod',
|
||||
'systemModule',
|
||||
'prompt',
|
||||
'config',
|
||||
];
|
||||
|
@ -58,6 +60,24 @@ function getArtAsset(art) {
|
|||
}
|
||||
}
|
||||
|
||||
function getModuleAsset(module) {
|
||||
if(!_.isString(module)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if('@' === module[0]) {
|
||||
var modAsset = parseAsset(module);
|
||||
assert('module' === modAsset.type || 'systemModule' === modAsset.type);
|
||||
|
||||
return modAsset;
|
||||
} else {
|
||||
return {
|
||||
type : 'module',
|
||||
asset : module,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resolveConfigAsset(from) {
|
||||
var asset = parseAsset(from);
|
||||
if(asset) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue