/** * @author ÀÌÁØÇÑ (junes127@gmail.com) * @version 1.0 * * Javascript Framework * ARBITER.init('my-module-name', ['util', 'form'], function(dom, lms) { * // some codes * }); * */ if(void 0===ARBITER||!ARBITER)var ARBITER={};if("undefined"==typeof jQuery)throw new Error("ARBITER requires jQuery javascript library.");!function(e,r){var n="/api/arbiter",t={},i={received:{},receivedQueue:[]};function o(e,r){var n,t,i,o=c(e),f={},d=e.split("."),u=ARBITER;if(o.__defined__||"function"==typeof o)o.__defined__=!0;else{for(i in o)o.hasOwnProperty(i)&&(f[i]=o[i]);for("ARBITER"===d[0]&&(d=d.slice(1)),modulename=d.pop(),n=0,t=d.length;n0&&ARBITER.require(e.requirements))}())}(d)},ARBITER.declare=function(e,r,n){if(!i.received[e]&&!c(e).__defined__){if(!e||"string"!=typeof e)throw new Error("Invalid classname type. Expected string, received "+typeof e+" instead.");if(r&&"function"==typeof r&&(n=r,r=[]),!r||r.constructor!==Array)throw new Error("Invalid requirements type. Expected array, received "+typeof r+" instead.");if(!n||"function"!=typeof n)throw new Error("Invalid factory type. Expected function, received "+typeof n+" instead.");i.received[e]=!0,i.receivedQueue.push({className:e,requirements:r,factory:n})}},ARBITER.namespace=c,ARBITER.init=function(){var r;if((r={id:arguments[0],dom:["element",jQuery],requires:arguments[1],factory:arguments[2]}).requires&&r.requires.length>0){var n=[];for(inx=0,limitInx=r.requires.length;inx1)throw new Error("Unexpected error. Multiple document body were found.");var i=r.factory.call(n.get(0),n,ARBITER);r.id&&(t[r.id]=i)})}}(jQuery,window);