';
+ newElt[newEltIdx++] = ThumbnailBuildStacks(bg) + '
';
// image size
@@ -4794,7 +5202,7 @@
var bgSize = 'contain';
if( G.tn.opt.Get('crop') ) {
- bgSize = 'cover';
+ bgSize = 'cover'; // thumbnail image will be cropped to fit in the thumbnail (no black border)
}
// ##### layer for image background (color, dominant color, blurred preview)
@@ -4940,9 +5348,11 @@
toolbar += ' ';
cnt++;
break;
- case 'CART':
+ case 'SHOPPINGCART':
toolbar += '
';
- toolbar += ' ' + G.O.icons.thumbnailCart + '
';
+ // toolbar += ' ' + G.O.icons.thumbnailShoppingcart + '
';
+ toolbar += ThumbnailBuildToolbarOneCart( item );
+
toolbar += ' ';
cnt++;
break;
@@ -5003,6 +5413,33 @@
}
}
+ // CART ICON AND COUNTER
+ function ThumbnailBuildToolbarOneCart( item ) {
+ var q = 0;
+
+ var id = item.GetID()
+ for( var i=0; i
' + G.O.icons.thumbnailShoppingcart + q + '';
+ }
+ function ThumbnailBuildToolbarOneCartUpdate( item ) {
+ var $e = item.$elt;
+
+ if( $e != null ) {
+ var $q = $e.find('*[data-ngy2action="SHOPPINGCART"]');
+ if( $q !== undefined ) {
+ $q.html( ThumbnailBuildToolbarOneCart( item ) );
+ }
+ }
+ }
+
function getThumbnailTitle( item ) {
var sTitle = item.title;
@@ -5063,7 +5500,7 @@
nbMaxTn = Math.floor((areaWidth)/(tnW));
}
else {
- nbMaxTn = Math.floor((areaWidth + G.tn.opt.Get('gutterWidth'))/(tnW + G.tn.opt.Get('gutterWidth')));
+ nbMaxTn = Math.floor((areaWidth + G.tn.settings.GetResponsive('gutterWidth'))/(tnW + G.tn.settings.GetResponsive('gutterWidth')));
}
if( G.O.maxItemsPerLine >0 && nbMaxTn > G.O.maxItemsPerLine ) {
@@ -5197,11 +5634,17 @@
oTo = { opacity: 1, translateY: 0, rotateX: 0 };
break;
case 'SLIDEUP2':
- var f=G.tn.opt.Get('displayTransitionStartVal');
+ var f = G.tn.opt.Get('displayTransitionStartVal');
if( f == 0 ) { f=100; } // default value
oFrom = { opacity: 0, translateY: f, rotateY: 40 };
oTo = { opacity: 1, translateY: 0, rotateY: 0 };
break;
+ case 'IMAGESLIDEUP':
+ var f = G.tn.opt.Get('displayTransitionStartVal');
+ if( f == 0 ) { f=100; } // default value
+ oFrom = { opacity: 0, top: '100%' };
+ oTo = { opacity: 1, top: '0%' };
+ break;
case 'SLIDEDOWN2':
var f=G.tn.opt.Get('displayTransitionStartVal');
if( f == 0 ) { f=-100; } // default value
@@ -5284,6 +5727,10 @@
att.item.CSSTransformSet('.nGY2GThumbnail', 'rotateY', state.rotateY + 'deg');
att.item.CSSTransformApply('.nGY2GThumbnail');
break;
+ case 'IMAGESLIDEUP':
+ att.item.$elt.css('opacity', state.opacity);
+ att.item.$Elts['.nGY2GThumbnailImage'].css('top', state.top);
+ break;
case 'SLIDEDOWN2':
att.item.$elt.css('opacity', state.opacity);
att.item.CSSTransformSet('.nGY2GThumbnail', 'translate', '0px, ' + state.translateY + 'px');
@@ -5323,34 +5770,24 @@
att.item.CSSTransformSet('.nGY2GThumbnail', 'scale', state.scale);
att.item.CSSTransformApply('.nGY2GThumbnail');
break;
- case 'SLIDEUP':
- att.item.$elt.css('opacity', '');
- break;
- case 'SLIDEDOWN':
- att.item.$elt.css('opacity', '');
- break;
- case 'FLIPUP':
- att.item.$elt.css('opacity', '');
- break;
- case 'FLIPDOWN':
- att.item.$elt.css('opacity', '');
- break;
- case 'SLIDEUP2':
+ case 'IMAGESLIDEUP':
att.item.$elt.css('opacity', '');
+ att.item.$Elts['.nGY2GThumbnailImage'].css('top', 0);
break;
case 'SLIDEDOWN2':
att.item.$elt.css('opacity', '');
att.item.CSSTransformApply('.nGY2GThumbnail');
break;
- case 'SLIDERIGHT':
+ default :
+ // case 'SLIDEUP':
+ // case 'SLIDEDOWN':
+ // case 'FLIPUP':
+ // case 'FLIPDOWN':
+ // case 'SLIDEUP2':
+ // case 'SLIDERIGHT':
+ // case 'SLIDELEFT':
+ // case 'FADEIN':
att.item.$elt.css('opacity', '');
- break;
- case 'SLIDELEFT':
- att.item.$elt.css('opacity', '');
- break;
- case 'FADEIN':
- att.$e.css('opacity', '');
- break;
}
ThumbnailAppearFinish(att.item);
});
@@ -5442,7 +5879,7 @@
}
// build initialization
- var inits = G.tn.buildInit.get();
+ var inits = G.tn.buildInit.get();
for( var j = 0; j < inits.length; j++) {
switch( inits[j].property ) {
// CSS Transform
@@ -5460,9 +5897,9 @@
case 'blur':
case 'brightness':
case 'grayscale':
- case 'sepia':
- case 'contrast':
- case 'opacity':
+ case 'sepia':
+ case 'contrast':
+ case 'opacity':
case 'saturate':
item.CSSFilterSet(inits[j].element, inits[j].property, inits[j].value);
item.CSSFilterApply(inits[j].element);
@@ -5475,7 +5912,7 @@
}
// hover
- var effects = G.tn.hoverEffects.get();
+ var effects = G.tn.hoverEffects.get();
for( var j = 0; j < effects.length; j++) {
if( effects[j].firstKeyframe === true ) {
switch( effects[j].type ) {
@@ -5493,9 +5930,9 @@
case 'brightness':
case 'grayscale':
case 'sepia':
- case 'contrast':
- case 'opacity':
- case 'saturate':
+ case 'contrast':
+ case 'opacity':
+ case 'saturate':
item.CSSFilterSet(effects[j].element, effects[j].type, effects[j].from);
item.CSSFilterApply(effects[j].element);
break;
@@ -5797,7 +6234,7 @@
GetContentApiObject();
}
else {
- if( G.O.$markup.length > 0 ) {
+ if( G.O.$markup.length > 0 ) {
// data defined as markup (href elements)
GetContentMarkup( G.O.$markup );
G.O.$markup=[] ;
@@ -5860,22 +6297,6 @@
thumbsrc = src;
}
- var thumbsrcX2 = '';
- if( item.srct2x !== undefined && item.srct2x.length > 0 ) {
- thumbsrcX2 = item.srct2x;
- if( !StartsWithProtocol(thumbsrcX2) ) {
- thumbsrcX2 = G.O.itemsBaseURL + thumbsrcX2;
- }
- }
- else {
- if( thumbsrc != '' ) {
- thumbsrcX2 = thumbsrc;
- }
- else {
- thumbsrcX2 = src;
- }
- }
-
if( G.O.thumbnailLabel.get('title') != '' ) {
title = GetImageTitle(src);
}
@@ -6020,7 +6441,7 @@
if( fu !== null ) {
typeof fu == 'function' ? fu(newItem, 'api', item) : window[fu](newItem, 'api', item);
}
-
+
AlbumPostProcess(albumID);
});
@@ -6029,19 +6450,37 @@
}
+
+ // Returns the text of the DOM element (without children)
+ // Because jQuery().text() returns the text of all children
+ function ElementGetText( element ) {
+
+ var text = '';
+ if( element.childNodes[0] !== undefined ) {
+ if( element.childNodes[0].nodeValue !== null && element.childNodes[0].nodeValue !== undefined ) {
+ text = element.childNodes[0].nodeValue.trim();
+ }
+ }
+ return text;
+ }
- function GetContentMarkup( $elements ) {
+ // Extract items from the jQuery elements
+ function GetContentMarkup( $elements, group ) {
var foundAlbumID = false;
var nbTitles = 0;
var AlbumPostProcess = NGY2Tools.AlbumPostProcess.bind(G);
+ var GetImageTitleFromURL = NGY2Tools.GetImageTitleFromURL.bind(G);
G.I[0].contentIsLoaded = true;
jQuery.each($elements, function(i, item){
+
+ // compare to group defined on the element that has been clicked (lightbox standalone)
+ if( item.dataset.nanogallery2Lgroup != group ) { return; }
// create dictionnary with all data attribute name in lowercase (to be case unsensitive)
var data = {
- // some default values
+ // all possible data attributes with some default values
'data-ngdesc': '', // item description
'data-ngid': null, // ID
'data-ngkind': 'image', // kind (image, album, albumup)
@@ -6060,50 +6499,85 @@
'data-ngexifexposure': '',
'data-ngexifiso': '',
'data-ngexiftime': '',
- 'data-ngexiflocation': ''
+ 'data-ngexiflocation': '',
+ 'data-ngsrc': '',
+ 'alt': ''
};
+
+ // Extract data attributes from main item
[].forEach.call( item.attributes, function(attr) {
- data[attr.name.toLowerCase()] = attr.value;
+ data[attr.name.toLowerCase()] = attr.value.trim();
});
- // responsive image source
+ var title = ElementGetText(item);
+ if( title == '' && data.alt != '') {
+ // no title -> check ALT attribute of main element
+ title = data['alt'];
+ }
+
+ // Complete with data attributes from all children
+ jQuery.each($(item).children(), function(i, sub_item){
+
+ // title may be set on a child element
+ if( title == '' ) {
+ title = ElementGetText(sub_item);
+ }
+
+ [].forEach.call( sub_item.attributes, function(attr) {
+ data[attr.name.toLowerCase()] = attr.value.trim();
+ });
+
+ if( title == '' && data.alt != '') {
+ // no title -> check ALT attribute of sub element
+ title = data['alt'];
+ }
+
+ });
+
+ // BIG IMAGE URL
+ // responsive image URL
var src = '',
st = RetrieveCurWidth().toUpperCase();
if( data.hasOwnProperty('data-ngsrc'+st) ) {
src = data['data-ngsrc'+st];
}
- if( src == '' ) {
- src = data['href'];
- }
- if( !StartsWithProtocol(src) ) {
+ // image URL from data-ngsrc attribute
+ // if( src == '' ) {
+ // src = data['data-ngsrc'];
+ // }
+ // image URL from href attribute (a element)
+ // if( src == '' ) {
+ // src = data['href'];
+ // }
+ src = src || data['data-ngsrc'] || data['href'];
+ if( !StartsWithProtocol(src) ) { // do not add the base URL if src starts with a protocol (http, https...)
src = G.O.itemsBaseURL + src;
}
- // thumbnail
+
+ // THUMBNAIL IMAGE
var thumbsrc = '';
- if( data.hasOwnProperty('data-ngthumb') ) {
- thumbsrc = data['data-ngthumb'];
- if( !StartsWithProtocol(thumbsrc) ) {
- thumbsrc = G.O.itemsBaseURL + thumbsrc;
- }
+ // src attribute (img element)
+ if( data.hasOwnProperty('src') ) {
+ thumbsrc = data['src'];
}
- else {
- thumbsrc = src;
+ // data-ngthumb attribute
+ if( thumbsrc == '' && data.hasOwnProperty('data-ngthumb') ) {
+ thumbsrc = data['data-ngthumb'];
}
- var thumbsrcX2 = '';
- if( data.hasOwnProperty('data-ngthumb2x') ) {
- thumbsrcX2 = data['data-ngthumb2x'];
- if( !StartsWithProtocol(thumbsrcX2) ) {
- thumbsrcX2 = G.O.itemsBaseURL + thumbsrcX2;
- }
+ if( thumbsrc == '' ) {
+ thumbsrc = src; // no thumbnail image URL -> use big image URL
}
-
+ if( !StartsWithProtocol(thumbsrc) ) {
+ thumbsrc = G.O.itemsBaseURL + thumbsrc;
+ }
+
//newObj.description=jQuery(item).attr('data-ngdesc');
var description = data['data-ngdesc'];
- var ID = data['id'];
- if( ID == undefined ) {
- ID = data['data-ngid'];
- }
+ var ID = data['id'] || data['data-ngid'];
+ // if( ID == undefined ) {
+ // ID = data['data-ngid'];
+ // }
var kind = data['data-ngkind'];
var tags = data['data-ngtags'];
@@ -6112,10 +6586,11 @@
albumID = data['data-ngalbumid'];
foundAlbumID = true;
}
-
- var title = jQuery(item).text();
- if( !(G.O.thumbnailLabel.get('title') == '' || G.O.thumbnailLabel.get('title') == undefined) ) {
- title = GetImageTitle(src);
+
+ // var title = jQuery(item).text();
+ var title_from_url = GetImageTitleFromURL( src );
+ if( title_from_url != '' ) {
+ title = title_from_url;
}
@@ -6128,7 +6603,7 @@
newItem.setMediaURL( src, 'img');
// manage media kinds other than IMG
- newItem.mediaKind = 'img';
+ // newItem.mediaKind = 'img';
jQuery.each(mediaList, function ( n, media ) {
var id = media.getID(src);
if( id != null ) {
@@ -6141,7 +6616,7 @@
});
- // image size
+ // Big image size
newItem.imageWidth = parseInt( data['data-ngimagewidth'] );
newItem.imageHeight = parseInt( data['data-ngimageheight'] );
@@ -6154,7 +6629,7 @@
height: { l1 : { xs: th, sm: th, me: th, la: th, xl: th }, lN : { xs: th, sm: th, me: th, la: th, xl: th } }
};
- // default media type -> IMG
+ // Media type -> IMG
if( newItem.mediaKind == 'img' ) {
// responsive thumbnails URL and size
@@ -6211,15 +6686,15 @@
// Exif - location
newItem.exif.location=data['data-ngexiflocation'];
- newItem.contentIsLoaded=true;
+ newItem.contentIsLoaded = true;
// custom data
if( jQuery(item).data('customdata') !== undefined ) {
- newItem.customData=cloneJSObject(jQuery(item).data('customdata'));
+ newItem.customData = cloneJSObject(jQuery(item).data('customdata'));
}
// custom data
if( jQuery(item).data('ngcustomdata') !== undefined ) {
- newItem.customData=cloneJSObject(jQuery(item).data('ngcustomdata'));
+ newItem.customData = cloneJSObject(jQuery(item).data('ngcustomdata'));
}
var fu=G.O.fnProcessData;
@@ -6233,7 +6708,7 @@
// if( foundAlbumID ) { G.O.displayBreadcrumb=true; }
if( nbTitles == 0 ) { G.O.thumbnailLabel.display = false; }
-
+
}
@@ -6265,6 +6740,34 @@
}
}
+ // convert label settings
+ if( G.O.thumbnailLabel.position == 'overImageOnBottom' ) {
+ G.O.thumbnailLabel.valign = 'bottom';
+ G.O.thumbnailLabel.position == 'overImage';
+ }
+ if( G.O.thumbnailLabel.position == 'overImageOnMiddle' ) {
+ G.O.thumbnailLabel.valign = 'middle';
+ G.O.thumbnailLabel.position == 'overImage';
+ }
+ if( G.O.thumbnailLabel.position == 'overImageOnTop' ) {
+ G.O.thumbnailLabel.valign = 'top';
+ G.O.thumbnailLabel.position == 'overImage';
+ }
+ if( G.O.thumbnailL1Label !== undefined && G.O.thumbnailL1Label.position !== undefined ) {
+ if( G.O.thumbnailL1Label.position == 'overImageOnBottom' ) {
+ G.O.thumbnailL1Label.valign = 'bottom';
+ G.O.thumbnailL1Label.position == 'overImage';
+ }
+ if( G.O.thumbnailL1Label.position == 'overImageOnMiddle' ) {
+ G.O.thumbnailL1Label.valign = 'middle';
+ G.O.thumbnailL1Label.position == 'overImage';
+ }
+ if( G.O.thumbnailL1Label.position == 'overImageOnTop' ) {
+ G.O.thumbnailL1Label.valign = 'top';
+ G.O.thumbnailL1Label.position == 'overImage';
+ }
+ }
+
// thumbnails label - level dependant settings
G.O.thumbnailLabel.get = function( opt ) {
if( G.GOM.curNavLevel == 'l1' && G.O.thumbnailL1Label !== undefined && G.O.thumbnailL1Label[opt] !== undefined ) {
@@ -6283,8 +6786,8 @@
}
};
- if( G.O.blackList != '' ) { G.blackList=G.O.blackList.toUpperCase().split('|'); }
- if( G.O.whiteList != '' ) { G.whiteList=G.O.whiteList.toUpperCase().split('|'); }
+ if( G.O.blockList != '' ) { G.blockList = G.O.blockList.toUpperCase().split('|'); }
+ if( G.O.allowList != '' ) { G.allowList = G.O.allowList.toUpperCase().split('|'); }
if( G.O.albumList2 !== undefined && G.O.albumList2 !== null && G.O.albumList2.constructor === Array ) {
var l=G.O.albumList2.length;
@@ -6304,10 +6807,10 @@
function ThumbnailOpt( lN, l1, opt) {
- G.tn.opt.lN[opt]=G.O[lN];
- G.tn.opt.l1[opt]=G.O[lN];
+ G.tn.opt.lN[opt] = G.O[lN];
+ G.tn.opt.l1[opt] = G.O[lN];
if( toType(G.O[l1]) == 'number' ) {
- G.tn.opt.l1[opt]=G.O[l1];
+ G.tn.opt.l1[opt] = G.O[l1];
}
}
// thumbnail stacks
@@ -6327,12 +6830,68 @@
// thumbnail stacks scale
ThumbnailOpt('thumbnailStacksScale', 'thumbnailL1StacksScale', 'stacksScale');
// thumbnail gutter width
- ThumbnailOpt('thumbnailGutterWidth', 'thumbnailL1GutterWidth', 'gutterWidth');
+ // ThumbnailOpt('thumbnailGutterWidth', 'thumbnailL1GutterWidth', 'gutterWidth');
// thumbnail gutter height
- ThumbnailOpt('thumbnailGutterHeight', 'thumbnailL1GutterHeight', 'gutterHeight');
+ // ThumbnailOpt('thumbnailGutterHeight', 'thumbnailL1GutterHeight', 'gutterHeight');
+ // thumbnail border horizontal
+ ThumbnailOpt('thumbnailBorderHorizontal', 'thumbnailL1BorderHorizontal', 'borderHorizontal');
+ // thumbnail border vertical
+ ThumbnailOpt('thumbnailBorderVertical', 'thumbnailL1BorderVertical', 'borderVertical');
// thumbnail grid base height (for cascading layout)
ThumbnailOpt('thumbnailBaseGridHeight', 'thumbnailL1BaseGridHeight', 'baseGridHeight');
+
+ // Set same value to all widths
+ function ResponsiveSetSize( setting, level, v ) {
+ G.tn.settings[setting][level]['xs'] = v;
+ G.tn.settings[setting][level]['sm'] = v;
+ G.tn.settings[setting][level]['me'] = v;
+ G.tn.settings[setting][level]['la'] = v;
+ G.tn.settings[setting][level]['xl'] = v;
+ }
+
+ // Get and evaluate responsive values from one option
+ // Responsive is with syntax: n XSn1 SMn2 MEn3 LAn4 XLn5 (where n is the default value)
+ // Value 'auto' is accepted for all options, but is handeld only for thumbnail width/height
+ function ResponsiveOption( option, setting, level ) {
+ var v = G.O[option];
+
+ if( v === undefined || v === null ) { return; }
+
+ // if( toType(v) == 'number' ) {
+ if( toType(v) == 'number' || v.indexOf(' ') == -1 ) {
+ // set value for all widths
+ var vn = 'auto';
+ if( v != 'auto' ) { vn = parseInt(v); }
+ ResponsiveSetSize( setting, level, vn );
+ }
+ else {
+ var sp = v.split(' ');
+ if( sp.length > 0 && +sp[0] === +sp[0] ) { // check if sp[0] is a number
+ // first value is the default size for all widths
+ var vn = 'auto';
+ if( sp[0] != 'auto' ) { vn = parseInt(sp[0]); }
+ ResponsiveSetSize( setting, level, vn );
+ }
+ for( var i = 1; i < sp.length; i++ ) {
+ if( /^xs|sm|me|la|xl/i.test( sp[i] ) ) { // regex: i ignores the case and ^ means "starts with"
+ var wi = sp[i].substring(0, 2).toLowerCase();
+ var va = sp[i].substring(2);
+ var vn = 'auto';
+ if( va != 'auto' ) { vn = parseInt(va); }
+ G.tn.settings[setting][level][wi] = vn;
+ }
+ }
+ }
+ }
+
+ ResponsiveOption('thumbnailGutterWidth', 'gutterWidth', 'lN');
+ ResponsiveOption('thumbnailGutterWidth', 'gutterWidth', 'l1'); // set default values for first level
+ ResponsiveOption('thumbnailL1GutterWidth', 'gutterWidth', 'l1');
+ ResponsiveOption('thumbnailGutterHeight', 'gutterHeight', 'lN');
+ ResponsiveOption('thumbnailGutterHeight', 'gutterHeight', 'l1'); // set default values for first level
+ ResponsiveOption('thumbnailL1GutterHeight', 'gutterHeight', 'l1');
+
// gallery display mode
G.galleryDisplayMode.lN = G.O.galleryDisplayMode.toUpperCase();
G.galleryDisplayMode.l1 = G.O.galleryL1DisplayMode != null ? G.O.galleryL1DisplayMode.toUpperCase() : G.O.galleryDisplayMode.toUpperCase();
@@ -6364,6 +6923,10 @@
// gallery filter tags
G.galleryFilterTags.lN = G.O.galleryFilterTags;
G.galleryFilterTags.l1 = G.O.galleryL1FilterTags != null ? G.O.galleryL1FilterTags : G.O.galleryFilterTags;
+
+ // gallery filter tags mode
+ G.galleryFilterTagsMode.lN = G.O.galleryFilterTagsMode;
+ G.galleryFilterTagsMode.l1 = G.O.galleryL1FilterTagsMode != null ? G.O.galleryL1FilterTagsMode : G.O.galleryFilterTagsMode;
// gallery pagination
G.O.galleryPaginationMode = G.O.galleryPaginationMode.toUpperCase();
@@ -6387,14 +6950,18 @@
}
}
- if( G.O.fnThumbnailDisplayEffect !== '' ) {
- G.tn.opt.lN.displayTransition = 'CUSTOM';
- G.tn.opt.l1.displayTransition = 'CUSTOM';
- }
- if( G.O.fnThumbnailL1DisplayEffect !== '' ) {
+ if( G.O.fnThumbnailDisplayEffect !== '' ) {
+ G.tn.opt.lN.displayTransition = 'CUSTOM';
+ G.tn.opt.l1.displayTransition = 'CUSTOM';
+ }
+ if( G.O.fnThumbnailL1DisplayEffect !== '' ) {
G.tn.opt.l1.displayTransition = 'CUSTOM';
}
+
+ // thumbnail display transition easing
+ // set default easing
+ ThumbnailOpt('thumbnailDisplayTransitionEasing', 'thumbnailL1DisplayTransitionEasing', 'displayTransitionEasing');
// parse thumbnail display transition
function thumbnailDisplayTransitionParse( cfg, level ) {
if( typeof cfg == 'string' ) {
@@ -6422,6 +6989,8 @@
ThumbnailOpt('thumbnailDisplayTransitionDuration', 'thumbnailL1DisplayTransitionDuration', 'displayTransitionDuration');
// thumbnail display transition interval duration
ThumbnailOpt('thumbnailDisplayInterval', 'thumbnailL1DisplayInterval', 'displayInterval');
+ // thumbnail display order
+ ThumbnailOpt('thumbnailDisplayOrder', 'thumbnailL1DisplayOrder', 'displayOrder');
// resolution breakpoints --> convert old syntax to new one
@@ -6433,7 +7002,7 @@
// THUMBNAIL BUILD INIT
//level 1
if( G.O.thumbnailL1BuildInit2 !== undefined ) {
- var t1 = G.O.thumbnailL1BuildInit2.split('|');
+ var t1 = G.O.thumbnailL1BuildInit2.split('|');
for( var i = 0; i < t1.length; i++ ) {
var o1 = t1[i].trim().split('_');
if( o1.length == 3 ) {
@@ -6562,52 +7131,18 @@
if( G.O.thumbnailL1Width == 0 || G.O.thumbnailL1Width == '' ) { G.O.thumbnailL1Width = 'auto'; }
// RETRIEVE ALL THUMBNAIL SIZES
- function ThumbnailSizes( srcOpt, onlyl1, opt) {
- if( G.O[srcOpt] == null ) { return; }
-
- if( toType(G.O[srcOpt]) == 'number' ) {
- ThumbnailsSetSize( opt, 'l1', G.O[srcOpt], 'u');
- if( !onlyl1 ) {
- ThumbnailsSetSize( opt, 'lN', G.O[srcOpt], 'u');
- }
- }
- else {
- var ws=G.O[srcOpt].split(' ');
- var v = 'auto';
- if( ws[0].substring(0,4) != 'auto' ) { v=parseInt(ws[0]); }
- var c = 'u';
- if( ws[0].charAt(ws[0].length - 1) == 'C' ) { c='c'; }
- ThumbnailsSetSize( opt, 'l1', v, c ); // default value for all resolutions and navigation levels
- if( !onlyl1 ) {
- ThumbnailsSetSize( opt, 'lN', v, c );
- }
- for( var i = 1; i < ws.length; i++ ) {
- var r = ws[i].substring(0,2).toLowerCase();
- if( /xs|sm|me|la|xl/i.test(r) ) {
- var w = ws[i].substring(2);
- var v = 'auto';
- if( w.substring(0,4) != 'auto' ) { v = parseInt(w); }
- var c = 'u';
- if( w.charAt(w.length - 1) == 'C' ) { c = 'c'; }
- G.tn.settings[opt]['l1'][r] = v;
- G.tn.settings[opt]['l1'][r + 'c'] = c;
- if( !onlyl1 ) {
- G.tn.settings[opt]['lN'][r] = v;
- G.tn.settings[opt]['lN'][r + 'c'] = c;
- }
- }
- }
- }
- }
- ThumbnailSizes( 'thumbnailWidth', false, 'width');
- ThumbnailSizes( 'thumbnailL1Width', true, 'width');
-
- ThumbnailSizes( 'thumbnailHeight', false, 'height');
- ThumbnailSizes( 'thumbnailL1Height', true, 'height');
+ // ThumbnailSizes( 'thumbnailWidth', false, 'width');
+ // ThumbnailSizes( 'thumbnailL1Width', true, 'width');
+ // ThumbnailSizes( 'thumbnailHeight', false, 'height');
+ // ThumbnailSizes( 'thumbnailL1Height', true, 'height');
+ ResponsiveOption('thumbnailWidth', 'width', 'lN');
+ ResponsiveOption('thumbnailWidth', 'width', 'l1');
+ ResponsiveOption('thumbnailL1Width', 'width', 'l1');
+ ResponsiveOption('thumbnailHeight', 'height', 'lN');
+ ResponsiveOption('thumbnailHeight', 'height', 'l1');
+ ResponsiveOption('thumbnailL1Height', 'height', 'l1');
- G.O.thumbnailBorderHorizontal = parseInt(G.O.thumbnailBorderHorizontal);
- G.O.thumbnailBorderVertical = parseInt(G.O.thumbnailBorderVertical);
G.O.thumbnailLabelHeight = parseInt(G.O.thumbnailLabelHeight);
@@ -6649,18 +7184,22 @@
G.tn.settings.mosaicCalcFactor('l1', 'la');
G.tn.settings.mosaicCalcFactor('l1', 'xl');
}
- for( var w = 0; w < G.tn.settings.mosaic.l1; w++ ) {
- if( G.O['galleryMosaic' + G.tn.settings.mosaic.l1[w].toUpperCase()] != undefined ) {
- G.tn.settings.mosaic.lN[tn.settings.mosaic.l1[w]] = JSON.parse(JSON.stringify( G.O['galleryMosaic' + G.tn.settings.mosaic.l1[w].toUpperCase()] ));
- G.tn.settings.mosaic.l1[tn.settings.mosaic.l1[w]] = JSON.parse(JSON.stringify( G.O['galleryMosaic' + G.tn.settings.mosaic.l1[w].toUpperCase()] ));
- G.tn.settings.mosaicCalcFactor('l1', G.tn.settings.mosaic.l1[w]);
- G.tn.settings.mosaicCalcFactor('lN', G.tn.settings.mosaic.l1[w]);
+
+ var lst=['xs','sm','me','la','xl'];
+ // retrieve responsive mosaic definition for levels l1 & lN
+ for( var w = 0; w < lst.length; w++ ) {
+ if( G.O['galleryMosaic' + lst[w].toUpperCase()] != undefined ) {
+ G.tn.settings.mosaic.lN[lst[w]] = JSON.parse(JSON.stringify( G.O['galleryMosaic' + lst[w].toUpperCase()] ));
+ G.tn.settings.mosaic.l1[lst[w]] = JSON.parse(JSON.stringify( G.O['galleryMosaic' + lst[w].toUpperCase()] ));
+ G.tn.settings.mosaicCalcFactor('lN',lst[w]);
+ G.tn.settings.mosaicCalcFactor('l1', lst[w]);
}
}
- for( var w = 0; w < G.tn.settings.mosaic.l1; w++ ) {
- if( G.O['galleryL1Mosaic'+G.tn.settings.mosaic.l1[w].toUpperCase()] != undefined ) {
- G.tn.settings.mosaic.l1[tn.settings.mosaic.l1[w]] = JSON.parse(JSON.stringify( G.O['galleryL1Mosaic'+G.tn.settings.mosaic.l1[w].toUpperCase()] ));
- G.tn.settings.mosaicCalcFactor('l1', G.tn.settings.mosaic.l1[w]);
+ // retrieve responsive mosaic definition for level l1
+ for( var w = 0; w < lst.length; w++ ) {
+ if( G.O['galleryL1Mosaic' + lst[w].toUpperCase()] != undefined ) {
+ G.tn.settings.mosaic.l1[lst[w]] = JSON.parse(JSON.stringify( G.O['galleryL1Mosaic' + lst[w].toUpperCase()] ));
+ G.tn.settings.mosaicCalcFactor('l1', lst[w]);
}
}
@@ -6765,41 +7304,23 @@
function ThumbnailOverEffectsGetCSSElement( element, property ) {
- var r = element;
- switch ( element ) {
- case 'image':
- if( property == 'blur' || property == 'brightness' || property == 'grayscale' || property == 'sepia' || property == 'contrast' || property == 'opacity'|| property == 'saturate' ) {
- // r='.nGY2GThumbnailImg';
- r = '.nGY2GThumbnailImage';
- }
- else {
- r = '.nGY2GThumbnailImage';
- }
- break;
- case 'thumbnail':
- r = '.nGY2GThumbnail';
- break;
- case 'label':
- r = '.nGY2GThumbnailLabel';
- break;
- case 'title':
- r = '.nGY2GThumbnailTitle';
- break;
- case 'description':
- r = '.nGY2GThumbnailDescription';
- break;
- case 'tools':
- r = '.nGY2GThumbnailIcons';
- break;
- case 'customlayer':
- r = '.nGY2GThumbnailCustomLayer';
- break;
- }
- return r;
+ var elts = {
+ 'image': '.nGY2GThumbnailImage',
+ 'thumbnail': '.nGY2GThumbnail',
+ 'label': '.nGY2GThumbnailLabel',
+ 'title': '.nGY2GThumbnailTitle',
+ 'description': '.nGY2GThumbnailDescription',
+ 'tools': '.nGY2GThumbnailIcons',
+ 'customlayer': '.nGY2GThumbnailCustomLayer',
+ 'default': 'nGY2GThumbnailImage'
+ };
+ return (elts[element] || elts['default']);
+
+
}
- // convert preset hover effects to new ones (nanogallery2)
+ // convert preset hover effects (nanoGALLERY) to new ones (nanogallery2)
function ThumbnailOverEffectsPreset( effects ) {
// COMPATIBILITY WITH nanoGALLERY
@@ -6820,20 +7341,17 @@
for( var i=0; i< effects.length; i++ ) {
switch( effects[i].name.toUpperCase() ) {
case 'BORDERLIGHTER':
- // var color=ngtinycolor(GalleryThemeGetCurrent().thumbnail.borderColor);
- // name='thumbnail_borderColor_'+color.toRgbString()+'_'+color.lighten(50).toRgbString();
-
var rgb = ColorHelperToRGB(GalleryThemeGetCurrent().thumbnail.borderColor);
name = 'thumbnail_borderColor_'+rgb+'_'+ShadeBlendConvert(0.5, rgb );
newEffects.push(ThumbnailHoverEffectExtract(name, effects[i]));
break;
+
case 'BORDERDARKER':
- // var color=ngtinycolor(GalleryThemeGetCurrent().thumbnail.borderColor);
- // name='thumbnail_borderColor_'+color.toRgbString()+'_'+color.darken(50).toRgbString();
var rgb = ColorHelperToRGB(GalleryThemeGetCurrent().thumbnail.borderColor);
name = 'thumbnail_borderColor_'+rgb+'_'+ShadeBlendConvert(-0.5, rgb );
newEffects.push(ThumbnailHoverEffectExtract(name, effects[i]));
break;
+
case 'SCALE120':
newEffects.push(ThumbnailHoverEffectExtract('thumbnail_scale_1.00_1.20', effects[i]));
break;
@@ -6984,39 +7502,78 @@
function ThumbnailStyle( cfg, level) {
-
+
switch( cfg.position ){
case 'onBottom' :
G.tn.style[level]['label'] = 'bottom:0; ';
break;
- case 'overImageOnTop' :
- G.tn.style[level]['label'] = 'top:0; position:absolute;';
- break;
- case 'overImageOnMiddle' :
- G.tn.style[level]['label'] = 'top:0; bottom:0;';
- G.tn.style[level]['title'] = 'position:absolute; bottom:50%;';
- G.tn.style[level]['desc'] = 'position:absolute; top:50%;';
- break;
- case 'custom' :
+ case 'right' :
+ switch( cfg.valign ) {
+ case 'top':
+ G.tn.style[level]['label'] = 'top:0; position:absolute; left: 50%;';
+ break;
+ case 'middle':
+ G.tn.style[level]['label'] = 'top:0; bottom:0; left: 50%;';
+ G.tn.style[level]['title'] = 'position:absolute; bottom:50%;';
+ G.tn.style[level]['desc'] = 'position:absolute; top:50%;';
+ break;
+ case 'bottom':
+ default:
+ G.tn.style[level].label = 'bottom:0; position:absolute; left: 50%;';
+ G.tn.style[level].title = 'position:absolute;bottom:0;';
+ break;
+ }
break;
- case 'overImageOnBottom' :
- default :
- G.O.thumbnailLabel.position = 'overImageOnBottom';
- G.tn.style[level].label = 'bottom:0; position:absolute;';
+ case 'custom':
break;
+ default:
+ case 'overImage' :
+ switch( cfg.valign ) {
+ case 'top':
+ G.tn.style[level]['label'] = 'top:0; position:absolute;';
+ break;
+ case 'middle':
+ G.tn.style[level]['label'] = 'top:0; bottom:0;';
+ G.tn.style[level]['title'] = 'position:absolute; bottom:50%;';
+ G.tn.style[level]['desc'] = 'position:absolute; top:50%;';
+ break;
+ case 'bottom':
+ default:
+ // G.O.thumbnailLabel.position = 'overImageOnBottom';
+ G.tn.style[level].label = 'bottom:0; position:absolute;';
+ break;
+ }
+
+ // case 'overImageOnTop' :
+ // G.tn.style[level]['label'] = 'top:0; position:absolute;';
+ // break;
+ // case 'overImageOnMiddle' :
+ // G.tn.style[level]['label'] = 'top:0; bottom:0;';
+ // G.tn.style[level]['title'] = 'position:absolute; bottom:50%;';
+ // G.tn.style[level]['desc'] = 'position:absolute; top:50%;';
+ // break;
+ // case 'right' :
+ // case 'custom' :
+ // break;
+ // case 'overImageOnBottom' :
+ // default :
+ // G.O.thumbnailLabel.position = 'overImageOnBottom';
+ // G.tn.style[level].label = 'bottom:0; position:absolute;';
+ // break;
}
+
// if( G.layout.engine != 'CASCADING' ) {
if( cfg.position != 'onBottom' ) {
// multi-line
if( cfg.titleMultiLine ) {
- G.tn.style[level]['title'] = 'white-space:normal;';
+ G.tn.style[level]['title'] += 'white-space:normal;';
}
if( cfg.descriptionMultiLine ) {
- G.tn.style[level]['desc'] = 'white-space:normal;';
+ G.tn.style[level]['desc'] += 'white-space:normal;';
}
}
-
+ // horizontal alignement
switch( cfg.align ) {
case 'right':
G.tn.style[level].label += 'text-align:right;';
@@ -7028,6 +7585,8 @@
G.tn.style[level].label += 'text-align:center;';
break;
}
+
+
if( cfg.titleFontSize != undefined && cfg.titleFontSize != '' ) {
G.tn.style[level].title += 'font-size:' + cfg.titleFontSize + ';';
}
@@ -7047,16 +7606,18 @@
// settings for level L1 and LN
ThumbnailStyle( G.O.thumbnailLabel, 'lN');
- ThumbnailStyle( G.O.thumbnailLabel, 'l1');
+ if( G.O.thumbnailL1Label !== undefined ) {
+ ThumbnailStyle( G.O.thumbnailL1Label, 'l1');
+ }
+ else {
+ ThumbnailStyle( G.O.thumbnailLabel, 'l1');
+ }
if( G.O.thumbnailL1Label && G.O.thumbnailL1Label.display ) {
// settings for level L1
ThumbnailStyle( G.O.thumbnailL1Label, 'l1');
}
- G.tn.borderWidth = G.O.thumbnailBorderHorizontal;
- G.tn.borderHeight = G.O.thumbnailBorderVertical;
-
// default thumbnail sizes levels l1 and lN
var lst=['xs','sm','me','la','xl'];
@@ -7112,21 +7673,6 @@
}
- // ##### THUMBNAIL SIZE MANAGEMENT
- function ThumbnailsSetSize( dir, level, v, crop ) {
- G.tn.settings[dir][level]['xs'] = v;
- G.tn.settings[dir][level]['sm'] = v;
- G.tn.settings[dir][level]['me'] = v;
- G.tn.settings[dir][level]['la'] = v;
- G.tn.settings[dir][level]['xl'] = v;
- G.tn.settings[dir][level]['xsc'] = crop;
- G.tn.settings[dir][level]['smc'] = crop;
- G.tn.settings[dir][level]['mec'] = crop;
- G.tn.settings[dir][level]['lac'] = crop;
- G.tn.settings[dir][level]['xlc'] = crop;
- }
-
-
//
function GalleryThemeGetCurrent() {
@@ -7192,57 +7738,73 @@
var s1='.' + galleryTheme + ' ';
// navigation bar
- var s=s1+'.nGY2Navigationbar { background:'+cs.navigationBar.background+'; }'+'\n';
- if( cs.navigationBar.border !== undefined && cs.navigationBar.border !== '' ) { s+=s1+'.nGY2Navigationbar { border:'+cs.navigationBar.border+'; }'+'\n'; }
- if( cs.navigationBar.borderTop !== undefined && cs.navigationBar.borderTop !== '' ) { s+=s1+'.nGY2Navigationbar { border-top:'+cs.navigationBar.borderTop+'; }'+'\n'; }
- if( cs.navigationBar.borderBottom !== undefined && cs.navigationBar.borderBottom !== '' ) { s+=s1+'.nGY2Navigationbar { border-bottom:'+cs.navigationBar.borderBottom+'; }'+'\n'; }
- if( cs.navigationBar.borderRight !== undefined && cs.navigationBar.borderRight !== '' ) { s+=s1+'.nGY2Navigationbar { border-right:'+cs.navigationBar.borderRight+'; }'+'\n'; }
- if( cs.navigationBar.borderLeft !== undefined && cs.navigationBar.borderLeft !== '' ) { s+=s1+'.nGY2Navigationbar { border-left:'+cs.navigationBar.borderLeft+'; }'+'\n'; }
+ var c = cs.navigationBar;
+ var s=s1+'.nGY2Navigationbar { background:'+c.background+'; }'+'\n';
+ if( c.border !== undefined && c.border !== '' ) { s+=s1+'.nGY2Navigationbar { border:'+c.border+'; }'+'\n'; }
+ if( c.borderTop !== undefined && c.borderTop !== '' ) { s+=s1+'.nGY2Navigationbar { border-top:'+c.borderTop+'; }'+'\n'; }
+ if( c.borderBottom !== undefined && c.borderBottom !== '' ) { s+=s1+'.nGY2Navigationbar { border-bottom:'+c.borderBottom+'; }'+'\n'; }
+ if( c.borderRight !== undefined && c.borderRight !== '' ) { s+=s1+'.nGY2Navigationbar { border-right:'+c.borderRight+'; }'+'\n'; }
+ if( c.borderLeft !== undefined && c.borderLeft !== '' ) { s+=s1+'.nGY2Navigationbar { border-left:'+c.borderLeft+'; }'+'\n'; }
// navigation bar - breadcrumb
- s+=s1+'.nGY2Breadcrumb { background:'+cs.navigationBreadcrumb.background+'; border-radius:'+cs.navigationBreadcrumb.borderRadius+'; }'+'\n';
- s+=s1+'.nGY2Breadcrumb .oneItem { color:'+cs.navigationBreadcrumb.color+'; }'+'\n';
- s+=s1+'.nGY2Breadcrumb .oneItem:hover { color:'+cs.navigationBreadcrumb.colorHover+'; }'+'\n';
+ var c = cs.navigationBreadcrumb;
+ s+=s1+'.nGY2Breadcrumb { background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';
+ s+=s1+'.nGY2Breadcrumb .oneItem { color:'+c.color+'; }'+'\n';
+ s+=s1+'.nGY2Breadcrumb .oneItem:hover { color:'+c.colorHover+'; }'+'\n';
// navigation bar - tag filter
- s+=s1+'.nGY2NavFilterUnselected { color:'+cs.navigationFilter.color+'; background:'+cs.navigationFilter.background+'; border-radius:'+cs.navigationFilter.borderRadius+'; }'+'\n';
- s+=s1+'.nGY2NavFilterSelected { color:'+cs.navigationFilter.colorSelected+'; background:'+cs.navigationFilter.backgroundSelected+'; border-radius:'+cs.navigationFilter.borderRadius+'; }'+'\n';
- s+=s1+'.nGY2NavFilterSelectAll { color:'+cs.navigationFilter.colorSelected+'; background:'+cs.navigationFilter.background+'; border-radius:'+cs.navigationFilter.borderRadius+'; }'+'\n';
+ var c = cs.navigationFilter;
+ s+=s1+'.nGY2NavFilterUnselected { color:'+c.color+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';
+ s+=s1+'.nGY2NavFilterSelected { color:'+c.colorSelected+'; background:'+c.backgroundSelected+'; border-radius:'+c.borderRadius+'; }'+'\n';
+ s+=s1+'.nGY2NavFilterSelectAll { color:'+c.colorSelected+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';
+
+ // navigation bar - pagination next/previous
+ var c = cs.navigationPagination;
+ s+=s1+'.nGY2NavPagination { color:'+c.color+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';
+ s+=s1+'.nGY2NavPagination:hover { color:'+c.colorHover+'; }'+'\n';
// thumbnails
- s+=s1+'.nGY2GThumbnail { background:'+cs.thumbnail.background+'; border-color:'+cs.thumbnail.borderColor+'; border-top-width:'+G.O.thumbnailBorderVertical+'px; border-right-width:'+G.O.thumbnailBorderHorizontal+'px; border-bottom-width:'+G.O.thumbnailBorderVertical+'px; border-left-width:'+G.O.thumbnailBorderHorizontal+'px;}'+'\n';
- s+=s1+'.nGY2GThumbnailStack { background:'+cs.thumbnail.stackBackground+'; }'+'\n';
+ var c = cs.thumbnail;
+ // s+=s1+'.nGY2GThumbnail { border-radius: '+c.borderRadius+'; background:'+c.background+'; border-color:'+c.borderColor+'; border-top-width:'+G.tn.opt.Get('borderVertical')+'px; border-right-width:'+G.tn.opt.Get('borderHorizontal')+'px; border-bottom-width:'+G.tn.opt.Get('borderVertical')+'px; border-left-width:'+G.tn.opt.Get('borderHorizontal')+'px;}'+'\n';
+ s+=s1+'.nGY2GThumbnail { border-radius: '+c.borderRadius+'; background:'+c.background+'; border-color:'+c.borderColor+'; }'+'\n';
+ s+=s1+'.nGY2GThumbnail_l1 { border-top-width:'+G.tn.opt.l1.borderVertical+'px; border-right-width:'+G.tn.opt.l1.borderHorizontal+'px; border-bottom-width:'+G.tn.opt.l1.borderVertical+'px; border-left-width:'+G.tn.opt.l1.borderHorizontal+'px;}'+'\n';
+ s+=s1+'.nGY2GThumbnail_lN { border-top-width:'+G.tn.opt.lN.borderVertical+'px; border-right-width:'+G.tn.opt.lN.borderHorizontal+'px; border-bottom-width:'+G.tn.opt.lN.borderVertical+'px; border-left-width:'+G.tn.opt.lN.borderHorizontal+'px;}'+'\n';
+ s+=s1+'.nGY2GThumbnailStack { background:'+c.stackBackground+'; }'+'\n';
// s+=s1+'.nGY2GThumbnailImage { background:'+cs.thumbnail.background+'; background-image:'+cs.thumbnail.backgroundImage+'; }'+'\n';
- s+=s1+'.nGY2TnImgBack { background:'+cs.thumbnail.background+'; background-image:'+cs.thumbnail.backgroundImage+'; }'+'\n';
- s+=s1+'.nGY2GThumbnailAlbumUp { background:'+cs.thumbnail.background+'; background-image:'+cs.thumbnail.backgroundImage+'; color:'+cs.thumbnail.titleColor+'; }'+'\n';
- s+=s1+'.nGY2GThumbnailIconsFullThumbnail { color:'+cs.thumbnail.titleColor+'; }\n';
- s+=s1+'.nGY2GThumbnailLabel { background:'+cs.thumbnail.labelBackground+'; opacity:'+cs.thumbnail.labelOpacity+'; }'+'\n';
- s+=s1+'.nGY2GThumbnailImageTitle { color:'+cs.thumbnail.titleColor+'; background-color:'+cs.thumbnail.titleBgColor+'; '+(cs.thumbnail.titleShadow =='' ? '': 'Text-Shadow:'+cs.thumbnail.titleShadow+';')+' }'+'\n';
- s+=s1+'.nGY2GThumbnailAlbumTitle { color:'+cs.thumbnail.titleColor+'; background-color:'+cs.thumbnail.titleBgColor+'; '+(cs.thumbnail.titleShadow =='' ? '': 'Text-Shadow:'+cs.thumbnail.titleShadow+';')+' }'+'\n';
- s+=s1+'.nGY2GThumbnailDescription { color:'+cs.thumbnail.descriptionColor+'; background-color:'+cs.thumbnail.descriptionBgColor+'; '+(cs.thumbnail.descriptionShadow =='' ? '': 'Text-Shadow:'+cs.thumbnail.descriptionShadow+';')+' }'+'\n';
+ s+=s1+'.nGY2TnImgBack { background:'+c.background+'; background-image:'+c.backgroundImage+'; }'+'\n';
+ s+=s1+'.nGY2GThumbnailAlbumUp { background:'+c.background+'; background-image:'+c.backgroundImage+'; color:'+cs.thumbnail.titleColor+'; }'+'\n';
+ s+=s1+'.nGY2GThumbnailIconsFullThumbnail { color:'+c.titleColor+'; }\n';
+ s+=s1+'.nGY2GThumbnailLabel { background:'+c.labelBackground+'; opacity:'+c.labelOpacity+'; }'+'\n';
+ s+=s1+'.nGY2GThumbnailImageTitle { color:'+c.titleColor+'; background-color:'+c.titleBgColor+'; '+(c.titleShadow =='' ? '': 'Text-Shadow:'+c.titleShadow+';')+' }'+'\n';
+ s+=s1+'.nGY2GThumbnailAlbumTitle { color:'+c.titleColor+'; background-color:'+c.titleBgColor+'; '+(c.titleShadow =='' ? '': 'Text-Shadow:'+c.titleShadow+';')+' }'+'\n';
+ s+=s1+'.nGY2GThumbnailDescription { color:'+c.descriptionColor+'; background-color:'+c.descriptionBgColor+'; '+(c.descriptionShadow =='' ? '': 'Text-Shadow:'+c.descriptionShadow+';')+' }'+'\n';
// thumbnails - icons
- s+=s1+'.nGY2GThumbnailIcons { padding:'+cs.thumbnailIcon.padding+'; }\n';
- s+=s1+'.nGY2GThumbnailIcon { color:'+cs.thumbnailIcon.color+'; }\n';
- s+=s1+'.nGY2GThumbnailIconTextBadge { background-color:'+cs.thumbnailIcon.color+'; }\n';
+ var c = cs.thumbnailIcon;
+ s+=s1+'.nGY2GThumbnailIcons { padding:'+c.padding+'; }\n';
+ s+=s1+'.nGY2GThumbnailIcon { color:'+c.color+'; '+(c.shadow =='' ? '': 'Text-Shadow:'+c.shadow+';')+' }\n';
+ s+=s1+'.nGY2GThumbnailIconTextBadge { background-color:'+c.color+'; }\n';
// gallery pagination -> dot/rectangle based
+ var c = cs.pagination;
if( G.O.galleryPaginationMode != 'NUMBERS' ) {
- s+=s1+'.nGY2paginationDot { border:'+cs.pagination.shapeBorder+'; background:'+cs.pagination.shapeColor+';}\n';
- s+=s1+'.nGY2paginationDotCurrentPage { border:'+cs.pagination.shapeBorder+'; background:'+cs.pagination.shapeSelectedColor+';}\n';
- s+=s1+'.nGY2paginationRectangle { border:'+cs.pagination.shapeBorder+'; background:'+cs.pagination.shapeColor+';}\n';
- s+=s1+'.nGY2paginationRectangleCurrentPage { border:'+cs.pagination.shapeBorder+'; background:'+cs.pagination.shapeSelectedColor+';}\n';
+ s+=s1+'.nGY2paginationDot { border:'+c.shapeBorder+'; background:'+c.shapeColor+';}\n';
+ s+=s1+'.nGY2paginationDotCurrentPage { border:'+c.shapeBorder+'; background:'+c.shapeSelectedColor+';}\n';
+ s+=s1+'.nGY2paginationRectangle { border:'+c.shapeBorder+'; background:'+c.shapeColor+';}\n';
+ s+=s1+'.nGY2paginationRectangleCurrentPage { border:'+c.shapeBorder+'; background:'+c.shapeSelectedColor+';}\n';
} else {
- s+=s1+'.nGY2paginationItem { background:'+cs.pagination.background+'; color:'+cs.pagination.color+'; border-radius:'+cs.pagination.borderRadius+'; }\n';
- s+=s1+'.nGY2paginationItemCurrentPage { background:'+cs.pagination.background+'; color:'+cs.pagination.color+'; border-radius:'+cs.pagination.borderRadius+'; }\n';
- s+=s1+'.nGY2PaginationPrev { background:'+cs.pagination.background+'; color:'+cs.pagination.color+'; border-radius:'+cs.pagination.borderRadius+'; }\n';
- s+=s1+'.nGY2PaginationNext { background:'+cs.pagination.background+'; color:'+cs.pagination.color+'; border-radius:'+cs.pagination.borderRadius+'; }\n';
- s+=s1+'.nGY2paginationItemCurrentPage { background:'+cs.pagination.backgroundSelected+'; }\n';
+ s+=s1+'.nGY2paginationItem { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';
+ s+=s1+'.nGY2paginationItemCurrentPage { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';
+ s+=s1+'.nGY2PaginationPrev { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';
+ s+=s1+'.nGY2PaginationNext { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';
+ s+=s1+'.nGY2paginationItemCurrentPage { background:'+c.backgroundSelected+'; }\n';
}
// gallery more button
- s+=s1+'.nGY2GalleryMoreButtonAnnotation { background:'+cs.thumbnail.background+'; border-color:'+cs.thumbnail.borderColor+'; border-top-width:'+G.O.thumbnailBorderVertical+'px; border-right-width:'+G.O.thumbnailBorderHorizontal+'px; border-bottom-width:'+G.O.thumbnailBorderVertical+'px; border-left-width:'+G.O.thumbnailBorderHorizontal+'px;}\n';
- s+=s1+'.nGY2GalleryMoreButtonAnnotation { color:'+cs.thumbnail.titleColor+'; '+(cs.thumbnail.titleShadow =='' ? '': 'Text-Shadow:'+cs.thumbnail.titleShadow)+'; }\n';
+ var c = cs.thumbnail;
+ // s+=s1+'.nGY2GalleryMoreButtonAnnotation { background:'+c.background+'; border-color:'+c.borderColor+'; border-top-width:'+G.O.thumbnailBorderVertical+'px; border-right-width:'+G.O.thumbnailBorderHorizontal+'px; border-bottom-width:'+G.O.thumbnailBorderVertical+'px; border-left-width:'+G.O.thumbnailBorderHorizontal+'px;}\n';
+ s+=s1+'.nGY2GalleryMoreButtonAnnotation { background:'+c.background+'; border-color:'+c.borderColor+'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;}\n';
+ s+=s1+'.nGY2GalleryMoreButtonAnnotation { color:'+c.titleColor+'; '+(c.titleShadow =='' ? '': 'Text-Shadow:'+c.titleShadow)+'; }\n';
jQuery('head').append('');
G.$E.base.addClass(galleryTheme);
@@ -7253,7 +7815,7 @@
function SetViewerTheme( ) {
if( G.VOM.viewerTheme != '' ) {
- G.VOM.$cont.addClass(G.VOM.viewerTheme);
+ G.VOM.$baseCont.addClass(G.VOM.viewerTheme);
return;
}
@@ -7277,10 +7839,6 @@
cs = G.viewerTheme_light;
G.VOM.viewerTheme = 'nanogallery_viewertheme_light_' + G.baseEltID;
break;
- case 'border':
- cs = G.viewerTheme_border;
- G.VOM.viewerTheme = 'nanogallery_viewertheme_border_' + G.baseEltID;
- break;
case 'dark':
case 'default':
cs = G.viewerTheme_dark;
@@ -7295,12 +7853,7 @@
var s1 = '.' + G.VOM.viewerTheme + ' ';
var s = s1 + '.nGY2Viewer { background:' + cs.background + '; }'+'\n';
- s += s1 + '.nGY2ViewerMedia { border:' + cs.imageBorder + '; box-shadow:' + cs.imageBoxShadow + '; }'+'\n';
s += s1 + '.nGY2Viewer .toolbarBackground { background:' + cs.barBackground + '; }'+'\n';
- s += s1 + '.nGY2Viewer .nGY2ViewerToolsTopLeft { background:' + cs.barBackground + '; }'+'\n';
- s += s1 + '.nGY2Viewer .nGY2ViewerToolsTopRight { background:' + cs.barBackground + '; }'+'\n';
- s += s1 + '.nGY2Viewer .nGY2ViewerAreaNext { background:' + cs.barBackground + '; }'+'\n';
- s += s1 + '.nGY2Viewer .nGY2ViewerAreaPrevious { background:' + cs.barBackground + '; }'+'\n';
s += s1 + '.nGY2Viewer .toolbar { border:' + cs.barBorder + '; color:' + cs.barColor + '; }'+'\n';
s += s1 + '.nGY2Viewer .toolbar .previousButton:after { color:' + cs.barColor + '; }'+'\n';
s += s1 + '.nGY2Viewer .toolbar .nextButton:after { color:' + cs.barColor + '; }'+'\n';
@@ -7308,7 +7861,7 @@
s += s1 + '.nGY2Viewer .toolbar .label .title { color:' + cs.barColor + '; }'+'\n';
s += s1 + '.nGY2Viewer .toolbar .label .description { color:' + cs.barDescriptionColor + '; }'+'\n';
jQuery('head').append('');
- G.VOM.$cont.addClass(G.VOM.viewerTheme);
+ G.VOM.$baseCont.addClass(G.VOM.viewerTheme);
};
@@ -7343,7 +7896,7 @@
};
}
- // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
+ // requestAnimationFrame polyfill by Erik M�ller. fixes from Paul Irish and Tino Zijdel
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// MIT license
@@ -7377,21 +7930,21 @@
this.splice(i, 1);
}
}
- };
-
- // IE11 for startsWith
- // thanks to @lichtamberg - https://github.com/lichtamberg
- if (!String.prototype.startsWith) {
- String.prototype.startsWith = function(searchString, position) {
- position = position || 0;
- return this.indexOf(searchString, position) === position;
- };
+ };
+
+ // IE11 for startsWith
+ // thanks to @lichtamberg - https://github.com/lichtamberg
+ if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function(searchString, position) {
+ position = position || 0;
+ return this.indexOf(searchString, position) === position;
+ };
}
}
- // Gallery clicked/touched -> retrieve & execute action
+ // Gallery clicked or toolbar touched -> retrieve & execute action
function GalleryClicked(e) {
var r = GalleryEventRetrieveElementl(e, false);
@@ -7400,7 +7953,6 @@
var idx = G.GOM.items[r.GOMidx].thumbnailIdx;
if( G.GOM.slider.hostIdx == r.GOMidx ) {
- // slider on thumbnail -> open the displayed image
idx = G.GOM.items[G.GOM.slider.currentIdx].thumbnailIdx;
}
switch( r.action ) {
@@ -7429,8 +7981,8 @@
ItemDisplayInfo(G.I[idx]);
return 'exit';
break;
- case 'CART':
- AddToCart(idx);
+ case 'SHOPPINGCART':
+ AddToCart(idx, 'gallery');
return 'exit';
break;
default:
@@ -7453,29 +8005,31 @@
if( G.I[idx].downloadURL != undefined && G.I[idx].downloadURL != '' ) {
url = G.I[idx].downloadURL;
}
-
- var a = document.createElement('a');
- a.href = url;
+
+ var a = document.createElement('a');
+ a.href = url;
// a.download = url.split('.').pop();
a.download = url.split('/').pop();
a.target = '_blank';
- a.style.display = 'none';
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
+ a.style.display = 'none';
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
}
// add one image to the shopping cart
- function AddToCart( idx ) {
- // increment counter if already in shopping cart
+ function AddToCart( idx, source ) {
+ // increment quantity if already in shopping cart
var found=false;
for( var i=0; i
';
content += '';
content += '';
@@ -7598,7 +8153,7 @@
var currentTn = item.thumbImg().src;
- Popup('Share to:', content, 'Center');
+ Popup('nanogallery2 - share to:', content, 'Center');
G.popup.$elt.find('.nGY2PopupOneItem').on('click', function(e) {
e.stopPropagation();
@@ -7649,7 +8204,7 @@
// build a modal popup
function Popup(title, content, align) {
var pp = '';
@@ -7661,12 +8216,13 @@
var tweenable = new NGTweenable();
tweenable.tween({
- from: { opacity: 0 },
- to: { opacity: 1 },
+ from: { o: 0, y: 100 },
+ to: { o: 1, y: 0 },
easing: 'easeInOutSine',
duration: 250,
step: function (state, att) {
- G.popup.$elt.css( state );
+ G.popup.$elt[0].style.opacity = state.o;
+ G.popup.$elt[0].style[G.CSStransformName] = 'translateY(' + (state.y) + 'px)';
}
});
@@ -7732,9 +8288,11 @@
}
- // Open one thumbnail
+ // OPEN ONE THUMBNAIL
function ThumbnailOpen( idx, ignoreSelected ) {
var item = G.I[idx];
+
+ G.GOM.albumIdxLoading = idx; // store idx -> may be used to display loader on album thumbnail
var fu = G.O.fnThumbnailClicked;
if( fu !== null ) {
@@ -7754,17 +8312,17 @@
}
else {
// display image
- DisplayPhotoIdx(idx);
+ DisplayPhotoIdx( idx );
}
break;
case 'album':
if( ignoreSelected === false && G.GOM.nbSelected > 0 ) {
- ThumbnailSelectionToggle(idx);
+ ThumbnailSelectionToggle( idx );
}
else {
if( G.O.thumbnailAlbumDisplayImage && idx != 0 ) {
// display album content in lightbox
- DisplayFirstMediaInAlbum(idx);
+ DisplayFirstMediaInAlbum( idx );
return;
}
else {
@@ -7823,10 +8381,13 @@
}
}
- // Display one photo (with internal or external viewer)
+ // ########################################################
+ // DISPLAY ONE MEDIA
+ // with internal or external viewer
+ // ########################################################
function DisplayPhotoIdx( ngy2ItemIdx ) {
- if( !G.O.thumbnailOpenImage ) { return; }
+ if( !G.O.thumbnailOpenInLightox ) { return; }
if( G.O.thumbnailOpenOriginal ) {
// Open link to original image
@@ -7835,14 +8396,15 @@
}
var items = [];
- G.VOM.currItemIdx = 0;
+// G.VOM.currItemIdx = 0;
+ G.VOM.content.current.vIdx = 0;
G.VOM.items = [];
G.VOM.albumID = G.I[ngy2ItemIdx].albumID;
var vimg = new VImg(ngy2ItemIdx);
G.VOM.items.push(vimg);
items.push(G.I[ngy2ItemIdx]);
- //TODO -> danger? -> pourquoi reconstruire la liste si déjà ouvert (back/forward)
+ //TODO -> danger? -> pourquoi reconstruire la liste si d�j� ouvert (back/forward)
var l = G.I.length;
for( var idx = ngy2ItemIdx+1; idx < l ; idx++) {
var item = G.I[idx];
@@ -7869,7 +8431,7 @@
cnt++;
}
- // opens media with external viewer
+ // opens media with external viewer
var fu = G.O.fnThumbnailOpen;
if( fu !== null ) {
typeof fu == 'function' ? fu(items) : window[fu](items);
@@ -7879,32 +8441,33 @@
// use internal viewer
if( !G.VOM.viewerDisplayed ) {
// build viewer and display
- OpenInternalViewer();
+ LightboxOpen();
}
else {
// viewer already displayed -> display new media in current viewer
- G.VOM.$mediaCurrent.empty();
- var item = G.VOM.NGY2Item(0);
+ G.VOM.content.current.$media.empty();
+ var item = G.VOM.content.current.NGY2Item();
var spreloader = '
';
if( item.mediaKind == 'img' && item.imageWidth != 0 && item.imageHeight != 0 ) {
spreloader = '
';
}
- G.VOM.$mediaCurrent.append( spreloader + item.mediaMarkup);
- ViewerSetMediaVisibility(G.VOM.NGY2Item(1), G.VOM.$mediaNext, 0);
- ViewerSetMediaVisibility(G.VOM.NGY2Item(-1), G.VOM.$mediaPrevious, 0);
+ G.VOM.content.current.$media.append( spreloader + item.mediaMarkup);
+ ViewerSetMediaVisibility(G.VOM.content.next, 0);
+ ViewerSetMediaVisibility(G.VOM.content.previous, 0);
if( item.mediaKind == 'img' ) {
G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved, item);
}
// G.VOM.$mediaCurrent.css({ opacity:0 }).attr('src','');
// G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved, G.VOM.NGY2Item(0));
// G.VOM.$mediaCurrent.children().eq(0).attr('src',G.emptyGif).attr('src', G.VOM.NGY2Item(0).responsiveURL());
- DisplayInternalViewer(0, '');
+ // LightboxDisplay(0, '');
+ LightboxDisplay('');
}
}
function ViewerZoomStart() {
if( G.O.viewerZoom && !G.VOM.viewerMediaIsChanged ) {
- var item=G.VOM.NGY2Item(0);
+ var item = G.VOM.content.current.NGY2Item();
if( item.imageHeight > 0 && item.imageWidth > 0 ) {
if( G.VOM.zoom.isZooming === false ) {
// default zoom
@@ -7919,12 +8482,12 @@
function ViewerZoomIn( zoomIn ) {
if( zoomIn ) {
// zoom in
- G.VOM.zoom.userFactor+=0.1;
+ G.VOM.zoom.userFactor += 0.1;
ViewerZoomMax();
}
else {
// zoom out
- G.VOM.zoom.userFactor-=0.1;
+ G.VOM.zoom.userFactor -= 0.1;
ViewerZoomMin();
}
ViewerMediaSetPosAndZoom();
@@ -7935,7 +8498,7 @@
G.VOM.zoom.userFactor = 3;
}
}
- function ViewerZoomMin() {
+ function ViewerZoomMin() {
if( G.VOM.zoom.userFactor < 0.2 ) {
G.VOM.zoom.userFactor = 0.2;
@@ -7951,9 +8514,9 @@
G.VOM.zoom.userFactor = 1;
}
// window.ng_draf( function() {
- ViewerMediaSetPosAndZoomOne( G.VOM.NGY2Item(0), G.VOM.$mediaCurrent, true );
- ViewerMediaSetPosAndZoomOne( G.VOM.NGY2Item(-1), G.VOM.$mediaPrevious, false );
- ViewerMediaSetPosAndZoomOne( G.VOM.NGY2Item(1), G.VOM.$mediaNext, false );
+ ViewerMediaSetPosAndZoomOne( G.VOM.content.current, true );
+ ViewerMediaSetPosAndZoomOne( G.VOM.content.previous, false );
+ ViewerMediaSetPosAndZoomOne( G.VOM.content.next, false );
// });
}
@@ -7962,21 +8525,29 @@
// Media which is not IMG -> center and set size
function ViewerMediaCenterNotImg( $mediaContainer ) {
var $media = $mediaContainer.children().eq(1);
- $media.css( {'height': '80%' });
+ var h = 90;
+ if( G.O.viewerGallery != 'none' ) { h -= 10; }
+ if( G.O.viewerToolbar.display != 'none' ) { h -= 10; }
+ $media.css( {'height': h+'%' });
$media.css( {'width': '90%' });
$media[0].style[G.CSStransformName] = 'translate(0px, "50%") ';
}
// Set position and size of ONE media container
- function ViewerMediaSetPosAndZoomOne(item, $img, isCurrent ) {
+ function ViewerMediaSetPosAndZoomOne(content_item, isCurrent ) {
+
+ var item = content_item.NGY2Item();
+ var $img = content_item.$media;
+
if( item.mediaKind != 'img' ) {
- ViewerMediaCenterNotImg($img);
+ ViewerMediaCenterNotImg( $img );
return;
}
if( item.imageHeight == 0 || item.imageWidth == 0 ) {
- ViewerSetMediaVisibility( item, $img, 0 );
+ // ViewerSetMediaVisibility( item, $img, 0 );
+ ViewerSetMediaVisibility( content_item, 0 );
return;
}
@@ -8029,7 +8600,7 @@
else {
// set the pan position of each media container
ViewerMediaPanX( G.VOM.swipePosX );
- $img.children().eq(1)[0].style[G.CSStransformName]= 'translate(0px, 0px) rotate('+ item.rotationAngle +'deg)';
+ $img.children().eq(1)[0].style[G.CSStransformName]= 'translate(0px, 0px) rotate('+ item.rotationAngle +'deg)';
}
}
@@ -8043,36 +8614,46 @@
}
posX += G.VOM.zoom.posX;
- posY += G.VOM.zoom.posY;
-
- // imageContainer.children().eq(1)[0].style[G.CSStransformName]= 'translate('+ posX + 'px, '+ posY + 'px)';
- imageContainer.children().eq(1)[0].style[G.CSStransformName]= 'translate('+ posX + 'px, '+ posY + 'px) rotate('+ G.VOM.NGY2Item(0).rotationAngle +'deg)';
+ posY += G.VOM.zoom.posY;
+
+ // imageContainer.children().eq(1)[0].style[G.CSStransformName]= 'translate('+ posX + 'px, '+ posY + 'px)';
+ imageContainer.children().eq(1)[0].style[G.CSStransformName]= 'translate('+ posX + 'px, '+ posY + 'px) rotate('+ G.VOM.content.current.NGY2Item().rotationAngle +'deg)';
}
+ // LIGHTBOX
// display media with internal viewer
- function OpenInternalViewer( ) {
+ function LightboxOpen( idx ) {
- G.VOM.viewerDisplayed = true;
+ // G.VOM.viewerDisplayed = true;
G.GOM.firstDisplay = false;
- G.VOM.saveOverflowX = window.getComputedStyle(document.body)['overflow-x'];
- G.VOM.saveOverflowY = window.getComputedStyle(document.body)['overflow-y'];
- jQuery('body').css({ overflow: 'hidden' }); //avoid scrollbars
+ // remove scrollbar and add right margin with same width as the scrollbar to avoid page reflow
+ jQuery('head').append('');
+ jQuery("body").addClass("nGY2_body_scrollbar");
+
- G.VOM.$cont = jQuery('
').appendTo('body');
+ G.VOM.$baseCont = jQuery('
').appendTo('body');
SetViewerTheme();
- G.VOM.$viewer = jQuery('
').appendTo( G.VOM.$cont );
+ G.VOM.$viewer = jQuery('
').appendTo( G.VOM.$baseCont );
G.VOM.$viewer.css({ msTouchAction: 'none', touchAction: 'none' }); // avoid pinch zoom
- G.VOM.currItemIdx = 0;
- var sMedia = '
'; // previous media
- sMedia += '
'; // current media
- sMedia += '
'; // next media
+ if( idx == undefined ) {
+ G.VOM.content.current.vIdx = 0;
+ }
+ else {
+ G.VOM.content.current.vIdx = idx;
+ }
+ G.VOM.content.previous.vIdx = G.VOM.IdxNext();
+ G.VOM.content.next.vIdx = G.VOM.IdxPrevious();
+
+ var sMedia = '
'; // previous media
+ sMedia += '
'; // current media
+ sMedia += '
'; // next media
var sNav = '';
var iconP = G.O.icons.viewerImgPrevious;
@@ -8086,14 +8667,17 @@
G.VOM.$content = jQuery('
' + sMedia + sNav + '
').appendTo( G.VOM.$viewer );
+ G.VOM.$buttonLeft = G.VOM.$content.find('.nGY2ViewerAreaPrevious');
+ G.VOM.$buttonRight = G.VOM.$content.find('.nGY2ViewerAreaNext');
+
var $mediaPan = G.VOM.$content.find('.nGY2ViewerMediaPan');
- G.VOM.$mediaPrevious = $mediaPan.eq(0); // pointer to previous media container
- G.VOM.$mediaCurrent = $mediaPan.eq(1); // pointer to current media container
- G.VOM.$mediaNext = $mediaPan.eq(2); // pointer to next media container
+ G.VOM.content.previous.$media = $mediaPan.eq(0); // pointer to previous media container
+ G.VOM.content.current.$media = $mediaPan.eq(1); // pointer to current media container
+ G.VOM.content.next.$media = $mediaPan.eq(2); // pointer to next media container
- G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(0) );
- G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(-1) );
- G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(1) );
+ G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.content.current.NGY2Item() );
+ G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.content.previous.NGY2Item() );
+ G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.content.next.NGY2Item() );
G.VOM.padding.H = parseInt(G.VOM.$content.css("padding-left")) + parseInt(G.VOM.$content.css("padding-right"));
G.VOM.padding.V = parseInt(G.VOM.$content.css("padding-top")) + parseInt(G.VOM.$content.css("padding-bottom"));
@@ -8125,84 +8709,171 @@
}
// top-left toolbar
- if( G.O.viewerTools.topLeft != '' ) {
- var sTopLeft = '
';
- G.VOM.$toolbarTL = jQuery(sTopLeft).appendTo(G.VOM.$viewer);
+ var sTopLeft = '
';
+ G.VOM.$toolbarTL = jQuery(sTopLeft).appendTo(G.VOM.$viewer);
+
// top-right toolbar
- if( G.O.viewerTools.topRight != '' ) {
- var sTopRight = '
';
- G.VOM.$toolbarTR = jQuery(sTopRight).appendTo(G.VOM.$viewer);
+ var sTopRight = '
';
+ G.VOM.$toolbarTR = jQuery(sTopRight).appendTo(G.VOM.$viewer);
- // set the events handler for toolbars
+ // set the events handler on the toolbars
ViewerToolsOn();
- // display logo
- if( G.O.viewerDisplayLogo ) { G.$E.vwLogo=jQuery('
').appendTo(G.VOM.$viewer); }
-
// Go to fullscreen mode
if( ngscreenfull.enabled && G.O.viewerFullscreen ) { ngscreenfull.request(); }
+ // Gallery
+ LightboxGalleryBuild();
+
setElementOnTop('', G.VOM.$viewer);
- ResizeInternalViewer(true);
+ ResizeLightbox(true);
+ G.VOM.gallery.Resize();
G.VOM.timeImgChanged = new Date().getTime();
// viewer display transition
+ G.VOM.$toolbarTL.css('opacity', 0);
+ G.VOM.$toolbarTR.css('opacity', 0);
+ G.VOM.$buttonLeft.css('opacity', 0);
+ G.VOM.$buttonRight.css('opacity', 0);
+ G.VOM.gallery.$elt.css('opacity', 0);
+ G.VOM.$content.css('opacity', 0);
+ G.VOM.$toolbarTR[0].style[G.CSStransformName] = 'translateY(-40px) ';
+ G.VOM.$toolbarTL[0].style[G.CSStransformName] = 'translateY(-40px) ';
+ G.VOM.$buttonLeft[0].style[G.CSStransformName] = 'translateX(-40px) ';
+ G.VOM.$buttonRight[0].style[G.CSStransformName] = 'translateX(40px) ';
+
+ // STEP 1: display main container, including media
var tweenable = new NGTweenable();
tweenable.tween({
from: { opacity: 0, posY: G.VOM.window.lastHeight*.5 },
to: { opacity: 1, posY: 0 },
- delay: 30,
- duration: 500,
- easing: 'easeOutQuart',
+ delay: 10,
+ duration: 450,
+ easing: 'easeInOutQuint',
step: function (state) {
+ // lightbox
G.VOM.$viewer.css('opacity', state.opacity);
G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(' + (state.posY) + 'px) ';
+
+ // media in lightbox
+ G.VOM.$content.css('opacity', state.opacity);
+ }
+ });
+
+
+ // STEP 2: display tools, left/right navigation buttons, gallery
+ var tweenable = new NGTweenable();
+ tweenable.tween({
+ from: { posY: -40, opacity: 0, scale: 3 },
+ to: { posY: 0, opacity: 1, scale: 1 },
+ delay: 300,
+ duration: 400,
+ easing: 'easeInOutQuint',
+ step: function (state) {
+
+ // tools
+ G.VOM.$toolbarTR[0].style[G.CSStransformName] = 'translateY(' + (state.posY) + 'px) ';
+ G.VOM.$toolbarTL[0].style[G.CSStransformName] = 'translateY(' + (state.posY) + 'px) ';
+ G.VOM.$buttonLeft[0].style[G.CSStransformName] = 'translateX(' + (state.posY) + 'px) ';
+ G.VOM.$buttonRight[0].style[G.CSStransformName] = 'translateX(' + (-state.posY) + 'px) ';
+
+ // gallery
+ G.VOM.gallery.$elt.css({ opacity: state.opacity });
+ G.VOM.gallery.$elt[0].style[G.CSStransformName] = 'scale('+state.scale+')';
+ },
+ finish: function() {
+ G.VOM.viewerDisplayed = true;
+ ViewerMediaPanX(0);
+ ViewerSetEvents();
+
+ LightboxDisplay('');
+
+ if( G.O.slideshowAutoStart ) {
+ G.VOM.playSlideshow = false;
+ SlideshowToggle();
+ }
+
+ ViewerToolsUnHide();
+ LightboxDisplayFinalize('');
}
});
+
+
+
// stop click propagation on media ==> if the user clicks outside of an media, the viewer is closed
// --> no more supported since v2.0.0
// G.VOM.$viewer.find('img').on('click', function (e) { e.stopPropagation(); });
- ViewerMediaPanX(0);
- ViewerSetEvents();
+ // ViewerMediaPanX(0);
+ // ViewerSetEvents();
- DisplayInternalViewer(0, '');
+ // LightboxDisplay('');
- if( G.O.slideshowAutoStart ) {
- G.VOM.playSlideshow = false;
- SlideshowToggle();
- }
+ // if( G.O.slideshowAutoStart ) {
+ // G.VOM.playSlideshow = false;
+ // SlideshowToggle();
+ // }
}
function ViewerEvents() {
- if( !G.VOM.viewerDisplayed || G.VOM.viewerMediaIsChanged || G.VOM.NGY2Item(0).mediaKind != 'img') {
- // ignore fired event if viewer not displayed or if currently changed or if current media not an image
+ if( !G.VOM.viewerDisplayed || G.VOM.viewerMediaIsChanged ) {
+ // if( !G.VOM.viewerDisplayed || G.VOM.viewerMediaIsChanged || G.VOM.content.current.NGY2Item().mediaKind != 'img') {
+ // ignore fired event if viewer not displayed or if currently changed (or if current media not an image)
return false;
}
return true;
}
+ // VIEWER - BUILD THE THUMBNAILS GALLERY
+ function LightboxGalleryBuild() {
+
+ G.VOM.gallery.firstDisplay = true;
+
+ if( G.O.viewerGallery != 'none' ) {
+
+ var tw = G.O.viewerGalleryTWidth;
+ var th = G.O.viewerGalleryTHeight;
+ var gutter = 2;
+
+ var t = '';
+ for( var i=0; i< G.VOM.items.length; i++) {
+ var idx = G.VOM.items[i].ngy2ItemIdx;
+ var o = G.I[idx];
+ var src = (o.thumbImg().src).replace(/'/g, "%27"); // replace single quote with %27
+ t += '
';
+ }
+ G.VOM.gallery.gwidth = (tw+2*gutter) * G.VOM.items.length;
+ G.VOM.gallery.oneTmbWidth = tw+2*gutter;
+ var tc = "
" + t + "
";
+ G.VOM.gallery.$elt = jQuery('
'+ tc +'
').appendTo(G.VOM.$viewer);
+ G.VOM.gallery.$tmbCont = G.VOM.gallery.$elt.find('.nGY2VThumbnailContainer')
+
+ G.VOM.gallery.Resize();
+ G.VOM.gallery.SetThumbnailActive();
+
+ }
+ }
- // viewer gesture handling
+
+ // Lightbox gesture handling
function ViewerSetEvents() {
if( G.VOM.hammertime == null ) {
- G.VOM.hammertime = new NGHammer.Manager(G.VOM.$cont[0], {
+ G.VOM.hammertime = new NGHammer.Manager(G.VOM.$baseCont[0], {
+ // domEvents: true,
recognizers: [
[NGHammer.Pinch, { enable: true }],
[NGHammer.Pan, { direction: NGHammer.DIRECTION_ALL }]
@@ -8213,78 +8884,189 @@
G.VOM.hammertime.on('pan', function(ev) {
if( !ViewerEvents() ) { return; }
- if( G.VOM.zoom.isZooming ) {
- // pan zoomed image
- ViewerImagePanSetPosition(G.VOM.panPosX + ev.deltaX, G.VOM.panPosY + ev.deltaY, G.VOM.$mediaCurrent, false);
- if( G.VOM.toolbarsDisplayed == true ) {
- G.VOM.toolsHide();
- }
- }
- else {
- if( ev.deltaY > G.VOM.panThreshold && Math.abs(ev.deltaX) < G.VOM.panThreshold && !G.VOM.panXOnly ) {
- // pan viewer down
- ViewerMediaPanX( 0 );
- var dist = Math.min(ev.deltaY, 200);
- G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(' + dist + 'px) ';
- G.VOM.$viewer.css('opacity', 1-dist/200/2);
+
+ if( G.VOM.panMode == 'off' ) {
+ // PAN START -> determine the element to pan
+ if( ev.target.dataset.ngy2_lightbox_thumbnail != undefined || ev.target.dataset.ngy2_lightbox_gallery != undefined ){
+ G.VOM.panMode = 'gallery';
}
else {
- // pan media left/right
- if( Math.abs(ev.deltaX) > G.VOM.panThreshold ) {
- G.VOM.panXOnly = true;
+ if( G.VOM.zoom.isZooming ) {
+ G.VOM.panMode = 'zoom';
+ }
+ else {
+ G.VOM.panMode = 'media';
}
- ViewerMediaPanX( ev.deltaX );
- G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(0px)';
- G.VOM.$viewer.css('opacity', 1);
}
}
+
+ // PAN the determined element
+ switch( G.VOM.panMode ) {
+ case 'zoom':
+ // pan zoomed image
+ ViewerImagePanSetPosition(G.VOM.panPosX + ev.deltaX, G.VOM.panPosY + ev.deltaY, G.VOM.content.current.$media, false);
+ G.VOM.toolsHide();
+ break;
+
+ case 'media':
+ if( Math.abs(ev.deltaY) > G.VOM.panThreshold && Math.abs(ev.deltaX) < G.VOM.panThreshold && !G.VOM.panXOnly ) {
+ // pan viewer down/up to close the lightbox
+ ViewerMediaPanX( 0 );
+ var dist = 0;
+ if( ev.deltaY < 0 ) {
+ // pan up
+ dist = Math.max( ev.deltaY, -200);
+ }
+ else {
+ // pan down
+ dist = Math.min( ev.deltaY, 200);
+ }
+ G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(' + dist + 'px) ';
+ G.VOM.$viewer.css('opacity', 1-Math.abs(dist)/200/2);
+ }
+ else {
+ // pan media left/right
+ if( Math.abs(ev.deltaX) > G.VOM.panThreshold ) {
+ G.VOM.panXOnly = true;
+ }
+ ViewerMediaPanX( ev.deltaX );
+ G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(0px)';
+ G.VOM.$viewer.css('opacity', 1);
+ }
+ break;
+
+ case 'gallery':
+ G.VOM.gallery.PanGallery( ev.deltaX );
+ break;
+ }
+
});
// PAN END
G.VOM.hammertime.on('panend', function(ev) {
if( !ViewerEvents() ) { return; }
- if( G.VOM.zoom.isZooming ) {
- G.VOM.timeImgChanged = new Date().getTime();
- ViewerImagePanSetPosition(G.VOM.panPosX+ev.deltaX, G.VOM.panPosY+ev.deltaY, G.VOM.$mediaCurrent, true);
- }
- else {
- var panY = false;
- if( !G.VOM.panXOnly ) {
- if( ev.deltaY > 50 && Math.abs(ev.deltaX) < 50 ) {
- // close viewer
- CloseInternalViewer(G.VOM.currItemIdx);
- panY = true;
- }
- }
- if( !panY ) {
- if( Math.abs( ev.deltaX ) < 50 ) {
- ViewerMediaPanX(0);
+
+ switch( G.VOM.panMode ) {
+ case 'zoom':
+ // PAN END in image zoom mode
+ G.VOM.timeImgChanged = new Date().getTime();
+ ViewerImagePanSetPosition( G.VOM.panPosX+ev.deltaX, G.VOM.panPosY+ev.deltaY, G.VOM.content.current.$media, true);
+ break;
+ case 'media':
+ var panY = false;
+ if( !G.VOM.panXOnly ) {
+ if( Math.abs(ev.deltaY) > 50 && Math.abs(ev.deltaX) < 50 ) {
+ // close viewer
+ LightboxClose();
+ panY = true;
+ }
}
- else {
- ev.deltaX > 50 ? DisplayPreviousMedia() : DisplayNextMedia();
+ if( !panY ) {
+ if( Math.abs( ev.deltaX ) < 50 ) {
+ ViewerMediaPanX(0);
+ }
+ else {
+ ev.deltaX > 50 ? DisplayPreviousMedia( Math.abs(ev.velocityX) ) : DisplayNextMedia( Math.abs(ev.velocityX) );
+ }
}
- }
+ G.VOM.panXOnly = false;
+ break;
+ case 'gallery':
+ // PAN END on thumbnail gallery
+ G.VOM.gallery.posX += ev.deltaX;
+ G.VOM.gallery.PanGallery( 0 );
+ G.VOM.gallery.PanGalleryEnd( ev.velocityX );
+ break;
}
- G.VOM.panXOnly = false;
+
+ G.VOM.panMode = 'off';
});
+
+ // ZOOM FEATURE ENABLED
if( G.O.viewerZoom ) {
-
- G.VOM.hammertime.add( new NGHammer.Tap({ event: 'doubletap', taps: 2 }) );
+
+ G.VOM.hammertime.add( new NGHammer.Tap({ event: 'doubletap', taps: 2, interval: 250 }) );
G.VOM.hammertime.add( new NGHammer.Tap({ event: 'singletap' }) );
G.VOM.hammertime.get('doubletap').recognizeWith('singletap');
G.VOM.hammertime.get('singletap').requireFailure('doubletap');
// single tap -> next/previous media
G.VOM.hammertime.on('singletap', function(ev) {
- if( !ViewerEvents() ) { return; }
+
+ if( !ViewerEvents() ) { return; }
+
+ // Gallery on viewer -> click/touch on one thumbnail -> display corresponding image
+ if( ev.target.dataset.ngy2_lightbox_thumbnail != undefined ){
+
+ var idx = parseInt(ev.target.dataset.ngy2_idx);
+ var vidx = parseInt(ev.target.dataset.ngy2_vidx);
+
+ if( idx != undefined && vidx != G.VOM.content.current.vIdx ) {
+
+ if( vidx > G.VOM.content.current.vIdx ) {
+ TriggerCustomEvent('lightboxNextImage');
+
+ // replace the next media with selected media
+ G.VOM.content.next.$media.empty();
+ var nextItem = G.I[idx];
+ G.VOM.content.next.vIdx = vidx;
+ var spreloader = '
';
+ if( nextItem.mediaKind == 'img' && nextItem.imageWidth != 0 && nextItem.imageHeight != 0 ) {
+ spreloader = '
';
+ }
+ G.VOM.content.next.$media.append( spreloader + nextItem.mediaMarkup );
+ if( nextItem.mediaKind == 'img' ) {
+ G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved, nextItem);
+ }
+ else {
+ ViewerMediaCenterNotImg( G.VOM.content.next.$media );
+ }
+ LightboxDisplay('nextImage');
+
+ }
+ else {
+ TriggerCustomEvent('lightboxPreviousImage');
+
+ // replace the previous media with selected media
+ G.VOM.content.previous.$media.empty();
+ var previousItem = G.I[idx];
+ G.VOM.content.previous.vIdx = vidx;
+ var spreloader = '
';
+ if( previousItem.mediaKind == 'img' && previousItem.imageWidth != 0 && previousItem.imageHeight != 0 ) {
+ spreloader = '
';
+ }
+ G.VOM.content.previous.$media.append( spreloader + previousItem.mediaMarkup );
+ if( previousItem.mediaKind == 'img' ) {
+ G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved, previousItem);
+ }
+ else {
+ ViewerMediaCenterNotImg( G.VOM.content.previous.$media );
+ }
+ LightboxDisplay('previousImage');
+ }
+ return;
+ }
+ }
+
+
StopPropagationPreventDefault(ev.srcEvent);
if( G.VOM.toolbarsDisplayed == false ) {
debounce( ViewerToolsUnHide, 100, false)();
+ G.VOM.singletapTime = new Date().getTime();
}
else {
+ // toolbars are displayed -> display next/previous media
+ if( (new Date().getTime()) - G.VOM.singletapTime < 400 ) { return; } // to avoid conflict with MOUSEMOVE event
if( ev.target.className.indexOf('nGY2ViewerMedia') !== -1 ) {
- if( ev.srcEvent.pageX < (G.GOM.cache.viewport.w/2) ) {
+ var x =0;
+ if( ev.srcEvent instanceof MouseEvent ) {
+ x = ev.srcEvent.pageX;
+ }
+ else {
+ x = ev.srcEvent.changedTouches[0].pageX;
+ }
+ if( x < (G.GOM.cache.viewport.w/2) ) {
DisplayPreviousMedia();
}
else {
@@ -8304,7 +9086,7 @@
if( G.VOM.zoom.isZooming ) {
G.VOM.zoom.isZooming = false;
// G.VOM.zoom.userFactor = 1;
- ResizeInternalViewer(true);
+ ResizeLightbox(true);
}
else {
if( ViewerZoomStart() ) {
@@ -8333,19 +9115,35 @@
}
});
}
+
+
else {
- // no zoom -> click/tap on image to go to next/previous one
- G.VOM.hammertime.on('tap', function(ev) {
+ // ZOOM FEATURE DISABLED
+
+ G.VOM.hammertime.add( new NGHammer.Tap({ event: 'singletap' }) );
+
+ // click/tap on image to go to next/previous one
+ // G.VOM.hammertime.on('tap', function(ev) {
+ G.VOM.hammertime.on('singletap', function(ev) {
if( !ViewerEvents() ) { return; }
- StopPropagationPreventDefault(ev.srcEvent);
+ StopPropagationPreventDefault( ev.srcEvent );
if( G.VOM.toolbarsDisplayed == false ){
// display tools on tap if hidden
debounce( ViewerToolsUnHide, 100, false)();
+ G.VOM.singletapTime = new Date().getTime();
}
else {
- // display next/previous image if tools not hidden
+ // toolbars are displayed -> display next/previous media
+ if( (new Date().getTime()) - G.VOM.singletapTime < 400 ) { return; } // to avoid conflict with MOUSEMOVE event
if( ev.target.className.indexOf('nGY2ViewerMedia') !== -1 ) {
- if( ev.srcEvent.pageX < (G.GOM.cache.viewport.w/2) ) {
+ var x = 0;
+ if( ev.srcEvent instanceof MouseEvent ) {
+ x = ev.srcEvent.pageX;
+ }
+ else {
+ x = ev.srcEvent.changedTouches[0].pageX;
+ }
+ if( x < (G.GOM.cache.viewport.w/2) ) {
DisplayPreviousMedia();
}
else {
@@ -8358,7 +9156,8 @@
}
}
}
-
+
+
function StopPropagationPreventDefault(e) {
e.stopPropagation();
e.preventDefault();
@@ -8373,25 +9172,30 @@
}
function ViewerToolsUnHide() {
- if( G.VOM.viewerDisplayed ) {
+ if( G.VOM.viewerDisplayed ) {
G.VOM.toolbarsDisplayed = true;
ViewerToolsOpacity(1);
- G.VOM.toolsHide();
+ G.VOM.toolsHide(); // re-init delay before hide tools+gallery
}
}
function ViewerToolsOpacity( op ) {
- if( G.VOM.$toolbar != null ) {
- G.VOM.$toolbar.css('opacity', op);
- }
+ if( G.VOM.$toolbar != null ) {
+ G.VOM.$toolbar.css('opacity', op);
+ }
if( G.VOM.$toolbarTL != null ) {
G.VOM.$toolbarTL.css('opacity', op);
}
if( G.VOM.$toolbarTR != null ) {
G.VOM.$toolbarTR.css('opacity', op);
}
+
+ // next/previous
G.VOM.$content.find('.nGY2ViewerAreaNext').css('opacity', op);
G.VOM.$content.find('.nGY2ViewerAreaPrevious').css('opacity', op);
+
+ // gallery
+ // G.VOM.gallery.$elt.css('opacity', op);
}
@@ -8405,7 +9209,7 @@
}
- // Actions of the buttton/elements
+ // Actions of the button/elements
function ViewerToolsAction(e) {
// delay to avoid twice handling on smartphone/tablet (both touchstart click events are fired)
if( (new Date().getTime()) - G.timeLastTouchStart < 300 ) { return; }
@@ -8454,88 +9258,110 @@
break;
case 'info':
e.stopPropagation();
- ItemDisplayInfo(G.VOM.NGY2Item(0));
+ ItemDisplayInfo( G.VOM.content.current.NGY2Item() );
break;
case 'close':
StopPropagationPreventDefault(e);
if( (new Date().getTime()) - G.VOM.timeImgChanged < 400 ) { return; }
- CloseInternalViewer(G.VOM.currItemIdx);
+ LightboxClose();
break;
case 'download':
StopPropagationPreventDefault(e);
- DownloadImage(G.VOM.items[G.VOM.currItemIdx].ngy2ItemIdx);
+ DownloadImage(G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx);
break;
case 'share':
StopPropagationPreventDefault(e);
- PopupShare(G.VOM.items[G.VOM.currItemIdx].ngy2ItemIdx);
+ PopupShare(G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx);
break;
case 'linkOriginal':
StopPropagationPreventDefault(e);
- OpenOriginal( G.VOM.NGY2Item(0) );
+ OpenOriginal( G.VOM.content.current.NGY2Item() );
+ break;
+ case 'rotateLeft':
+ StopPropagationPreventDefault(e);
+ ViewerImageRotate(-90);
+ break;
+ case 'rotateRight':
+ StopPropagationPreventDefault(e);
+ ViewerImageRotate(90);
break;
- case 'rotateLeft':
+ case 'shoppingcart':
StopPropagationPreventDefault(e);
- ViewerImageRotate(-90);
- break;
- case 'rotateRight':
- StopPropagationPreventDefault(e);
- ViewerImageRotate(90);
+ AddToCart( G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx, 'lightbox');
break;
}
// custom button
var fu = G.O.fnImgToolbarCustClick;
- if( ngy2action.indexOf('custom') == 0 && fu !== null ) {
- typeof fu == 'function' ? fu(ngy2action, $this, G.VOM.NGY2Item(0)) : window[fu](ngy2action, $this, G.VOM.NGY2Item(0));
- }
- }
-
- // rotate displayed image
- function ViewerImageRotate( angle ) {
- var item = G.VOM.NGY2Item(0);
- if( item.mediaKind == 'img' ) {
- item.rotationAngle += angle;
- item.rotationAngle = item.rotationAngle % 360;
- if( item.rotationAngle < 0 ) {
- item.rotationAngle += 360;
- }
- ViewerMediaPanX( 0 );
- ViewerMediaSetPosAndZoomOne( G.VOM.NGY2Item(0), G.VOM.$mediaCurrent, true );
- }
+ if( ngy2action.indexOf('custom') == 0 && fu !== null ) {
+ typeof fu == 'function' ? fu(ngy2action, $this, G.VOM.content.current.NGY2Item() ) : window[fu](ngy2action, $this, G.VOM.content.current.NGY2Item() );
+ }
+ }
+
+ // rotate displayed image
+ function ViewerImageRotate( angle ) {
+ var item = G.VOM.content.current.NGY2Item();
+ if( item.mediaKind == 'img' ) {
+ item.rotationAngle += angle;
+ item.rotationAngle = item.rotationAngle % 360;
+ if( item.rotationAngle < 0 ) {
+ item.rotationAngle += 360;
+ }
+ ViewerMediaPanX( 0 );
+ ViewerMediaSetPosAndZoomOne( G.VOM.content.current, true );
+ }
}
- // Display photo infos
- function ItemDisplayInfo( item ) {
-
- var content = '';
- content += '';
- if( item.author != '' ) {
- content += '';
- }
- if( item.exif.model != '' ) {
- content += '';
- }
- var sexif = '';
- sexif += item.exif.flash == '' ? '' : ' ' + item.exif.flash;
- sexif += item.exif.focallength == '' ? '' : ' ' + item.exif.focallength+'mm';
- sexif += item.exif.fstop == '' ? '' : ' f' + item.exif.fstop;
- sexif += item.exif.exposure == '' ? '' : ' ' + item.exif.exposure+'s';
- sexif += item.exif.iso == '' ? '' : ' ' + item.exif.iso+' ISO';
- if( item.exif.time != '' ) {
- // var date = new Date(parseInt(item.exif.time));
+ // Display photo infos in popup/modal
+ function ItemDisplayInfo( ng2item ) {
+
+ var content = '';
+ content += '';
+ if( ng2item.author != '' ) {
+ content += '';
+ }
+ if( ng2item.exif.model != '' ) {
+ content += '';
+ }
+ var sexif = G.O.icons.picture + ':';
+ if( ng2item.exif.flash != '' || ng2item.exif.focallength != '' || ng2item.exif.fstop != '' || ng2item.exif.exposure != '' || ng2item.exif.iso != '' || ng2item.exif.time != '' ) {
+ sexif += '
';
+ sexif += ng2item.exif.flash == '' ? '' : ' ' + ng2item.exif.flash;
+ sexif += ng2item.exif.focallength == '' ? '' : ' ' + ng2item.exif.focallength+'mm';
+ sexif += ng2item.exif.fstop == '' ? '' : ' f' + ng2item.exif.fstop;
+ sexif += ng2item.exif.exposure == '' ? '' : ' ' + ng2item.exif.exposure+'s';
+ sexif += ng2item.exif.iso == '' ? '' : ' ' + ng2item.exif.iso+' ISO';
+ if( ng2item.exif.time != '' ) {
+ // var date = new Date(parseInt(ng2item.exif.time));
// sexif += ' '+date.toLocaleDateString();
- sexif += ' ' + item.exif.time;
+ sexif += ' ' + ng2item.exif.time;
+ }
+ }
+ else {
+ sexif += ' n/a';
}
content += '';
- if( item.exif.location != '' ) {
- content += '';
+ if( ng2item.exif.location != '' ) {
+ content += '';
// embed google map in iframe (no api key required)
- content += '
';
+ content += '
';
+ }
+ else {
+ content += '';
}
- Popup(G.O.icons.viewerInfo, content, 'Left');
+ var r = { title: G.O.icons.viewerInfo, content: content };
+
+ // callback
+ var fu = G.O.fnPopupMediaInfo;
+ if( fu !== null ) {
+ typeof fu == 'function' ? r=fu(ng2item, r.title, r.content) : r=window[fu](ng2item, r.title, r.content);
+ }
+
+
+ Popup( r.title, r.content, 'Left');
}
@@ -8546,6 +9372,7 @@
e=elt.replace(/^\s+|\s+$/g, ''); // remove trailing/leading whitespace
switch( e ) {
case 'minimizeButton':
+ case 'minimize':
var ic = G.O.icons.viewerToolbarMin;
if( G.VOM.toolbarMode == 'min' ) {
ic = G.O.icons.viewerToolbarStd;
@@ -8553,30 +9380,36 @@
r += 'minimizeButton nGEvent" data-ngy2action="minimize">'+ic+'
';
break;
case 'previousButton':
- r += 'previousButton nGEvent" data-ngy2action="previous">'+G.O.icons.viewerPrevious+'