// 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(g){var c=function(){};c.VERSION="1.0.0";var h=ModulogLog;c.open=function(a,b){try{if("image"!=a.type&&"animate"!=a.type&&"youtube"!=a.type)h.error("Error in open(). Unsupported type: "+a.type,"EdgeCommons | Spotlight");else{void 0==b&&(b=window.top.document);a.width=a.width||400;a.height=a.height||600;a.borderWidth=a.borderWidth||5;a.borderColor=a.borderColor||"#FFF";$("body",b).append('<div id="spotlight"> <div class="background"> </div> </div>');$("#spotlight .background",b).append('<div class="base"></div>');
$("#spotlight .background",b).append('<div class="close-button"></div>');$("#spotlight .close-button",b).css("margin-left",0.5*a.width-15+a.borderWidth).css("margin-top",-0.5*a.height-15);var c=$("#spotlight .base",b);c.css("width",0).css("height",0).css("margin-left",0).css("margin-top",0).css("border-width",a.borderWidth).css("border-color",a.borderColor).css("border-radius",5);c.animate({width:a.width,"margin-left":-0.5*a.width,height:a.height,"margin-top":-0.5*a.height},400,"easeOutBack",function(){$("#spotlight .content",
b).css("display","inline");$("#spotlight .fader",b).fadeOut(2E3);$("#spotlight .close-button",b).fadeIn()});c.append('<div class="content"></div>');var d=$("#spotlight .content",b),e=document.location.href.split("/");-1!=e[e.length-1].indexOf(".")&&e.pop();var i=e.join("/");switch(a.type){case "image":var f=i+"/"+a.source;d.append('<img src="'+f+'" />');break;case "animate":f=i+"/"+a.source;d.append('<iframe src="'+f+'" style="overflow: hidden; width: 100%; height: 100%; margin: auto; border: 0 none;"></iframe>');
break;case "youtube":d.append('<iframe width="'+a.width+'" height="'+a.height+'" src="http://www.youtube.com/embed/'+a.source+"?autoplay="+(a.param&&a.param.autoPlay?"1":"0")+'" frameborder="0" allowfullscreen></iframe>')}d.append('<div class="fader"></div>');$("#spotlight .fader",b);$("#spotlight .background",b).click(function(){g.Spotlight.close(a,b)});return!0}}catch(j){return h.error(j.toString()),!1}};c.close=function(a,b){void 0==b&&(b=window.top.document);$("#spotlight .content",b).remove();
$("#spotlight .close-button",b).remove();$("#spotlight .background",b).fadeOut(400);$("#spotlight .base",b).animate({width:0,"margin-left":0,height:0,"margin-top":0,opacity:0},400,"easeOutCubic",function(){$("#spotlight",b).remove()})};g.Spotlight=c})(EdgeCommons);
