fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: optimize undo for setText transformation
[fnpeditor.git]
/
src
/
fnpjs
/
runner.js
diff --git
a/src/fnpjs/runner.js
b/src/fnpjs/runner.js
index
0da2916
..
7797e24
100644
(file)
--- a/
src/fnpjs/runner.js
+++ b/
src/fnpjs/runner.js
@@
-10,9
+10,10
@@
var Runner = function(app, modules) {
}
var bootstrappedData = {},
}
var bootstrappedData = {},
- options = {},
moduleInstances = {},
moduleInstances = {},
- eventListeners = [];
+ eventListeners = [],
+ plugins = [],
+ config;
_.each(_.keys(modules || {}), function(moduleName) {
if(_.contains(app.permissions[moduleName] || [], 'handleEvents')) {
_.each(_.keys(modules || {}), function(moduleName) {
if(_.contains(app.permissions[moduleName] || [], 'handleEvents')) {
@@
-51,20
+52,31
@@
var Runner = function(app, modules) {
} : undefined;
this.getDOM = _.contains(permissions, 'getDOM') ? function() {
} : undefined;
this.getDOM = _.contains(permissions, 'getDOM') ? function() {
- return $(
options
.rootSelector);
+ return $(
config
.rootSelector);
} : undefined;
} : undefined;
-
+
+ this.getPlugins = function() {
+ return plugins;
+ };
+
+ this.getConfig = function() {
+ return config;
+ };
};
this.setBootstrappedData = function(moduleName, data) {
bootstrappedData[moduleName] = data;
};
};
this.setBootstrappedData = function(moduleName, data) {
bootstrappedData[moduleName] = data;
};
+
+ this.registerPlugin = function(plugin) {
+ plugins.push(plugin);
+ };
- this.start = function(_
options
) {
-
options
= _.extend({
+ this.start = function(_
config
) {
+
config
= _.extend({
rootSelector: 'body'
rootSelector: 'body'
- }, _
options
);
+ }, _
config
);
app.initModules.forEach(function(moduleName) {
getModuleInstance(moduleName).start();
});
app.initModules.forEach(function(moduleName) {
getModuleInstance(moduleName).start();
});