/ * !
TimelineJS
Designed and built by Zach Wise at VéritéCo
This program is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
http : //www.gnu.org/licenses/
* //***********************************************
Begin VMM . js
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //* Verite
* Verite JS Master
* Version : 0.6
* Date : April 26 , 2012
* Copyright 2012 Verite unless part of Verite Timeline ,
* if part of Timeline then it inherits Timeline ' s license .
* Designed and built by Zach Wise digitalartwork . net
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * //* Simple JavaScript Inheritance
* By John Resig http : //ejohn.org/
* MIT Licensed .
=== === === === === === === === === === === === === === === === == * / f u n c t i o n t r a c e ( a ) { V M M . d e b u g & & ( w i n d o w . c o n s o l e ? c o n s o l e . l o g ( a ) : t y p e o f j s T r a c e ! = " u n d e f i n e d " & & j s T r a c e . s e n d ( a ) ) } f u n c t i o n o n Y o u T u b e P l a y e r A P I R e a d y ( ) { t r a c e ( " G L O B A L Y O U T U B E A P I C A L L E D " ) ; V M M . E x t e r n a l A P I . y o u t u b e . o n A P I R e a d y ( ) } ( f u n c t i o n ( ) { v a r a = ! 1 , b = / x y z / . t e s t ( f u n c t i o n ( ) { x y z } ) ? / \ b _ s u p e r \ b / : / . * / ; t h i s . C l a s s = f u n c t i o n ( ) { } ; C l a s s . e x t e n d = f u n c t i o n ( c ) { f u n c t i o n g ( ) { ! a & & t h i s . i n i t & & t h i s . i n i t . a p p l y ( t h i s , a r g u m e n t s ) } v a r d = t h i s . p r o t o t y p e ; a = ! 0 ; v a r e = n e w t h i s ; a = ! 1 ; f o r ( v a r f i n c ) e [ f ] = t y p e o f c [ f ] = = " f u n c t i o n " & & t y p e o f d [ f ] = = " f u n c t i o n " & & b . t e s t ( c [ f ] ) ? f u n c t i o n ( a , b ) { r e t u r n f u n c t i o n ( ) { v a r c = t h i s . _ s u p e r ; t h i s . _ s u p e r = d [ a ] ; v a r e = b . a p p l y ( t h i s , a r g u m e n t s ) ; t h i s . _ s u p e r = c ; r e t u r n e } } ( f , c [ f ] ) : c [ f ] ; g . p r o t o t y p e = e ; g . p r o t o t y p e . c o n s t r u c t o r = g ; g . e x t e n d = a r g u m e n t s . c a l l e e ; r e t u r n g } } ) ( ) ; v a r g l o b a l = f u n c t i o n ( ) { r e t u r n t h i s | | ( 1 , e v a l ) ( " t h i s " ) } ( ) ; i f ( t y p e o f V M M = = " u n d e f i n e d " ) { v a r V M M = C l a s s . e x t e n d ( { } ) ; V M M . d e b u g = ! 0 ; V M M . m a s t e r _ c o n f i g = { i n i t : f u n c t i o n ( ) { r e t u r n t h i s } , s i z e s : { a p i : { w i d t h : 0 , h e i g h t : 0 } } , v p : " P e l l e n t e s q u e n i b h f e l i s , e l e i f e n d i d , c o m m o d o i n , i n t e r d u m v i t a e , l e o " , a p i _ k e y s _ m a s t e r : { f l i c k r : " R A I v x H Y 4 h E / E l m 5 c i e h 4 X 5 p t M y D p j 7 M Y I x z i G x i 0 W G C c y 1 s + y r 7 r K Q = = " , g o o g l e : " j w N G n Y w 4 h E 9 l m A e z 4 l l 0 Q D + j o 6 S K B J F k n k o p L S 4 F r S A u G f I w y j 5 7 A u s u R 0 s 8 d A o = " , t w i t t e r : " " } , t i m e r s : { a p i : 7 e 3 } , a p i : { p u s h q u e s : [ ] } , t w i t t e r : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , f l i c k r : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , y o u t u b e : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , v i m e o : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , g o o g l e m a p s : { a c t i v e : ! 1 , m a p _ a c t i v e : ! 1 , p l a c e s _ a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , g o o g l e d o c s : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , g o o g l e p l u s : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } , w i k i p e d i a : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] , t r i e s : 0 } , s o u n d c l o u d : { a c t i v e : ! 1 , a r r a y : [ ] , a p i _ l o a d e d : ! 1 , q u e : [ ] } } . i n i t ( ) ; V M M . c r e a t e E l e m e n t = f u n c t i o n ( a , b , c , d , e ) { v a r f = " " ; i f ( a ! = n u l l & & a ! = " " ) { f + = " < " + a ; c ! = n u l l & & c ! = " " & & ( f + = " c l a s s = ' " + c + " ' " ) ; d ! = n u l l & & d ! = " " & & ( f + = " " + d ) ; e ! = n u l l & & e ! = " " & & ( f + = " s t y l e = ' " + e + " ' " ) ; f + = " > " ; b ! = n u l l & & b ! = " " & & ( f + = b ) ; f = f + " < / " + a + " > " } r e t u r n f } ; V M M . c r e a t e M e d i a E l e m e n t = f u n c t i o n ( a , b , c ) { v a r d = " " , e = ! 1 ; d + = " < d i v c l a s s = ' m e d i a ' > " ; i f ( a ! = n u l l & & a ! = " " ) { v a l i d = ! 0 ; d + = " < i m g s r c = ' " + a + " ' > " ; c ! = n u l l & & c ! = " " & & ( d + = V M M . c r e a t e E l e m e n t ( " d i v " , c , " c r e d i t " ) ) ; b ! = n u l l & & b ! = " " & & ( d + = V M M . c r e a t e E l e m e n t ( " d i v " , b , " c a p t i o n " ) ) } d + = " < / d i v > " ; r e t u r n d } ; V M M . h i d e U r l B a r = f u n c t i o n ( ) { v a r a = w i n d o w , b = a . d o c u m e n t ; i f ( ! l o c a t i o n . h a s h | | ! a . a d d E v e n t L i s t e n e r ) { w i n d o w . s c r o l l T o ( 0 , 1 ) ; v a r c = 1 , d = s e t I n t e r v a l ( f u n c t i o n ( ) { i f ( b . b o d y ) { c l e a r I n t e r v a l ( d ) ; c = " s c r o l l T o p " i n b . b o d y ? b . b o d y . s c r o l l T o p : 1 ; a . s c r o l l T o ( 0 , c = = = 1 ? 0 : 1 ) } } , 1 5 ) ; a . a d d E v e n t L i s t e n e r ( " l o a d " , f u n c t i o n ( ) { s e t T i m e o u t ( f u n c t i o n ( ) { a . s c r o l l T o ( 0 , c = = = 1 ? 0 : 1 ) } , 0 ) } , ! 1 ) } } } A r r a y . p r o t o t y p e . r e m o v e = f u n c t i o n ( a , b ) { v a r c = t h i s . s l i c e ( ( b | | a ) + 1 | | t h i s . l e n g t h ) ; t h i s . l e n g t h = a < 0 ? t h i s . l e n g t h + a : a ; r e t u r n t h i s . p u s h . a p p l y ( t h i s , c ) } ; D a t e . p r o t o t y p e . g e t W e e k = f u n c t i o n ( ) { v a r a = n e w D a t e ( t h i s . g e t F u l l Y e a r ( ) , 0 , 1 ) ; r e t u r n M a t h . c e i l ( ( ( t h i s - a ) / 8 6 4 e 5 + a . g e t D a y ( ) + 1 ) / 7 ) } ; D a t e . p r o t o t y p e . g e t D a y O f Y e a r = f u n c t i o n ( ) { v a r a = n e w D a t e ( t h i s . g e t F u l l Y e a r ( ) , 0 , 1 ) ; r e t u r n M a t h . c e i l ( ( t h i s - a ) / 8 6 4 e 5 ) } ; v a r i s = { N u l l : f u n c t i o n ( a ) { r e t u r n a = = = n u l l } , U n d e f i n e d : f u n c t i o n ( a ) { r e t u r n a = = = u n d e f i n e d } , n t : f u n c t i o n ( a ) { r e t u r n a = = = n u l l | | a = = = u n d e f i n e d } , F u n c t i o n : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " f u n c t i o n " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / F u n c t i o n / ) ! = = n u l l : ! 1 } , S t r i n g : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " s t r i n g " ? ! 0 : t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / s t r i n g / i ) ! = = n u l l : ! 1 } , A r r a y : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / a r r a y / i ) ! = = n u l l | | a . l e n g t h ! = = u n d e f i n e d : ! 1 } , B o o l e a n : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " b o o l e a n " ? ! 0 : t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / b o o l e a n / i ) ! = = n u l l : ! 1 } , D a t e : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " d a t e " ? ! 0 : t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / d a t e / i ) ! = = n u l l : ! 1 } , H T M L : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / h t m l / i ) ! = = n u l l : ! 1 } , N u m b e r : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " n u m b e r " ? ! 0 : t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / N u m b e r / ) ! = = n u l l : ! 1 } , O b j e c t : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " o b j e c t " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / o b j e c t / i ) ! = = n u l l : ! 1 } , R e g E x p : f u n c t i o n ( a ) { r e t u r n t y p e o f a = = " f u n c t i o n " ? a . c o n s t r u c t o r . t o S t r i n g ( ) . m a t c h ( / r e g
a + "&callback=?" ; VMM . getJSON ( b , VMM . ExternalAPI . twitter . onJSONLoaded ) } , onJSONLoaded : function ( a ) { trace ( "TWITTER JSON LOADED" ) ; var b = a . id ; VMM . attachElement ( "#" + b , VMM . Util . linkify _with _twitter ( a . html ) ) } , parseTwitterDate : function ( a ) { var b = new Date ( Date . parse ( a ) ) ; return b } , prettyParseTwitterDate : function ( a ) { var b = new Date ( Date . parse ( a ) ) ; return VMM . Date . prettyDate ( b , ! 0 ) } , getTweets : function ( a ) { var b = [ ] , c = a . length ; for ( var d = 0 ; d < a . length ; d ++ ) { var e = "" ; a [ d ] . tweet . match ( "status/" ) ? e = a [ d ] . tweet . split ( "status/" ) [ 1 ] : a [ d ] . tweet . match ( "statuses/" ) ? e = a [ d ] . tweet . split ( "statuses/" ) [ 1 ] : e = "" ; var f = "http://api.twitter.com/1/statuses/show.json?id=" + e + "&include_entities=true&callback=?" ; VMM . getJSON ( f , function ( a ) { var d = { } , e = "<div class='twitter'><blockquote><p>" , f = VMM . Util . linkify _with _twitter ( a . text , "_blank" ) ; e += f ; e += "</p>" ; e += "— " + a . user . name + " (<a href='https://twitter.com/" + a . user . screen _name + "'>@" + a . user . screen _name + "</a>) <a href='https://twitter.com/" + a . user . screen _name + "/status/" + a . id + "'>" + VMM . ExternalAPI . twitter . prettyParseTwitterDate ( a . created _at ) + " </a></blockquote></div>" ; d . content = e ; d . raw = a ; b . push ( d ) ; if ( b . length == c ) { var g = { tweetdata : b } ; VMM . fireEvent ( global , "TWEETSLOADED" , g ) } } ) . success ( function ( ) { trace ( "second success" ) } ) . error ( function ( ) { trace ( "error" ) } ) . complete ( function ( ) { trace ( "complete" ) } ) } } , getTweetSearch : function ( a , b ) { var c = 40 ; b != null && b != "" && ( c = b ) ; var d = "http://search.twitter.com/search.json?q=" + a + "&rpp=" + c + "&include_entities=true&result_type=mixed" , e = [ ] ; VMM . getJSON ( d , function ( a ) { for ( var b = 0 ; b < a . results . length ; b ++ ) { var c = { } , d = "<div class='twitter'><blockquote><p>" , f = VMM . Util . linkify _with _twitter ( a . results [ b ] . text , "_blank" ) ; d += f ; d += "</p>" ; d += "— " + a . results [ b ] . from _user _name + " (<a href='https://twitter.com/" + a . results [ b ] . from _user + "'>@" + a . results [ b ] . from _user + "</a>) <a href='https://twitter.com/" + a . results [ b ] . from _user + "/status/" + a . id + "'>" + VMM . ExternalAPI . twitter . prettyParseTwitterDate ( a . results [ b ] . created _at ) + " </a></blockquote></div>" ; c . content = d ; c . raw = a . results [ b ] ; e . push ( c ) } var g = { tweetdata : e } ; VMM . fireEvent ( global , "TWEETSLOADED" , g ) } ) } , prettyHTML : function ( a , b ) { var a = a . toString ( ) , c = { twitterid : a } , d = "http://api.twitter.com/1/statuses/show.json?id=" + a + "&include_entities=true&callback=?" , e = setTimeout ( VMM . ExternalAPI . twitter . errorTimeOut , VMM . master _config . timers . api , a ) ; VMM . getJSON ( d , VMM . ExternalAPI . twitter . formatJSON ) . error ( function ( b , c , d ) { trace ( "TWITTER error" ) ; trace ( "TWITTER ERROR: " + c + " " + b . responseText ) ; VMM . attachElement ( "#twitter_" + a , "<p>ERROR LOADING TWEET " + a + "</p>" ) } ) . success ( function ( a ) { clearTimeout ( e ) ; b && VMM . ExternalAPI . twitter . secondaryMedia ( a ) } ) } , formatJSON : function ( a ) { var b = a . id _str , c = "<blockquote><p>" , d = VMM . Util . linkify _with _twitter ( a . text , "_blank" ) ; c += d ; c += "</p></blockquote>" ; c += "<div class='vcard author'>" ; c += "<a class='screen-name url' href='https://twitter.com/" + a . user . screen _name + "' data-screen-name='" + a . user . screen _name + "' target='_blank'>" ; c += "<span class='avatar'><img src=' " + a . user . profile _image _url + "' alt=''></span>" ; c += "<span class='fn'>" + a . user . name + "</span>" ; c += "<span class='nickname'>@" + a . user . screen _name + "<span class='thumbnail-inline'></span></span>" ; c += "</a>" ; c += "</div>" ; typeof a . entities . media != "undefined" && a . entities . media [ 0 ] . type == "photo" && ( c += "<img src=' " + a . entities . media [ 0 ] . media _url + "' alt=''>" ) ; VMM . attachElement ( "#twitter_" + b . toString ( ) , c ) ; VMM . attachElement ( "#text_thumb_" + b . toString ( ) , a . text ) } } , googlemaps : { get : function ( a , b ) { var c , d , e ; e = VMM . Util . getUrlVars ( a ) ; VMM . master _config . Timeline . api _keys . google != "" ? d = VMM . master _config . Timeline . api _keys . google : d = Aes . Ctr . decrypt ( VMM . master _config . api _keys _master . google , VMM . master _config . vp , 256 ) ; var f = "http://maps.googleapis.com/maps/api/js?key=" + d + "&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady" , g = { url : a , vars : e , id : b } ; if ( VMM . master _config . googlemaps . active ) VMM . master _config . googlemaps . que . push ( g ) ; else { VMM . master _config . googlemaps . que . push ( g ) ; VMM . master _config . googlemaps . api _loaded || VMM . LoadLib . js ( f , function ( ) { trace ( "Google Maps API Library Loaded" ) } ) } } , create : function ( a ) { function e ( a ) { if ( a in VMM . ExternalAPI . googlemaps
. onDragEnd , "mouseup" , { element : b , delement : a } ) ; VMM . bindEvent ( a , VMM . DragSlider . onDragLeave , "mouseleave" , { element : b , delement : a } ) } , cancelSlide : function ( a ) { VMM . unbindEvent ( VMM . DragSlider . drag _elem , VMM . DragSlider . onDragMove , "mousemove" ) ; return ! 0 } , onDragLeave : function ( a ) { VMM . unbindEvent ( a . data . delement , VMM . DragSlider . onDragMove , "mousemove" ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; return ! 0 } , onDragStart : function ( a ) { VMM . DragSlider . dragStart ( a . data . element , a . data . delement , a ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; return ! 0 } , onDragEnd : function ( a ) { a . preventDefault ( ) ; a . stopPropagation ( ) ; if ( VMM . DragSlider . sliding ) { VMM . DragSlider . sliding = ! 1 ; VMM . DragSlider . dragEnd ( a . data . element , a . data . delement , a ) ; return ! 1 } return ! 0 } , onDragMove : function ( a ) { VMM . DragSlider . dragMove ( a . data . element , a ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; return ! 1 } , dragStart : function ( a , b , c ) { VMM . DragSlider . startX = c . pageX ; VMM . DragSlider . startLeft = VMM . DragSlider . getLeft ( a ) ; VMM . DragSlider . dragStartTime = ( new Date ) . getTime ( ) ; VMM . DragSlider . dragWidth = VMM . Lib . width ( b ) ; var d = Math . round ( VMM . DragSlider . startX - c . pageX - VMM . DragSlider . startLeft ) ; VMM . Lib . stop ( a ) ; VMM . bindEvent ( b , VMM . DragSlider . onDragMove , "mousemove" , { element : a } ) } , dragEnd : function ( a , b , c ) { VMM . unbindEvent ( b , VMM . DragSlider . onDragMove , "mousemove" ) ; VMM . DragSlider . getLeft ( a ) > 0 || VMM . DragSlider . dragMomentum ( a , c ) } , dragMove : function ( a , b ) { ! ! VMM . DragSlider . sliding ; VMM . DragSlider . sliding = ! 0 ; if ( VMM . DragSlider . startX > b . pageX ) { VMM . Lib . css ( a , "left" , - ( VMM . DragSlider . startX - b . pageX - VMM . DragSlider . startLeft ) ) ; VMM . DragSlider . slidingLeft = ! 0 } else { var c = b . pageX - VMM . DragSlider . startX + VMM . DragSlider . startLeft ; VMM . Lib . css ( a , "left" , - ( VMM . DragSlider . startX - b . pageX - VMM . DragSlider . startLeft ) ) ; VMM . DragSlider . slidingLeft = ! 1 } } , dragMomentum : function ( a , b ) { var c = ( ( new Date ) . getTime ( ) - VMM . DragSlider . dragStartTime ) * 10 , d = c , e = VMM . DragSlider . getLeft ( a ) , f = 6e3 * ( Math . abs ( VMM . DragSlider . startLeft ) - Math . abs ( e ) ) ; c = Math . round ( f / c ) ; var g = e + c , h = g % VMM . DragSlider . width , i = { left : Math . min ( g ) , time : d } ; VMM . fireEvent ( a , "DRAGUPDATE" , [ i ] ) ; var j = "easeOutExpo" ; i . time > 0 && VMM . Lib . animate ( a , i . time , j , { left : i . left } ) } , getLeft : function ( a ) { return parseInt ( VMM . Lib . css ( a , "left" ) . substring ( 0 , VMM . Lib . css ( a , "left" ) . length - 2 ) , 10 ) } } ) ; typeof VMM != "undefined" && typeof VMM . Slider == "undefined" && ( VMM . Slider = function ( a , b ) { function u ( ) { trace ( "onConfigSet" ) } function v ( a , b ) { var c = ! 0 , e = ! 1 ; a != null && ( c = a ) ; b != null && ( e = b ) ; n = d . slider . width ; d . slider . nav . height = VMM . Lib . height ( s . prevBtnContainer ) ; d . slider . content . width = n - d . slider . content . padding * 2 ; VMM . Lib . width ( h , j . length * d . slider . content . width ) ; if ( e ) { var i = j [ m ] . leftpos ( ) ; VMM . Lib . css ( g , "left" , i ) } G ( ) ; H ( ) ; VMM . Lib . css ( s . nextBtn , "left" , n - d . slider . nav . width ) ; VMM . Lib . height ( s . prevBtn , d . slider . height ) ; VMM . Lib . height ( s . nextBtn , d . slider . height ) ; VMM . Lib . css ( s . nextBtnContainer , "top" , d . slider . height / 2 - d . slider . nav . height / 2 + 10 ) ; VMM . Lib . css ( s . prevBtnContainer , "top" , d . slider . height / 2 - d . slider . nav . height / 2 + 10 ) ; VMM . Lib . height ( f , d . slider . height ) ; VMM . Lib . width ( f , n ) ; c && J ( m , "linear" , 1 ) ; m == 0 && VMM . Lib . visible ( s . prevBtn , ! 1 ) } function w ( a ) { if ( m == j . length - 1 ) VMM . Lib . animate ( g , d . duration , d . ease , { left : - j [ m ] . leftpos ( ) } ) ; else { J ( m + 1 ) ; A ( ) } } function x ( a ) { if ( m == 0 ) J ( m ) ; else { J ( m - 1 ) ; A ( ) } } function y ( a ) { switch ( a . keyCode ) { case 39 : w ( a ) ; break ; case 37 : x ( a ) } } function z ( a , b ) { if ( k . length == 0 ) for ( var c = 0 ; c < j . length ; c ++ ) k . push ( j [ c ] . leftpos ( ) ) ; if ( typeof b . left == "number" ) { var e = b . left , f = - j [ m ] . leftpos ( ) ; e < f - d . slider _width / 3 ? w ( ) : e > f + d . slider _width / 3 ? x ( ) : VMM . Lib . animate ( g , d . duration , d . ease , { left : f } ) } else VMM . Lib . animate ( g , d . duration , d . ease , { left : f } ) ; typeof b . top == "number" && VMM . Lib . animate ( g , d . duration , d . ease , { top : - b . top } ) } function A ( ) { d . current _slide = m ; VMM . fireEvent ( r , "UPDATE" ) } var c = { } , d , e , f , g , h , i = [ ] , j = [ ] , k = [ ] , l = "" , m = 0 , n = 960 , o = { move : ! 1 , x : 10 , y : 0 , off : 0 , dampen : 48 } , p = "" , q = ! 1 , r = a , s = { nextBtn : "" , prevBtn : "" , nextDate : "" , prevDate : "" , nextTitle : "" , prevTitle : "" } , t ; typeof VMM . Timeline != "undefined" ? d = VMM . Timeline . Config : d = { preload : 4 , current _slide : 0 , interval : 10 , something : 0 , width : 720 , height : 400 , ease : "easeInOutExpo" , duration : 1e3 , timeline : ! 1 , spacing : 15 , slider : { width : 720 , height : 400 , content : { width : 720 , height : 400 , padding : 130 } , nav : { width : 100 , height :
) ; var b ; for ( b in timeline _config ) Object . prototype . hasOwnProperty . call ( timeline _config , b ) && ( o [ b ] = timeline _config [ b ] ) } else if ( typeof a == "object" ) { var b ; for ( b in a ) Object . prototype . hasOwnProperty . call ( a , b ) && ( o [ b ] = a [ b ] ) } o . nav . width = o . width ; o . nav . height = 200 ; o . feature . width = o . width ; o . feature . height = o . height - o . nav . height ; VMM . Timeline . Config = o ; VMM . master _config . Timeline = VMM . Timeline . Config ; this . events = o . events } , v = function ( a , b ) { e = VMM . getElement ( k ) ; VMM . Lib . addClass ( k , "vmm-timeline" ) ; f = VMM . appendAndGetElement ( e , "<div>" , "feedback" , "" ) ; g = VMM . appendAndGetElement ( f , "<div>" , "messege" , "Timeline" ) ; h = new VMM . Slider ( k + " div.slider" , o ) ; i = new VMM . Timeline . TimeNav ( k + " div.navigation" ) ; p ? VMM . Lib . width ( e , o . width ) : o . width = VMM . Lib . width ( e ) ; q ? VMM . Lib . height ( e , o . height ) : o . height = VMM . Lib . height ( e ) } , E = function ( a ) { if ( a <= n . length - 1 && a >= 0 ) { o . current _slide = a ; h . setSlide ( o . current _slide ) ; i . setMarker ( o . current _slide , o . ease , o . duration ) } } ; this . init = function ( c , d , h ) { type . of ( d ) == "string" && ( d . match ( "#" ) ? k = d : k = "#" + d ) ; u ( h ) ; v ( a , b ) ; trace ( "TIMELINE INIT" ) ; VMM . Date . setLanguage ( VMM . Timeline . Config . language ) ; VMM . master _config . language = VMM . Timeline . Config . language ; f = VMM . appendAndGetElement ( e , "<div>" , "feedback" , "" ) ; g = VMM . appendAndGetElement ( f , "<div>" , "messege" , VMM . master _config . language . messages . loading _timeline ) ; VMM . bindEvent ( global , w , o . events . data _ready ) ; VMM . bindEvent ( global , H , o . events . messege ) ; ( VMM . Browser . browser == "Explorer" || VMM . Browser . browser == "MSIE" ) && parseInt ( VMM . Browser . version , 10 ) <= 7 && ( r = ! 0 ) ; if ( r ) { r = ! 0 ; VMM . fireEvent ( global , o . events . messege , "Internet Explorer " + VMM . Browser . version + " is not supported by TimelineJS. Please update your browser to version 8 or higher." ) } else type . of ( c ) == "string" || type . of ( c ) == "object" ? VMM . Timeline . DataObj . getData ( c ) : VMM . Timeline . DataObj . getData ( VMM . getElement ( k ) ) } ; this . iframeLoaded = function ( ) { trace ( "iframeLoaded" ) } ; this . reload = function ( a ) { trace ( "loadNewDates" + a ) ; g = VMM . appendAndGetElement ( f , "<div>" , "messege" , VMM . master _config . language . messages . loading _timeline ) ; m = { } ; VMM . Timeline . DataObj . getData ( a ) } ; var G = function ( a ) { VMM . getJSON ( a , function ( a ) { m = VMM . Timeline . DataObj . getData ( a ) ; VMM . fireEvent ( global , o . events . data _ready ) } ) } , H = function ( a , b ) { trace ( "showMessege " + b ) ; VMM . attachElement ( g , b ) } , I = function ( ) { VMM . Lib . animate ( f , o . duration , o . ease * 4 , { opacity : 0 } , J ) } , J = function ( ) { VMM . Lib . detach ( f ) } , K = function ( ) { o . start _at _end && o . current _slide == 0 && ( o . current _slide = n . length - 1 ) ; VMM . attachElement ( e , "" ) ; VMM . appendElement ( e , "<div class='container main'><div class='feature'><div class='slider'></div></div><div class='navigation'></div></div>" ) ; y ( ) ; VMM . bindEvent ( "div.slider" , z , "LOADED" ) ; VMM . bindEvent ( "div.navigation" , B , "LOADED" ) ; VMM . bindEvent ( "div.slider" , C , "UPDATE" ) ; VMM . bindEvent ( "div.navigation" , D , "UPDATE" ) ; h . init ( n ) ; i . init ( n , m . era ) ; VMM . bindEvent ( global , y , o . events . resize ) } , L = function ( ) { trace ( "UPDATE SIZE" ) ; o . width = VMM . Lib . width ( e ) ; o . height = VMM . Lib . height ( e ) ; o . nav . width = o . width ; o . feature . width = o . width ; VMM . Browser . device != "mobile" ; o . feature . height = o . height - o . nav . height - 3 } , M = function ( ) { n = [ ] ; VMM . fireEvent ( global , o . events . messege , "Building Dates" ) ; L ( ) ; for ( var a = 0 ; a < m . date . length ; a ++ ) if ( m . date [ a ] . startDate != null && m . date [ a ] . startDate != "" ) { var b = { } ; m . date [ a ] . type == "tweets" ? b . startdate = VMM . ExternalAPI . twitter . parseTwitterDate ( m . date [ a ] . startDate ) : b . startdate = VMM . Date . parse ( m . date [ a ] . startDate ) ; if ( ! isNaN ( b . startdate ) ) { m . date [ a ] . endDate != null && m . date [ a ] . endDate != "" ? m . date [ a ] . type == "tweets" ? b . enddate = VMM . ExternalAPI . twitter . parseTwitterDate ( m . date [ a ] . endDate ) : b . enddate = VMM . Date . parse ( m . date [ a ] . endDate ) : b . enddate = b . startdate ; b . needs _slug = ! 1 ; m . date [ a ] . headline == "" && m . date [ a ] . slug != null && m . date [ a ] . slug != "" && ( b . needs _slug = ! 0 ) ; b . title = m . date [ a ] . headline ; b . headline = m . date [ a ] . headline ; b . type = m . date [ a ] . type ; b . date = VMM . Date . prettyDate ( b . startdate ) ; b . asset = m . date [ a ] . asset ; b . fulldate = b . startdate . getTime ( ) ; b . text = m . date [ a ] . text ; b . content = "" ; b . tag = m . date [ a ] . tag ; b . slug = m . date [ a ] . slug ; b . uniqueid = VMM . Util . unique _ID ( 7 ) ; n . push ( b ) } } m . type != "storify" && n . sort ( function ( a , b ) { return a . fulldate - b . fulldate } ) ; if ( m . headline != null && m . headline != "" && m . text != null && m . text != "" ) { trace ( "HAS STARTPAGE" ) ; var b
e + "<span class='thumbnail-inline'></span></span>" ; m += "</a></div></div>" ; j . text = m ; if ( f + 1 >= a . content . elements . length ) j . startDate = a . content . elements [ f - 1 ] . posted _at ; else if ( a . content . elements [ f + 1 ] . type == "text" && a . content . elements [ f + 1 ] . permalink . match ( "storify" ) ) if ( f + 2 >= a . content . elements . length ) j . startDate = a . content . elements [ f - 1 ] . posted _at ; else if ( a . content . elements [ f + 2 ] . type == "text" && a . content . elements [ f + 2 ] . permalink . match ( "storify" ) ) if ( f + 3 >= a . content . elements . length ) j . startDate = a . content . elements [ f - 1 ] . posted _at ; else if ( a . content . elements [ f + 3 ] . type == "text" && a . content . elements [ f + 3 ] . permalink . match ( "storify" ) ) j . startDate = a . content . elements [ f - 1 ] . posted _at ; else { trace ( "LEVEL 3" ) ; j . startDate = a . content . elements [ f + 3 ] . posted _at } else { trace ( "LEVEL 2" ) ; j . startDate = a . content . elements [ f + 2 ] . posted _at } else { trace ( "LEVEL 1" ) ; j . startDate = a . content . elements [ f + 1 ] . posted _at } j . endDate = j . startDate } } else if ( g . type == "video" ) { j . headline = g . data . video . title ; j . asset . caption = g . data . video . description ; j . asset . caption = g . source . username ; j . asset . media = g . data . video . src } else { trace ( "NO MATCH " ) ; trace ( g ) } h && ( j . slug = VMM . Util . untagify ( g . data . text ) ) ; b . timeline . date . push ( j ) } VMM . fireEvent ( global , VMM . Timeline . Config . events . data _ready , b ) } } , tweets : { type : "twitter" , buildData : function ( a ) { VMM . bindEvent ( global , VMM . Timeline . DataObj . model . tweets . onTwitterDataReady , "TWEETSLOADED" ) ; VMM . ExternalAPI . twitter . getTweets ( a . timeline . tweets ) } , getData : function ( a ) { VMM . bindEvent ( global , VMM . Timeline . DataObj . model . tweets . onTwitterDataReady , "TWEETSLOADED" ) ; VMM . ExternalAPI . twitter . getTweetSearch ( a ) } , onTwitterDataReady : function ( a , b ) { var c = VMM . Timeline . DataObj . data _template _obj ; for ( var d = 0 ; d < b . tweetdata . length ; d ++ ) { var e = { type : "tweets" , startDate : "" , headline : "" , text : "" , asset : { media : "" , credit : "" , caption : "" } , tags : "Optional" } ; e . startDate = b . tweetdata [ d ] . raw . created _at ; type . of ( b . tweetdata [ d ] . raw . from _user _name ) ? e . headline = b . tweetdata [ d ] . raw . from _user _name + " (<a href='https://twitter.com/" + b . tweetdata [ d ] . raw . from _user + "'>" + "@" + b . tweetdata [ d ] . raw . from _user + "</a>)" : e . headline = b . tweetdata [ d ] . raw . user . name + " (<a href='https://twitter.com/" + b . tweetdata [ d ] . raw . user . screen _name + "'>" + "@" + b . tweetdata [ d ] . raw . user . screen _name + "</a>)" ; e . asset . media = b . tweetdata [ d ] . content ; c . timeline . date . push ( e ) } VMM . fireEvent ( global , VMM . Timeline . Config . events . data _ready , c ) } } } , data _template _obj : { timeline : { headline : "" , description : "" , asset : { media : "" , credit : "" , caption : "" } , date : [ ] } } , date _obj : { startDate : "2012,2,2,11,30" , headline : "" , text : "" , asset : { media : "http://youtu.be/vjVfu8-Wp6s" , credit : "" , caption : "" } , tags : "Optional" } } ) ; VMM . debug = ! 1 ;