Browse Source

可以两个fineui一起运行

es6
guy 4 years ago
parent
commit
1721393f69
  1. 4
      src/core/func/function.js
  2. 34
      src/core/inject.js
  3. 6
      src/core/ob.js
  4. 2
      src/core/platform/web/dom.js
  5. 2
      src/core/plugin.js
  6. 6
      src/core/shortcut.js
  7. 4
      src/core/widget.js

4
src/core/func/function.js

@ -2,7 +2,7 @@
* 基本的函数
* Created by GUY on 2015/6/24.
*/
BI.Func = {};
BI.Func = BI.Func || {};
_.extend(BI.Func, {
/**
* 创建唯一的名字
@ -165,4 +165,4 @@ _.extend(BI, {
return ret;
};
}
});
});

34
src/core/inject.js

@ -1,6 +1,6 @@
(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
BI.module = BI.module || function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
@ -8,7 +8,7 @@
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
BI.constant = BI.constant || function (xtype, cls) {
if (constantInjection[xtype] != null) {
_global.console && console.error("constant:[" + xtype + "] has been registed");
}
@ -16,7 +16,7 @@
};
var modelInjection = {};
BI.model = function (xtype, cls) {
BI.model = BI.model || function (xtype, cls) {
if (modelInjection[xtype] != null) {
_global.console && console.error("model:[" + xtype + "] has been registed");
}
@ -24,7 +24,7 @@
};
var storeInjection = {};
BI.store = function (xtype, cls) {
BI.store = BI.store || function (xtype, cls) {
if (storeInjection[xtype] != null) {
_global.console && console.error("store:[" + xtype + "] has been registed");
}
@ -32,7 +32,7 @@
};
var serviceInjection = {};
BI.service = function (xtype, cls) {
BI.service = BI.service || function (xtype, cls) {
if (serviceInjection[xtype] != null) {
_global.console && console.error("service:[" + xtype + "] has been registed");
}
@ -40,7 +40,7 @@
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
BI.provider = BI.provider || function (xtype, cls) {
if (providerInjection[xtype] != null) {
_global.console && console.error("provider:[" + xtype + "] has been registed");
}
@ -48,7 +48,7 @@
};
var configFunctions = {};
BI.config = function (type, configFn, opt) {
BI.config = BI.config || function (type, configFn, opt) {
if (BI.initialized) {
if (constantInjection[type]) {
return (constantInjection[type] = configFn(constantInjection[type]));
@ -94,7 +94,7 @@
var actions = {};
var globalAction = [];
BI.action = function (type, actionFn) {
BI.action = BI.action || function (type, actionFn) {
if (BI.isFunction(type)) {
globalAction.push(type);
return function () {
@ -118,7 +118,7 @@
};
var points = {};
BI.point = function (type, action, pointFn, after) {
BI.point = BI.point || function (type, action, pointFn, after) {
if (!points[type]) {
points[type] = {};
}
@ -131,7 +131,7 @@
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
BI.Modules = BI.Modules || {
getModule: function (type) {
if (!moduleInjection[type]) {
_global.console && console.error("module:[" + type + "] does not exists");
@ -144,7 +144,7 @@
}
};
BI.Constants = {
BI.Constants = BI.Constants || {
getConstant: function (type) {
return constantInjection[type];
}
@ -188,7 +188,7 @@
});
};
BI.Models = {
BI.Models = BI.Models || {
getModel: function (type, config) {
var inst = new modelInjection[type](config);
inst._constructor && inst._constructor(config);
@ -200,7 +200,7 @@
var stores = {};
BI.Stores = {
BI.Stores = BI.Stores || {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
@ -216,7 +216,7 @@
var services = {};
BI.Services = {
BI.Services = BI.Services || {
getService: function (type, config) {
if (services[type]) {
return services[type];
@ -230,7 +230,7 @@
var providers = {},
providerInstance = {};
BI.Providers = {
BI.Providers = BI.Providers || {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
@ -242,7 +242,7 @@
}
};
BI.Actions = {
BI.Actions = BI.Actions || {
runAction: function (type, event, config) {
BI.each(actions[type], function (i, act) {
try {
@ -264,7 +264,7 @@
}
};
BI.getContext = function (type, config) {
BI.getContext = BI.getContext || function (type, config) {
if (constantInjection[type]) {
return BI.Constants.getConstant(type);
}

6
src/core/ob.js

@ -28,10 +28,10 @@
* @class BI.OB
* @abstract
*/
BI.OB = function (config) {
BI.OB = BI.OB || function (config) {
this._constructor(config);
};
_.extend(BI.OB.prototype, {
_.defaults(BI.OB.prototype, {
props: {},
init: null,
destroyed: null,
@ -184,4 +184,4 @@
this.purgeListeners();
}
});
})();
})();

2
src/core/platform/web/dom.js

@ -3,7 +3,7 @@
* @type {{}}
*/
!(function () {
BI.DOM = {};
BI.DOM = BI.DOM || {};
BI.extend(BI.DOM, {
ready: function (fn) {

2
src/core/plugin.js

@ -5,7 +5,7 @@ BI.Plugin = BI.Plugin || {};
var _ConfigPlugin = {};
var _GlobalWidgetConfigFns = [];
var __GlobalObjectConfigFns = [];
BI.extend(BI.Plugin, {
BI.defaults(BI.Plugin, {
getWidget: function (type, options) {
if (_GlobalWidgetConfigFns.length > 0) {

6
src/core/shortcut.js

@ -1,6 +1,6 @@
(function () {
var kv = {};
BI.shortcut = BI.component = function (xtype, cls) {
BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -24,7 +24,7 @@
return widget;
};
BI.createWidget = function (item, options, context) {
BI.createWidget = BI.createWidget || function (item, options, context) {
// 先把准备环境准备好
BI.init();
var el, w;
@ -71,7 +71,7 @@
throw new Error("无法根据item创建组件");
};
BI.createElement = function () {
BI.createElement = BI.createElement || function () {
var widget = BI.createWidget.apply(this, arguments);
return widget.element;
};

4
src/core/widget.js

@ -7,7 +7,7 @@
*/
!(function () {
BI.Widget = BI.inherit(BI.OB, {
BI.Widget = BI.Widget || BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
root: false,
@ -545,4 +545,4 @@
}
return widget._mount(true, false, false, predicate);
};
})();
})();

Loading…
Cancel
Save