ConLite/conlite/scripts/conlite.min.js

1 zeile
1.7 KiB
JavaScript

(function(e,a){var d="ConLite";var c;var b=e;a.Con=a.Con||{Plugin:{},cfg:{},sid:0};c=a.Con;c.$=e;c.cfg.enableLog=true;c.namespace=function(h){var g=h.split("."),j=a,f;for(f=0;f<g.length;f++){j[g[f]]=j[g[f]]||{};j=j[g[f]]}return j};c.getFrame=function(f){try{if("undefined"===typeof(a.top.content)){switch(f){case"header":return a.header;case"content":return a.contentFrame;case"left":return a.top.left;case"left_deco":return a.top.left.left_deco;case"left_top":return a.top.left.left_top;case"left_bottom":return a.top.left.left_bottom;case"right":return a.top.right;case"right_top":return a.top.right.right_top;case"right_bottom":return a.top.right.right_bottom}}switch(f){case"header":return a.top.header;case"content":return a.top.content;case"left":return a.top.content.left;case"left_deco":return a.top.content.left.left_deco;case"left_top":return a.top.content.left.left_top;case"left_bottom":return a.top.content.left.left_bottom;case"right":return a.top.content.right;case"right_top":if("undefined"!==b.type(a.top.content.right)){return a.top.content.right.right_top}else{return a.top.content.right_top}case"right_bottom":if("undefined"!==typeof(a.top.content.right)){return a.top.content.right.right_bottom}else{return a.top.content.right_bottom}}}catch(g){c.log(["getFrame: Couldn't get frame "+f,g],d,"warn");return null}};c.log=function(g,h,f){f=f||"log";if(!c.cfg.enableLog){return}else{if(-1===b.inArray(f,["log","info","warn","error"])){return}}if(a.console&&"function"===typeof a.console[f]){var i=f.toUpperCase()+": "+h+": ";a.console[f](i,g)}};if(!("console" in a)){(function(){a.console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){}}})()}})(jQuery,window);