From d25de691990d1b945cdd3cd351722a62027aab6c Mon Sep 17 00:00:00 2001
From: Zach Wise
Date: Fri, 9 Oct 2015 11:14:26 -0500
Subject: [PATCH] Update spreadsheet test example to include debug
---
compiled/examples/google_spreadsheet_tester.html | 1 +
compiled/js/timeline-min.js | 10 +++++-----
compiled/js/timeline.js | 6 ++++--
source/jade/google_spreadsheet_tester.jade | 1 +
source/js/media/types/TL.Media.Text.js | 6 ++++--
5 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/compiled/examples/google_spreadsheet_tester.html b/compiled/examples/google_spreadsheet_tester.html
index 9c740a40..b0b18d55 100644
--- a/compiled/examples/google_spreadsheet_tester.html
+++ b/compiled/examples/google_spreadsheet_tester.html
@@ -68,6 +68,7 @@
document.getElementById('timeline').style.height = (window.innerHeight - 40 + "px");
timeline = new TL.Timeline('timeline', new TL.TimelineConfig(json), {
+ debug:true
});
diff --git a/compiled/js/timeline-min.js b/compiled/js/timeline-min.js
index 529b9b60..617e7b3a 100644
--- a/compiled/js/timeline-min.js
+++ b/compiled/js/timeline-min.js
@@ -1,6 +1,6 @@
-!function(t){t.TL={VERSION:"0.1",_originalL:t.TL}}(this),TL.debug=!1,TL.Bind=function(t,e){return function(){return t.apply(e,arguments)}},trace=function(t){TL.debug&&(window.console?console.log(t):"undefined"!=typeof jsTrace&&jsTrace.send(t))},TL.Util={mergeData:function(t,e){var i;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},extend:function(t){for(var e=Array.prototype.slice.call(arguments,1),i=0,n=e.length,a;n>i;i++)a=e[i]||{},TL.Util.mergeData(t,a);return t},isEven:function(t){return t==parseFloat(t)?!(t%2):void 0},findArrayNumberByUniqueID:function(t,e,i,n){for(var a=n||0,s=0;si;i++)e+=n();return e};return e?e+"-"+a(t):"tl-"+a(t)},ensureUniqueKey:function(t,e){if(e||(e=TL.Util.unique_ID(6)),!(e in t))return e;var i=e.match(/^(.+)(-\d+)?$/)[1],n=[];for(key in t)key.match(/^(.+?)(-\d+)?$/)[1]==i&&n.push(key);e=i+"-"+(n.length+1);for(var a=n.length;-1!=n.indexOf(e);a++)e=i+"-"+a;return e},htmlify:function(t){return t.match(/[\s\S]*?<\/p>/)?t:"
"+t+"
"},linkify:function(t,e,i){var n=function(t,e,i){i||(i="");var n=30;return e&&e.length>n&&(e=e.substring(0,n)+"…"),i+""+e+""},a=/\b(?:https?|ftp):\/\/([a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|])/gim,s=/(^|[^\/>])(www\.[\S]+(\b|$))/gim,o=/([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)/gim;return t.replace(a,function(t,e,i,a){if(i>0){var s=a[i-1];if('"'==s||"'"==s||"="==s)return t}return n(t,e)}).replace(s,function(t,e,i,a,s){return n("http://"+i,i,e)}).replace(o,function(t,e,i,a){return n("mailto:"+e,e)})},unlinkify:function(t){return t?(t=t.replace(/]*>/i,""),t=t.replace(/<\/a>/i,"")):t},getParamString:function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i+"="+t[i]);return"?"+e.join("&")},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},falseFn:function(){return!1},requestAnimFrame:function(){function t(t){window.setTimeout(t,1e3/60)}var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||t;return function(i,n,a,s){i=n?TL.Util.bind(i,n):i,a&&e===t?i():e(i,s)}}(),bind:function(t,e){return function(){return t.apply(e,arguments)}},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw new Error("No value provided for variable "+t);return n})},hexToRgb:function(t){TL.Util.css_named_colors[t.toLowerCase()]&&(t=TL.Util.css_named_colors[t.toLowerCase()]);var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,n){return e+e+i+i+n+n});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},rgbToHex:function(t){var e,i,n;if("object"==typeof t)e=t.r,i=t.g,n=t.b;else if("function"==typeof t.match){var a=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);a&&(e=a[1],i=a[2],n=a[3])}if(isNaN(e)||isNaN(n)||isNaN(i))throw"Invalid RGB argument";return"#"+TL.Util.intToHexString(e)+TL.Util.intToHexString(i)+TL.Util.intToHexString(n)},colorObjToHex:function(t){var e=[t.r,t.g,t.b];return TL.Util.rgbToHex("rgb("+e.join(",")+")")},css_named_colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ratio:{square:function(t){var e={w:0,h:0};return t.w>t.h&&t.h>0?(e.h=t.h,e.w=t.h):(e.w=t.w,e.h=t.w),e},r16_9:function(t){return null!==t.w&&""!==t.w?Math.round(t.w/16*9):null!==t.h&&""!==t.h?Math.round(t.h/9*16):0},r4_3:function(t){return null!==t.w&&""!==t.w?Math.round(t.w/4*3):null!==t.h&&""!==t.h?Math.round(t.h/3*4):void 0}},getObjectAttributeByIndex:function(t,e){if("undefined"!=typeof t){var i=0;for(var n in t){if(e===i)return t[n];i++}return""}return""},getUrlVars:function(t){var e,i=[],n,a;e=t.toString(),e.match("&")?e=e.replace("&","&"):e.match("&")?e=e.replace("&","&"):e.match("&")&&(e=e.replace("&","&")),a=e.slice(e.indexOf("?")+1).split("&");for(var s=0;sn;n++)t=t.replace(new RegExp(e.charAt(n),"g"),i.charAt(n));return t=t.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),t=t.replace(/^([0-9])/,"_$1")},maxDepth:function(t){for(var e=[],i=0,n=0;n1){for(var a=e[e.length-1],s=-1,o=0;o=0&&(e=e.slice(s+1))}e.length>i&&(i=e.length)}return i},pad:function(t,e){for(t=String(t),e=e||2;t.length=0;n--)if(e>t[n])return t[n];return i?i:e},isEmptyObject:function(t){var e=[];if(Object.keys)e=Object.keys(t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);for(var n=0;n0?$.fn.concat.apply([],t):t}function h(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function d(t){return t in S?S[t]:S[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function c(t,e){return"number"!=typeof e||N[h(t)]?e:e+"px"}function u(t){var e,i;return E[t]||(e=M.createElement(t),M.body.appendChild(e),i=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==i&&(i="block"),E[t]=i),E[t]}function m(t){return"children"in t?k.call(t.children):$.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function f(t,e,i){for(w in e)i&&(s(e[w])||K(e[w]))?(s(e[w])&&!s(t[w])&&(t[w]={}),K(e[w])&&!K(t[w])&&(t[w]=[]),f(t[w],e[w],i)):e[w]!==L&&(t[w]=e[w])}function _(t,e){return null==e?$(t):$(t).filter(e)}function p(t,i,n,a){return e(i)?i.call(t,n,a):i}function g(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}function v(t,e){var i=t.className,n=i&&i.baseVal!==L;return e===L?n?i.baseVal:i:void(n?i.baseVal=e:t.className=e)}function y(t){var e;try{return t?"true"==t||("false"==t?!1:"null"==t?null:/^0/.test(t)||isNaN(e=Number(t))?/^[\[\{]/.test(t)?$.parseJSON(t):t:e):t}catch(i){return t}}function T(t,e){e(t);for(var i in t.childNodes)T(t.childNodes[i],e)}var L,w,$,b,x=[],k=x.slice,D=x.filter,M=window.document,E={},S={},N={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},C=/^\s*<(\w+|!)[^>]*>/,I=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,A=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,j=/^(?:body|html)$/i,O=/([A-Z])/g,U=["val","css","html","text","data","width","height","offset"],P=["after","prepend","before","append"],z=M.createElement("table"),B=M.createElement("tr"),q={tr:M.createElement("tbody"),tbody:z,thead:z,tfoot:z,td:B,th:B,"*":M.createElement("div")},H=/complete|loaded|interactive/,R=/^\.([\w-]+)$/,F=/^#([\w-]*)$/,W=/^[\w-]*$/,Y={},Z=Y.toString,G={},J,V,X=M.createElement("div"),Q={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},K=Array.isArray||function(t){return t instanceof Array};return G.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var i=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(i)return i.call(t,e);var n,a=t.parentNode,s=!a;return s&&(a=X).appendChild(t),n=~G.qsa(a,e).indexOf(t),s&&X.removeChild(t),n},J=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},V=function(t){return D.call(t,function(e,i){return t.indexOf(e)==i})},G.fragment=function(t,e,i){var n,a,o;return I.test(t)&&(n=$(M.createElement(RegExp.$1))),n||(t.replace&&(t=t.replace(A,"<$1>$2>")),e===L&&(e=C.test(t)&&RegExp.$1),e in q||(e="*"),o=q[e],o.innerHTML=""+t,n=$.each(k.call(o.childNodes),function(){o.removeChild(this)})),s(i)&&(a=$(n),$.each(i,function(t,e){U.indexOf(t)>-1?a[t](e):a.attr(t,e)})),n},G.Z=function(t,e){return t=t||[],t.__proto__=$.fn,t.selector=e||"",t},G.isZ=function(t){return t instanceof G.Z},G.init=function(t,i){var n;if(!t)return G.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&C.test(t))n=G.fragment(t,RegExp.$1,i),t=null;else{if(i!==L)return $(i).find(t);n=G.qsa(M,t)}else{if(e(t))return $(M).ready(t);if(G.isZ(t))return t;if(K(t))n=r(t);else if(a(t))n=[t],t=null;else if(C.test(t))n=G.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==L)return $(i).find(t);n=G.qsa(M,t)}}return G.Z(n,t)},$=function(t,e){return G.init(t,e)},$.extend=function(t){var e,i=k.call(arguments,1);return"boolean"==typeof t&&(e=t,t=i.shift()),i.forEach(function(i){f(t,i,e)}),t},G.qsa=function(t,e){var i,a="#"==e[0],s=!a&&"."==e[0],o=a||s?e.slice(1):e,r=W.test(o);return n(t)&&r&&a?(i=t.getElementById(o))?[i]:[]:1!==t.nodeType&&9!==t.nodeType?[]:k.call(r&&!a?s?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},$.contains=function(t,e){return t!==e&&t.contains(e)},$.type=t,$.isFunction=e,$.isWindow=i,$.isArray=K,$.isPlainObject=s,$.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},$.inArray=function(t,e,i){return x.indexOf.call(e,t,i)},$.camelCase=J,$.trim=function(t){return null==t?"":String.prototype.trim.call(t)},$.uuid=0,$.support={},$.expr={},$.map=function(t,e){var i,n=[],a,s;if(o(t))for(a=0;a=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return x.every.call(this,function(e,i){return t.call(e,i,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):$(D.call(this,function(e){return G.matches(e,t)}))},add:function(t,e){return $(V(this.concat($(t,e))))},is:function(t){return this.length>0&&G.matches(this[0],t)},not:function(t){var i=[];if(e(t)&&t.call!==L)this.each(function(e){t.call(this,e)||i.push(this)});else{var n="string"==typeof t?this.filter(t):o(t)&&e(t.item)?k.call(t):$(t);this.forEach(function(t){n.indexOf(t)<0&&i.push(t)})}return $(i)},has:function(t){return this.filter(function(){return a(t)?$.contains(this,t):$(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!a(t)?t:$(t)},last:function(){var t=this[this.length-1];return t&&!a(t)?t:$(t)},find:function(t){var e,i=this;return e="object"==typeof t?$(t).filter(function(){var t=this;return x.some.call(i,function(e){return $.contains(e,t)})}):1==this.length?$(G.qsa(this[0],t)):this.map(function(){return G.qsa(this,t)})},closest:function(t,e){var i=this[0],a=!1;for("object"==typeof t&&(a=$(t));i&&!(a?a.indexOf(i)>=0:G.matches(i,t));)i=i!==e&&!n(i)&&i.parentNode;return $(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=$.map(i,function(t){return(t=t.parentNode)&&!n(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return _(e,t)},parent:function(t){return _(V(this.pluck("parentNode")),t)},children:function(t){return _(this.map(function(){return m(this)}),t)},contents:function(){return this.map(function(){return k.call(this.childNodes)})},siblings:function(t){return _(this.map(function(t,e){return D.call(m(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return $.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=u(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var i=e(t);if(this[0]&&!i)var n=$(t).get(0),a=n.parentNode||this.length>1;return this.each(function(e){$(this).wrapAll(i?t.call(this,e):a?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){$(this[0]).before(t=$(t));for(var e;(e=t.children()).length;)t=e.first();$(t).append(this)}return this},wrapInner:function(t){var i=e(t);return this.each(function(e){var n=$(this),a=n.contents(),s=i?t.call(this,e):t;a.length?a.wrapAll(s):n.append(s)})},unwrap:function(){return this.parent().each(function(){$(this).replaceWith($(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=$(this);(t===L?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return $(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return $(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0===arguments.length?this.length>0?this[0].innerHTML:null:this.each(function(e){var i=this.innerHTML;$(this).empty().append(p(this,t,e,i))})},text:function(t){return 0===arguments.length?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t===L?"":""+t})},attr:function(t,e){var i;return"string"==typeof t&&e===L?0==this.length||1!==this[0].nodeType?L:"value"==t&&"INPUT"==this[0].nodeName?this.val():!(i=this[0].getAttribute(t))&&t in this[0]?this[0][t]:i:this.each(function(i){if(1===this.nodeType)if(a(t))for(w in t)g(this,w,t[w]);else g(this,t,p(this,e,i,this.getAttribute(t)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&g(this,t)})},prop:function(t,e){return t=Q[t]||t,e===L?this[0]&&this[0][t]:this.each(function(i){this[t]=p(this,e,i,this[t])})},data:function(t,e){var i=this.attr("data-"+t.replace(O,"-$1").toLowerCase(),e);return null!==i?y(i):L},val:function(t){return 0===arguments.length?this[0]&&(this[0].multiple?$(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(e){this.value=p(this,t,e,this.value)})},offset:function(t){if(t)return this.each(function(e){var i=$(this),n=p(this,t,e,i.offset()),a=i.offsetParent().offset(),s={top:n.top-a.top,left:n.left-a.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(0==this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,i){if(arguments.length<2){var n=this[0],a=getComputedStyle(n,"");if(!n)return;if("string"==typeof e)return n.style[J(e)]||a.getPropertyValue(e);if(K(e)){var s={};return $.each(K(e)?e:[e],function(t,e){s[e]=n.style[J(e)]||a.getPropertyValue(e)}),s}}var o="";if("string"==t(e))i||0===i?o=h(e)+":"+c(e,i):this.each(function(){this.style.removeProperty(h(e))});else for(w in e)e[w]||0===e[w]?o+=h(w)+":"+c(w,e[w])+";":this.each(function(){this.style.removeProperty(h(w))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf($(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?x.some.call(this,function(t){return this.test(v(t))},d(t)):!1},addClass:function(t){return t?this.each(function(e){b=[];var i=v(this),n=p(this,t,e,i);n.split(/\s+/g).forEach(function(t){$(this).hasClass(t)||b.push(t)},this),b.length&&v(this,i+(i?" ":"")+b.join(" "))}):this},removeClass:function(t){return this.each(function(e){return t===L?v(this,""):(b=v(this),p(this,t,e,b).split(/\s+/g).forEach(function(t){b=b.replace(d(t)," ")}),void v(this,b.trim()))})},toggleClass:function(t,e){return t?this.each(function(i){var n=$(this),a=p(this,t,i,v(this));a.split(/\s+/g).forEach(function(t){(e===L?!n.hasClass(t):e)?n.addClass(t):n.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===L?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===L?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),n=j.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat($(t).css("margin-top"))||0,i.left-=parseFloat($(t).css("margin-left"))||0,n.top+=parseFloat($(e[0]).css("border-top-width"))||0,n.left+=parseFloat($(e[0]).css("border-left-width"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||M.body;t&&!j.test(t.nodeName)&&"static"==$(t).css("position");)t=t.offsetParent;return t})}},$.fn.detach=$.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});$.fn[t]=function(a){var s,o=this[0];return a===L?i(o)?o["inner"+e]:n(o)?o.documentElement["scroll"+e]:(s=this.offset())&&s[t]:this.each(function(e){o=$(this),o.css(t,p(this,a,e,o[t]()))})}}),P.forEach(function(e,i){var n=i%2;$.fn[e]=function(){var e,a=$.map(arguments,function(i){return e=t(i),"object"==e||"array"==e||null==i?i:G.fragment(i)}),s,o=this.length>1;return a.length<1?this:this.each(function(t,e){s=n?e:e.parentNode,e=0==i?e.nextSibling:1==i?e.firstChild:2==i?e:null,a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!s)return $(t).remove();T(s.insertBefore(t,e),function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},$.fn[n?e+"To":"insert"+(i?"Before":"After")]=function(t){return $(t)[e](this),this}}),G.Z.prototype=$.fn,G.uniq=V,G.deserializeValue=y,$.zepto=G,$}();window.Zepto=e,void 0===window.$&&(window.$=e),function($){function t(t){return t._zid||(t._zid=c++)}function e(e,a,s,o){if(a=i(a),a.ns)var r=n(a.ns);return(p[t(e)]||[]).filter(function(e){return e&&(!a.e||e.e==a.e)&&(!a.ns||r.test(e.ns))&&(!s||t(e.fn)===t(s))&&(!o||e.sel==o)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function n(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function a(t,e){return t.del&&!v&&t.e in y||!!e}function s(t){return T[t]||v&&y[t]||t}function o(e,n,o,r,h,d,c){var m=t(e),f=p[m]||(p[m]=[]);n.split(/\s/).forEach(function(t){if("ready"==t)return $(document).ready(o);var n=i(t);n.fn=o,n.sel=h,n.e in T&&(o=function(t){var e=t.relatedTarget;return!e||e!==this&&!$.contains(this,e)?n.fn.apply(this,arguments):void 0}),n.del=d;var m=d||o;n.proxy=function(t){if(t=l(t),!t.isImmediatePropagationStopped()){t.data=r;var i=m.apply(e,t._args==u?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},n.i=f.length,f.push(n),"addEventListener"in e&&e.addEventListener(s(n.e),n.proxy,a(n,c))})}function r(i,n,o,r,l){var h=t(i);(n||"").split(/\s/).forEach(function(t){e(i,t,o,r).forEach(function(t){delete p[h][t.i],"removeEventListener"in i&&i.removeEventListener(s(t.e),t.proxy,a(t,l))})})}function l(t,e){return(e||!t.isDefaultPrevented)&&(e||(e=t),$.each(x,function(i,n){var a=e[i];t[i]=function(){return this[n]=L,a&&a.apply(e,arguments)},t[n]=w}),(e.defaultPrevented!==u?e.defaultPrevented:"returnValue"in e?e.returnValue===!1:e.getPreventDefault&&e.getPreventDefault())&&(t.isDefaultPrevented=L)),t}function h(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===u||(i[e]=t[e]);return l(i,t)}var d=$.zepto.qsa,c=1,u,m=Array.prototype.slice,f=$.isFunction,_=function(t){return"string"==typeof t},p={},g={},v="onfocusin"in window,y={focus:"focusin",blur:"focusout"},T={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",$.event={add:o,remove:r},$.proxy=function(e,i){if(f(e)){var n=function(){return e.apply(i,arguments)};return n._zid=t(e),n}if(_(i))return $.proxy(e[i],e);throw new TypeError("expected function")},$.fn.bind=function(t,e,i){return this.on(t,e,i)},$.fn.unbind=function(t,e){return this.off(t,e)},$.fn.one=function(t,e,i,n){return this.on(t,e,i,n,1)};var L=function(){return!0},w=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,x={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};$.fn.delegate=function(t,e,i){return this.on(e,t,i)},$.fn.undelegate=function(t,e,i){return this.off(e,t,i)},$.fn.live=function(t,e){return $(document.body).delegate(this.selector,t,e),this},$.fn.die=function(t,e){return $(document.body).undelegate(this.selector,t,e),this},$.fn.on=function(t,e,i,n,a){var s,l,d=this;return t&&!_(t)?($.each(t,function(t,n){d.on(t,e,i,n,a)}),d):(_(e)||f(n)||n===!1||(n=i,i=e,e=u),(f(i)||i===!1)&&(n=i,i=u),n===!1&&(n=w),d.each(function(d,c){a&&(s=function(t){return r(c,t.type,n),n.apply(this,arguments)}),e&&(l=function(t){var i,a=$(t.target).closest(e,c).get(0);return a&&a!==c?(i=$.extend(h(t),{currentTarget:a,liveFired:c}),(s||n).apply(a,[i].concat(m.call(arguments,1)))):void 0}),o(c,t,n,i,e,l||s)}))},$.fn.off=function(t,e,i){var n=this;return t&&!_(t)?($.each(t,function(t,i){n.off(t,e,i)}),n):(_(e)||f(i)||i===!1||(i=e,e=u),i===!1&&(i=w),n.each(function(){r(this,t,i,e)}))},$.fn.trigger=function(t,e){return t=_(t)||$.isPlainObject(t)?$.Event(t):l(t),t._args=e,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(t):$(this).triggerHandler(t,e)})},$.fn.triggerHandler=function(t,i){var n,a;return this.each(function(s,o){n=h(_(t)?$.Event(t):t),n._args=i,n.target=o,$.each(e(o,t.type||t),function(t,e){return a=e.proxy(n),n.isImmediatePropagationStopped()?!1:void 0})}),a},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){$.fn[t]=function(e){return e?this.bind(t,e):this.trigger(t)}}),["focus","blur"].forEach(function(t){$.fn[t]=function(e){return e?this.bind(t,e):this.each(function(){try{this[t]()}catch(e){}}),this}}),$.Event=function(t,e){_(t)||(e=t,t=e.type);var i=document.createEvent(g[t]||"Events"),n=!0;if(e)for(var a in e)"bubbles"==a?n=!!e[a]:i[a]=e[a];return i.initEvent(t,n,!0),l(i)}}(e),function($){function t(t,e,i){var n=$.Event(e);return $(t).trigger(n,i),!n.isDefaultPrevented()}function e(e,i,n,a){return e.global?t(i||_,n,a):void 0}function i(t){t.global&&0===$.active++&&e(t,null,"ajaxStart")}function n(t){t.global&&!--$.active&&e(t,null,"ajaxStop")}function a(t,i){var n=i.context;return i.beforeSend.call(n,t,i)===!1||e(i,n,"ajaxBeforeSend",[t,i])===!1?!1:void e(i,n,"ajaxSend",[t,i])}function s(t,i,n,a){var s=n.context,o="success";n.success.call(s,t,o,i),a&&a.resolveWith(s,[t,o,i]),e(n,s,"ajaxSuccess",[i,n,t]),r(o,i,n)}function o(t,i,n,a,s){var o=a.context;a.error.call(o,n,i,t),s&&s.rejectWith(o,[n,i,t]),e(a,o,"ajaxError",[n,a,t||i]),r(i,n,a)}function r(t,i,a){var s=a.context;a.complete.call(s,i,t),e(a,s,"ajaxComplete",[i,a]),n(a)}function l(){}function h(t){return t&&(t=t.split(";",2)[0]),t&&(t==w?"html":t==L?"json":y.test(t)?"script":T.test(t)&&"xml")||"text"}function d(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function c(t){t.processData&&t.data&&"string"!=$.type(t.data)&&(t.data=$.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()||(t.url=d(t.url,t.data),t.data=void 0)}function u(t,e,i,n){var a=!$.isFunction(e);return{url:t,data:a?e:void 0,success:a?$.isFunction(i)?i:void 0:e,dataType:a?n||i:i}}function m(t,e,i,n){var a,s=$.isArray(e),o=$.isPlainObject(e);$.each(e,function(e,r){a=$.type(r),n&&(e=i?n:n+"["+(o||"object"==a||"array"==a?e:"")+"]"),!n&&s?t.add(r.name,r.value):"array"==a||!i&&"object"==a?m(t,r,i,e):t.add(e,r)})}var f=0,_=window.document,p,g,v=/",this._el.content_item.innerHTML=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),TL.Media.Text=TL.Class.extend({includes:[TL.Events],_el:{container:{},content_container:{},content:{},headline:{},date:{}},data:{unique_id:"",headline:"headline",text:"text"},options:{title:!1},initialize:function(t,e,i){TL.Util.setData(this,t),TL.Util.mergeData(this.options,e),this._el.container=TL.Dom.create("div","tl-text"),this._el.container.id=this.data.unique_id,this._initLayout(),i&&i.appendChild(this._el.container)},show:function(){},hide:function(){},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},headlineHeight:function(){return this._el.headline.offsetHeight+40},addDateText:function(t){this._el.date.innerHTML=t},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){if(this._el.content_container=TL.Dom.create("div","tl-text-content-container",this._el.container),this._el.date=TL.Dom.create("h3","tl-headline-date",this._el.content_container),""!=this.data.headline){var t="tl-headline";this.options.title&&(t="tl-headline tl-headline-title"),this._el.headline=TL.Dom.create("h2",t,this._el.content_container),this._el.headline.innerHTML=this.data.headline}if(""!=this.data.text){var e="";e+=TL.Util.htmlify(1==this.options.autolink?TL.Util.linkify(this.data.text):this.data.text),this._el.content=TL.Dom.create("div","tl-text-content",this._el.content_container),this._el.content.innerHTML=e}this.onLoaded()}}),TL.Media.Twitter=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-twitter",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this.data.url.match("status/")?this.media_id=this.data.url.split("status/")[1]:url.match("statuses/")?this.media_id=this.data.url.split("statuses/")[1]:this.media_id="",t="https://api.twitter.com/1/statuses/oembed.json?id="+this.media_id+"&omit_script=true&include_entities=true&callback=?",TL.ajax({type:"GET",url:t,dataType:"json",success:function(t){e.createMedia(t)},error:function(t,i){var n="";n+="Unable to load Tweet.
"+e.media_id+"
"+i,e.loadErrorDisplay(n)}})},createMedia:function(t){var e="",i="",n="",a="",s="",o="";i=t.html.split("
—")[0]+"",n=t.author_url.split("twitter.com/")[1],a=t.html.split("—")[1].split('')[0],o=a.split('">')[1].split("")[0],i=i.replace(/",e+="",e+="",e+="",this._el.content_item.innerHTML=e,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.Vimeo=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-vimeo tl-media-shadow",this._el.content),this.media_id=this.data.url.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0],t="https://player.vimeo.com/video/"+this.media_id+"?api=1&title=0&byline=0&portrait=0&color=ffffff",this.player=TL.Dom.create("iframe","",this._el.content_item),this.player.addEventListener("load",function(t){e.onMediaLoaded()}),this.player.width="100%",this.player.height="100%",this.player.frameBorder="0",this.player.src=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=TL.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){try{this.player.contentWindow.postMessage(JSON.stringify({method:"pause"}),"https://player.vimeo.com")}catch(t){trace(t)}}}),TL.Media.Vine=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-vine tl-media-shadow",this._el.content),this.media_id=this.data.url.split("vine.co/v/")[1],t="https://vine.co/v/"+this.media_id+"/embed/simple",this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){var t=TL.Util.ratio.square({w:this._el.content_item.offsetWidth,h:this.options.height});this._el.content_item.style.height=t.h+"px"}}),TL.Media.Website=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this;this.loadingMessage(),this.media_id=this.data.url.replace(/.*?:\/\//g,""),this.options.api_key_embedly?(api_url="http://api.embed.ly/1/extract?key="+this.options.api_key_embedly+"&url="+this.media_id+"&callback=?",TL.getJSON(api_url,function(e){t.createMedia(e)})):this.createCardContent()},createCardContent:function(){!function(t,e){var i="embedly-platform",n="script";if(!e.getElementById(i)){t.embedly=t.embedly||function(){(t.embedly.q=t.embedly.q||[]).push(arguments)};var a=e.createElement(n);a.id=i,a.async=1,a.src=("https:"===document.location.protocol?"https":"http")+"://cdn.embedly.com/widgets/platform.js";var s=e.getElementsByTagName(n)[0];s.parentNode.insertBefore(a,s)}}(window,document);var t=''+this.data.url+"";this._setContent(t)},createMedia:function(t){var e="";e+="",t.images&&t.images[0]&&(trace(t.images[0].url),e+="
"),t.favicon_url&&(e+="
"),e+=""+t.provider_name+"
",e+=""+t.description+"
",this._setContent(e)},_setContent:function(t){this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-website",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this._el.content_item.innerHTML=t,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.Wikipedia=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e,i=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-wikipedia",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this.media_id=this.data.url.split("wiki/")[1].split("#")[0].replace("_"," "),this.media_id=this.media_id.replace(" ","%20"),e=this.data.url.split("//")[1].split(".wikipedia")[0],t="http://"+e+".wikipedia.org/w/api.php?action=query&prop=extracts|pageimages&redirects=&titles="+this.media_id+"&exintro=1&format=json&callback=?",TL.ajax({type:"GET",url:t,dataType:"json",success:function(t){i.createMedia(t)},error:function(t,e){var n="";n+="Unable to load Wikipedia entry.
"+i.media_id+"
"+e,i.loadErrorDisplay(n)}})},createMedia:function(t){var e="";if(t.query){var i="",e={entry:{},title:"",text:"",extract:"",paragraphs:1,page_image:"",text_array:[]};e.entry=TL.Util.getObjectAttributeByIndex(t.query.pages,0),e.extract=e.entry.extract,e.title=e.entry.title,e.page_image=e.entry.thumbnail,e.extract.match("")?e.text_array=e.extract.split("
"):e.text_array.push(e.extract);for(var n=0;n"+e.text_array[n+1]);i+="",i+="",i+="
"+this._("wikipedia")+" ",e.page_image,i+=e.text,e.extract.match("REDIRECT")||(this._el.content_item.innerHTML=i,this.onLoaded())}},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.YouTube=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this,e;this.loadingMessage(),this.youtube_loaded=!1,this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-youtube tl-media-shadow",this._el.content),this._el.content_item.id=TL.Util.unique_ID(7),e=TL.Util.getUrlVars(this.data.url),this.media_id={},this.data.url.match("v=")?this.media_id.id=e.v:this.data.url.match("/embed/")?this.media_id.id=this.data.url.split("embed/")[1].split(/[?&]/)[0]:this.data.url.match(/v\/|v=|youtu\.be\//)?this.media_id.id=this.data.url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]:trace("YOUTUBE IN URL BUT NOT A VALID VIDEO"),this.media_id.start=TL.Util.parseYouTubeTime(e.t),this.media_id.hd=Boolean("undefined"!=typeof e.hd),TL.Load.js("https://www.youtube.com/iframe_api",function(){t.createMedia()})},_updateMediaDisplay:function(){this._el.content_item.style.height=TL.Util.ratio.r16_9({w:this.options.width})+"px",this._el.content_item.style.width=this.options.width+"px"},_stopMedia:function(){if(this.youtube_loaded)try{this.player.getPlayerState()==YT.PlayerState.PLAYING&&this.player.pauseVideo()}catch(t){trace(t)}},createMedia:function(){var t=this;clearTimeout(this.timer),"undefined"!=typeof YT&&"undefined"!=typeof YT.Player?this.player=new YT.Player(this._el.content_item.id,{playerVars:{enablejsapi:1,color:"white",autohide:1,showinfo:0,theme:"light",start:this.media_id.start,fs:0,rel:0},videoId:this.media_id.id,events:{onReady:function(){t.onPlayerReady(),t.onLoaded()},onStateChange:t.onStateChange}}):this.timer=setTimeout(function(){t.createMedia()},1e3)},onPlayerReady:function(t){this.youtube_loaded=!0,this._el.content_item=document.getElementById(this._el.content_item.id),this.onMediaLoaded()},onStateChange:function(t){t.data==YT.PlayerState.ENDED&&(t.target.seekTo(0),t.target.pauseVideo())}}),TL.Slide=TL.Class.extend({includes:[TL.Events,TL.DomMixins,TL.I18NMixins],_el:{},initialize:function(t,e,i){this._el={container:{},scroll_container:{},background:{},content_container:{},content:{}},this._media=null,this._mediaclass={},this._text={},this._state={loaded:!1},this.has={headline:!1,text:!1,media:!1,title:!1,background:{image:!1,color:!1,color_value:""}},this.has.title=i,this.data={unique_id:null,background:null,start_date:null,end_date:null,location:null,text:null,media:null,autolink:!0},this.options={duration:1e3,slide_padding_lr:40,ease:TL.Ease.easeInSpline,width:600,height:600,skinny_size:650,media_name:""},this.active=!1,this.animator={},TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){this.animator=TL.Animate(this._el.slider_container,{left:-(this._el.container.offsetWidth*n)+"px",duration:this.options.duration,easing:this.options.ease})},hide:function(){},setActive:function(t){this.active=t,this.active?(this.data.background&&this.fire("background_change",this.has.background),this.loadMedia()):this.stopMedia()},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e,i){this._updateDisplay(t,e,i)},loadMedia:function(){this._media&&!this._state.loaded&&(this._media.loadMedia(),this._state.loaded=!0)},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getBackground:function(){return this.has.background},scrollToTop:function(){this._el.container.scrollTop=0},getFormattedDate:function(){if(TL.Util.trim(this.data.display_date).length>0)return this.data.display_date;var t="";return this.has.title||(this.data.end_date&&(t=" — "+this.data.end_date.getDisplayDate(this.getLanguage())),this.data.start_date&&(t=this.data.start_date.getDisplayDate(this.getLanguage())+t)),t},_initLayout:function(){this._el.container=TL.Dom.create("div","tl-slide"),this.has.title&&(this._el.container.className="tl-slide tl-slide-titleslide"),this.data.unique_id&&(this._el.container.id=this.data.unique_id),this._el.scroll_container=TL.Dom.create("div","tl-slide-scrollable-container",this._el.container),this._el.content_container=TL.Dom.create("div","tl-slide-content-container",this._el.scroll_container),this._el.content=TL.Dom.create("div","tl-slide-content",this._el.content_container),this._el.background=TL.Dom.create("div","tl-slide-background",this._el.container),this.data.background&&(this.data.background.url&&(this.has.background.image=!0,this._el.container.className+=" tl-full-image-background",this.has.background.color_value="#000",this._el.background.style.backgroundImage="url('"+this.data.background.url+"')",this._el.background.style.display="block"),this.data.background.color&&(this.has.background.color=!0,this._el.container.className+=" tl-full-color-background",this.has.background.color_value=this.data.background.color),this.data.background.text_background&&(this._el.container.className+=" tl-text-background")),this.data.media&&this.data.media.url&&""!=this.data.media.url&&(this.has.media=!0),this.data.text&&this.data.text.text&&(this.has.text=!0),this.data.text&&this.data.text.headline&&(this.has.headline=!0),this.has.media&&(this.data.media.mediatype=TL.MediaType(this.data.media),this.options.media_name=this.data.media.mediatype.name,this.options.media_type=this.data.media.mediatype.type,this.options.autolink=this.data.autolink,this._media=new this.data.media.mediatype.cls(this.data.media,this.options)),(this.has.text||this.has.headline)&&(this._text=new TL.Media.Text(this.data.text,{title:this.has.title,language:this.options.language,autolink:this.data.autolink}),this._text.addDateText(this.getFormattedDate())),this.has.text||this.has.headline||!this.has.media?this.has.headline&&this.has.media&&!this.has.text?(this._el.container.className+=" tl-slide-media-only",this._text.addTo(this._el.content),this._media.addTo(this._el.content)):this.has.text&&this.has.media?(this._media.addTo(this._el.content),this._text.addTo(this._el.content)):(this.has.text||this.has.headline)&&(this._el.container.className+=" tl-slide-text-only",this._text.addTo(this._el.content)):(this._el.container.className+=" tl-slide-media-only",this._media.addTo(this._el.content)),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){var n,a=this.options.slide_padding_lr,s=this.options.slide_padding_lr;t?this.options.width=t:this.options.width=this._el.container.offsetWidth,n=this.options.width-2*this.options.slide_padding_lr,TL.Browser.mobile&&this.options.width<=this.options.skinny_size?(a=0,s=0,n=this.options.width):"landscape"==i||this.options.width<=this.options.skinny_size&&(a=50,s=50,n=this.options.width-a-s),this._el.content.style.paddingLeft=a+"px",this._el.content.style.paddingRight=s+"px",this._el.content.style.width=n+"px",e?this.options.height=e:this.options.height=this._el.container.offsetHeight,this._media&&(!this.has.text&&this.has.headline?this._media.updateDisplay(n,this.options.height-this._text.headlineHeight(),i):this.has.text||this.has.headline?this.options.width<=this.options.skinny_size?this._media.updateDisplay(n,this.options.height,i):this._media.updateDisplay(n/2,this.options.height,i):this._media.updateDisplay(n,this.options.height,i))}}),TL.SlideNav=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e,i){this._el={container:{},content_container:{},icon:{},title:{},description:{}},this.mediatype={},this.data={title:"Navigation",description:"Description",date:"Date"},this.options={direction:"previous"},this.animator=null,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._el.container=TL.Dom.create("div","tl-slidenav-"+this.options.direction),TL.Browser.mobile&&this._el.container.setAttribute("ontouchstart"," "),this._initLayout(),this._initEvents(),i&&i.appendChild(this._el.container)},update:function(t){var e={title:"",description:"",date:t.getFormattedDate()};t.data.text&&t.data.text.headline&&(e.title=t.data.text.headline),this._update(e)},setColor:function(t){t?this._el.content_container.className="tl-slidenav-content-container tl-slidenav-inverted":this._el.content_container.className="tl-slidenav-content-container"},_onMouseClick:function(){this.fire("clicked",this.options)},_update:function(t){this.data=TL.Util.mergeData(this.data,t),this._el.title.innerHTML=TL.Util.unlinkify(this.data.title),this._el.description.innerHTML=TL.Util.unlinkify(this.data.date)},_initLayout:function(){this._el.content_container=TL.Dom.create("div","tl-slidenav-content-container",this._el.container),this._el.icon=TL.Dom.create("div","tl-slidenav-icon",this._el.content_container),this._el.title=TL.Dom.create("div","tl-slidenav-title",this._el.content_container),this._el.description=TL.Dom.create("div","tl-slidenav-description",this._el.content_container),this._el.icon.innerHTML=" ",this._update()},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)}}),TL.StorySlider=TL.Class.extend({includes:TL.Events,initialize:function(t,e,i,n){this._el={container:{},background:{},slider_container_mask:{},slider_container:{},slider_item_container:{}},this._nav={},this._nav.previous={},this._nav.next={},this.slide_spacing=0,this._slides=[],this._swipable,this.preloadTimer,this._message,this.current_id="",this.data={},this.options={id:"",layout:"portrait",width:600,height:600,default_bg_color:{r:255,g:255,b:255},slide_padding_lr:40,start_at_slide:1,slide_default_fade:"0%",duration:1e3,ease:TL.Ease.easeInOutQuint,dragging:!0,trackResize:!0},"object"==typeof t?(this._el.container=t,this.options.id=TL.Util.unique_ID(6,"tl")):(this.options.id=t,this._el.container=TL.Dom.get(t)),
-this._el.container.id||(this._el.container.id=this.options.id),this.animator=null,TL.Util.mergeData(this.options,i),TL.Util.mergeData(this.data,e),n&&this.init()},init:function(){this._initLayout(),this._initEvents(),this._initData(),this._updateDisplay(),this.goTo(this.options.start_at_slide),this._onLoaded()},_addSlide:function(t){t.addTo(this._el.slider_item_container),t.on("added",this._onSlideAdded,this),t.on("background_change",this._onBackgroundChange,this)},_createSlide:function(t,e,i){var n=new TL.Slide(t,this.options,e);this._addSlide(n),0>i?this._slides.push(n):this._slides.splice(i,0,n)},_createSlides:function(t){for(var e=0;e=0&&(this.current_id=this._slides[t].data.unique_id,this.animator&&this.animator.stop(),this._swipable&&this._swipable.stopMomentum(),e?(this._el.slider_container.style.left=-(this.slide_spacing*t)+"px",this._onSlideChange(i)):this.animator=TL.Animate(this._el.slider_container,{left:-(this.slide_spacing*t)+"px",duration:this.options.duration,easing:this.options.ease,complete:this._onSlideChange(i)}),this._slides[t].setActive(!0),this._slides[t+1]?(this.showNav(this._nav.next,!0),this._nav.next.update(this._slides[t+1])):this.showNav(this._nav.next,!1),this._slides[t-1]?(this.showNav(this._nav.previous,!0),this._nav.previous.update(this._slides[t-1])):this.showNav(this._nav.previous,!1),this.preloadTimer=setTimeout(function(){n.preloadSlides(t)},this.options.duration))},goToId:function(t,e,i){this.goTo(this._findSlideIndex(t),e,i)},preloadSlides:function(t){this._slides[t+1]&&(this._slides[t+1].loadMedia(),this._slides[t+1].scrollToTop()),this._slides[t+2]&&(this._slides[t+2].loadMedia(),this._slides[t+2].scrollToTop()),this._slides[t-1]&&(this._slides[t-1].loadMedia(),this._slides[t-1].scrollToTop()),this._slides[t-2]&&(this._slides[t-2].loadMedia(),this._slides[t-2].scrollToTop())},next:function(){var t=this._findSlideIndex(this.current_id);t+1=0?this.goTo(t-1):this.goTo(t)},showNav:function(t,e){this.options.width<=500&&TL.Browser.mobile||(e?t.show():t.hide())},changeBackground:function(t){var e={r:256,g:256,b:256},i;t.color_value&&""!=t.color_value?(e=TL.Util.hexToRgb(t.color_value),e||(trace("Invalid color value "+t.color_value),e=this.options.default_bg_color)):(e=this.options.default_bg_color,t.color_value="rgb("+e.r+" , "+e.g+", "+e.b+")"),i=e.r+","+e.g+","+e.b,this._el.background.style.backgroundImage="none",t.color_value?this._el.background.style.backgroundColor=t.color_value:this._el.background.style.backgroundColor="transparent",e.r<255||e.g<255||e.b<255||t.image?(this._nav.next.setColor(!0),this._nav.previous.setColor(!0)):(this._nav.next.setColor(!1),this._nav.previous.setColor(!1))},_updateDisplay:function(t,e,i,n){var a,s;s="undefined"==typeof n?this.options.layout:n,this.options.layout=s,this.slide_spacing=2*this.options.width,t?this.options.width=t:this.options.width=this._el.container.offsetWidth,e?this.options.height=e:this.options.height=this._el.container.offsetHeight,a=this.options.height/2,this._nav.next.setPosition({top:a}),this._nav.previous.setPosition({top:a});for(var o=0;oOK"),this._message.addTo(this._el.container))},_initEvents:function(){this._nav.next.on("clicked",this._onNavigation,this),this._nav.previous.on("clicked",this._onNavigation,this),this._message&&this._message.on("clicked",this._onMessageClick,this),this._swipable&&(this._swipable.on("swipe_left",this._onNavigation,this),this._swipable.on("swipe_right",this._onNavigation,this),this._swipable.on("swipe_nodirection",this._onSwipeNoDirection,this))},_initData:function(){this.data.title&&this._createSlide(this.data.title,!0,-1),this._createSlides(this.data.events)},_onBackgroundChange:function(t){var e=this._findSlideIndex(this.current_id),i=this._slides[e].getBackground();this.changeBackground(t),this.fire("colorchange",i)},_onMessageClick:function(t){this._message.hide()},_onSwipeNoDirection:function(t){this.goToId(this.current_id)},_onNavigation:function(t){"next"==t.direction||"left"==t.direction?this.next():("previous"==t.direction||"right"==t.direction)&&this.previous(),this.fire("nav_"+t.direction,this.data)},_onSlideAdded:function(t){trace("slideadded"),this.fire("slideAdded",this.data)},_onSlideRemoved:function(t){this.fire("slideRemoved",this.data)},_onSlideChange:function(t){t||this.fire("change",{unique_id:this.current_id})},_onMouseClick:function(t){},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)&&("contextmenu"===e&&TL.DomEvent.preventDefault(t),this.fire(e,{latlng:"something",layerPoint:"something else"}))}},_onLoaded:function(){this.fire("loaded",this.data)}}),TL.TimeNav=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e,i,n){this._el={parent:{},container:{},slider:{},slider_background:{},line:{},marker_container_mask:{},marker_container:{},marker_item_container:{},timeaxis:{},timeaxis_background:{},attribution:{}},this.collapsed=!1,"object"==typeof t?this._el.container=t:this._el.container=TL.Dom.get(t),this.config=e,this.options={width:600,height:600,duration:1e3,ease:TL.Ease.easeInOutQuint,has_groups:!1,optimal_tick_width:50,scale_factor:2,marker_padding:5,timenav_height_min:150,marker_height_min:30,marker_width_min:100,zoom_sequence:[.5,1,2,3,5,8,13,21,34,55,89]},this.animator=null,this.ready=!1,this._markers=[],this._eras=[],this.has_eras=!1,this._groups=[],this._calculated_row_height=100,this.current_id="",this.timescale={},this.timeaxis={},this.axishelper={},this.max_rows=6,this.animate_css=!1,this._swipable,TL.Util.mergeData(this.options,i),n&&this.init()},init:function(){this._initLayout(),this._initEvents(),this._initData(),this._updateDisplay(),this._onLoaded()},positionMarkers:function(){this._positionMarkers()},updateDisplay:function(t,e,i,n){this._updateDisplay(t,e,i,n)},_getTimeScale:function(){var t=0;try{t=parseInt(this.options.marker_height_min)}catch(e){trace("Invalid value for marker_height_min option."),t=30}return 0==t&&(trace("marker_height_min option must not be zero."),t=30),this.max_rows=Math.round((this.options.height-this._el.timeaxis_background.offsetHeight-this.options.marker_padding)/t),this.max_rows<1&&(this.max_rows=1),new TL.TimeScale(this.config,{display_width:this._el.container.offsetWidth,screen_multiplier:this.options.scale_factor,max_rows:this.max_rows})},_updateTimeScale:function(t){this.options.scale_factor=t,this._updateDrawTimeline()},zoomIn:function(){var t=TL.Util.findNextGreater(this.options.zoom_sequence,this.options.scale_factor);t==this.options.zoom_sequence[this.options.zoom_sequence.length-1]?this.fire("zoomtoggle",{zoom:"in",show:!1}):this.fire("zoomtoggle",{zoom:"in",show:!0}),this.setZoomFactor(t)},zoomOut:function(){var t=TL.Util.findNextLesser(this.options.zoom_sequence,this.options.scale_factor);t==this.options.zoom_sequence[0]?this.fire("zoomtoggle",{zoom:"out",show:!1}):this.fire("zoomtoggle",{zoom:"out",show:!0}),this.setZoomFactor(t)},setZoom:function(t){var e=this.options.zoom_sequence[t];"number"==typeof e?this.setZoomFactor(e):console.warn("Invalid zoom level. Please use a number between 0 and "+(this.options.zoom_sequence.length-1))},setZoomFactor:function(t){this.options.scale_factor=t,this.goToId(this.current_id,!this._updateDrawTimeline(!0),!0)},_createGroups:function(){var t=this.timescale.getGroupLabels();if(t){this.options.has_groups=!0;for(var e=0;et-this.options.marker_padding&&(o=!0),this._groups[n].setRowPosition(s,this._calculated_row_height+this.options.marker_padding/2),this._groups[n].setAlternateRowColor(TL.Util.isEven(n),o),a+=this._groups[n].data.rows}},_addMarker:function(t){t.addTo(this._el.marker_item_container),t.on("markerclick",this._onMarkerClick,this),t.on("added",this._onMarkerAdded,this)},_createMarker:function(t,e){var i=new TL.TimeMarker(t,this.options);this._addMarker(i),0>e?this._markers.push(i):this._markers.splice(e,0,i)},_createMarkers:function(t){for(var e=0;ee?this._eras.push(i):this._eras.splice(e,0,i)},_addEra:function(t){t.addTo(this._el.marker_item_container),t.on("added",this._onEraAdded,this)},_removeEra:function(t){t.removeFrom(this._el.marker_item_container)},_destroyEra:function(t){this._removeEra(this._eras[t]),this._eras.splice(t,1)},_positionEras:function(t){for(var e=0,i=0;i5&&(e=0),this._eras[i].setColor(e)}},createMarker:function(t,e){this._createMarker(t,e)},createMarkers:function(t){this._createMarkers(t)},destroyMarker:function(t){this._destroyMarker(t)},destroyMarkerId:function(t){this.destroyMarker(this._findMarkerIndex(t))},goTo:function(t,e,i){var n=this,a=this.options.ease,s=this.options.duration,o=0>t?0:t;this._resetMarkersActive(),t>=0&&t=0&&tMath.abs(t.wheelDeltaY)?t.wheelDeltaX/6:0),e&&(t.preventDefault&&t.preventDefault(),t.returnValue=!1),i=parseInt(this._el.slider.style.left.replace("px",""))+e,i>n.left?i=n.left:iTimeline JS",this.timeaxis=new TL.TimeAxis(this._el.timeaxis,this.options),this._swipable=new TL.Swipable(this._el.slider_background,this._el.slider,{enable:{x:!0,y:!1},constraint:{top:!1,bottom:!1,left:this.options.width/2,right:!1},snap:!1}),this._swipable.enable()},_initEvents:function(){this._swipable.on("dragmove",this._onDragMove,this),TL.DomEvent.addListener(this._el.container,"mousewheel",this._onMouseScroll,this),TL.DomEvent.addListener(this._el.container,"DOMMouseScroll",this._onMouseScroll,this)},_initData:function(){this._createMarkers(this.config.events),this.config.eras&&(this.has_eras=!0,this._createEras(this.config.eras)),this._drawTimeline()}}),TL.TimeMarker=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e){this._el={container:{},content_container:{},media_container:{},timespan:{},line_left:{},line_right:{},content:{},text:{},media:{}},this._text={},this._state={loaded:!1},this.data={unique_id:"",background:null,date:{year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,thumbnail:"",format:""},text:{headline:"",text:""},media:null},this.options={duration:1e3,ease:TL.Ease.easeInSpline,width:600,height:600,marker_width_min:100},this.active=!1,this.animator={},this.has_end_date=!1,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){},hide:function(){},setActive:function(t){this.active=t,this.active&&this.has_end_date?this._el.container.className="tl-timemarker tl-timemarker-with-end tl-timemarker-active":this.active?this._el.container.className="tl-timemarker tl-timemarker-active":this.has_end_date?this._el.container.className="tl-timemarker tl-timemarker-with-end":this._el.container.className="tl-timemarker"},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e){this._updateDisplay(t,e)},loadMedia:function(){this._media&&!this._state.loaded&&(this._media.loadMedia(),this._state.loaded=!0)},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getLeft:function(){return this._el.container.style.left.slice(0,-2)},getTime:function(){return this.data.start_date.getTime()},getEndTime:function(){return this.data.end_date?this.data.end_date.getTime():!1},setHeight:function(t){var e=12,i=1;this._el.content_container.style.height=t+"px",this._el.timespan_content.style.height=t+"px",30>=t?this._el.content.className="tl-timemarker-content tl-timemarker-content-small":this._el.content.className="tl-timemarker-content",56>=t?TL.DomUtil.addClass(this._el.content_container,"tl-timemarker-content-container-small"):TL.DomUtil.removeClass(this._el.content_container,"tl-timemarker-content-container-small"),TL.Browser.webkit?(i=Math.floor(t/(e+2)),1>i&&(i=1),this._text.className="tl-headline",this._text.style.webkitLineClamp=i):(i=t/e,i>1?this._text.className="tl-headline tl-headline-fadeout":this._text.className="tl-headline",this._text.style.height=i*e+"px")},setWidth:function(t){this.data.end_date&&(this._el.container.style.width=t+"px",t>this.options.marker_width_min?(this._el.content_container.style.width=t+"px",this._el.content_container.className="tl-timemarker-content-container tl-timemarker-content-container-long"):(this._el.content_container.style.width=this.options.marker_width_min+"px",this._el.content_container.className="tl-timemarker-content-container"))},setClass:function(t){this._el.container.className=t},setRowPosition:function(t,e){this.setPosition({top:t}),this._el.timespan.style.height=e+"px"},_onMarkerClick:function(t){this.fire("markerclick",{unique_id:this.data.unique_id})},_initLayout:function(){if(this._el.container=TL.Dom.create("div","tl-timemarker"),this.data.unique_id&&(this._el.container.id=this.data.unique_id+"-marker"),this.data.end_date&&(this.has_end_date=!0,this._el.container.className="tl-timemarker tl-timemarker-with-end"),this._el.timespan=TL.Dom.create("div","tl-timemarker-timespan",this._el.container),this._el.timespan_content=TL.Dom.create("div","tl-timemarker-timespan-content",this._el.timespan),this._el.content_container=TL.Dom.create("div","tl-timemarker-content-container",this._el.container),this._el.content=TL.Dom.create("div","tl-timemarker-content",this._el.content_container),this._el.line_left=TL.Dom.create("div","tl-timemarker-line-left",this._el.timespan),this._el.line_right=TL.Dom.create("div","tl-timemarker-line-right",this._el.timespan),this.data.media)if(this._el.media_container=TL.Dom.create("div","tl-timemarker-media-container",this._el.content),this.data.media.thumbnail&&""!=this.data.media.thumbnail)this._el.media=TL.Dom.create("img","tl-timemarker-media",this._el.media_container),this._el.media.src=TL.Util.transformImageURL(this.data.media.thumbnail);else{var t=TL.MediaType(this.data.media).type;this._el.media=TL.Dom.create("span","tl-icon-"+t,this._el.media_container)}this._el.text=TL.Dom.create("div","tl-timemarker-text",this._el.content),this._text=TL.Dom.create("h2","tl-headline",this._el.text),this.data.text.headline&&""!=this.data.text.headline?this._text.innerHTML=TL.Util.unlinkify(this.data.text.headline):this.data.text.text&&""!=this.data.text.text?this._text.innerHTML=TL.Util.unlinkify(this.data.text.text):this.data.media.caption&&""!=this.data.media.caption&&(this._text.innerHTML=TL.Util.unlinkify(this.data.media.caption)),this.onLoaded()},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMarkerClick,this)},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.TimeEra=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e){this._el={container:{},background:{},content_container:{},content:{},text:{}},this._text={},this._state={loaded:!1},this.data={unique_id:"",date:{year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,thumbnail:"",format:""},text:{headline:"",text:""}},this.options={duration:1e3,ease:TL.Ease.easeInSpline,width:600,height:600,marker_width_min:100},this.active=!1,this.animator={},this.has_end_date=!1,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){},hide:function(){},setActive:function(t){},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e){this._updateDisplay(t,e)},getLeft:function(){return this._el.container.style.left.slice(0,-2)},getTime:function(){return this.data.start_date.getTime()},getEndTime:function(){return this.data.end_date?this.data.end_date.getTime():!1},setHeight:function(t){var e=12,i=1;this._el.content_container.style.height=t+"px",this._el.content.className="tl-timeera-content",TL.Browser.webkit?(i=Math.floor(t/(e+2)),1>i&&(i=1),this._text.className="tl-headline",this._text.style.webkitLineClamp=i):(i=t/e,i>1?this._text.className="tl-headline tl-headline-fadeout":this._text.className="tl-headline",this._text.style.height=i*e+"px")},setWidth:function(t){this.data.end_date&&(this._el.container.style.width=t+"px",t>this.options.marker_width_min?(this._el.content_container.style.width=t+"px",this._el.content_container.className="tl-timeera-content-container tl-timeera-content-container-long"):(this._el.content_container.style.width=this.options.marker_width_min+"px",this._el.content_container.className="tl-timeera-content-container"))},setClass:function(t){this._el.container.className=t},setRowPosition:function(t,e){this.setPosition({top:t})},setColor:function(t){this._el.container.className="tl-timeera tl-timeera-color"+t},_initLayout:function(){this._el.container=TL.Dom.create("div","tl-timeera"),this.data.unique_id&&(this._el.container.id=this.data.unique_id+"-era"),this.data.end_date&&(this.has_end_date=!0,this._el.container.className="tl-timeera tl-timeera-with-end"),this._el.content_container=TL.Dom.create("div","tl-timeera-content-container",this._el.container),this._el.background=TL.Dom.create("div","tl-timeera-background",this._el.content_container),this._el.content=TL.Dom.create("div","tl-timeera-content",this._el.content_container),this._el.text=TL.Dom.create("div","tl-timeera-text",this._el.content),this._text=TL.Dom.create("h2","tl-headline",this._el.text),this.data.text.headline&&""!=this.data.text.headline&&(this._text.innerHTML=TL.Util.unlinkify(this.data.text.headline)),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.TimeGroup=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t){this._el={parent:{},container:{},message:{}},this.options={width:600,height:600},this.data={label:"",rows:1},this._el.container=TL.Dom.create("div","tl-timegroup"),TL.Util.mergeData(this.data,t),this.animator={},this._initLayout(),this._initEvents()},updateDisplay:function(t,e){},setRowPosition:function(t,e){this.options.height=e*this.data.rows,this.setPosition({top:t}),this._el.container.style.height=this.options.height+"px"},setAlternateRowColor:function(t,e){var i="tl-timegroup";t&&(i+=" tl-timegroup-alternate"),e&&(i+=" tl-timegroup-hidden"),this._el.container.className=i},_onMouseClick:function(){this.fire("clicked",this.options)},_initLayout:function(){this._el.message=TL.Dom.create("div","tl-timegroup-message",this._el.container),this._el.message.innerHTML=this.data.label},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)},_updateDisplay:function(t,e,i){}}),TL.TimeScale=TL.Class.extend({initialize:function(t,e){var i=t.events;this._scale=t.scale,e=TL.Util.mergeData({display_width:500,screen_multiplier:3,max_rows:null},e),this._display_width=e.display_width,this._screen_multiplier=e.screen_multiplier,this._pixel_width=this._screen_multiplier*this._display_width,this._group_labels=void 0,this._positions=[],this._pixels_per_milli=0,this._earliest=t.getEarliestDate().getTime(),this._latest=t.getLatestDate().getTime(),this._span_in_millis=this._latest-this._earliest,this._span_in_millis<=0&&(this._span_in_millis=this._computeDefaultSpan(t)),this._average=this._span_in_millis/i.length,this._pixels_per_milli=this.getPixelWidth()/this._span_in_millis,this._axis_helper=TL.AxisHelper.getBestHelper(this),this._scaled_padding=1/this.getPixelsPerTick()*(this._display_width/2),this._computePositionInfo(i,e.max_rows)},_computeDefaultSpan:function(t){if("human"==t.scale){for(var e={},i=0;i=0;i--)if(e.hasOwnProperty(TL.Date.SCALES[i][0])){var a=TL.Date.SCALES[TL.Date.SCALES.length-1];return TL.Date.SCALES[i+1]&&(a=TL.Date.SCALES[i+1]),a[1]}return 31536e6}return 2e5},getGroupLabels:function(){return this._group_labels||[]},getScale:function(){return this._scale},getNumberOfRows:function(){return this._number_of_rows},getPixelWidth:function(){return this._pixel_width},getPosition:function(t){return(t-this._earliest)*this._pixels_per_milli},getPositionInfo:function(t){return this._positions[t]},getPixelsPerTick:function(){return this._axis_helper.getPixelsPerTick(this._pixels_per_milli)},getTicks:function(){return{major:this._axis_helper.getMajorTicks(this),minor:this._axis_helper.getMinorTicks(this)}},getDateFromTime:function(t){if("human"==this._scale)return new TL.Date(t);if("cosmological"==this._scale)return new TL.BigDate(new TL.BigYear(t));throw"Don't know how to get date from time for "+this._scale},getMajorScale:function(){return this._axis_helper.major.name},getMinorScale:function(){return this._axis_helper.minor.name},_assessGroups:function(t){for(var e=[],i=!1,n=0;n0)s.row=i.length,i.push(s),e--;else{var l=Math.min.apply(null,o),h=o.indexOf(l);s.row=h,s.end>i[h].end&&(i[h]=s),n++}}return{n_rows:i.length,n_overlaps:n}},_computePositionInfo:function(t,e,i){i=i||100;for(var n=[],a=!1,s=0;si?o.end=o.start+o.width:o.end=o.start+i}else o.width=i,o.end=o.start+i;t[s].group?n.indexOf(t[s].group)<0&&n.push(t[s].group):a=!0}if(n.length){a&&n.push("");for(var l=[],s=0;s=0;d--)h.positions[d].end>o.start&&h.n_overlaps++;h.positions.push(o)}for(var c=n.length;;){var u=Math.max(0,e-c);if(!u)break;if(l.sort(function(t,e){return t.n_overlaps>e.n_overlaps?-1:t.n_overlapsn&&(a=Math.round(i/e.getPixelsPerTick()));for(var s=1,o=0;o1?s>=a?(s=1,r.tick_text.style.opacity=1,r.tick.className="tl-timeaxis-tick"):(s++,r.tick_text.style.opacity=0,r.tick.className="tl-timeaxis-tick tl-timeaxis-tick-hidden"):(r.tick_text.style.opacity=1,r.tick.className="tl-timeaxis-tick")}}},_initLayout:function(){this._el.content_container=TL.Dom.create("div","tl-timeaxis-content-container",this._el.container),this._el.major=TL.Dom.create("div","tl-timeaxis-major",this._el.content_container),this._el.minor=TL.Dom.create("div","tl-timeaxis-minor",this._el.content_container),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.AxisHelper=TL.Class.extend({initialize:function(t){if(!t)throw"Axis helper must be configured with options";this.scale=t.scale,this.minor=t.minor,this.major=t.major},getPixelsPerTick:function(t){return t*this.minor.factor},getMajorTicks:function(t){return this._getTicks(t,this.major)},getMinorTicks:function(t){return this._getTicks(t,this.minor)},_getTicks:function(t,e){for(var i=t._scaled_padding*e.factor,n=t._earliest-i,a=t._latest+i,s=[],o=n;a>o;o+=e.factor)s.push(t.getDateFromTime(o).floor(e.name));return{name:e.name,ticks:s}}}),function(t){var e={},i=function(i,n){e[i]=[];for(var a=0;ai){if(null==s)return r;var h=Math.abs(i-l),d=Math.abs(i-l);return d>h?r:s}s=r}return a[a.length-1]}}(TL.AxisHelper),TL.Timeline=TL.Class.extend({includes:[TL.Events,TL.I18NMixins],initialize:function(t,e,i){var n=this;if(i||(i={}),this.version="3.2.6",this.ready=!1,this._el={container:{},storyslider:{},timenav:{},menubar:{}},"object"==typeof t?this._el.container=t:this._el.container=TL.Dom.get(t),this._storyslider={},this._style_sheet=new TL.StyleSheet,this._timenav={},this.message=new TL.Message({},{message_class:"tl-message-full"}),this._menubar={},this._loaded={storyslider:!1,timenav:!1},this.config=null,this.options={script_path:"",height:this._el.container.offsetHeight,width:this._el.container.offsetWidth,debug:!1,is_embed:!1,is_full_embed:!1,hash_bookmark:!1,default_bg_color:{r:255,g:255,b:255},scale_factor:2,layout:"landscape",timenav_position:"bottom",optimal_tick_width:60,base_class:"tl-timeline",timenav_height:null,timenav_height_percentage:25,timenav_mobile_height_percentage:40,timenav_height_min:175,marker_height_min:30,marker_width_min:100,marker_padding:5,start_at_slide:0,start_at_end:!1,menubar_height:0,skinny_size:650,medium_size:800,relative_date:!1,use_bc:!1,duration:1e3,ease:TL.Ease.easeInOutQuint,dragging:!0,trackResize:!0,map_type:"stamen:toner-lite",slide_padding_lr:100,slide_default_fade:"0%",zoom_sequence:[.5,1,2,3,5,8,13,21,34,55,89],language:"en",ga_property_id:null,track_events:["back_to_start","nav_next","nav_previous","zoom_in","zoom_out"]},this.animator_timenav=null,this.animator_storyslider=null,this.animator_menubar=null,"string"==typeof i.default_bg_color){var a=TL.Util.hexToRgb(i.default_bg_color);a?i.default_bg_color=a:(delete i.default_bg_color,trace("Invalid default background color. Ignoring."))}TL.Util.mergeData(this.options,i),window.addEventListener("resize",function(t){n.updateDisplay()}),TL.debug=this.options.debug,this._el.container.className+=" tl-timeline",this.options.is_embed&&(this._el.container.className+=" tl-timeline-embed"),this.options.is_full_embed&&(this._el.container.className+=" tl-timeline-full-embed"),this.message.addTo(this._el.container),this.options.relative_date?"undefined"!=typeof moment?n._loadLanguage(e):TL.Load.js(this.options.script_path+"/library/moment.js",function(){n._loadLanguage(e),trace("LOAD MOMENTJS")}):n._loadLanguage(e)},_loadLanguage:function(t){var e=this;this.options.language=new TL.Language(this.options),this._initData(t)},goToId:function(t){this.current_id!=t&&(this.current_id=t,this._timenav.goToId(this.current_id),this._storyslider.goToId(this.current_id,!1,!0),this.fire("change",{unique_id:this.current_id},this))},goTo:function(t){this.config.title?0==t?this.goToId(this.config.title.unique_id):this.goToId(this.config.events[t-1].unique_id):this.goToId(this.config.events[t].unique_id)},goToStart:function(){this.goTo(0)},goToEnd:function(){var t=this.config.events.length-1;this.goTo(this.config.title?t+1:t)},goToPrev:function(){this.goTo(this._getSlideIndex(this.current_id)-1)},goToNext:function(){this.goTo(this._getSlideIndex(this.current_id)+1)},add:function(t){var e=this.config.addEvent(t),i=this._getEventIndex(e),n=this.config.events[i];this._storyslider.createSlide(n,this.config.title?i+1:i),this._storyslider._updateDrawSlides(),this._timenav.createMarker(n,i),this._timenav._updateDrawTimeline(!1),this.fire("added",{unique_id:e})},remove:function(t){if(t>=0&&t0&&t<=this.config.events.length)return this.config.events[t-1]}else if(t>=0&&t=0&&t"+this._("error")+": "+this.config.getErrors("
"))},_initLayout:function(){var t=this;this._el.container.innerHTML="","top"==this.options.timenav_position?(this._el.timenav=TL.Dom.create("div","tl-timenav",this._el.container),this._el.storyslider=TL.Dom.create("div","tl-storyslider",this._el.container)):(this._el.storyslider=TL.Dom.create("div","tl-storyslider",this._el.container),this._el.timenav=TL.Dom.create("div","tl-timenav",this._el.container)),this._el.menubar=TL.Dom.create("div","tl-menubar",this._el.container),this.options.width=this._el.container.offsetWidth,this.options.height=this._el.container.offsetHeight,this._el.storyslider.style.top="1px",this.options.timenav_height=this._calculateTimeNavHeight(this.options.timenav_height),this._timenav=new TL.TimeNav(this._el.timenav,this.config,this.options),this._timenav.on("loaded",this._onTimeNavLoaded,this),this._timenav.on("update_timenav_min",this._updateTimeNavHeightMin,this),this._timenav.options.height=this.options.timenav_height,this._timenav.init(),this.options.initial_zoom&&this.setZoom(this.options.initial_zoom),this._storyslider=new TL.StorySlider(this._el.storyslider,this.config,this.options),this._storyslider.on("loaded",this._onStorySliderLoaded,this),this._storyslider.init(),this._menubar=new TL.MenuBar(this._el.menubar,this._el.container,this.options),"portrait"==this.options.layout?this.options.storyslider_height=this.options.height-this.options.timenav_height-1:this.options.storyslider_height=this.options.height-1,this._updateDisplay(this._timenav.options.height,!0,2e3)},_initEvents:function(){this._timenav.on("change",this._onTimeNavChange,this),this._timenav.on("zoomtoggle",this._onZoomToggle,this),this._storyslider.on("change",this._onSlideChange,this),this._storyslider.on("colorchange",this._onColorChange,this),this._storyslider.on("nav_next",this._onStorySliderNext,this),this._storyslider.on("nav_previous",this._onStorySliderPrevious,this),this._menubar.on("zoom_in",this._onZoomIn,this),this._menubar.on("zoom_out",this._onZoomOut,this),this._menubar.on("back_to_start",this._onBackToStart,this)},_initGoogleAnalytics:function(){!function(t,e,i,n,a,s,o){t.GoogleAnalyticsObject=a,t[a]=t[a]||function(){(t[a].q=t[a].q||[]).push(arguments)},t[a].l=1*new Date,s=e.createElement(i),o=e.getElementsByTagName(i)[0],s.async=1,s.src=n,o.parentNode.insertBefore(s,o)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",this.options.ga_property_id,"auto")},_initAnalytics:function(){if(null!==this.options.ga_property_id){this._initGoogleAnalytics(),ga("send","pageview");var t=this.options.track_events;for(i=0;ithis.config.events.length?this.goToEnd():this.goTo(this.options.start_at_slide),this.options.hash_bookmark&&this._updateHashBookmark(this.current_id)))}}),TL.Timeline.source_path=function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].src;return e.substr(0,e.lastIndexOf("/"))}();
\ No newline at end of file
+this.options.credit_height=this._el.credit.offsetHeight),!this.data.caption&&this.data.caption_alternate&&(this._el.caption=TL.Dom.create("div","tl-caption",this._el.content_container),this._el.caption.innerHTML=this.data.caption_alternate,this.options.caption_height=this._el.caption.offsetHeight),this.updateDisplay()},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){this.message=new TL.Message({},this.options),this.message.addTo(this._el.container),this._el.content_container=TL.Dom.create("div","tl-media-content-container",this._el.container),this.data.link&&""!=this.data.link?(this._el.link=TL.Dom.create("a","tl-media-link",this._el.content_container),this._el.link.href=this.data.link,this.data.link_target&&""!=this.data.link_target?this._el.link.target=this.data.link_target:this._el.link.target="_blank",this._el.content=TL.Dom.create("div","tl-media-content",this._el.link)):this._el.content=TL.Dom.create("div","tl-media-content",this._el.content_container)},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e),i&&(this.options.layout=i),this._el.credit&&(this.options.credit_height=this._el.credit.offsetHeight),this._el.caption&&(this.options.caption_height=this._el.caption.offsetHeight+5),this.updateMediaDisplay(this.options.layout)},_stopMedia:function(){}}),TL.Media.Blockquote=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-blockquote",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this.media_id=this.data.url,this._el.content_item.innerHTML=this.media_id,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.DailyMotion=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-dailymotion",this._el.content),this.data.url.match("video")?this.media_id=this.data.url.split("video/")[1].split(/[?&]/)[0]:this.media_id=this.data.url.split("embed/")[1].split(/[?&]/)[0],t="http://www.dailymotion.com/embed/video/"+this.media_id,this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=TL.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"}}),TL.Media.DocumentCloud=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-documentcloud tl-media-shadow",this._el.content),this._el.content_item.id=TL.Util.unique_ID(7),this.data.url.match(/\.html$/)?this.data.url=this._transformURL(this.data.url):this.data.url.match(/.(json|js)$/)||trace("DOCUMENT CLOUD IN URL BUT INVALID SUFFIX"),TL.Load.js(["//s3.documentcloud.org/viewer/loader.js","//s3.amazonaws.com/s3.documentcloud.org/viewer/viewer.js"],function(){t.createMedia()})},_transformURL:function(t){return t.replace(/(.*)\.html$/,"$1.js")},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"},createMedia:function(){DV.load(this.data.url,{container:"#"+this._el.content_item.id,showSidebar:!1}),this.onLoaded()}}),TL.Media.Flickr=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_link=TL.Dom.create("a","",this._el.content),this._el.content_link.href=this.data.url,this._el.content_link.target="_blank",this._el.content_item=TL.Dom.create("img","tl-media-item tl-media-image tl-media-flickr tl-media-shadow",this._el.content_link),this._el.content_item.addEventListener("load",function(t){e.onMediaLoaded()}),this.establishMediaID(),t="https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+this.options.api_key_flickr+"&photo_id="+this.media_id+"&format=json&jsoncallback=?",TL.getJSON(t,function(t){"ok"==t.stat?e.createMedia(t):e.loadErrorDisplay("Photo not found or private.")})},establishMediaID:function(){var t="flickr.com/photos/",e=this.data.url.indexOf(t);if(-1==e)throw"Invalid Flickr URL";var i=e+t.length;this.media_id=this.data.url.substr(i).split("/")[1]},createMedia:function(t){trace(t);var e=this.sizes(this.options.height),i=t.sizes.size[t.sizes.size.length-2].source;self=this;for(var n=0;n"+e.photo.owner.realname+"",t.data.caption_alternate=e.photo.title._content+" "+e.photo.description._content,t.updateMeta()})},sizes:function(t){var e="";return e=75>=t?0>=t?"Large":"Thumbnail":180>=t?"Small":240>=t?"Small 320":375>=t?"Medium":480>=t?"Medium 640":"Large"}}),TL.Media.GoogleDoc=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;if(this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe",this._el.content),this.data.url.match("open?id="))this.media_id=this.data.url.split("open?id=")[1],this.data.url.match("&authuser=0")&&(t=this.media_id.match("&authuser=0")[0]);else if(this.data.url.match(/file\/d\/([^/]*)\/?/)){var i=this.data.url.match(/file\/d\/([^/]*)\/?/)[1];t="https://drive.google.com/file/d/"+i+"/preview"}else t=this.data.url;this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),TL.Media.GooglePlus=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-googleplus",this._el.content),this.media_id=this.data.url,t=this.media_id,this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),TL.Media.IFrame=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe",this._el.content),this.media_id=this.data.url,t=this.media_id,this._el.content_item.innerHTML=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),TL.Media.Image=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this,e="tl-media-item tl-media-image tl-media-shadow";this.loadingMessage(),(this.data.url.match(/.png(\?.*)?$/)||this.data.url.match(/.svg(\?.*)?$/))&&(e="tl-media-item tl-media-image"),this.data.link?(this._el.content_link=TL.Dom.create("a","",this._el.content),this._el.content_link.href=this.data.link,this._el.content_link.target="_blank",this._el.content_item=TL.Dom.create("img",e,this._el.content_link)):this._el.content_item=TL.Dom.create("img",e,this._el.content),this._el.content_item.addEventListener("load",function(e){t.onMediaLoaded()}),this._el.content_item.src=TL.Util.transformImageURL(this.data.url),this.onLoaded()},_updateMediaDisplay:function(t){TL.Browser.firefox&&(this._el.content_item.style.width="auto")}}),TL.Media.Instagram=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this.media_id=this.data.url.split("/p/")[1].split("/")[0],this._el.content_link=TL.Dom.create("a","",this._el.content),this._el.content_link.href=this.data.url,this._el.content_link.target="_blank",this._el.content_item=TL.Dom.create("img","tl-media-item tl-media-image tl-media-instagram tl-media-shadow",this._el.content_link),this._el.content_item.addEventListener("load",function(t){e.onMediaLoaded()}),this._el.content_item.src="http://instagr.am/p/"+this.media_id+"/media/?size="+this.sizes(this._el.content.offsetWidth),t="http://api.instagram.com/oembed?url=http://instagr.am/p/"+this.media_id+"&callback=?",this.onLoaded()},_getMeta:function(){var t=this,e;e="http://api.instagram.com/oembed?url=http://instagr.am/p/"+this.media_id+"&callback=?",TL.getJSON(e,function(e){t.data.credit_alternate=""+e.author_name+"",t.data.caption_alternate=e.title,t.updateMeta()})},sizes:function(t){var e="";return e=150>=t?"t":306>=t?"m":"l"}}),TL.Media.GoogleMap=TL.Media.extend({includes:[TL.Events],_API_KEY:"AIzaSyB9dW8e_iRrATFa8g24qB6BDBGdkrLDZYI",_loadMedia:function(){this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-map tl-media-shadow",this._el.content),this.media_id=this.data.url,this.mapframe=TL.Dom.create("iframe","",this._el.content_item),window.stash=this,this.mapframe.width="100%",this.mapframe.height="100%",this.mapframe.frameBorder="0",this.mapframe.src=this.makeGoogleMapsEmbedURL(this.media_id,this.options.api_key_googlemaps),this.onLoaded()},_updateMediaDisplay:function(){if(this._state.loaded){var t=TL.Util.ratio.square({w:this._el.content_item.offsetWidth});this._el.content_item.style.height=t.h+"px"}},makeGoogleMapsEmbedURL:function(t,e){function i(t){function i(e,i){if("z"==e.slice(-1))i.zoom=e;else if("m"==e.slice(-1))i.zoom=14,i.maptype="satellite";else if("t"==e.slice(-1)){if(n=!0,"place"==mapmode)var s=t.match(d.place)[3]+","+t.match(d.place)[4];else{var s=i.center;delete i.center}i={},i.location=s,streetview_params=e.split(",");for(param in a.streetview){var o=parseInt(param)+1;"pitch"==a.streetview[param]&&"90t"==streetview_params[o]?i[a.streetview[param]]=0:i[a.streetview[param]]=streetview_params[o].slice(0,-1)}}return i}function s(t,s){var o={},r=s[1],l=s[s.length-1];for(param in a[t]){var h=parseInt(param)+2;"center"==a[t][param]?o[a[t][param]]=s[h]+","+s[++h]:o[a[t][param]]=s[h]}return o=i(l,o),o.key=e,1==n&&(t="streetview"),r+"/embed/v1/"+t+TL.Util.getParamString(o)}return mapmode="view",t.match(d.place)?mapmode="place":t.match(d.directions)?mapmode="directions":t.match(d.search)&&(mapmode="search"),s(mapmode,t.match(d[mapmode]))}var n=!1,a={view:["center"],place:["q","center"],directions:["origin","destination","center"],search:["q","center"],streetview:["fov","heading","pitch"]},s=/(https:\/\/.+google.+?\/maps)/,o=/@([-\d.]+),([-\d.]+)/,r=/([\w\W]+)/,l=/data=[\S]*/,h=/,((?:[-\d.]+[zmayht],?)*)/,d={view:new RegExp(s.source+"/"+o.source+h.source),place:new RegExp(s.source+"/place/"+r.source+"/"+o.source+h.source),directions:new RegExp(s.source+"/dir/"+r.source+"/"+r.source+"/"+o.source+h.source),search:new RegExp(s.source+"/search/"+r.source+"/"+o.source+h.source)};return i(t)}}),TL.Media.Profile=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){this.loadingMessage(),this._el.content_item=TL.Dom.create("img","tl-media-item tl-media-image tl-media-profile tl-media-shadow",this._el.content),this._el.content_item.src=this.data.url,this.onLoaded()},_updateMediaDisplay:function(t){TL.Browser.firefox&&(this._el.content_item.style.maxWidth=this.options.width/2-40+"px")}}),TL.Media.Slider=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){this._el.content_item=TL.Dom.create("img","tl-media-item tl-media-image",this._el.content),this._el.content_item.src=this.data.url,this.onLoaded()}}),TL.Media.SoundCloud=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-soundcloud tl-media-shadow",this._el.content),this.media_id=this.data.url,t="http://soundcloud.com/oembed?url="+this.media_id+"&format=js&callback=?",TL.getJSON(t,function(t){e.createMedia(t)})},createMedia:function(t){this._el.content_item.innerHTML=t.html,this.onLoaded()}}),TL.Media.Spotify=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;if(this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-spotify",this._el.content),this.data.url.match("open.spotify.com/track/"))this.media_id="spotify:track:"+this.data.url.split("open.spotify.com/track/")[1];else if(this.data.url.match("spotify:track:"))this.media_id=this.data.url;else if(this.data.url.match("/playlist/")){var i=this.data.url.split("open.spotify.com/user/")[1].split("/playlist/")[0];this.media_id="spotify:user:"+i+":playlist:"+this.data.url.split("/playlist/")[1]}else this.data.url.match(":playlist:")&&(this.media_id=this.data.url);t="http://embed.spotify.com/?uri="+this.media_id+"&theme=white&view=coverart",this.player=TL.Dom.create("iframe","tl-media-shadow",this._el.content_item),this.player.width="100%",this.player.height="100%",this.player.frameBorder="0",this.player.src=t,this.onLoaded()},_updateMediaDisplay:function(t){var e=this.options.height,i=0,n=0;e=TL.Browser.mobile?this.options.height/2:this.options.height-this.options.credit_height-this.options.caption_height-30,this._el.content_item.style.maxHeight="none",trace(e),trace(this.options.width),e>this.options.width?(trace("height is greater"),i=this.options.width+80+"px",n=this.options.width+"px"):(trace("width is greater"),trace(this.options.width),i=e+"px",n=e-80+"px"),this.player.style.width=n,this.player.style.height=i,this._el.credit&&(this._el.credit.style.width=n),this._el.caption&&(this._el.caption.style.width=n)},_stopMedia:function(){}}),TL.Media.Storify=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-storify",this._el.content),this.media_id=this.data.url,t="",t+="",this._el.content_item.innerHTML=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),TL.Media.Text=TL.Class.extend({includes:[TL.Events],_el:{container:{},content_container:{},content:{},headline:{},date:{}},data:{unique_id:"",headline:"headline",text:"text"},options:{title:!1},initialize:function(t,e,i){TL.Util.setData(this,t),TL.Util.mergeData(this.options,e),this._el.container=TL.Dom.create("div","tl-text"),this._el.container.id=this.data.unique_id,this._initLayout(),i&&i.appendChild(this._el.container)},show:function(){},hide:function(){},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},headlineHeight:function(){return this._el.headline.offsetHeight+40},addDateText:function(t){this._el.date.innerHTML=t},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){if(this._el.content_container=TL.Dom.create("div","tl-text-content-container",this._el.container),this._el.date=TL.Dom.create("h3","tl-headline-date",this._el.content_container),""!=this.data.headline){var t="tl-headline";this.options.title&&(t="tl-headline tl-headline-title"),this._el.headline=TL.Dom.create("h2",t,this._el.content_container),this._el.headline.innerHTML=this.data.headline}if(""!=this.data.text){var e="";e+=TL.Util.htmlify(1==this.options.autolink?TL.Util.linkify(this.data.text):this.data.text),trace(this.data.text),this._el.content=TL.Dom.create("div","tl-text-content",this._el.content_container),this._el.content.innerHTML=e,trace(e),trace(this._el.content)}this.onLoaded()}}),TL.Media.Twitter=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-twitter",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this.data.url.match("status/")?this.media_id=this.data.url.split("status/")[1]:url.match("statuses/")?this.media_id=this.data.url.split("statuses/")[1]:this.media_id="",t="https://api.twitter.com/1/statuses/oembed.json?id="+this.media_id+"&omit_script=true&include_entities=true&callback=?",TL.ajax({type:"GET",url:t,dataType:"json",success:function(t){e.createMedia(t)},error:function(t,i){var n="";n+="Unable to load Tweet.
"+e.media_id+"
"+i,e.loadErrorDisplay(n)}})},createMedia:function(t){var e="",i="",n="",a="",s="",o="";i=t.html.split("
—")[0]+"",n=t.author_url.split("twitter.com/")[1],a=t.html.split("—")[1].split('')[0],o=a.split('">')[1].split("")[0],i=i.replace(/",e+="",e+="",e+="",this._el.content_item.innerHTML=e,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.Vimeo=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-vimeo tl-media-shadow",this._el.content),this.media_id=this.data.url.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0],t="https://player.vimeo.com/video/"+this.media_id+"?api=1&title=0&byline=0&portrait=0&color=ffffff",this.player=TL.Dom.create("iframe","",this._el.content_item),this.player.addEventListener("load",function(t){e.onMediaLoaded()}),this.player.width="100%",this.player.height="100%",this.player.frameBorder="0",this.player.src=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=TL.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){try{this.player.contentWindow.postMessage(JSON.stringify({method:"pause"}),"https://player.vimeo.com")}catch(t){trace(t)}}}),TL.Media.Vine=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-iframe tl-media-vine tl-media-shadow",this._el.content),this.media_id=this.data.url.split("vine.co/v/")[1],t="https://vine.co/v/"+this.media_id+"/embed/simple",this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){var t=TL.Util.ratio.square({w:this._el.content_item.offsetWidth,h:this.options.height});this._el.content_item.style.height=t.h+"px"}}),TL.Media.Website=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this;this.loadingMessage(),this.media_id=this.data.url.replace(/.*?:\/\//g,""),this.options.api_key_embedly?(api_url="http://api.embed.ly/1/extract?key="+this.options.api_key_embedly+"&url="+this.media_id+"&callback=?",TL.getJSON(api_url,function(e){t.createMedia(e)})):this.createCardContent()},createCardContent:function(){!function(t,e){var i="embedly-platform",n="script";if(!e.getElementById(i)){t.embedly=t.embedly||function(){(t.embedly.q=t.embedly.q||[]).push(arguments)};var a=e.createElement(n);a.id=i,a.async=1,a.src=("https:"===document.location.protocol?"https":"http")+"://cdn.embedly.com/widgets/platform.js";var s=e.getElementsByTagName(n)[0];s.parentNode.insertBefore(a,s)}}(window,document);var t=''+this.data.url+"";this._setContent(t)},createMedia:function(t){var e="";e+="",t.images&&t.images[0]&&(trace(t.images[0].url),e+="
"),t.favicon_url&&(e+="
"),e+=""+t.provider_name+"
",e+=""+t.description+"
",this._setContent(e)},_setContent:function(t){this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-website",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this._el.content_item.innerHTML=t,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.Wikipedia=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t,e,i=this;this.loadingMessage(),this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-wikipedia",this._el.content),this._el.content_container.className="tl-media-content-container tl-media-content-container-text",this.media_id=this.data.url.split("wiki/")[1].split("#")[0].replace("_"," "),this.media_id=this.media_id.replace(" ","%20"),e=this.data.url.split("//")[1].split(".wikipedia")[0],t="http://"+e+".wikipedia.org/w/api.php?action=query&prop=extracts|pageimages&redirects=&titles="+this.media_id+"&exintro=1&format=json&callback=?",TL.ajax({type:"GET",url:t,dataType:"json",success:function(t){i.createMedia(t)},error:function(t,e){var n="";n+="Unable to load Wikipedia entry.
"+i.media_id+"
"+e,i.loadErrorDisplay(n)}})},createMedia:function(t){var e="";if(t.query){var i="",e={entry:{},title:"",text:"",extract:"",paragraphs:1,page_image:"",text_array:[]};e.entry=TL.Util.getObjectAttributeByIndex(t.query.pages,0),e.extract=e.entry.extract,e.title=e.entry.title,e.page_image=e.entry.thumbnail,e.extract.match("")?e.text_array=e.extract.split("
"):e.text_array.push(e.extract);for(var n=0;n"+e.text_array[n+1]);i+="",i+="",i+="
"+this._("wikipedia")+" ",e.page_image,i+=e.text,e.extract.match("REDIRECT")||(this._el.content_item.innerHTML=i,this.onLoaded())}},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),TL.Media.YouTube=TL.Media.extend({includes:[TL.Events],_loadMedia:function(){var t=this,e;this.loadingMessage(),this.youtube_loaded=!1,this._el.content_item=TL.Dom.create("div","tl-media-item tl-media-youtube tl-media-shadow",this._el.content),this._el.content_item.id=TL.Util.unique_ID(7),e=TL.Util.getUrlVars(this.data.url),this.media_id={},this.data.url.match("v=")?this.media_id.id=e.v:this.data.url.match("/embed/")?this.media_id.id=this.data.url.split("embed/")[1].split(/[?&]/)[0]:this.data.url.match(/v\/|v=|youtu\.be\//)?this.media_id.id=this.data.url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]:trace("YOUTUBE IN URL BUT NOT A VALID VIDEO"),this.media_id.start=TL.Util.parseYouTubeTime(e.t),this.media_id.hd=Boolean("undefined"!=typeof e.hd),TL.Load.js("https://www.youtube.com/iframe_api",function(){t.createMedia()})},_updateMediaDisplay:function(){this._el.content_item.style.height=TL.Util.ratio.r16_9({w:this.options.width})+"px",this._el.content_item.style.width=this.options.width+"px"},_stopMedia:function(){if(this.youtube_loaded)try{this.player.getPlayerState()==YT.PlayerState.PLAYING&&this.player.pauseVideo()}catch(t){trace(t)}},createMedia:function(){var t=this;clearTimeout(this.timer),"undefined"!=typeof YT&&"undefined"!=typeof YT.Player?this.player=new YT.Player(this._el.content_item.id,{playerVars:{enablejsapi:1,color:"white",autohide:1,showinfo:0,theme:"light",start:this.media_id.start,fs:0,rel:0},videoId:this.media_id.id,events:{onReady:function(){t.onPlayerReady(),t.onLoaded()},onStateChange:t.onStateChange}}):this.timer=setTimeout(function(){t.createMedia()},1e3)},onPlayerReady:function(t){this.youtube_loaded=!0,this._el.content_item=document.getElementById(this._el.content_item.id),this.onMediaLoaded()},onStateChange:function(t){t.data==YT.PlayerState.ENDED&&(t.target.seekTo(0),t.target.pauseVideo())}}),TL.Slide=TL.Class.extend({includes:[TL.Events,TL.DomMixins,TL.I18NMixins],_el:{},initialize:function(t,e,i){this._el={container:{},scroll_container:{},background:{},content_container:{},content:{}},this._media=null,this._mediaclass={},this._text={},this._state={loaded:!1},this.has={headline:!1,text:!1,media:!1,title:!1,background:{image:!1,color:!1,color_value:""}},this.has.title=i,this.data={unique_id:null,background:null,start_date:null,end_date:null,location:null,text:null,media:null,autolink:!0},this.options={duration:1e3,slide_padding_lr:40,ease:TL.Ease.easeInSpline,width:600,height:600,skinny_size:650,media_name:""},this.active=!1,this.animator={},TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){this.animator=TL.Animate(this._el.slider_container,{left:-(this._el.container.offsetWidth*n)+"px",duration:this.options.duration,easing:this.options.ease})},hide:function(){},setActive:function(t){this.active=t,this.active?(this.data.background&&this.fire("background_change",this.has.background),this.loadMedia()):this.stopMedia()},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e,i){this._updateDisplay(t,e,i)},loadMedia:function(){this._media&&!this._state.loaded&&(this._media.loadMedia(),this._state.loaded=!0)},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getBackground:function(){return this.has.background},scrollToTop:function(){this._el.container.scrollTop=0},getFormattedDate:function(){if(TL.Util.trim(this.data.display_date).length>0)return this.data.display_date;var t="";return this.has.title||(this.data.end_date&&(t=" — "+this.data.end_date.getDisplayDate(this.getLanguage())),this.data.start_date&&(t=this.data.start_date.getDisplayDate(this.getLanguage())+t)),t},_initLayout:function(){this._el.container=TL.Dom.create("div","tl-slide"),this.has.title&&(this._el.container.className="tl-slide tl-slide-titleslide"),this.data.unique_id&&(this._el.container.id=this.data.unique_id),this._el.scroll_container=TL.Dom.create("div","tl-slide-scrollable-container",this._el.container),this._el.content_container=TL.Dom.create("div","tl-slide-content-container",this._el.scroll_container),this._el.content=TL.Dom.create("div","tl-slide-content",this._el.content_container),this._el.background=TL.Dom.create("div","tl-slide-background",this._el.container),this.data.background&&(this.data.background.url&&(this.has.background.image=!0,this._el.container.className+=" tl-full-image-background",this.has.background.color_value="#000",this._el.background.style.backgroundImage="url('"+this.data.background.url+"')",this._el.background.style.display="block"),this.data.background.color&&(this.has.background.color=!0,this._el.container.className+=" tl-full-color-background",this.has.background.color_value=this.data.background.color),this.data.background.text_background&&(this._el.container.className+=" tl-text-background")),this.data.media&&this.data.media.url&&""!=this.data.media.url&&(this.has.media=!0),this.data.text&&this.data.text.text&&(this.has.text=!0),this.data.text&&this.data.text.headline&&(this.has.headline=!0),this.has.media&&(this.data.media.mediatype=TL.MediaType(this.data.media),this.options.media_name=this.data.media.mediatype.name,this.options.media_type=this.data.media.mediatype.type,this.options.autolink=this.data.autolink,this._media=new this.data.media.mediatype.cls(this.data.media,this.options)),(this.has.text||this.has.headline)&&(this._text=new TL.Media.Text(this.data.text,{title:this.has.title,language:this.options.language,autolink:this.data.autolink}),this._text.addDateText(this.getFormattedDate())),this.has.text||this.has.headline||!this.has.media?this.has.headline&&this.has.media&&!this.has.text?(this._el.container.className+=" tl-slide-media-only",this._text.addTo(this._el.content),this._media.addTo(this._el.content)):this.has.text&&this.has.media?(this._media.addTo(this._el.content),this._text.addTo(this._el.content)):(this.has.text||this.has.headline)&&(this._el.container.className+=" tl-slide-text-only",this._text.addTo(this._el.content)):(this._el.container.className+=" tl-slide-media-only",this._media.addTo(this._el.content)),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){var n,a=this.options.slide_padding_lr,s=this.options.slide_padding_lr;t?this.options.width=t:this.options.width=this._el.container.offsetWidth,n=this.options.width-2*this.options.slide_padding_lr,TL.Browser.mobile&&this.options.width<=this.options.skinny_size?(a=0,s=0,n=this.options.width):"landscape"==i||this.options.width<=this.options.skinny_size&&(a=50,s=50,n=this.options.width-a-s),this._el.content.style.paddingLeft=a+"px",this._el.content.style.paddingRight=s+"px",this._el.content.style.width=n+"px",e?this.options.height=e:this.options.height=this._el.container.offsetHeight,this._media&&(!this.has.text&&this.has.headline?this._media.updateDisplay(n,this.options.height-this._text.headlineHeight(),i):this.has.text||this.has.headline?this.options.width<=this.options.skinny_size?this._media.updateDisplay(n,this.options.height,i):this._media.updateDisplay(n/2,this.options.height,i):this._media.updateDisplay(n,this.options.height,i))}}),TL.SlideNav=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e,i){this._el={container:{},content_container:{},icon:{},title:{},description:{}},this.mediatype={},this.data={title:"Navigation",description:"Description",date:"Date"},this.options={direction:"previous"},this.animator=null,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._el.container=TL.Dom.create("div","tl-slidenav-"+this.options.direction),TL.Browser.mobile&&this._el.container.setAttribute("ontouchstart"," "),this._initLayout(),this._initEvents(),i&&i.appendChild(this._el.container)},update:function(t){var e={title:"",description:"",date:t.getFormattedDate()};t.data.text&&t.data.text.headline&&(e.title=t.data.text.headline),this._update(e)},setColor:function(t){t?this._el.content_container.className="tl-slidenav-content-container tl-slidenav-inverted":this._el.content_container.className="tl-slidenav-content-container"},_onMouseClick:function(){this.fire("clicked",this.options)},_update:function(t){this.data=TL.Util.mergeData(this.data,t),this._el.title.innerHTML=TL.Util.unlinkify(this.data.title),this._el.description.innerHTML=TL.Util.unlinkify(this.data.date)},_initLayout:function(){this._el.content_container=TL.Dom.create("div","tl-slidenav-content-container",this._el.container),this._el.icon=TL.Dom.create("div","tl-slidenav-icon",this._el.content_container),this._el.title=TL.Dom.create("div","tl-slidenav-title",this._el.content_container),this._el.description=TL.Dom.create("div","tl-slidenav-description",this._el.content_container),this._el.icon.innerHTML=" ",this._update()},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)}}),TL.StorySlider=TL.Class.extend({includes:TL.Events,initialize:function(t,e,i,n){this._el={container:{},background:{},slider_container_mask:{},slider_container:{},slider_item_container:{}},this._nav={},this._nav.previous={},this._nav.next={},this.slide_spacing=0,this._slides=[],this._swipable,this.preloadTimer,this._message,this.current_id="",this.data={},this.options={id:"",layout:"portrait",width:600,height:600,default_bg_color:{r:255,g:255,b:255},slide_padding_lr:40,start_at_slide:1,slide_default_fade:"0%",duration:1e3,ease:TL.Ease.easeInOutQuint,dragging:!0,trackResize:!0},"object"==typeof t?(this._el.container=t,this.options.id=TL.Util.unique_ID(6,"tl")):(this.options.id=t,
+this._el.container=TL.Dom.get(t)),this._el.container.id||(this._el.container.id=this.options.id),this.animator=null,TL.Util.mergeData(this.options,i),TL.Util.mergeData(this.data,e),n&&this.init()},init:function(){this._initLayout(),this._initEvents(),this._initData(),this._updateDisplay(),this.goTo(this.options.start_at_slide),this._onLoaded()},_addSlide:function(t){t.addTo(this._el.slider_item_container),t.on("added",this._onSlideAdded,this),t.on("background_change",this._onBackgroundChange,this)},_createSlide:function(t,e,i){var n=new TL.Slide(t,this.options,e);this._addSlide(n),0>i?this._slides.push(n):this._slides.splice(i,0,n)},_createSlides:function(t){for(var e=0;e=0&&(this.current_id=this._slides[t].data.unique_id,this.animator&&this.animator.stop(),this._swipable&&this._swipable.stopMomentum(),e?(this._el.slider_container.style.left=-(this.slide_spacing*t)+"px",this._onSlideChange(i)):this.animator=TL.Animate(this._el.slider_container,{left:-(this.slide_spacing*t)+"px",duration:this.options.duration,easing:this.options.ease,complete:this._onSlideChange(i)}),this._slides[t].setActive(!0),this._slides[t+1]?(this.showNav(this._nav.next,!0),this._nav.next.update(this._slides[t+1])):this.showNav(this._nav.next,!1),this._slides[t-1]?(this.showNav(this._nav.previous,!0),this._nav.previous.update(this._slides[t-1])):this.showNav(this._nav.previous,!1),this.preloadTimer=setTimeout(function(){n.preloadSlides(t)},this.options.duration))},goToId:function(t,e,i){this.goTo(this._findSlideIndex(t),e,i)},preloadSlides:function(t){this._slides[t+1]&&(this._slides[t+1].loadMedia(),this._slides[t+1].scrollToTop()),this._slides[t+2]&&(this._slides[t+2].loadMedia(),this._slides[t+2].scrollToTop()),this._slides[t-1]&&(this._slides[t-1].loadMedia(),this._slides[t-1].scrollToTop()),this._slides[t-2]&&(this._slides[t-2].loadMedia(),this._slides[t-2].scrollToTop())},next:function(){var t=this._findSlideIndex(this.current_id);t+1=0?this.goTo(t-1):this.goTo(t)},showNav:function(t,e){this.options.width<=500&&TL.Browser.mobile||(e?t.show():t.hide())},changeBackground:function(t){var e={r:256,g:256,b:256},i;t.color_value&&""!=t.color_value?(e=TL.Util.hexToRgb(t.color_value),e||(trace("Invalid color value "+t.color_value),e=this.options.default_bg_color)):(e=this.options.default_bg_color,t.color_value="rgb("+e.r+" , "+e.g+", "+e.b+")"),i=e.r+","+e.g+","+e.b,this._el.background.style.backgroundImage="none",t.color_value?this._el.background.style.backgroundColor=t.color_value:this._el.background.style.backgroundColor="transparent",e.r<255||e.g<255||e.b<255||t.image?(this._nav.next.setColor(!0),this._nav.previous.setColor(!0)):(this._nav.next.setColor(!1),this._nav.previous.setColor(!1))},_updateDisplay:function(t,e,i,n){var a,s;s="undefined"==typeof n?this.options.layout:n,this.options.layout=s,this.slide_spacing=2*this.options.width,t?this.options.width=t:this.options.width=this._el.container.offsetWidth,e?this.options.height=e:this.options.height=this._el.container.offsetHeight,a=this.options.height/2,this._nav.next.setPosition({top:a}),this._nav.previous.setPosition({top:a});for(var o=0;oOK"),this._message.addTo(this._el.container))},_initEvents:function(){this._nav.next.on("clicked",this._onNavigation,this),this._nav.previous.on("clicked",this._onNavigation,this),this._message&&this._message.on("clicked",this._onMessageClick,this),this._swipable&&(this._swipable.on("swipe_left",this._onNavigation,this),this._swipable.on("swipe_right",this._onNavigation,this),this._swipable.on("swipe_nodirection",this._onSwipeNoDirection,this))},_initData:function(){this.data.title&&this._createSlide(this.data.title,!0,-1),this._createSlides(this.data.events)},_onBackgroundChange:function(t){var e=this._findSlideIndex(this.current_id),i=this._slides[e].getBackground();this.changeBackground(t),this.fire("colorchange",i)},_onMessageClick:function(t){this._message.hide()},_onSwipeNoDirection:function(t){this.goToId(this.current_id)},_onNavigation:function(t){"next"==t.direction||"left"==t.direction?this.next():("previous"==t.direction||"right"==t.direction)&&this.previous(),this.fire("nav_"+t.direction,this.data)},_onSlideAdded:function(t){trace("slideadded"),this.fire("slideAdded",this.data)},_onSlideRemoved:function(t){this.fire("slideRemoved",this.data)},_onSlideChange:function(t){t||this.fire("change",{unique_id:this.current_id})},_onMouseClick:function(t){},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)&&("contextmenu"===e&&TL.DomEvent.preventDefault(t),this.fire(e,{latlng:"something",layerPoint:"something else"}))}},_onLoaded:function(){this.fire("loaded",this.data)}}),TL.TimeNav=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e,i,n){this._el={parent:{},container:{},slider:{},slider_background:{},line:{},marker_container_mask:{},marker_container:{},marker_item_container:{},timeaxis:{},timeaxis_background:{},attribution:{}},this.collapsed=!1,"object"==typeof t?this._el.container=t:this._el.container=TL.Dom.get(t),this.config=e,this.options={width:600,height:600,duration:1e3,ease:TL.Ease.easeInOutQuint,has_groups:!1,optimal_tick_width:50,scale_factor:2,marker_padding:5,timenav_height_min:150,marker_height_min:30,marker_width_min:100,zoom_sequence:[.5,1,2,3,5,8,13,21,34,55,89]},this.animator=null,this.ready=!1,this._markers=[],this._eras=[],this.has_eras=!1,this._groups=[],this._calculated_row_height=100,this.current_id="",this.timescale={},this.timeaxis={},this.axishelper={},this.max_rows=6,this.animate_css=!1,this._swipable,TL.Util.mergeData(this.options,i),n&&this.init()},init:function(){this._initLayout(),this._initEvents(),this._initData(),this._updateDisplay(),this._onLoaded()},positionMarkers:function(){this._positionMarkers()},updateDisplay:function(t,e,i,n){this._updateDisplay(t,e,i,n)},_getTimeScale:function(){var t=0;try{t=parseInt(this.options.marker_height_min)}catch(e){trace("Invalid value for marker_height_min option."),t=30}return 0==t&&(trace("marker_height_min option must not be zero."),t=30),this.max_rows=Math.round((this.options.height-this._el.timeaxis_background.offsetHeight-this.options.marker_padding)/t),this.max_rows<1&&(this.max_rows=1),new TL.TimeScale(this.config,{display_width:this._el.container.offsetWidth,screen_multiplier:this.options.scale_factor,max_rows:this.max_rows})},_updateTimeScale:function(t){this.options.scale_factor=t,this._updateDrawTimeline()},zoomIn:function(){var t=TL.Util.findNextGreater(this.options.zoom_sequence,this.options.scale_factor);t==this.options.zoom_sequence[this.options.zoom_sequence.length-1]?this.fire("zoomtoggle",{zoom:"in",show:!1}):this.fire("zoomtoggle",{zoom:"in",show:!0}),this.setZoomFactor(t)},zoomOut:function(){var t=TL.Util.findNextLesser(this.options.zoom_sequence,this.options.scale_factor);t==this.options.zoom_sequence[0]?this.fire("zoomtoggle",{zoom:"out",show:!1}):this.fire("zoomtoggle",{zoom:"out",show:!0}),this.setZoomFactor(t)},setZoom:function(t){var e=this.options.zoom_sequence[t];"number"==typeof e?this.setZoomFactor(e):console.warn("Invalid zoom level. Please use a number between 0 and "+(this.options.zoom_sequence.length-1))},setZoomFactor:function(t){this.options.scale_factor=t,this.goToId(this.current_id,!this._updateDrawTimeline(!0),!0)},_createGroups:function(){var t=this.timescale.getGroupLabels();if(t){this.options.has_groups=!0;for(var e=0;et-this.options.marker_padding&&(o=!0),this._groups[n].setRowPosition(s,this._calculated_row_height+this.options.marker_padding/2),this._groups[n].setAlternateRowColor(TL.Util.isEven(n),o),a+=this._groups[n].data.rows}},_addMarker:function(t){t.addTo(this._el.marker_item_container),t.on("markerclick",this._onMarkerClick,this),t.on("added",this._onMarkerAdded,this)},_createMarker:function(t,e){var i=new TL.TimeMarker(t,this.options);this._addMarker(i),0>e?this._markers.push(i):this._markers.splice(e,0,i)},_createMarkers:function(t){for(var e=0;ee?this._eras.push(i):this._eras.splice(e,0,i)},_addEra:function(t){t.addTo(this._el.marker_item_container),t.on("added",this._onEraAdded,this)},_removeEra:function(t){t.removeFrom(this._el.marker_item_container)},_destroyEra:function(t){this._removeEra(this._eras[t]),this._eras.splice(t,1)},_positionEras:function(t){for(var e=0,i=0;i5&&(e=0),this._eras[i].setColor(e)}},createMarker:function(t,e){this._createMarker(t,e)},createMarkers:function(t){this._createMarkers(t)},destroyMarker:function(t){this._destroyMarker(t)},destroyMarkerId:function(t){this.destroyMarker(this._findMarkerIndex(t))},goTo:function(t,e,i){var n=this,a=this.options.ease,s=this.options.duration,o=0>t?0:t;this._resetMarkersActive(),t>=0&&t=0&&tMath.abs(t.wheelDeltaY)?t.wheelDeltaX/6:0),e&&(t.preventDefault&&t.preventDefault(),t.returnValue=!1),i=parseInt(this._el.slider.style.left.replace("px",""))+e,i>n.left?i=n.left:iTimeline JS",this.timeaxis=new TL.TimeAxis(this._el.timeaxis,this.options),this._swipable=new TL.Swipable(this._el.slider_background,this._el.slider,{enable:{x:!0,y:!1},constraint:{top:!1,bottom:!1,left:this.options.width/2,right:!1},snap:!1}),this._swipable.enable()},_initEvents:function(){this._swipable.on("dragmove",this._onDragMove,this),TL.DomEvent.addListener(this._el.container,"mousewheel",this._onMouseScroll,this),TL.DomEvent.addListener(this._el.container,"DOMMouseScroll",this._onMouseScroll,this)},_initData:function(){this._createMarkers(this.config.events),this.config.eras&&(this.has_eras=!0,this._createEras(this.config.eras)),this._drawTimeline()}}),TL.TimeMarker=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e){this._el={container:{},content_container:{},media_container:{},timespan:{},line_left:{},line_right:{},content:{},text:{},media:{}},this._text={},this._state={loaded:!1},this.data={unique_id:"",background:null,date:{year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,thumbnail:"",format:""},text:{headline:"",text:""},media:null},this.options={duration:1e3,ease:TL.Ease.easeInSpline,width:600,height:600,marker_width_min:100},this.active=!1,this.animator={},this.has_end_date=!1,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){},hide:function(){},setActive:function(t){this.active=t,this.active&&this.has_end_date?this._el.container.className="tl-timemarker tl-timemarker-with-end tl-timemarker-active":this.active?this._el.container.className="tl-timemarker tl-timemarker-active":this.has_end_date?this._el.container.className="tl-timemarker tl-timemarker-with-end":this._el.container.className="tl-timemarker"},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e){this._updateDisplay(t,e)},loadMedia:function(){this._media&&!this._state.loaded&&(this._media.loadMedia(),this._state.loaded=!0)},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getLeft:function(){return this._el.container.style.left.slice(0,-2)},getTime:function(){return this.data.start_date.getTime()},getEndTime:function(){return this.data.end_date?this.data.end_date.getTime():!1},setHeight:function(t){var e=12,i=1;this._el.content_container.style.height=t+"px",this._el.timespan_content.style.height=t+"px",30>=t?this._el.content.className="tl-timemarker-content tl-timemarker-content-small":this._el.content.className="tl-timemarker-content",56>=t?TL.DomUtil.addClass(this._el.content_container,"tl-timemarker-content-container-small"):TL.DomUtil.removeClass(this._el.content_container,"tl-timemarker-content-container-small"),TL.Browser.webkit?(i=Math.floor(t/(e+2)),1>i&&(i=1),this._text.className="tl-headline",this._text.style.webkitLineClamp=i):(i=t/e,i>1?this._text.className="tl-headline tl-headline-fadeout":this._text.className="tl-headline",this._text.style.height=i*e+"px")},setWidth:function(t){this.data.end_date&&(this._el.container.style.width=t+"px",t>this.options.marker_width_min?(this._el.content_container.style.width=t+"px",this._el.content_container.className="tl-timemarker-content-container tl-timemarker-content-container-long"):(this._el.content_container.style.width=this.options.marker_width_min+"px",this._el.content_container.className="tl-timemarker-content-container"))},setClass:function(t){this._el.container.className=t},setRowPosition:function(t,e){this.setPosition({top:t}),this._el.timespan.style.height=e+"px"},_onMarkerClick:function(t){this.fire("markerclick",{unique_id:this.data.unique_id})},_initLayout:function(){if(this._el.container=TL.Dom.create("div","tl-timemarker"),this.data.unique_id&&(this._el.container.id=this.data.unique_id+"-marker"),this.data.end_date&&(this.has_end_date=!0,this._el.container.className="tl-timemarker tl-timemarker-with-end"),this._el.timespan=TL.Dom.create("div","tl-timemarker-timespan",this._el.container),this._el.timespan_content=TL.Dom.create("div","tl-timemarker-timespan-content",this._el.timespan),this._el.content_container=TL.Dom.create("div","tl-timemarker-content-container",this._el.container),this._el.content=TL.Dom.create("div","tl-timemarker-content",this._el.content_container),this._el.line_left=TL.Dom.create("div","tl-timemarker-line-left",this._el.timespan),this._el.line_right=TL.Dom.create("div","tl-timemarker-line-right",this._el.timespan),this.data.media)if(this._el.media_container=TL.Dom.create("div","tl-timemarker-media-container",this._el.content),this.data.media.thumbnail&&""!=this.data.media.thumbnail)this._el.media=TL.Dom.create("img","tl-timemarker-media",this._el.media_container),this._el.media.src=TL.Util.transformImageURL(this.data.media.thumbnail);else{var t=TL.MediaType(this.data.media).type;this._el.media=TL.Dom.create("span","tl-icon-"+t,this._el.media_container)}this._el.text=TL.Dom.create("div","tl-timemarker-text",this._el.content),this._text=TL.Dom.create("h2","tl-headline",this._el.text),this.data.text.headline&&""!=this.data.text.headline?this._text.innerHTML=TL.Util.unlinkify(this.data.text.headline):this.data.text.text&&""!=this.data.text.text?this._text.innerHTML=TL.Util.unlinkify(this.data.text.text):this.data.media.caption&&""!=this.data.media.caption&&(this._text.innerHTML=TL.Util.unlinkify(this.data.media.caption)),this.onLoaded()},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMarkerClick,this)},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.TimeEra=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t,e){this._el={container:{},background:{},content_container:{},content:{},text:{}},this._text={},this._state={loaded:!1},this.data={unique_id:"",date:{year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,thumbnail:"",format:""},text:{headline:"",text:""}},this.options={duration:1e3,ease:TL.Ease.easeInSpline,width:600,height:600,marker_width_min:100},this.active=!1,this.animator={},this.has_end_date=!1,TL.Util.mergeData(this.options,e),TL.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){},hide:function(){},setActive:function(t){},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e){this._updateDisplay(t,e)},getLeft:function(){return this._el.container.style.left.slice(0,-2)},getTime:function(){return this.data.start_date.getTime()},getEndTime:function(){return this.data.end_date?this.data.end_date.getTime():!1},setHeight:function(t){var e=12,i=1;this._el.content_container.style.height=t+"px",this._el.content.className="tl-timeera-content",TL.Browser.webkit?(i=Math.floor(t/(e+2)),1>i&&(i=1),this._text.className="tl-headline",this._text.style.webkitLineClamp=i):(i=t/e,i>1?this._text.className="tl-headline tl-headline-fadeout":this._text.className="tl-headline",this._text.style.height=i*e+"px")},setWidth:function(t){this.data.end_date&&(this._el.container.style.width=t+"px",t>this.options.marker_width_min?(this._el.content_container.style.width=t+"px",this._el.content_container.className="tl-timeera-content-container tl-timeera-content-container-long"):(this._el.content_container.style.width=this.options.marker_width_min+"px",this._el.content_container.className="tl-timeera-content-container"))},setClass:function(t){this._el.container.className=t},setRowPosition:function(t,e){this.setPosition({top:t})},setColor:function(t){this._el.container.className="tl-timeera tl-timeera-color"+t},_initLayout:function(){this._el.container=TL.Dom.create("div","tl-timeera"),this.data.unique_id&&(this._el.container.id=this.data.unique_id+"-era"),this.data.end_date&&(this.has_end_date=!0,this._el.container.className="tl-timeera tl-timeera-with-end"),this._el.content_container=TL.Dom.create("div","tl-timeera-content-container",this._el.container),this._el.background=TL.Dom.create("div","tl-timeera-background",this._el.content_container),this._el.content=TL.Dom.create("div","tl-timeera-content",this._el.content_container),this._el.text=TL.Dom.create("div","tl-timeera-text",this._el.content),this._text=TL.Dom.create("h2","tl-headline",this._el.text),this.data.text.headline&&""!=this.data.text.headline&&(this._text.innerHTML=TL.Util.unlinkify(this.data.text.headline)),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.TimeGroup=TL.Class.extend({includes:[TL.Events,TL.DomMixins],_el:{},initialize:function(t){this._el={parent:{},container:{},message:{}},this.options={width:600,height:600},this.data={label:"",rows:1},this._el.container=TL.Dom.create("div","tl-timegroup"),TL.Util.mergeData(this.data,t),this.animator={},this._initLayout(),this._initEvents()},updateDisplay:function(t,e){},setRowPosition:function(t,e){this.options.height=e*this.data.rows,this.setPosition({top:t}),this._el.container.style.height=this.options.height+"px"},setAlternateRowColor:function(t,e){var i="tl-timegroup";t&&(i+=" tl-timegroup-alternate"),e&&(i+=" tl-timegroup-hidden"),this._el.container.className=i},_onMouseClick:function(){this.fire("clicked",this.options)},_initLayout:function(){this._el.message=TL.Dom.create("div","tl-timegroup-message",this._el.container),this._el.message.innerHTML=this.data.label},_initEvents:function(){TL.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)},_updateDisplay:function(t,e,i){}}),TL.TimeScale=TL.Class.extend({initialize:function(t,e){var i=t.events;this._scale=t.scale,e=TL.Util.mergeData({display_width:500,screen_multiplier:3,max_rows:null},e),this._display_width=e.display_width,this._screen_multiplier=e.screen_multiplier,this._pixel_width=this._screen_multiplier*this._display_width,this._group_labels=void 0,this._positions=[],this._pixels_per_milli=0,this._earliest=t.getEarliestDate().getTime(),this._latest=t.getLatestDate().getTime(),this._span_in_millis=this._latest-this._earliest,this._span_in_millis<=0&&(this._span_in_millis=this._computeDefaultSpan(t)),this._average=this._span_in_millis/i.length,this._pixels_per_milli=this.getPixelWidth()/this._span_in_millis,this._axis_helper=TL.AxisHelper.getBestHelper(this),this._scaled_padding=1/this.getPixelsPerTick()*(this._display_width/2),this._computePositionInfo(i,e.max_rows)},_computeDefaultSpan:function(t){if("human"==t.scale){for(var e={},i=0;i=0;i--)if(e.hasOwnProperty(TL.Date.SCALES[i][0])){var a=TL.Date.SCALES[TL.Date.SCALES.length-1];return TL.Date.SCALES[i+1]&&(a=TL.Date.SCALES[i+1]),a[1]}return 31536e6}return 2e5},getGroupLabels:function(){return this._group_labels||[]},getScale:function(){return this._scale},getNumberOfRows:function(){return this._number_of_rows},getPixelWidth:function(){return this._pixel_width},getPosition:function(t){return(t-this._earliest)*this._pixels_per_milli},getPositionInfo:function(t){return this._positions[t]},getPixelsPerTick:function(){return this._axis_helper.getPixelsPerTick(this._pixels_per_milli)},getTicks:function(){return{major:this._axis_helper.getMajorTicks(this),minor:this._axis_helper.getMinorTicks(this)}},getDateFromTime:function(t){if("human"==this._scale)return new TL.Date(t);if("cosmological"==this._scale)return new TL.BigDate(new TL.BigYear(t));throw"Don't know how to get date from time for "+this._scale},getMajorScale:function(){return this._axis_helper.major.name},getMinorScale:function(){return this._axis_helper.minor.name},_assessGroups:function(t){for(var e=[],i=!1,n=0;n0)s.row=i.length,i.push(s),e--;else{var l=Math.min.apply(null,o),h=o.indexOf(l);s.row=h,s.end>i[h].end&&(i[h]=s),n++}}return{n_rows:i.length,n_overlaps:n}},_computePositionInfo:function(t,e,i){i=i||100;for(var n=[],a=!1,s=0;si?o.end=o.start+o.width:o.end=o.start+i}else o.width=i,o.end=o.start+i;t[s].group?n.indexOf(t[s].group)<0&&n.push(t[s].group):a=!0}if(n.length){a&&n.push("");for(var l=[],s=0;s=0;d--)h.positions[d].end>o.start&&h.n_overlaps++;h.positions.push(o)}for(var c=n.length;;){var u=Math.max(0,e-c);if(!u)break;if(l.sort(function(t,e){return t.n_overlaps>e.n_overlaps?-1:t.n_overlapsn&&(a=Math.round(i/e.getPixelsPerTick()));for(var s=1,o=0;o1?s>=a?(s=1,r.tick_text.style.opacity=1,r.tick.className="tl-timeaxis-tick"):(s++,r.tick_text.style.opacity=0,r.tick.className="tl-timeaxis-tick tl-timeaxis-tick-hidden"):(r.tick_text.style.opacity=1,r.tick.className="tl-timeaxis-tick")}}},_initLayout:function(){this._el.content_container=TL.Dom.create("div","tl-timeaxis-content-container",this._el.container),this._el.major=TL.Dom.create("div","tl-timeaxis-major",this._el.content_container),this._el.minor=TL.Dom.create("div","tl-timeaxis-minor",this._el.content_container),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){t&&(this.options.width=t),e&&(this.options.height=e)}}),TL.AxisHelper=TL.Class.extend({initialize:function(t){if(!t)throw"Axis helper must be configured with options";this.scale=t.scale,this.minor=t.minor,this.major=t.major},getPixelsPerTick:function(t){return t*this.minor.factor},getMajorTicks:function(t){return this._getTicks(t,this.major)},getMinorTicks:function(t){return this._getTicks(t,this.minor)},_getTicks:function(t,e){for(var i=t._scaled_padding*e.factor,n=t._earliest-i,a=t._latest+i,s=[],o=n;a>o;o+=e.factor)s.push(t.getDateFromTime(o).floor(e.name));return{name:e.name,ticks:s}}}),function(t){var e={},i=function(i,n){e[i]=[];for(var a=0;ai){if(null==s)return r;var h=Math.abs(i-l),d=Math.abs(i-l);return d>h?r:s}s=r}return a[a.length-1]}}(TL.AxisHelper),TL.Timeline=TL.Class.extend({includes:[TL.Events,TL.I18NMixins],initialize:function(t,e,i){var n=this;if(i||(i={}),this.version="3.2.6",this.ready=!1,this._el={container:{},storyslider:{},timenav:{},menubar:{}},"object"==typeof t?this._el.container=t:this._el.container=TL.Dom.get(t),this._storyslider={},this._style_sheet=new TL.StyleSheet,this._timenav={},this.message=new TL.Message({},{message_class:"tl-message-full"}),this._menubar={},this._loaded={storyslider:!1,timenav:!1},this.config=null,this.options={script_path:"",height:this._el.container.offsetHeight,width:this._el.container.offsetWidth,debug:!1,is_embed:!1,is_full_embed:!1,hash_bookmark:!1,default_bg_color:{r:255,g:255,b:255},scale_factor:2,layout:"landscape",timenav_position:"bottom",optimal_tick_width:60,base_class:"tl-timeline",timenav_height:null,timenav_height_percentage:25,timenav_mobile_height_percentage:40,timenav_height_min:175,marker_height_min:30,marker_width_min:100,marker_padding:5,start_at_slide:0,start_at_end:!1,menubar_height:0,skinny_size:650,medium_size:800,relative_date:!1,use_bc:!1,duration:1e3,ease:TL.Ease.easeInOutQuint,dragging:!0,trackResize:!0,map_type:"stamen:toner-lite",slide_padding_lr:100,slide_default_fade:"0%",zoom_sequence:[.5,1,2,3,5,8,13,21,34,55,89],language:"en",ga_property_id:null,track_events:["back_to_start","nav_next","nav_previous","zoom_in","zoom_out"]},this.animator_timenav=null,this.animator_storyslider=null,this.animator_menubar=null,"string"==typeof i.default_bg_color){var a=TL.Util.hexToRgb(i.default_bg_color);a?i.default_bg_color=a:(delete i.default_bg_color,trace("Invalid default background color. Ignoring."))}TL.Util.mergeData(this.options,i),window.addEventListener("resize",function(t){n.updateDisplay()}),TL.debug=this.options.debug,this._el.container.className+=" tl-timeline",this.options.is_embed&&(this._el.container.className+=" tl-timeline-embed"),this.options.is_full_embed&&(this._el.container.className+=" tl-timeline-full-embed"),this.message.addTo(this._el.container),this.options.relative_date?"undefined"!=typeof moment?n._loadLanguage(e):TL.Load.js(this.options.script_path+"/library/moment.js",function(){n._loadLanguage(e),trace("LOAD MOMENTJS")}):n._loadLanguage(e)},_loadLanguage:function(t){var e=this;this.options.language=new TL.Language(this.options),this._initData(t)},goToId:function(t){this.current_id!=t&&(this.current_id=t,this._timenav.goToId(this.current_id),this._storyslider.goToId(this.current_id,!1,!0),this.fire("change",{unique_id:this.current_id},this))},goTo:function(t){this.config.title?0==t?this.goToId(this.config.title.unique_id):this.goToId(this.config.events[t-1].unique_id):this.goToId(this.config.events[t].unique_id)},goToStart:function(){this.goTo(0)},goToEnd:function(){var t=this.config.events.length-1;this.goTo(this.config.title?t+1:t)},goToPrev:function(){this.goTo(this._getSlideIndex(this.current_id)-1)},goToNext:function(){this.goTo(this._getSlideIndex(this.current_id)+1)},add:function(t){var e=this.config.addEvent(t),i=this._getEventIndex(e),n=this.config.events[i];this._storyslider.createSlide(n,this.config.title?i+1:i),this._storyslider._updateDrawSlides(),this._timenav.createMarker(n,i),this._timenav._updateDrawTimeline(!1),this.fire("added",{unique_id:e})},remove:function(t){if(t>=0&&t0&&t<=this.config.events.length)return this.config.events[t-1]}else if(t>=0&&t=0&&t"+this._("error")+": "+this.config.getErrors("
"))},_initLayout:function(){var t=this;this._el.container.innerHTML="","top"==this.options.timenav_position?(this._el.timenav=TL.Dom.create("div","tl-timenav",this._el.container),this._el.storyslider=TL.Dom.create("div","tl-storyslider",this._el.container)):(this._el.storyslider=TL.Dom.create("div","tl-storyslider",this._el.container),this._el.timenav=TL.Dom.create("div","tl-timenav",this._el.container)),this._el.menubar=TL.Dom.create("div","tl-menubar",this._el.container),this.options.width=this._el.container.offsetWidth,this.options.height=this._el.container.offsetHeight,this._el.storyslider.style.top="1px",this.options.timenav_height=this._calculateTimeNavHeight(this.options.timenav_height),this._timenav=new TL.TimeNav(this._el.timenav,this.config,this.options),this._timenav.on("loaded",this._onTimeNavLoaded,this),this._timenav.on("update_timenav_min",this._updateTimeNavHeightMin,this),this._timenav.options.height=this.options.timenav_height,this._timenav.init(),this.options.initial_zoom&&this.setZoom(this.options.initial_zoom),this._storyslider=new TL.StorySlider(this._el.storyslider,this.config,this.options),this._storyslider.on("loaded",this._onStorySliderLoaded,this),this._storyslider.init(),this._menubar=new TL.MenuBar(this._el.menubar,this._el.container,this.options),"portrait"==this.options.layout?this.options.storyslider_height=this.options.height-this.options.timenav_height-1:this.options.storyslider_height=this.options.height-1,this._updateDisplay(this._timenav.options.height,!0,2e3)},_initEvents:function(){this._timenav.on("change",this._onTimeNavChange,this),this._timenav.on("zoomtoggle",this._onZoomToggle,this),this._storyslider.on("change",this._onSlideChange,this),this._storyslider.on("colorchange",this._onColorChange,this),this._storyslider.on("nav_next",this._onStorySliderNext,this),this._storyslider.on("nav_previous",this._onStorySliderPrevious,this),this._menubar.on("zoom_in",this._onZoomIn,this),this._menubar.on("zoom_out",this._onZoomOut,this),this._menubar.on("back_to_start",this._onBackToStart,this)},_initGoogleAnalytics:function(){!function(t,e,i,n,a,s,o){t.GoogleAnalyticsObject=a,t[a]=t[a]||function(){(t[a].q=t[a].q||[]).push(arguments)},t[a].l=1*new Date,s=e.createElement(i),o=e.getElementsByTagName(i)[0],s.async=1,s.src=n,o.parentNode.insertBefore(s,o)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",this.options.ga_property_id,"auto")},_initAnalytics:function(){if(null!==this.options.ga_property_id){this._initGoogleAnalytics(),ga("send","pageview");var t=this.options.track_events;for(i=0;ithis.config.events.length?this.goToEnd():this.goTo(this.options.start_at_slide),this.options.hash_bookmark&&this._updateHashBookmark(this.current_id)))}}),TL.Timeline.source_path=function(){var t=document.getElementsByTagName("script"),e=t[t.length-1].src;return e.substr(0,e.lastIndexOf("/"))}();
\ No newline at end of file
diff --git a/compiled/js/timeline.js b/compiled/js/timeline.js
index 18df65b1..94cc698d 100644
--- a/compiled/js/timeline.js
+++ b/compiled/js/timeline.js
@@ -8141,10 +8141,12 @@ TL.Media.Text = TL.Class.extend({
if (this.data.text != "") {
var text_content = "";
- text_content += TL.Util.htmlify(this.options.autolink == true ? TL.Util.linkify(this.data.text) : this.data.text);
-
+ text_content += TL.Util.htmlify(this.options.autolink == true ? TL.Util.linkify(this.data.text) : this.data.text);
+ trace(this.data.text);
this._el.content = TL.Dom.create("div", "tl-text-content", this._el.content_container);
this._el.content.innerHTML = text_content;
+ trace(text_content);
+ trace(this._el.content)
}
// Fire event that the slide is loaded
diff --git a/source/jade/google_spreadsheet_tester.jade b/source/jade/google_spreadsheet_tester.jade
index 58283df3..6187ed0c 100755
--- a/source/jade/google_spreadsheet_tester.jade
+++ b/source/jade/google_spreadsheet_tester.jade
@@ -68,6 +68,7 @@ html(lang="en")
document.getElementById('timeline').style.height = (window.innerHeight - 40 + "px");
timeline = new TL.Timeline('timeline', new TL.TimelineConfig(json), {
+ debug:true
});
diff --git a/source/js/media/types/TL.Media.Text.js b/source/js/media/types/TL.Media.Text.js
index 20c23064..bc4dd7b1 100644
--- a/source/js/media/types/TL.Media.Text.js
+++ b/source/js/media/types/TL.Media.Text.js
@@ -108,10 +108,12 @@ TL.Media.Text = TL.Class.extend({
if (this.data.text != "") {
var text_content = "";
- text_content += TL.Util.htmlify(this.options.autolink == true ? TL.Util.linkify(this.data.text) : this.data.text);
-
+ text_content += TL.Util.htmlify(this.options.autolink == true ? TL.Util.linkify(this.data.text) : this.data.text);
+ trace(this.data.text);
this._el.content = TL.Dom.create("div", "tl-text-content", this._el.content_container);
this._el.content.innerHTML = text_content;
+ trace(text_content);
+ trace(this._el.content)
}
// Fire event that the slide is loaded