|
|
@ -47,17 +47,53 @@ |
|
|
|
providerInjection[xtype] = cls; |
|
|
|
providerInjection[xtype] = cls; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
BI.config = function (type, configFn) { |
|
|
|
var configFunctions = {}; |
|
|
|
if (constantInjection[type]) { |
|
|
|
BI.config = function (type, configFn, options) { |
|
|
|
return constantInjection[type] = configFn(constantInjection[type]); |
|
|
|
if (BI.initialize) { |
|
|
|
} |
|
|
|
if (constantInjection[type]) { |
|
|
|
if (providerInjection[type]) { |
|
|
|
return (constantInjection[type] = configFn(constantInjection[type])); |
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return configFn(providers[type]); |
|
|
|
if (providerInjection[type]) { |
|
|
|
|
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return configFn(providers[type]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.Plugin.configWidget(type, configFn); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!configFunctions[type]) { |
|
|
|
|
|
|
|
configFunctions[type] = []; |
|
|
|
|
|
|
|
BI.prepares.push(function () { |
|
|
|
|
|
|
|
var stack = [], head; |
|
|
|
|
|
|
|
for (var len = configFunctions[type].length, i = len - 1; i >= 0; i--) { |
|
|
|
|
|
|
|
head = configFunctions[type][i]; |
|
|
|
|
|
|
|
stack.push(i); |
|
|
|
|
|
|
|
if (head.options && head.options.prevent) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (var len = stack.length, i = len - 1; i >= 0; i--) { |
|
|
|
|
|
|
|
head = configFunctions[type][stack[i]]; |
|
|
|
|
|
|
|
if (constantInjection[type]) { |
|
|
|
|
|
|
|
constantInjection[type] = head.fn(constantInjection[type]); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (providerInjection[type]) { |
|
|
|
|
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
head.fn(providers[type]); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BI.Plugin.configWidget(type, head.fn); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
configFunctions[type] = null; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Plugin.configWidget(type, configFn); |
|
|
|
configFunctions[type].push({ |
|
|
|
|
|
|
|
fn: configFn, |
|
|
|
|
|
|
|
options: options |
|
|
|
|
|
|
|
}) |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var actions = {}; |
|
|
|
var actions = {}; |
|
|
@ -189,7 +225,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var providers = {}, providerInstance = {}; |
|
|
|
var providers = {}, |
|
|
|
|
|
|
|
providerInstance = {}; |
|
|
|
|
|
|
|
|
|
|
|
BI.Providers = { |
|
|
|
BI.Providers = { |
|
|
|
getProvider: function (type, config) { |
|
|
|
getProvider: function (type, config) { |
|
|
@ -242,4 +279,4 @@ |
|
|
|
return BI.Providers.getProvider(type, config); |
|
|
|
return BI.Providers.getProvider(type, config); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
})(); |
|
|
|
})(); |