Beautifully crafted timelines that are easy and intuitive to use. http://timeline.knightlab.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
93 KiB

// @codekit-append "VMM.Timeline.js";
/* LANGUAGE
================================================== */function trace(a){window.console?console.log(a):typeof jsTrace!="undefined"&&jsTrace.send(a)}function onYouTubePlayerAPIReady(){trace("GLOBAL YOUTUBE API CALLED");VMM.ExternalAPI.youtube.onAPIReady()}typeof VMM!="undefined"&&typeof VMM.Language=="undefined"&&(VMM.Language={date:{month:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],month_abbr:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],day:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],day_abbr:["일","월","화","수","목","금","토"]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"d mmm",full:"d mmmm yyyy",time_no_seconds_short:"HH:MM",time_no_seconds_small_date:"HH:MM'<br/><small>'d mmmm yyyy'</small>'",full_long:"dddd',' d mmm yyyy 'um' HH:MM",full_long_small_date:"HH:MM'<br/><small>'dddd',' d mmm yyyy'</small>'"},messages:{loading_timeline:"Loading Timeline... ",return_to_title:"Return to Title",expand_timeline:"Expand Timeline",contract_timeline:"Contract Timeline"}});(function(){var a=!1,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(c){function g(){!a&&this.init&&this.init.apply(this,arguments)}var d=this.prototype;a=!0;var e=new this;a=!1;for(var f in c)e[f]=typeof c[f]=="function"&&typeof d[f]=="function"&&b.test(c[f])?function(a,b){return function(){var c=this._super;this._super=d[a];var e=b.apply(this,arguments);this._super=c;return e}}(f,c[f]):c[f];g.prototype=e;g.prototype.constructor=g;g.extend=arguments.callee;return g}})();var global=function(){return this||(1,eval)("this")}();if(typeof VMM=="undefined"){var $;typeof jQuery!="undefined"&&($=jQuery);var VMM=Class.extend({});VMM.master_config={init:function(){return this},vp:"Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",keys:{flickr:"RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",google:"jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo="},youtube:{active:!1,array:[],api_loaded:!1,que:[]},googlemaps:{active:!1,map_active:!1,places_active:!1,array:[],api_loaded:!1,que:[]}}.init();VMM.createElement=function(a,b,c,d,e){var f="";if(a!=null&&a!=""){f+="<"+a;c!=null&&c!=""&&(f+=" class='"+c+"'");d!=null&&d!=""&&(f+=" "+d);e!=null&&e!=""&&(f+=" "+e);f+=">";b!=null&&b!=""&&(f+=b);f=f+"</"+a+">"}return f};VMM.createMediaElement=function(a,b,c){var d="",e=!1;d+="<div class='media'>";if(a!=null&&a!=""){valid=!0;d+="<img src='"+a+"'>";c!=null&&c!=""&&(d+=VMM.createElement("div",c,"credit"));b!=null&&b!=""&&(d+=VMM.createElement("div",b,"caption"))}d+="</div>";return d};VMM.attachElement=function(a,b){typeof jQuery!="undefined"&&$(a).html(b)};VMM.appendElement=function(a,b){typeof jQuery!="undefined"&&$(a).append(b)};VMM.getHTML=function(a){var b;if(typeof jQuery!="undefined"){b=jQuery(a).html();return b}};VMM.getElement=function(a,b){var c;if(typeof jQuery!="undefined"){b?c=jQuery(a).parent().get(0):c=jQuery(a).get(0);return c}};VMM.bindEvent=function(a,b,c,d){var e,f="click",g={};c!=null&&c!=""&&(f=c);g!=null&&g!=""&&(g=d);typeof jQuery!="undefined"&&jQuery(a).bind(f,g,b)};VMM.unbindEvent=function(a,b,c){var d,e="click",f={};c!=null&&c!=""&&(e=c);typeof jQuery!="undefined"&&jQuery(a).unbind(e,b)};VMM.fireEvent=function(a,b,c){var d,e="click",f=[];b!=null&&b!=""&&(e=b);c!=null&&c!=""&&(f=c);typeof jQuery!="undefined"&&jQuery(a).trigger(e,f)};VMM.getJSON=function(a,b,c){if(typeof jQuery!="undefined"){if(!(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=8&&window.XDomainRequest))return jQuery.getJSON(a,b,c);trace("it's ie");var d=a;if(d.match("^http://")){trace("RUNNING GET JSON");return jQuery.getJSON(a,b,c)}if(!d.match("^https://"))return jQuery.getJSON(a,b,c);trace("RUNNING XDR");d=d.replace("https://","http://");var e=new XDomainRequest;e.open("get",d);e.onload=function(){var a=VMM.parseJSON(e.responseText);trace(e.responseText);if(type.of(a)!="null"&&type.of(a)!="undefined")return b(a);trace("IE J
(j,"<img src='"+d.id+"'>"):d.type=="youtube"?VMM.appendElement(j,"<iframe frameborder='0' src='http://www.youtube.com/embed/"+d.id+"?&rel=0&theme=light&showinfo=0&hd=1&autohide=0&color=white' allowfullscreen>"):d.type=="vimeo"&&VMM.appendElement(j,"<iframe frameborder='0' src='http://player.vimeo.com/video/"+d.id+"?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff'>");e.credit!=null&&e.credit!=""&&VMM.appendElement(i,VMM.createElement("div",e.credit,"credit"));e.caption!=null&&e.caption!=""&&VMM.appendElement(i,VMM.createElement("div",e.caption,"caption"))}};this.setData=function(a){if(typeof a!="undefined"){e=a;m()}else trace("NO DATA")}};VMM.Media.prototype.height=function(a){if(a==null||a=="")return config.height;config.height=a;reSize()};VMM.Media.prototype.width=function(a){if(a==null||a=="")return config.width;config.width=a;reSize()};VMM.Media.prototype.getData=function(){return data};VMM.Media.prototype.setConfig=function(a){typeof a!="undefined"?config=a:trace("NO CONFIG DATA")};VMM.Media.prototype.getConfig=function(){return config};VMM.Media.prototype.setSize=function(a,b){a!=null&&(config.width=a);b!=null&&(config.height=b);_active&&reSize()};VMM.Media.prototype.active=function(){return _active}}Date.prototype.getWeek=function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil(((this-a)/864e5+a.getDay()+1)/7)};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil((this-a)/864e5)};var is={Null:function(a){return a===null},Undefined:function(a){return a===undefined},nt:function(a){return a===null||a===undefined},Function:function(a){return typeof a=="function"?a.constructor.toString().match(/Function/)!==null:!1},String:function(a){return typeof a=="string"?!0:typeof a=="object"?a.constructor.toString().match(/string/i)!==null:!1},Array:function(a){return typeof a=="object"?a.constructor.toString().match(/array/i)!==null||a.length!==undefined:!1},Boolean:function(a){return typeof a=="boolean"?!0:typeof a=="object"?a.constructor.toString().match(/boolean/i)!==null:!1},Date:function(a){return typeof a=="date"?!0:typeof a=="object"?a.constructor.toString().match(/date/i)!==null:!1},HTML:function(a){return typeof a=="object"?a.constructor.toString().match(/html/i)!==null:!1},Number:function(a){return typeof a=="number"?!0:typeof a=="object"?a.constructor.toString().match(/Number/)!==null:!1},Object:function(a){return typeof a=="object"?a.constructor.toString().match(/object/i)!==null:!1},RegExp:function(a){return typeof a=="function"?a.constructor.toString().match(/regexp/i)!==null:!1}},type={of:function(a){for(var b in is)if(is[b](a))return b.toLowerCase()}};if(typeof jQuery!="undefined"){jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c}})}typeof VMM!="undefined"&&typeof VMM.Slider=="undefined"&&(VMM.Slider=function(a,b,c,d){function y(){trace("onConfigSet")}function z(a,b){var c=!0,d=!1;a!=null&&(c=a);b!=null&&(d=b);l=o.width;o.nav_height=VMM.Element.height(w.prevBtnContainer);o.content_width=l-o.content_padding*2;VMM.Element.width(v,i.length*o.content_width);if(d){var e=VMM.Element.position(i[k]);VMM.Element.css(u,"left",e.left)}H();VMM.Element.css(w.nextBtn,"left",l-o.nav_width);VMM.Element.height(w.prevBtn,o.height);VMM.Element.height(w.nextBtn,o.height);VMM.Element.css(w.nextBtnContainer,"top",o.height/2-o.nav_height/2);VMM.Element.css(w.prevBtnContainer,"top",o.height/2-o.nav_height/2);VMM.Element.height(t,o.height);VMM.Element.width(t,l);c&&J(k,"linear",1);k==0&&VMM.Element.visible
,function(a){var b=(a.charCodeAt(0)&15)<<12|(a.charCodeAt(1)&63)<<6|a.charCodeAt(2)&63;return String.fromCharCode(b)});b=b.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(a){var b=(a.charCodeAt(0)&31)<<6|a.charCodeAt(1)&63;return String.fromCharCode(b)});return b};typeof VMM!="undefined"&&typeof VMM.Language=="undefined"&&(VMM.Language={date:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],month_abbr:["Jan.","Feb.","March","April","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],day:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_abbr:["Sun.","Mon.","Tues.","Wed.","Thurs.","Fri.","Sat."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"mmm d",full:"mmmm d',' yyyy",time_no_seconds_short:"hh:MM TT",time_no_seconds_small_date:"hh:MM TT'<br/><small>'mmmm d',' yyyy'</small>'",full_long:"dddd',' mmm d',' yyyy 'at' hh:MM TT",full_long_small_date:"hh:MM TT'<br/><small>'dddd',' mmm d',' yyyy'</small>'"},messages:{loading_timeline:"Loading Timeline... ",return_to_title:"Return to Title",expand_timeline:"Expand Timeline",contract_timeline:"Contract Timeline"}});if(typeof VMM!="undefined"&&typeof VMM.Timeline=="undefined"){VMM.Timeline=function(a,b,c){function r(a,b){m=b.timeline;type.of(m.era)!="array"&&(m.era=[]);H()}function s(){D()}function t(){F();i.setSize(o.feature_width,o.feature_height);j.setSize(o.width,o.height);G()}function u(a){o.loaded.slider=!0;v()}function v(a){o.loaded.percentloaded=o.loaded.percentloaded+25;A("Loading Timeline "+o.loaded.percentloaded);o.loaded.slider&&o.loaded.timenav&&B()}function w(a){o.loaded.timenav=!0;v()}function x(a){j.setMarker(i.getCurrentNumber(),o.ease,o.duration)}function y(a){i.setSlide(j.getCurrentNumber())}var d="0.92";trace("TIMELINE VERSION "+d);var e=VMM.getElement("#timeline"),f,g,h=VMM.getElement("#timeline");f=VMM.appendAndGetElement(e,"<div>","feedback","");g=VMM.appendAndGetElement(f,"<div>","messege","#Timeline");var i=new VMM.Slider("div.slider",720,400,!0),j=new VMM.Timeline.TimeNav("div.navigation",720,400,!0),k="private",l={},m={},n=[],o=VMM.Timeline.Config;VMM.master_config.Timeline=VMM.Timeline.Config;o.maptype="toner";o.interval=10;o.something=0;o.width=960;o.height=540;o.spacing=15;o.loaded={slider:!1,timenav:!1,percentloaded:0};o.ease="easeInOutExpo";o.duration=1e3;if(a!=null&&a!=""){o.width=a;VMM.Element.width(e,a)}else o.width=VMM.Element.width(e);if(b!=null&&b!=""){o.height=b;VMM.Element.height(e,b)}else o.height=VMM.Element.height(e);o.nav_width=o.width;o.nav_height=200;o.feature_width=o.width;VMM.Browser.device=="mobile"?o.feature_height=o.height:o.feature_height=o.height-o.nav_height;if(typeof timeline_config=="object"){trace("HAS TIMELINE CONFIG");var p;for(p in timeline_config)Object.prototype.hasOwnProperty.call(timeline_config,p)&&(o[p]=timeline_config[p])}else if(typeof c=="object"){var p;for(p in c)Object.prototype.hasOwnProperty.call(c,p)&&(o[p]=c[p])}o.language=VMM.Language;VMM.master_config.language=o.language;var q=!1;VMM.Browser.browser=="MSIE"&&parseInt(VMM.Browser.version,10)==7&&(q=!0);this.init=function(a){trace("TIMELINE INIT");VMM.Util.date.setLanguage(VMM.Timeline.Config.language);VMM.bindEvent(global,r,"DATAREADY");if(q){f=VMM.appendAndGetElement(e,"<div>","feedback","");g=VMM.appendAndGetElement(f,"<div>","messege","Internet Explorer 7 is not supported by #Timeline.")}else{type.of(a)=="string"?VMM.Timeline.DataObj.getData(a):VMM.Timeline.DataObj.getData(h);f=VMM.appendAndGetElement(e,"<div>","feedback","");g=VMM.appendAndGetElement(f,"<div>","messege",VMM.Timeline.Config.language.messages.loading_timeline)}};this.iframeLoaded=function(){trace("iframeLoaded")};var z=function(a){VMM.getJSON(a,function(a){m=VMM.Timeline.DataObj.getData(a);VMM.fireEvent(global,"DATAREADY")})},A=function(a){},B=function(){VMM.Element.animate(f,o.duration,o.ease*4,{opacity:0},C)},C=function(){VMM.Element.detach(f)},D=function(){VMM.attachElement(e,"");VMM.appendElement(e,"<div class='container main'><div class='feature'><div cla