-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86ef796
commit 7112ebd
Showing
6 changed files
with
79 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ax5core", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"authors": [ | ||
"ThomasJ <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2259,7 +2259,6 @@ ax5.info.errorMsg["ax5combobox"] = { | |
/** | ||
* @class ax5.ui.root | ||
* @classdesc ax5 ui class | ||
* @version v0.1.0 | ||
* @author [email protected] | ||
* @example | ||
* ``` | ||
|
@@ -2323,12 +2322,19 @@ ax5.ui = function () { | |
this.main = function () {}.apply(this, arguments); | ||
} | ||
|
||
var addUI = function addUI(key, version, cls) { | ||
/* | ||
if (ax5.ui.root) ax5.ui.root.call(this); // 부모호출 | ||
if (ax5.util.isFunction(ax5.ui.root)) cls.prototype = new ax5.ui.root(); // 상속 | ||
ax5.ui[key] = cls; | ||
*/ | ||
/** | ||
* @method ax5.ui.addClass | ||
* @param {Object} config | ||
* @param {String} config.className - name of Class | ||
* @param {String} [config.version=""] - version of Class | ||
* @param {Object} [config.classStore=ax5.ui] - 클래스가 저장될 경로 | ||
* @param {Function} [config.superClass=ax5.ui.root] | ||
* @param {Function} cls - Class Function | ||
*/ | ||
function addClass(config, cls) { | ||
if (!config || !config.className) throw 'invalid call'; | ||
var classStore = config.classStore ? config.classStore : ax5.ui; | ||
if (!classStore) throw 'invalid classStore'; | ||
|
||
var factory = function factory(cls, arg) { | ||
switch (arg.length) { | ||
|
@@ -2341,28 +2347,35 @@ ax5.ui = function () { | |
case 2: | ||
return new cls(arg[0], arg[1]); | ||
break; | ||
case 3: | ||
return new cls(arg[0], arg[1], arg[2]); | ||
break; | ||
} | ||
}; | ||
var initInstance = function initInstance(instance) { | ||
instance.a = ""; | ||
var initInstance = function initInstance(name, version, instance) { | ||
instance.name = name; | ||
instance.version = version; | ||
instance.instanceId = ax5.getGuid(); | ||
return instance; | ||
}; | ||
var initPrototype = function initPrototype(cls) { | ||
var fn = cls.prototype; | ||
var superClass = config.superClass ? config.superClass : ax5.ui.root; | ||
if (!ax5.util.isFunction(superClass)) throw 'invalid superClass'; | ||
superClass.call(this); // 부모호출 | ||
cls.prototype = new superClass(); // 상속 | ||
}; | ||
|
||
var wrapper = function wrapper() { | ||
if (!this || !(this instanceof wrapper)) throw 'invalid call'; | ||
var instance = factory(cls, arguments); | ||
return initInstance(instance); | ||
return initInstance(config.className, config.version || "", instance); | ||
}; | ||
initPrototype(cls); | ||
ax5.ui[key] = wrapper; | ||
}; | ||
initPrototype.call(this, cls); | ||
classStore[config.className] = wrapper; | ||
} | ||
|
||
return { | ||
root: axUi, | ||
addUI: addUI | ||
addClass: addClass | ||
}; | ||
}(); | ||
/*! | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
/** | ||
* @class ax5.ui.root | ||
* @classdesc ax5 ui class | ||
* @version v0.1.0 | ||
* @author [email protected] | ||
* @example | ||
* ``` | ||
|
@@ -72,13 +71,19 @@ ax5.ui = (function () { | |
}).apply(this, arguments); | ||
} | ||
|
||
|
||
var addUI = function (key, version, cls) { | ||
/* | ||
if (ax5.ui.root) ax5.ui.root.call(this); // 부모호출 | ||
if (ax5.util.isFunction(ax5.ui.root)) cls.prototype = new ax5.ui.root(); // 상속 | ||
ax5.ui[key] = cls; | ||
*/ | ||
/** | ||
* @method ax5.ui.addClass | ||
* @param {Object} config | ||
* @param {String} config.className - name of Class | ||
* @param {String} [config.version=""] - version of Class | ||
* @param {Object} [config.classStore=ax5.ui] - 클래스가 저장될 경로 | ||
* @param {Function} [config.superClass=ax5.ui.root] | ||
* @param {Function} cls - Class Function | ||
*/ | ||
function addClass(config, cls) { | ||
if (!config || !config.className) throw 'invalid call'; | ||
var classStore = (config.classStore) ? config.classStore : ax5.ui; | ||
if (!classStore) throw 'invalid classStore'; | ||
|
||
var factory = function (cls, arg) { | ||
switch (arg.length) { | ||
|
@@ -91,28 +96,34 @@ ax5.ui = (function () { | |
case 2: | ||
return new cls(arg[0], arg[1]); | ||
break; | ||
case 3: | ||
return new cls(arg[0], arg[1], arg[2]); | ||
break; | ||
} | ||
}; | ||
var initInstance = function (instance) { | ||
instance.a = ""; | ||
var initInstance = function (name, version, instance) { | ||
instance.name = name; | ||
instance.version = version; | ||
instance.instanceId = ax5.getGuid(); | ||
return instance; | ||
}; | ||
var initPrototype = function (cls) { | ||
var fn = cls.prototype; | ||
|
||
var superClass = (config.superClass) ? config.superClass : ax5.ui.root; | ||
if (!ax5.util.isFunction(superClass)) throw 'invalid superClass'; | ||
superClass.call(this); // 부모호출 | ||
cls.prototype = new superClass(); // 상속 | ||
}; | ||
|
||
var wrapper = function () { | ||
if (!this || !(this instanceof wrapper)) throw 'invalid call'; | ||
var instance = factory(cls, arguments); | ||
return initInstance(instance); | ||
return initInstance(config.className, config.version || "", instance); | ||
}; | ||
initPrototype(cls); | ||
ax5.ui[key] = wrapper; | ||
}; | ||
initPrototype.call(this, cls); | ||
classStore[config.className] = wrapper; | ||
} | ||
|
||
return { | ||
root: axUi, | ||
addUI: addUI | ||
addClass: addClass | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters