', { 'class': id.navigation }).appendTo(gallery);
scrollbox = setupThumbs(navigation);
thumbs = scrollbox.find('.cont a');
controls = setupControls(navigation);
if ( !settings.thumbsOn ) {
navigation.css('top', -scrollbox.outerHeight() - 10);
}
// Show / hide the control strip on mouse move
scrollbox.mouseenter(function() {
fadeCtrl();
smo = true;
}).mouseleave(function() {
smo = false;
});
controls.mouseenter(function() {
cmo = true;
$(this).stop(true, false).fadeTo(200, 1.0);
}).mouseleave(function() {
cmo = false;
$(this).stop(true, false).fadeTo(200, 0.7);
});
var mly = 0, mlx = 0;
if ( !$.support.touch ) {
gallery.mousemove(function(e) {
if (!smo && ((mly - e.clientY) || (mlx - e.clientX))) {
showCtrl();
mlx = e.clientX;
mly = e.clientY;
}
});
}
// Collect all coordinates for the map
if ( settings.mapAll ) {
var c, i, m, t;
images.each(function(i) {
c = $(this).find('img:first');
if ( c.length && (m = c.data('map')) && (m = getLatLng(m)) ) {
t = getLabel(c);
markers.push({
map: m,
label: (i + 1) + (t? (': ' + t.stripHTML()) : ''),
link: $(this)
});
}
});
}
// Installing keyboard listener
if ( !$.support.touch && ($.isFunction(settings.enableKeyboard) || settings.enableKeyboard) ) {
$(document).keydown(keyhandler);
}
// Jumping to the hash image
if ( settings.hash && settings.hash !== 'no' ) {
$.history.init(function(hash) {
if ( hash && hash.length ) {
var n = (settings.hash === 'number')? ((parseInt( hash ) || 1) - 1) : findImg( hash );
//log('history: ' + n);
showImg( n );
settings.slideshowAuto = false;
} else {
backToIndex();
if ( $.browser.msie ) {
setTimeout(function() {
$('[role=main]').show();
$('.folders>ul>li').equalHeight();
$('[role=scroll]').trigger('adjust');
}, 10 );
}
}
});
}
setActive( curr );
// Starting slideshow
if ( settings.slideshowAuto ) {
showImg( curr );
startAuto();
} else if ( settings.skipIndex ) {
showImg( curr );
}
$(window).resize(function() {
clearTimeout(rto);
rto = setTimeout(function() {
var rw = $(window).width(), rh = $(window).height();
if (rw !== rlw || rh !== rlh) {
recenter();
rlw = rw;
rlh = rh;
}
}, 100);
});
});
};
$.fn.turtleGallery.defaults = {
hash: 'fileName', // Hash type: 'no' || 'number' || 'fileName'
resPath: '', // relative path to '/res' folder
relPath: '', // relative path from '/res' back to current folder
level: 0, // gallery level (0 = top level)
skipIndex: false, // skip the index (thumbnail) page and goes straight to gallery
speed: 600, // picture transition speed
transitions: true, // Use transitions?
preScale: 0.95, // size of the image before the transitions starts
slideshowDelay: 3000, // slideshow delay 3 s
slideshowLoop: false, // automatically starts over
slideshowAuto: false, // automatically starts with the first image
markNewDays: 30, // : days passed by considered a picture is 'new'
askAtLast: true, // Asks what to do rolling over the last image
infoOn: true, // Show the captions by default?
thumbsOn: false, // Show the thumbnail scroller by default?
fitImage: true, // Fit the images to window size by default or use 1:1?
fitShrinkonly: true, // Fit only by shrinking (no enlarging)
fitFreespace: true, // Fit only the space below the thumbnail scroller
fitPadding: 15, // Distance from the window border
borderWidth: 10, // Image border width
rightClickProtect: false, // No right-click menu on main images
metaOn: false, // Show Metadatas by default?
mapOn: false, // : Map?
shopOn: false, // : Shopping panel?
shareOn: false, // : Sharing panel?
printOn: false, // : Printing panel?
enableKeyboard: true, // Enable keyboard controls?
enableMouseWheel: true, // Enable mouse wheel?
numberLinks: false, // Use #1 or #IMG_0001.JPG as internal links?
videoAuto: true, // Automatic play of videos
videoFit: true, // Stretch to player size
videoWidth: 640, // Video player size
videoHeight: 480,
controlbarHeight: 24,
help: '
{0}
- 1{5}
- 2{6}
- 3{7}
- 4{8}
- 5{9}
- 6{10}
- 7{11}
{12}
',
helpgall: '
{0}
- 1{5}
- 2{1}
- 3{7}
- 4{8}
- 5{9}
- 6{10}
- 7{11}
{12}
'
};
$.fn.turtleGallery.texts = {
startSlideshow: 'Start slideshow',
close: 'Close',
atLastPage: 'At last page',
atLastPageQuestion: 'Where to go next?',
startOver: 'Start over',
backToHome: 'Back to home',
stop: 'Stop',
upOneLevel: 'Up one level',
backToIndex: 'Back to index page',
previousPicture: 'Previous picture',
nextPicture: 'Next picture',
oneToOneSize: '1:1 size',
fitToScreen: 'Fit to screen',
showInfo: 'Show caption / info',
hideInfo: 'Hide caption / info',
showThumbs: 'Show thumbnails',
hideThumbs: 'Hide thumbnails',
startAutoplay: 'Start autoplay',
stopAutoplay: 'Stop autoplay',
closeWindow: 'Close window',
clickToOpen: 'Click to open this document with the associated viewer',
download: 'Download',
original: 'Original',
hiRes: 'Hi res.',
saveTip: 'Use Right click -> Save link as... to download',
metaBtn: 'Photo data',
metaLabel: 'Display photograpic (Exif/Iptc) data',
mapBtn: 'Map',
mapLabel: 'Show the photo location on map',
shopBtn: 'Buy',
shopLabel: 'Show options to buy this item',
shareBtn: 'Share',
shareLabel: 'Share this photo over social sites',
help: [
'Using Turtle gallery',
'Up one level
Up arrow',
'Share album over social sites',
'Start slideshow
Numpad *',
'Author / Company info',
'Previous image
Left arrow',
'Back to index page
Esc',
'Toggle zoom (fit/1:1)
Numpad +',
'Toggle info window
Numpad -',
'Toggle thumbnail scoller',
'Start / Stop slideshow
Numpad *',
'Next image
Right arrow',
'Swipe for previous / next image'
]
};
$.fn.turtleGallery.ids = { // Class names and data- id's
gallery: 'gallery', // The container for gallery
navigation: 'navigation', // Navigation at top
scrollbox: 'scrollbox', // Thumbnail scroller box
active: 'active', // active state
parent: 'parent', // up link
bottom: 'bottom', // bottom section
img: 'img', // one image
main: 'main', // the main image class
video: 'video', // video class
audio: 'audio', // audio class
other: 'other', // other file panel class
wait: 'wait', // wait animation
cont: 'cont', // inside containers generated by the script
panel: 'panel', // general panel on the bottom
icon: 'icon', // icon container
caption: 'caption', // caption markup
meta: 'meta', // metadata container / also the name of data attr
map: 'map', // map container class
mapcont: 'mapcont', // map inside wrapper
mapid: 'mapid', // map marker unique id
shop: 'shop', // shop container class
share: 'share', // share container class
print: 'print', // print container class
comment: 'comment', // commenting container class
link: 'link', // link to original / hi res.
isoriginal: 'isoriginal', // link points to original or hi res.?
width: 'width', // width attribute
height: 'height', // herght attribute
src: 'src', // source link
isvideo: 'isvideo', // is video attr
isaudio: 'isaudio', // is audio attr
isother: 'isother', // is other attr
modified: 'modified', // modified x days ago attr
startBtn: 'startbtn', // Start button class
startTxt: 'starttxt', // Start text class
prev: 'prev', // control strip classes
next: 'next',
up: 'up',
noresize: 'noresize',
resize: 'resize',
hideInfo: 'hideinfo',
showInfo: 'showinfo',
hideThumbs: 'hidethumbs',
showThumbs: 'showthumbs',
play: 'play',
pause: 'pause',
help: 'helpbtn',
newItem: 'newlabel',
showHint: 'showhint'
};
})(jQuery);