@ -9,7 +9,7 @@
} ;
} ;
BI . module = BI . module || function ( xtype , cls ) {
BI . module = BI . module || function ( xtype , cls ) {
if ( moduleInjection [ xtype ] != null ) {
if ( moduleInjection [ xtype ] != null ) {
_global . console && console . error ( "module: [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "module: [" + xtype + "] already registered " ) ;
} else {
} else {
if ( BI . isFunction ( cls ) ) {
if ( BI . isFunction ( cls ) ) {
cls = cls ( ) ;
cls = cls ( ) ;
@ -41,7 +41,7 @@
var constantInjection = { } ;
var constantInjection = { } ;
BI . constant = BI . constant || function ( xtype , cls ) {
BI . constant = BI . constant || function ( xtype , cls ) {
if ( constantInjection [ xtype ] != null ) {
if ( constantInjection [ xtype ] != null ) {
_global . console && console . error ( "constant: [" + xtype + "]已经注册过了 " ) ;
_global . console && console . error ( "constant: [" + xtype + "]already registered " ) ;
} else {
} else {
constantInjection [ xtype ] = cls ;
constantInjection [ xtype ] = cls ;
}
}
@ -54,7 +54,7 @@
var modelInjection = { } ;
var modelInjection = { } ;
BI . model = BI . model || function ( xtype , cls ) {
BI . model = BI . model || function ( xtype , cls ) {
if ( modelInjection [ xtype ] != null ) {
if ( modelInjection [ xtype ] != null ) {
_global . console && console . error ( "model: [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "model: [" + xtype + "] already registered " ) ;
} else {
} else {
modelInjection [ xtype ] = cls ;
modelInjection [ xtype ] = cls ;
}
}
@ -67,7 +67,7 @@
var storeInjection = { } ;
var storeInjection = { } ;
BI . store = BI . store || function ( xtype , cls ) {
BI . store = BI . store || function ( xtype , cls ) {
if ( storeInjection [ xtype ] != null ) {
if ( storeInjection [ xtype ] != null ) {
_global . console && console . error ( "store: [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "store: [" + xtype + "] already registered " ) ;
} else {
} else {
storeInjection [ xtype ] = cls ;
storeInjection [ xtype ] = cls ;
}
}
@ -80,7 +80,7 @@
var serviceInjection = { } ;
var serviceInjection = { } ;
BI . service = BI . service || function ( xtype , cls ) {
BI . service = BI . service || function ( xtype , cls ) {
if ( serviceInjection [ xtype ] != null ) {
if ( serviceInjection [ xtype ] != null ) {
_global . console && console . error ( "service: [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "service: [" + xtype + "] already registered " ) ;
}
}
serviceInjection [ xtype ] = cls ;
serviceInjection [ xtype ] = cls ;
@ -93,7 +93,7 @@
var providerInjection = { } ;
var providerInjection = { } ;
BI . provider = BI . provider || function ( xtype , cls ) {
BI . provider = BI . provider || function ( xtype , cls ) {
if ( providerInjection [ xtype ] != null ) {
if ( providerInjection [ xtype ] != null ) {
_global . console && console . error ( "provider: [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "provider: [" + xtype + "] already registered " ) ;
} else {
} else {
providerInjection [ xtype ] = cls ;
providerInjection [ xtype ] = cls ;
}
}
@ -151,7 +151,7 @@
}
}
}
}
if ( findVersion === true ) {
if ( findVersion === true ) {
_global . console && console . error ( "moduleId: [" + module . moduleId + "] 接口 : [" + type + "] 接口版本 : [" + version + "] 已过期,版本要求为 :" , dependencies [ module . moduleId ] , "=>" , moduleInjection [ module . moduleId ] ) ;
_global . console && console . error ( "moduleId: [" + module . moduleId + "] interface : [" + type + "] version : [" + version + "] has expired,The version requirement is :" , dependencies [ module . moduleId ] , "=>" , moduleInjection [ module . moduleId ] ) ;
continue ;
continue ;
}
}
}
}
@ -251,7 +251,7 @@
BI . Modules = BI . Modules || {
BI . Modules = BI . Modules || {
getModule : function ( type ) {
getModule : function ( type ) {
if ( ! moduleInjection [ type ] ) {
if ( ! moduleInjection [ type ] ) {
_global . console && console . error ( "module: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "module: [" + type + "] undefined " ) ;
}
}
return moduleInjection [ type ] ;
return moduleInjection [ type ] ;
} ,
} ,
@ -263,7 +263,7 @@
BI . Constants = BI . Constants || {
BI . Constants = BI . Constants || {
getConstant : function ( type ) {
getConstant : function ( type ) {
if ( BI . isNull ( constantInjection [ type ] ) ) {
if ( BI . isNull ( constantInjection [ type ] ) ) {
_global . console && console . error ( "constant: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "constant: [" + type + "] undefined " ) ;
}
}
runConfigFunction ( type ) ;
runConfigFunction ( type ) ;
return BI . isFunction ( constantInjection [ type ] ) ? constantInjection [ type ] ( ) : constantInjection [ type ] ;
return BI . isFunction ( constantInjection [ type ] ) ? constantInjection [ type ] ( ) : constantInjection [ type ] ;
@ -311,7 +311,7 @@
BI . Models = BI . Models || {
BI . Models = BI . Models || {
getModel : function ( type , config ) {
getModel : function ( type , config ) {
if ( ! modelInjection [ type ] ) {
if ( ! modelInjection [ type ] ) {
_global . console && console . error ( "model: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "model: [" + type + "] undefined " ) ;
}
}
runConfigFunction ( type ) ;
runConfigFunction ( type ) ;
var inst = new modelInjection [ type ] ( config ) ;
var inst = new modelInjection [ type ] ( config ) ;
@ -327,7 +327,7 @@
BI . Stores = BI . Stores || {
BI . Stores = BI . Stores || {
getStore : function ( type , config ) {
getStore : function ( type , config ) {
if ( ! storeInjection [ type ] ) {
if ( ! storeInjection [ type ] ) {
_global . console && console . error ( "store: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "store: [" + type + "] undefined " ) ;
}
}
if ( stores [ type ] ) {
if ( stores [ type ] ) {
return stores [ type ] ;
return stores [ type ] ;
@ -346,7 +346,7 @@
BI . Services = BI . Services || {
BI . Services = BI . Services || {
getService : function ( type , config ) {
getService : function ( type , config ) {
if ( ! serviceInjection [ type ] ) {
if ( ! serviceInjection [ type ] ) {
_global . console && console . error ( "service: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "service: [" + type + "] undefined " ) ;
}
}
if ( services [ type ] ) {
if ( services [ type ] ) {
return services [ type ] ;
return services [ type ] ;
@ -363,7 +363,7 @@
BI . Providers = BI . Providers || {
BI . Providers = BI . Providers || {
getProvider : function ( type , config ) {
getProvider : function ( type , config ) {
if ( ! providerInjection [ type ] ) {
if ( ! providerInjection [ type ] ) {
_global . console && console . error ( "provider: [" + type + "] 未定义 " ) ;
_global . console && console . error ( "provider: [" + type + "] undefined " ) ;
}
}
runConfigFunction ( type ) ;
runConfigFunction ( type ) ;
if ( ! providers [ type ] ) {
if ( ! providers [ type ] ) {
@ -401,7 +401,7 @@
var kv = { } ;
var kv = { } ;
BI . shortcut = BI . component = BI . shortcut || function ( xtype , cls ) {
BI . shortcut = BI . component = BI . shortcut || function ( xtype , cls ) {
if ( kv [ xtype ] != null ) {
if ( kv [ xtype ] != null ) {
_global . console && console . error ( "组件 : [" + xtype + "] 已经注册过了 " ) ;
_global . console && console . error ( "widget : [" + xtype + "] already registered " ) ;
}
}
if ( cls ) {
if ( cls ) {
cls [ "xtype" ] = xtype ;
cls [ "xtype" ] = xtype ;
@ -414,7 +414,7 @@
var cls = BI . isFunction ( config . type ) ? config . type : kv [ config . type ] ;
var cls = BI . isFunction ( config . type ) ? config . type : kv [ config . type ] ;
if ( ! cls ) {
if ( ! cls ) {
throw new Error ( "组件 : [" + config . type + "] 未定义 " ) ;
throw new Error ( "widget : [" + config . type + "] undefined " ) ;
}
}
var pushed = false ;
var pushed = false ;
var widget = new cls ( ) ;
var widget = new cls ( ) ;
@ -472,12 +472,14 @@
if ( wType === elType ) {
if ( wType === elType ) {
if ( BI . Plugin . hasObject ( elType ) ) {
if ( BI . Plugin . hasObject ( elType ) ) {
if ( ! w . listeners || BI . isArray ( w . listeners ) ) {
if ( ! w . listeners || BI . isArray ( w . listeners ) ) {
w . listeners = ( w . listeners || [ ] ) . concat ( [ {
w . listeners = ( w . listeners || [ ] ) . concat ( [
{
eventName : BI . Events . MOUNT ,
eventName : BI . Events . MOUNT ,
action : function ( ) {
action : function ( ) {
BI . Plugin . getObject ( elType , this ) ;
BI . Plugin . getObject ( elType , this ) ;
}
}
} ] ) ;
}
] ) ;
} else {
} else {
w . listeners [ BI . Events . MOUNT ] = [
w . listeners [ BI . Events . MOUNT ] = [
function ( ) {
function ( ) {
@ -493,7 +495,7 @@
if ( BI . isWidget ( item . el ) ) {
if ( BI . isWidget ( item . el ) ) {
return item . el ;
return item . el ;
}
}
throw new Error ( "组件:无法根据item创建组件 " , item ) ;
throw new Error ( "widget: Unable to create widget from item " , item ) ;
} ;
} ;
BI . _lazyCreateWidget = BI . _lazyCreateWidget || function ( item , options , context ) {
BI . _lazyCreateWidget = BI . _lazyCreateWidget || function ( item , options , context ) {
@ -521,6 +523,6 @@
if ( providerInjection [ type ] ) {
if ( providerInjection [ type ] ) {
return BI . Providers . getProvider ( type , config ) ;
return BI . Providers . getProvider ( type , config ) ;
}
}
throw new Error ( "未知类型 : [" + type + "] 未定义 " ) ;
throw new Error ( "unknown type : [" + type + "] undefined " ) ;
} ;
} ;
} ) ( ) ;
} ) ( ) ;