@ -1168,7 +1168,6 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
VMM . Date = ( {
init : function ( ) {
"use strict" ;
return this ;
} ,
@ -1187,8 +1186,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
month : [ "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ] ,
month _abbr : [ "Jan." , "Feb." , "March" , "April" , "May" , "June" , "July" , "Aug." , "Sept." , "Oct." , "Nov." , "Dec." ] ,
day : [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" ] ,
day _abbr : [ "Sun." , "Mon." , "Tues." , "Wed." , "Thurs." , "Fri." , "Sat." ] ,
hour : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ] ,
day _abbr : [ "Sun." , "Mon." , "Tues." , "Wed." , "Thurs." , "Fri." , "Sat." ] ,
hour : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ] ,
hour _suffix : [ "am" ] ,
//B.C.
@ -1205,7 +1204,6 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
} ,
setLanguage : function ( lang ) {
"use strict" ;
trace ( "SET DATE LANGUAGE" ) ;
VMM . Date . dateformats = lang . dateformats ;
VMM . Date . month = lang . date . month ;
@ -1231,7 +1229,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
if ( d . match ( /,/gi ) ) {
date _array = d . split ( "," ) ;
for ( var i = 0 ; i < date _array . length ; i ++ ) {
date _array [ i ] = parseInt ( date _array [ i ] ) ;
date _array [ i ] = parseInt ( date _array [ i ] , 10 ) ;
}
if ( date _array [ 0 ] ) { date . setFullYear ( date _array [ 0 ] ) ; }
if ( date _array [ 1 ] > 1 ) { date . setMonth ( date _array [ 1 ] - 1 ) ; }
@ -1258,7 +1256,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
if ( date _array [ 0 ] > 1 ) { date . setMonth ( date _array [ 0 ] - 1 ) ; }
if ( date _array [ 1 ] > 1 ) { date . setDate ( date _array [ 1 ] ) ; }
} else if ( d . length <= 5 ) {
date . setFullYear ( parseInt ( d ) ) ;
date . setFullYear ( parseInt ( d , 10 ) ) ;
date . setMonth ( 0 ) ;
date . setDate ( 1 ) ;
date . setHours ( 0 ) ;
@ -1286,11 +1284,11 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
}
} else {
date = new Date (
parseInt ( d . slice ( 0 , 4 ) ) ,
parseInt ( d . slice ( 4 , 6 ) ) - 1 ,
parseInt ( d . slice ( 6 , 8 ) ) ,
parseInt ( d . slice ( 8 , 10 ) ) ,
parseInt ( d . slice ( 10 , 12 ) )
parseInt ( d . slice ( 0 , 4 ) , 10 ) ,
parseInt ( d . slice ( 4 , 6 ) , 10 ) - 1 ,
parseInt ( d . slice ( 6 , 8 ) , 10 ) ,
parseInt ( d . slice ( 8 , 10 ) , 10 ) ,
parseInt ( d . slice ( 10 , 12 ) , 10 )
) ;
}
@ -1303,7 +1301,10 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
_date2 ,
format ,
bc _check ,
is _pair = false ;
is _pair = false ,
bc _original ,
bc _number ,
bc _string ;
if ( d2 != null ) {
is _pair = true ;
@ -1349,12 +1350,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
// BC TIME SUPPORT
for ( var i = 0 ; i < bc _check . length ; i ++ ) {
if ( parseInt ( bc _check [ i ] ) < 0 ) {
if ( parseInt ( bc _check [ i ] , 10 ) < 0 ) {
trace ( "YEAR IS BC" ) ;
var bc _original = bc _check [ i ] ;
var bc _number = Math . abs ( parseInt ( bc _check [ i ] ) ) ;
var bc _string = bc _number . toString ( ) + " B.C." ;
_date = _date . replace ( bc _original , bc _string ) ;
bc _original = bc _check [ i ] ;
bc _number = Math . abs ( parseInt ( bc _check [ i ] , 10 ) ) ;
bc _string = bc _number . toString ( ) + " B.C." ;
_date = _date . replace ( bc _original , bc _string ) ;
}
}
@ -1363,12 +1364,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
_date2 = dateFormat ( d2 , format ) ;
bc _check = _date2 . split ( " " ) ;
// BC TIME SUPPORT
for ( var i = 0 ; i < bc _check . length ; i ++ ) {
if ( parseInt ( bc _check [ i ] ) < 0 ) {
for ( var j = 0 ; j < bc _check . length ; j ++ ) {
if ( parseInt ( bc _check [ j ] , 10 ) < 0 ) {
trace ( "YEAR IS BC" ) ;
var bc _original = bc _check [ i ] ;
var bc _number = Math . abs ( parseInt ( bc _check [ i ] ) ) ;
var bc _string = bc _number . toString ( ) + " B.C." ;
bc _original = bc _check [ j ] ;
bc _number = Math . abs ( parseInt ( bc _check [ j ] , 10 ) ) ;
bc _string = bc _number . toString ( ) + " B.C." ;
_date2 = _date2 . replace ( bc _original , bc _string ) ;
}
}
@ -2354,8 +2355,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
errorTimeOut : function ( tweet ) {
trace ( "TWITTER JSON ERROR TIMEOUT " + tweet . mid ) ;
VMM . attachElement ( "#tweet_" + tweet . id , "<span class='messege'><p>Still waiting on Twitter: " + tweet . mid + "</p></span>" ) ;
VMM . attachElement ( "#" + tweet . id . toString ( ) , VMM . MediaElement . loadingmessage ( "Still waiting on Twitter: " + tweet . mid ) ) ;
// CHECK RATE STATUS
VMM . getJSON ( "http://api.twitter.com/1/account/rate_limit_status.json" , function ( d ) {
trace ( "REMAINING TWITTER API CALLS " + d . remaining _hits ) ;
@ -2365,10 +2365,10 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
mes = "<p>You've reached the maximum number of tweets you can load in an hour.</p>" ;
mes += "<p>You can view tweets again starting at: <br/>" + d . reset _time + "</p>" ;
} else {
mes = "<p>Still waiting on Twitter. " + id + "</p>" ;
mes = "<p>Still waiting on Twitter. " + tweet . m id + "</p>" ;
//mes = "<p>Tweet " + id + " was not found.</p>";
}
VMM . attachElement ( "#twitter_ " + id , VMM . MediaElement . loadingmessage ( mes ) ) ;
VMM . attachElement ( "#" + tweet . id . toString ( ) , VMM . MediaElement . loadingmessage ( mes ) ) ;
} ) ;
} ,
@ -4106,146 +4106,202 @@ if(typeof VMM != 'undefined' && typeof VMM.TouchSlider == 'undefined') {
if ( typeof VMM != 'undefined' && typeof VMM . DragSlider == 'undefined' ) {
// VMM.DragSlider.createSlidePanel(drag_object, move_object, w, padding, sticky);
// VMM.DragSlider.cancelSlide();
VMM . DragSlider = {
createPanel : function ( drag _object , move _object , w , padding , sticky ) {
VMM . DragSlider = function ( ) {
var drag = {
element : "" ,
element _move : "" ,
constraint : "" ,
sliding : false ,
pagex : {
start : 0 ,
end : 0
} ,
left : {
start : 0 ,
end : 0
} ,
time : {
start : 0 ,
end : 0
} ,
touch : false
} ,
dragevent = {
down : "mousedown" ,
up : "mouseup" ,
leave : "mouseleave" ,
move : "mousemove"
} ,
mousedrag = {
down : "mousedown" ,
up : "mouseup" ,
leave : "mouseleave" ,
move : "mousemove"
} ,
touchdrag = {
down : "touchstart" ,
up : "touchend" ,
leave : "mouseleave" ,
move : "touchmove"
} ;
this . createPanel = function ( drag _object , move _object , constraint , touch ) {
drag . element = drag _object ;
drag . element _move = move _object ;
var x = padding ;
VMM . DragSlider . width = w ;
VMM . DragSlider . makeDraggable ( drag _object , move _object ) ;
VMM . DragSlider . drag _elem = drag _object ;
/ *
if ( sticky != null && sticky != "" ) {
VMM . TouchSlider . sticky = sticky ;
if ( constraint != null && constraint != "" ) {
drag . constraint = constraint ;
} else {
VMM . TouchSlider . sticky = false ;
drag . constraint = false ;
}
* /
VMM . DragSlider . sticky = sticky ;
} ,
makeDraggable : function ( drag _object , move _object ) {
VMM . bindEvent ( drag _object , VMM . DragSlider . onDragStart , "mousedown" , { element : move _object , delement : drag _object } ) ;
//VMM.bindEvent(drag_object, VMM.DragSlider.onDragMove, "mousemove", {element: move_object});
VMM . bindEvent ( drag _object , VMM . DragSlider . onDragEnd , "mouseup" , { element : move _object , delement : drag _object } ) ;
VMM . bindEvent ( drag _object , VMM . DragSlider . onDragLeave , "mouseleave" , { element : move _object , delement : drag _object } ) ;
} ,
cancelSlide : function ( e ) {
VMM . unbindEvent ( VMM . DragSlider . drag _elem , VMM . DragSlider . onDragMove , "mousemove" ) ;
//VMM.DragSlider.drag_elem.preventDefault();
//VMM.DragSlider.drag_elem.stopPropagation();
if ( touch ) {
drag . touch = touch ;
} else {
drag . touch = false ;
}
trace ( "TOUCH" + drag . touch ) ;
if ( drag . touch ) {
dragevent = touchdrag ;
} else {
dragevent = mousedrag ;
}
makeDraggable ( drag . element , drag . element _move ) ;
}
this . updateConstraint = function ( constraint ) {
trace ( "updateConstraint" ) ;
drag . constraint = constraint ;
}
var makeDraggable = function ( drag _object , move _object ) {
VMM . bindEvent ( drag _object , onDragStart , dragevent . down , { element : move _object , delement : drag _object } ) ;
VMM . bindEvent ( drag _object , onDragEnd , dragevent . up , { element : move _object , delement : drag _object } ) ;
VMM . bindEvent ( drag _object , onDragLeave , dragevent . leave , { element : move _object , delement : drag _object } ) ;
}
this . cancelSlide = function ( e ) {
VMM . unbindEvent ( drag . element , onDragMove , dragevent . move ) ;
return true ;
} ,
onDragLeave : function ( e ) {
VMM . unbindEvent ( e . data . delement , VMM . DragSlider . onDragMove , "mousemove" ) ;
}
var onDragLeave = function ( e ) {
VMM . unbindEvent ( e . data . delement , onDragMove , dragevent . move ) ;
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
return true ;
} ,
onDragStart : function ( e ) {
VMM . DragSlider . dragStart ( e . data . element , e . data . delement , e ) ;
if ( drag . sliding ) {
drag . sliding = false ;
dragEnd ( e . data . element , e . data . delement , e ) ;
return false ;
} else {
return true ;
}
}
var onDragStart = function ( e ) {
dragStart ( e . data . element , e . data . delement , e ) ;
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
return true ;
} ,
onDragEnd : function ( e ) {
}
var onDragEnd = function ( e ) {
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
if ( VMM . DragSlider . sliding ) {
VMM . DragSlider . sliding = false ;
VMM . DragSlider . dragEnd ( e . data . element , e . data . delement , e ) ;
if ( drag . sliding ) {
drag . sliding = false ;
dragEnd ( e . data . element , e . data . delement , e ) ;
return false ;
} else {
return true ;
}
} ,
onDragMove : function ( e ) {
VMM . DragSlider . dragMove ( e . data . element , e ) ;
}
var onDragMove = function ( e ) {
dragMove ( e . data . element , e ) ;
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
return false ;
} ,
dragStart : function ( elem , delem , e ) {
VMM . DragSlider . startX = e . pageX ;
VMM . DragSlider . startLeft = VMM . DragSlider . getLeft ( elem ) ;
VMM . DragSlider . dragStartTime = new Date ( ) . getTime ( ) ;
VMM . DragSlider . dragWidth = VMM . Lib . width ( delem ) ;
// CANCEL CURRENT ANIMATION IF ANIMATING
var _newx = Math . round ( VMM . DragSlider . startX - e . pageX - VMM . DragSlider . startLeft ) ;
}
var dragStart = function ( elem , delem , e ) {
if ( drag . touch ) {
trace ( "IS TOUCH" )
VMM . Lib . css ( elem , '-webkit-transition-duration' , '0' ) ;
drag . pagex . start = e . originalEvent . touches [ 0 ] . screenX ;
} else {
drag . pagex . start = e . pageX ;
}
drag . left . start = getLeft ( elem ) ;
drag . time . start = new Date ( ) . getTime ( ) ;
VMM . Lib . stop ( elem ) ;
VMM . bindEvent ( delem , VMM . DragSlider . onDragMove , "mousemove" , { element : elem } ) ;
VMM . bindEvent ( delem , onDragMove , dragevent . move , { element : elem } ) ;
} ,
dragEnd : function ( elem , delem , e ) {
VMM . unbindEvent ( delem , VMM . DragSlider . onDragMove , "mousemove" ) ;
//VMM.DragSlider.dragMomentum(elem, e);
if ( VMM . DragSlider . getLeft ( elem ) > 0 ) {
//(VMM.DragSlider.dragWidth/2)
//This means they dragged to the right past the first item
//VMM.Lib.animate(elem, 1000, "linear", {"left": 0});
//VMM.fireEvent(elem, "DRAGUPDATE", [0]);
}
var dragEnd = function ( elem , delem , e ) {
VMM . unbindEvent ( delem , onDragMove , dragevent . move ) ;
dragMomentum ( elem , e ) ;
}
var dragMove = function ( elem , e ) {
drag . sliding = true ;
if ( drag . touch ) {
drag . pagex . end = e . originalEvent . touches [ 0 ] . screenX ;
} else {
//This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid.
VMM . DragSlider . dragMomentum ( elem , e ) ;
}
} ,
dragMove : function ( elem , e ) {
if ( ! VMM . DragSlider . sliding ) {
//elem.parent().addClass('sliding');
drag . pagex . end = e . pageX ;
}
drag . left . end = getLeft ( elem ) ;
VMM . Lib . css ( elem , 'left' , - ( drag . pagex . start - drag . pagex . end - drag . left . start ) ) ;
}
var dragMomentum = function ( elem , e ) {
var drag _info = {
left : drag . left . end ,
left _adjust : 0 ,
change : {
x : 0
} ,
time : ( new Date ( ) . getTime ( ) - drag . time . start ) * 10 ,
time _adjust : ( new Date ( ) . getTime ( ) - drag . time . start ) * 10
} ,
ease = "easeOutExpo" ;
drag _info . change . x = 6000 * ( Math . abs ( drag . pagex . end ) - Math . abs ( drag . pagex . start ) ) ;
VMM . DragSlider . sliding = true ;
if ( VMM . DragSlider . startX > e . pageX ) {
//Sliding to the left
VMM . Lib . css ( elem , 'left' , - ( VMM . DragSlider . startX - e . pageX - VMM . DragSlider . startLeft ) ) ;
VMM . DragSlider . slidingLeft = true ;
} else {
//Sliding to the right
var left = ( e . pageX - VMM . DragSlider . startX + VMM . DragSlider . startLeft ) ;
VMM . Lib . css ( elem , 'left' , - ( VMM . DragSlider . startX - e . pageX - VMM . DragSlider . startLeft ) ) ;
VMM . DragSlider . slidingLeft = false ;
}
} ,
dragMomentum : function ( elem , e ) {
var slideAdjust = ( new Date ( ) . getTime ( ) - VMM . DragSlider . dragStartTime ) * 10 ;
var timeAdjust = slideAdjust ;
var left = VMM . DragSlider . getLeft ( elem ) ;
var changeX = 6000 * ( Math . abs ( VMM . DragSlider . startLeft ) - Math . abs ( left ) ) ;
//var changeX = 6000 * (VMM.DragSlider.startLeft - left);
slideAdjust = Math . round ( changeX / slideAdjust ) ;
var newLeft = left + slideAdjust ;
drag _info . left _adjust = Math . round ( drag _info . change . x / drag _info . time ) ;
var t = newLeft % VMM . DragSlider . width ;
//left: Math.min(0, newLeft),
var _r _object = {
left : Math . min ( newLeft ) ,
time : timeAdjust
drag _info . left = Math . min ( drag _info . left + drag _info . left _adjust ) ;
if ( drag . constraint ) {
if ( drag _info . left > drag . constraint . left ) {
drag _info . left = drag . constraint . left ;
if ( drag _info . time > 5000 ) {
drag _info . time = 5000 ;
}
} else if ( drag _info . left < drag . constraint . right ) {
drag _info . left = drag . constraint . right ;
if ( drag _info . time > 5000 ) {
drag _info . time = 5000 ;
}
}
}
VMM . fireEvent ( elem , "DRAGUPDATE" , [ _r _object ] ) ;
var _ease = "easeOutExpo" ;
if ( _r _object . time > 0 ) {
VMM . Lib . animate ( elem , _r _object . time , _ease , { "left" : _r _object . left } ) ;
} ;
VMM . fireEvent ( elem , "DRAGUPDATE" , [ drag _info ] ) ;
if ( drag _info . time > 0 ) {
if ( drag . touch ) {
VMM . Lib . css ( elem , '-webkit-transition-property' , 'left' ) ;
VMM . Lib . css ( elem , '-webkit-transition-duration' , drag _info . time ) ;
VMM . Lib . css ( elem , 'left' , drag _info . left ) ;
} else {
VMM . Lib . animate ( elem , drag _info . time , ease , { "left" : drag _info . left } ) ;
}
}
//VMM.DragSlider.startX = null;
} ,
getLeft : function ( elem ) {
}
var getLeft = function ( elem ) {
return parseInt ( VMM . Lib . css ( elem , 'left' ) . substring ( 0 , VMM . Lib . css ( elem , 'left' ) . length - 2 ) , 10 ) ;
}
}
}
@ -6364,6 +6420,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
current _slide : 0 ,
hash _bookmark : false ,
start _at _end : false ,
start _at _slide : 0 ,
start _page : false ,
api _keys : {
google : "" ,
@ -6386,10 +6443,11 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
density : 4 ,
minor _width : 0 ,
minor _left : 0 ,
cont straint : {
constraint : {
left : 0 ,
right : 0 ,
right _min : 0
right _min : 0 ,
right _max : 0
} ,
multiplier : {
current : 6 ,
@ -6439,18 +6497,20 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
if ( window . location . hash ) {
var hash = window . location . hash . substring ( 1 ) ;
if ( ! isNaN ( hash ) ) {
config . current _slide = parseInt ( hash ) ;
config . current _slide = parseInt ( hash ) ;
}
}
window . onhashchange = function ( ) {
var hash = window . location . hash . substring ( 1 ) ;
if ( config . hash _bookmark ) {
if ( is _moving ) {
var hash = window . location . hash . substring ( 1 ) ;
goToEvent ( parseInt ( hash ) ) ;
} else {
is _moving = false ;
}
} else {
goToEvent ( parseInt ( hash ) ) ;
}
}
@ -6617,17 +6677,13 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
}
}
if ( ie7 ) {
ie7 = true ;
VMM . fireEvent ( global , config . events . messege , "Internet Explorer " + VMM . Browser . version + " is not supported by TimelineJS. Please update your browser to version 8 or higher." ) ;
if ( type . of ( _data ) == "string" || type . of ( _data ) == "object" ) {
VMM . Timeline . DataObj . getData ( _data ) ;
} else {
if ( type . of ( _data ) == "string" || type . of ( _data ) == "object" ) {
VMM . Timeline . DataObj . getData ( _data ) ;
} else {
VMM . Timeline . DataObj . getData ( VMM . getElement ( timeline _id ) ) ;
}
VMM . Timeline . DataObj . getData ( VMM . getElement ( timeline _id ) ) ;
}
} ;
this . iframeLoaded = function ( ) {
@ -6675,26 +6731,61 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
if ( config . start _at _end && config . current _slide == 0 ) {
config . current _slide = _dates . length - 1 ;
}
// CREATE DOM STRUCTURE
VMM . attachElement ( $timeline , "" ) ;
VMM . appendElement ( $timeline , "<div class='container main'><div class='feature'><div class='slider'></div></div><div class='navigation'></div></div>" ) ;
// START AT END?
if ( parseInt ( config . start _at _slide ) > 0 ) {
config . current _slide = parseInt ( config . start _at _slide ) ;
}
reSize ( ) ;
// IE7
if ( ie7 ) {
ie7 = true ;
VMM . fireEvent ( global , config . events . messege , "Internet Explorer " + VMM . Browser . version + " is not supported by TimelineJS. Please update your browser to version 8 or higher." ) ;
} else {
// CREATE DOM STRUCTURE
VMM . attachElement ( $timeline , "" ) ;
VMM . appendElement ( $timeline , "<div class='container main'><div class='feature'><div class='slider'></div></div><div class='navigation'></div></div>" ) ;
VMM . bindEvent ( "div.slider" , onSliderLoaded , "LOADED" ) ;
VMM . bindEvent ( "div.navigation" , onTimeNavLoaded , "LOADED" ) ;
VMM . bindEvent ( "div.slider" , onSlideUpdate , "UPDATE" ) ;
VMM . bindEvent ( "div.navigation" , onMarkerUpdate , "UPDATE" ) ;
reSize ( ) ;
slider . init ( _dates ) ;
timenav . init ( _dates , data . era ) ;
VMM . bindEvent ( "div.slider" , onSliderLoaded , "LOADED" ) ;
VMM . bindEvent ( "div.navigation" , onTimeNavLoaded , "LOADED" ) ;
VMM . bindEvent ( "div.slider" , onSlideUpdate , "UPDATE" ) ;
VMM . bindEvent ( "div.navigation" , onMarkerUpdate , "UPDATE" ) ;
slider . init ( _dates ) ;
timenav . init ( _dates , data . era ) ;
// RESIZE EVENT LISTENERS
VMM . bindEvent ( global , reSize , config . events . resize ) ;
//VMM.bindEvent(global, function(e) {e.preventDefault()}, "touchmove");
}
// RESIZE EVENT LISTENERS
VMM . bindEvent ( global , reSize , config . events . resize ) ;
//VMM.bindEvent(global, function(e) {e.preventDefault()}, "touchmove");
} ;
var ie7Build = function ( ) {
trace ( "IE7 or lower" ) ;
for ( var i = 0 ; i < _dates . length ; i ++ ) {
trace ( _dates [ i ] ) ;
/ *
var st = VMM . Date . prettyDate ( data . startdate ) ;
var en = VMM . Date . prettyDate ( data . enddate ) ;
var tag = "" ;
if ( data . tag != null && data . tag != "" ) {
tag = VMM . createElement ( "span" , data . tag , "slide-tag" ) ;
}
if ( st != en ) {
c . text += VMM . createElement ( "h2" , st + " — " + en + tag , "date" ) ;
} else {
c . text += VMM . createElement ( "h2" , st + tag , "date" ) ;
}
* /
}
} ;
var updateSize = function ( ) {
trace ( "UPDATE SIZE" ) ;
config . width = VMM . Lib . width ( $timeline ) ;
@ -6880,7 +6971,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
} ,
$timenav , $content , $time , $timeintervalminor , $timeinterval , $timeintervalmajor , $timebackground ,
$timeintervalbackground , $timenavline , $timenavindicator , $timeintervalminor _minor , $toolbar , $zoomin , $zoomout ;
$timeintervalbackground , $timenavline , $timenavindicator , $timeintervalminor _minor , $toolbar , $zoomin , $zoomout , $dragslide ;
@ -6972,8 +7063,10 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
} ;
function reSize ( firstrun ) {
config . nav . contstraint . left = ( config . width / 2 ) ;
config . nav . contstraint . right = config . nav . contstraint . right _min - ( config . width / 2 ) ;
config . nav . constraint . left = ( config . width / 2 ) ;
config . nav . constraint . right = config . nav . constraint . right _min - ( config . width / 2 ) ;
$dragslide . updateConstraint ( config . nav . constraint ) ;
VMM . Lib . css ( $timenavline , "left" , Math . round ( config . width / 2 ) + 2 ) ;
VMM . Lib . css ( $timenavindicator , "left" , Math . round ( config . width / 2 ) - 8 ) ;
goToMarker ( config . current _slide , config . ease , config . duration , true , firstrun ) ;
@ -6984,7 +7077,8 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
function onZoomIn ( ) {
VMM . DragSlider . cancelSlide ( ) ;
$dragslide . cancelSlide ( ) ;
if ( config . nav . multiplier . current > config . nav . multiplier . min ) {
if ( config . nav . multiplier . current <= 1 ) {
config . nav . multiplier . current = config . nav . multiplier . current - . 25 ;
@ -7008,7 +7102,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
function onZoomOut ( ) {
VMM . DragSlider . cancelSlide ( ) ;
$dragslide . cancelSlide ( ) ;
if ( config . nav . multiplier . current < config . nav . multiplier . max ) {
if ( config . nav . multiplier . current > 4 ) {
if ( config . nav . multiplier . current > 16 ) {
@ -7028,7 +7122,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
function onBackHome ( e ) {
VMM . DragSlider . cancelSlide ( ) ;
$dragslide . cancelSlide ( ) ;
goToMarker ( 0 ) ;
upDate ( ) ;
}
@ -7060,10 +7154,10 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
// Stop from scrolling too far
scroll _to = VMM . Lib . position ( $timenav ) . left + delta ;
if ( scroll _to > config . nav . cont straint . left ) {
if ( scroll _to > config . nav . constraint . left ) {
scroll _to = config . width / 2 ;
} else if ( scroll _to < config . nav . cont straint . right ) {
scroll _to = config . nav . cont straint . right ;
} else if ( scroll _to < config . nav . constraint . right ) {
scroll _to = config . nav . constraint . right ;
}
VMM . Lib . stop ( $timenav ) ;
@ -7077,12 +7171,15 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
positionEras ( true ) ;
positionInterval ( $timeinterval , interval _array , true , true ) ;
positionInterval ( $timeintervalmajor , interval _major _array , true ) ;
config . nav . constraint . left = ( config . width / 2 ) ;
config . nav . constraint . right = config . nav . constraint . right _min - ( config . width / 2 ) ;
$dragslide . updateConstraint ( config . nav . constraint ) ;
} ;
/ * M A R K E R E V E N T S
=== === === === === === === === === === === === === === === === == * /
function onMarkerClick ( e ) {
VMM . DragSlider . cancelSlide ( ) ;
$dragslide . cancelSlide ( ) ;
goToMarker ( e . data . number ) ;
upDate ( ) ;
} ;
@ -7833,13 +7930,18 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if ( pos > config . nav . minor _width ) {
config . nav . minor _width = pos ;
//config.nav.constraint.right_min = -pos;
//config.nav.constraint.right = config.nav.constraint.right_min + (config.width/2);
}
if ( pos < config . nav . minor _left ) {
config . nav . minor _left = pos ;
config . nav . contstraint . right _min = pos ;
config . nav . contstraint . right = config . nav . contstraint . right _min - ( config . width / 2 ) ;
//config.nav.constraint.right_min = pos;
//config.nav.constraint.right = config.nav.constraint.right_min + (config.width/2);
}
}
@ -7852,6 +7954,10 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
}
}
config . nav . constraint . right _min = - ( config . nav . minor _width ) + ( config . width ) ;
config . nav . constraint . right = config . nav . constraint . right _min + ( config . width / 2 ) ;
VMM . Lib . css ( $timeintervalminor _minor , "left" , config . nav . minor _left - ( config . width ) / 2 ) ;
VMM . Lib . width ( $timeintervalminor _minor , ( config . nav . minor _width ) + ( config . width ) + Math . abs ( config . nav . minor _left ) ) ;
@ -8124,15 +8230,17 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
$toolbar . tooltip ( { selector : "div[rel=tooltip]" , placement : "right" } )
// MAKE TIMELINE TOUCHABLE
// MAKE TIMELINE DRAGGABLE/TOUCHABLE
$dragslide = new VMM . DragSlider ;
if ( VMM . Browser . device == "mobile" || VMM . Browser . device == "tablet" ) {
VMM . TouchSlider . createPanel ( $timebackground , $timenav , config . width , config . spacing , false ) ;
VMM . bindEvent ( $timenav , onTouchUpdate , "TOUCHUPDATE" ) ;
$dragslide . createPanel ( layout , $timenav , config . nav . constraint , true ) ;
} else {
VMM . DragSlider . createPanel ( layout , $timenav , config . width , config . spacing , false ) ;
$dragslide . createPanel ( layout , $timenav , config . nav . constraint ) ;
}
VMM . bindEvent ( ".zoom-in" , onZoomIn , "click" ) ;
VMM . bindEvent ( ".zoom-out" , onZoomOut , "click" ) ;
VMM . bindEvent ( layout , onMouseScroll , 'DOMMouseScroll' ) ;
@ -8428,22 +8536,16 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
Begin VMM . Timeline . DataObj . js
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * T I M E L I N E S O U R C E D A T A P R O C E S S O R
/ * T I M E L I N E S O U R C E D A T A P R O C E S S O R
=== === === === === === === === === === === === === === === === == * /
if ( typeof VMM . Timeline != 'undefined' && typeof VMM . Timeline . DataObj == 'undefined' ) {
if ( typeof VMM . Timeline !== 'undefined' && typeof VMM . Timeline . DataObj == 'undefined' ) {
VMM . Timeline . DataObj = {
data _obj : { } ,
model _array : [ ] ,
getData : function ( raw _data ) {
getData : function ( raw _data ) {
VMM . Timeline . DataObj . data _obj = { } ;
data = VMM . Timeline . DataObj . data _obj ;
VMM . fireEvent ( global , VMM . Timeline . Config . events . messege , VMM . Timeline . Config . language . messages . loading _timeline ) ;
if ( type . of ( raw _data ) == "object" ) {
trace ( "DATA SOURCE: JSON OBJECT" ) ;
VMM . Timeline . DataObj . parseJSON ( raw _data ) ;
@ -8471,7 +8573,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.DataObj == 'undefin
} ,
parseHTML : function ( d ) {
parseHTML : function ( d ) {
trace ( "parseHTML" ) ;
trace ( "WARNING: THIS IS STILL ALPHA AND WILL NOT WORK WITH ID's other than #timeline" ) ;
var _data _obj = VMM . Timeline . DataObj . data _template _obj ;