// EdgeCommons v1.0.0 +++ Visit edgecommons.org for documentation, updates and examples +++ Copyright (c) 2013 by Simon Widjaja +++ Distributed under the terms of the MIT license (http://www.opensource.org/licenses/mit-license.html) +++ This notice shall be included in all copies or substantial portions of the Software.
// Input 0
(function(a){var d=function(){};d.VERSION="0.0.2";a.Modulog=d})(window);
(function(){var a=function(){};a.VERSION="0.0.2";a.LEVEL_NONE=0;a.LEVEL_ERROR=1;a.LEVEL_WARN=2;a.LEVEL_INFO=3;a.LEVEL_DEBUG=4;a.level=a.LEVEL_DEBUG;var d=null;a.addLogTarget=function(c){"function"===typeof c&&(d=c)};a.debug=function(c,a,b){ModulogLog.level>=ModulogLog.LEVEL_DEBUG&&(c="[ DEBUG "+(a?"| "+a+" ":"")+"] "+c,"undefined"!=typeof console&&"undefined"!=typeof console.debug?b?console.debug(c,b):console.debug(c):"undefined"!=typeof console&&"undefined"!=typeof console.info&&(b?console.info(c,
b):console.info(c)),ModulogLog.__delegate(c,b))};a.info=function(a,e,b){ModulogLog.level>=ModulogLog.LEVEL_INFO&&(a="[ INFO "+(e?"| "+e+" ":"")+"] "+a,"undefined"!=typeof console&&"undefined"!=typeof console.info&&(b?console.info(a,b):console.info(a)),ModulogLog.__delegate(a,b))};a.warn=function(a,e,b){ModulogLog.level>=ModulogLog.LEVEL_WARN&&(a="[ WARN "+(e?"| "+e+" ":"")+"] "+a,"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(b?console.warn(a,b):console.warn(a)),ModulogLog.__delegate(a,
b))};a.error=function(a,e,b){ModulogLog.level>=ModulogLog.LEVEL_ERROR&&(a="[ ERROR "+(e?"| "+e+" ":"")+"] "+a,"undefined"!=typeof console&&"undefined"!=typeof console.error&&(b?console.error(a,b):console.error(a)),ModulogLog.__delegate(a,b))};a.__delegate=function(a,e){d&&(e?d(a+" : "+e.toString()):d(a))};window.Log=window.MLog=window.ModulogLog=a})(window.Modulog);
(function(){var a=function(){};a.VERSION="0.0.1";var d=null,c=ModulogLog;a.get=function(a){for(var b=a.split("."),g=d,j=0;j<b.length;j++){var c=b[j];g.hasOwnProperty(c)||ModulogLog.warn("Config value not found: "+a,"CONFIG");g=g[c]}return g};a.set=function(a,b){for(var g=a.split("."),c=d,f=0;f<g.length-1;f++)c=c[g[f]];c[g.pop()]=b};a.init=function(a,b){"string"===typeof a&&jQuery?$.getJSON(a,function(a){d=a;"function"===typeof b&&b()}):"object"===typeof a?d=a:c.error("Could not init config. init() function expects config object or url to config.js. Latter needs jQuery to be initialized before.",
"Modulog | ModulogConfig")};window.Config=window.MConfig=window.ModulogConfig=a})(window.Modulog);
// Input 1
(function(a){var d=function(){};d.VERSION="1.0.0";a.EC=a.EdgeCommons=d})(window);
// Input 2
(function(a){var d=function(){};d.VERSION="1.0.0";var c=ModulogLog,e=null,b=null;d.getSymbolName=function(a){var c=a.getVariable("symbolSelector");(a=a.getParentSymbol())&&(c=c.replace(a.getVariable("symbolSelector")+"_",""));return c=c.replace("#","")};a.getInjectedData=function(a,b){try{b=b||"data";for((!a||!a.getParentSymbol)&&c.error("getInjectedData(): First argument 'sys' is not optional","EdgeCommons | Core");a.getParentSymbol();)a=a.getParentSymbol();var d=a.getSymbolElement().find("."+b).html();
return $.parseJSON(d)}catch(e){c.error("Reading injected data failed (scriptClassSelector="+b+")","EdgeCommons | Core",e)}};a.setAdaptiveLayouts=function(b,d,f){!b||!b.length?c.error("Error in setAdaptiveLayouts(). Argument 'layouts' is not optional and has to be an array.","EdgeCommons | Core"):(e=b,d&&($(window).resize(function(){a.applyAdaptiveLayout(d,f)}),a.applyAdaptiveLayout(d,f)))};a.applyAdaptiveLayout=function(a,d){try{a.setVariable("doResizing",function(){var f=a.getComposition().getStage().getSymbolElement().width(),
i=a.$(d),h=null;$.each(e,function(a,b){f>=b-20&&(h=b)});b!=h&&(c.debug("Switching to: layout"+h,"EdgeCommons | Core"),b=h,i.html(""),a.createChildSymbol("layout"+h,d));a.$("currentLayout").html(a.getVariable("layout"))}),a.getVariable("doResizing")()}catch(f){console.error(f)}};a.centerStage=function(a){a?a.getComposition().getStage().getSymbolElement().css("margin","0px auto"):c.error("Error in centerStage(). Argument 'sym' is not optional.","EdgeCommons | Core")};a.loadComposition=function(b,d){if(!b||
!d)c.error("Error in loadComposition(). Arguments 'src' and 'sym' are not optional.","EdgeCommons | Core");else{try{var e=d.getSymbolElement(),l="ec_"+Math.random().toString(36).substring(7);e.html('<iframe id="'+l+'" src="'+b+'" style="overflow: hidden; width: 100%; height: 100%; margin: auto; border: 0 none; background-color: rgba(255,255,255,0)"></iframe>');var i=new jQuery.Deferred,h=jQuery("#"+l),k=h[0].contentWindow;h.load(function(){k.AdobeEdge.bootstrapCallback(function(a){a=k.AdobeEdge.getComposition(a);
i.resolve(a,k.AdobeEdge)})})}catch(m){a.error("Error in loadComposition: ","EdgeCommons | Core",m.toString())}return i}};a.Core=d;a.Log=c;a.debug=c.debug;a.info=c.info;a.warn=c.warn;a.error=c.error;a.Config=MConfig})(EdgeCommons);
