2013-12-04 17:24:04 +00:00
|
|
|
define([
|
2013-12-04 18:52:56 +00:00
|
|
|
"command",
|
2014-01-21 05:24:50 +00:00
|
|
|
"storage/settingsProvider",
|
|
|
|
], function(command, Settings) {
|
2014-01-21 06:10:06 +00:00
|
|
|
|
|
|
|
/* A plugin that handles loading Settings "synchronously" */
|
2013-09-03 15:47:59 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
load: function(name, parentRequire, onLoad, config) {
|
2013-09-16 18:16:06 +00:00
|
|
|
if (name.length == 0) {
|
|
|
|
return onLoad(Settings);
|
|
|
|
}
|
|
|
|
|
2013-09-03 15:47:59 +00:00
|
|
|
var files = name.split(",");
|
|
|
|
var completed = 0;
|
|
|
|
|
|
|
|
files.forEach(function(file) {
|
|
|
|
Settings.load(file, function() {
|
|
|
|
completed++;
|
|
|
|
if (completed == files.length) {
|
|
|
|
onLoad(Settings);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|