Browse Source

Added start_zoom_adjust to allow user tweaking of default zoom. See updated README documentation on how to implement. Issues #92 and #40 and #38 should be of interest.

pull/177/head
Zach Wise 13 years ago
parent
commit
a0fb7f7d90
  1. 6
      compiled/js/timeline-min.js
  2. 103
      compiled/js/timeline.js
  3. 16
      source/js/VMM.Timeline.TimeNav.js
  4. 19
      source/js/VMM.Timeline.js

6
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

103
compiled/js/timeline.js

@ -4631,37 +4631,38 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
/* SIZE SLIDES /* SIZE SLIDES
================================================== */ ================================================== */
var sizeSlides = function() { var sizeSlides = function() {
var layout_text_media = ".slider-item .layout-text-media .media .media-container "; var layout_text_media = ".slider-item .layout-text-media .media .media-container ",
var layout_media = ".slider-item .layout-media .media .media-container "; layout_media = ".slider-item .layout-media .media .media-container ",
var layout_both = ".slider-item .media .media-container"; layout_both = ".slider-item .media .media-container",
var mediasize = { layout_caption = ".slider-item .media .media-container .media-shadow .caption",
text_media: { mediasize = {
width: (config.slider.content.width/100) * 60, text_media: {
height: config.slider.height - 60, width: (config.slider.content.width/100) * 60,
video: { height: config.slider.height - 60,
width: 0, video: {
height: 0 width: 0,
height: 0
},
text: {
width: ((config.slider.content.width/100) * 40) - 30,
height: config.slider.height
}
}, },
text: { media: {
width: ((config.slider.content.width/100) * 40) - 30, width: config.slider.content.width,
height: config.slider.height height: config.slider.height - 110,
} video: {
}, width: 0,
media: { height: 0
width: config.slider.content.width, }
height: config.slider.height - 110,
video: {
width: 0,
height: 0
} }
} };
}
VMM.master_config.sizes.api.width = mediasize.media.width; VMM.master_config.sizes.api.width = mediasize.media.width;
VMM.master_config.sizes.api.height = mediasize.media.height; VMM.master_config.sizes.api.height = mediasize.media.height;
mediasize.text_media.video = VMM.Util.ratio.fit(mediasize.text_media.width, mediasize.text_media.height, 16, 9); mediasize.text_media.video = VMM.Util.ratio.fit(mediasize.text_media.width, mediasize.text_media.height, 16, 9);
mediasize.media.video = VMM.Util.ratio.fit(mediasize.media.width, mediasize.media.height, 16, 9); mediasize.media.video = VMM.Util.ratio.fit(mediasize.media.width, mediasize.media.height, 16, 9);
VMM.Lib.css(".slider-item", "width", config.slider.content.width ); VMM.Lib.css(".slider-item", "width", config.slider.content.width );
VMM.Lib.height(".slider-item", config.slider.height); VMM.Lib.height(".slider-item", config.slider.height);
@ -4775,6 +4776,10 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.Lib.width( layout_media + ".plain-text-quote", mediasize.media.width); VMM.Lib.width( layout_media + ".plain-text-quote", mediasize.media.width);
VMM.Lib.width( layout_media + ".plain-text", mediasize.media.width); VMM.Lib.width( layout_media + ".plain-text", mediasize.media.width);
// CAPTION WIDTH
VMM.Lib.css( layout_text_media + ".caption", "max-width", mediasize.text_media.video.width);
VMM.Lib.css( layout_media + ".caption", "max-width", mediasize.media.video.width);
// MAINTAINS VERTICAL CENTER IF IT CAN // MAINTAINS VERTICAL CENTER IF IT CAN
for(var i = 0; i < slides.length; i++) { for(var i = 0; i < slides.length; i++) {
@ -4896,7 +4901,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.Lib.css(".slider", "overflow-y", "scroll" ); VMM.Lib.css(".slider", "overflow-y", "scroll" );
} else { } else {
VMM.Lib.css(layout, "overflow-y", "hidden" ); VMM.Lib.css(layout, "overflow-y", "hidden" );
VMM.Lib.animate(layout, _duration, _ease, {scrollTop: VMM.Lib.prop(layout, "scrollHeight") - VMM.Lib.height(layout) }); var scroll_height = 0;
try {
scroll_height = VMM.Lib.prop(layout, "scrollHeight");
VMM.Lib.animate(layout, _duration, _ease, {scrollTop: scroll_height - VMM.Lib.height(layout) });
}
catch(err) {
scroll_height = VMM.Lib.height(layout);
}
} }
preloadSlides(); preloadSlides();
@ -6421,6 +6433,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
hash_bookmark: false, hash_bookmark: false,
start_at_end: false, start_at_end: false,
start_at_slide: 0, start_at_slide: 0,
start_zoom_adjust: 0,
start_page: false, start_page: false,
api_keys: { api_keys: {
google: "", google: "",
@ -6449,6 +6462,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
right_min: 0, right_min: 0,
right_max: 0 right_max: 0
}, },
zoom: {
adjust: 0
},
multiplier: { multiplier: {
current: 6, current: 6,
min: .1, min: .1,
@ -6536,13 +6552,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
} }
} }
config.nav.width = config.width; config.nav.width = config.width;
config.nav.height = 200; config.nav.height = 200;
config.feature.width = config.width; config.feature.width = config.width;
config.feature.height = config.height - config.nav.height; config.feature.height = config.height - config.nav.height;
VMM.Timeline.Config = config; config.nav.zoom.adjust = parseInt(config.start_zoom_adjust, 10);
VMM.master_config.Timeline = VMM.Timeline.Config; VMM.Timeline.Config = config;
this.events = config.events; VMM.master_config.Timeline = VMM.Timeline.Config;
this.events = config.events;
} }
/* CREATE TIMELINE STRUCTURE /* CREATE TIMELINE STRUCTURE
@ -7283,10 +7300,11 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
for(var i = 0; i < temp_multiplier; i++) { for(var i = 0; i < temp_multiplier; i++) {
if (averageMarkerPositionDistance() < 75) { if (averageMarkerPositionDistance() < 75) {
if (config.nav.multiplier.current > 1) { if (config.nav.multiplier.current > 1) {
config.nav.multiplier.current = config.nav.multiplier.current - 1; config.nav.multiplier.current = (config.nav.multiplier.current - 1);
} }
} }
} }
} }
var calculateInterval = function() { var calculateInterval = function() {
@ -8252,6 +8270,19 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
reSize(true); reSize(true);
// USER CONFIGURABLE ADJUSTMENT TO DEFAULT ZOOM
if (config.nav.zoom.adjust != 0) {
if (config.nav.zoom.adjust < 0) {
for(var i = 0; i < Math.abs(config.nav.zoom.adjust); i++) {
onZoomOut();
}
} else {
for(var j = 0; j < config.nav.zoom.adjust; j++) {
onZoomIn();
}
}
}
}; };
var buildInterval = function() { var buildInterval = function() {

16
source/js/VMM.Timeline.TimeNav.js

@ -343,10 +343,11 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
for(var i = 0; i < temp_multiplier; i++) { for(var i = 0; i < temp_multiplier; i++) {
if (averageMarkerPositionDistance() < 75) { if (averageMarkerPositionDistance() < 75) {
if (config.nav.multiplier.current > 1) { if (config.nav.multiplier.current > 1) {
config.nav.multiplier.current = config.nav.multiplier.current - 1; config.nav.multiplier.current = (config.nav.multiplier.current - 1);
} }
} }
} }
} }
var calculateInterval = function() { var calculateInterval = function() {
@ -1312,6 +1313,19 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
reSize(true); reSize(true);
// USER CONFIGURABLE ADJUSTMENT TO DEFAULT ZOOM
if (config.nav.zoom.adjust != 0) {
if (config.nav.zoom.adjust < 0) {
for(var i = 0; i < Math.abs(config.nav.zoom.adjust); i++) {
onZoomOut();
}
} else {
for(var j = 0; j < config.nav.zoom.adjust; j++) {
onZoomIn();
}
}
}
}; };
var buildInterval = function() { var buildInterval = function() {

19
source/js/VMM.Timeline.js

@ -104,6 +104,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
hash_bookmark: false, hash_bookmark: false,
start_at_end: false, start_at_end: false,
start_at_slide: 0, start_at_slide: 0,
start_zoom_adjust: 0,
start_page: false, start_page: false,
api_keys: { api_keys: {
google: "", google: "",
@ -132,6 +133,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
right_min: 0, right_min: 0,
right_max: 0 right_max: 0
}, },
zoom: {
adjust: 0
},
multiplier: { multiplier: {
current: 6, current: 6,
min: .1, min: .1,
@ -219,13 +223,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
} }
} }
config.nav.width = config.width; config.nav.width = config.width;
config.nav.height = 200; config.nav.height = 200;
config.feature.width = config.width; config.feature.width = config.width;
config.feature.height = config.height - config.nav.height; config.feature.height = config.height - config.nav.height;
VMM.Timeline.Config = config; config.nav.zoom.adjust = parseInt(config.start_zoom_adjust, 10);
VMM.master_config.Timeline = VMM.Timeline.Config; VMM.Timeline.Config = config;
this.events = config.events; VMM.master_config.Timeline = VMM.Timeline.Config;
this.events = config.events;
} }
/* CREATE TIMELINE STRUCTURE /* CREATE TIMELINE STRUCTURE

Loading…
Cancel
Save