Skip to content

Commit

Permalink
v5.9.2beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris-B committed Apr 24, 2016
1 parent 7e05272 commit 4a0e284
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 40 deletions.
3 changes: 2 additions & 1 deletion demonstration.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,15 @@
items:contentGalleryMLN,
//paginationMaxItemsPerPage:3,
paginationMaxLinesPerPage:1,
// paginationDots : true,
paginationVisiblePages: 4,
thumbnailHoverEffect:'imageInvisible,imageScale150',
viewerDisplayLogo:true,
useTags:false,
locationHash:false,
breadcrumbAutoHideTopLevel:true,
maxItemsPerLine:5,
locationHash: false,
paginationDots : true,
itemsBaseURL:'demonstration/'
});

Expand Down
98 changes: 59 additions & 39 deletions jquery.nanogallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
nanoGALLERY v5.9.2beta release notes.
##### New options
- **paginationVisiblePages**: maximum visible pages.
*integer; Default: 10*
- nanoPhotosProvider now supports options `albumList`, `whiteList`, `blackList`, `album`
##### Misc
- spanish translation (thanks to eae710 - https://github.com/eae710)
**Visit nanoGALLERY homepage for usage details: [http://nanogallery.brisbois.fr](http://www.nanogallery.brisbois.fr/)**
Expand Down Expand Up @@ -113,6 +119,7 @@ nanoGALLERY v5.9.2beta release notes.
keepSelection: false,
jsonCharset: 'Latin', jsonProvider: '',
paginationMaxLinesPerPage : 0, paginationDots : false, paginationSwipe : true,
paginationVisiblePages : 10,
maxWidth : 0,
viewer : 'internal',
viewerFullscreen: false,
Expand Down Expand Up @@ -1402,7 +1409,7 @@ nanoGALLERY v5.9.2beta release notes.

// CUSTOM STORAGE
case 'json':
NGAddItem(G.i18nTranslations.breadcrumbHome, '', '', '', '', 'album', '', '0', '-1' );
NGAddItem(G.i18nTranslations.breadcrumbHome, '', '', '', '', 'album', '', G.O.album.length > 0 ? encodeURIComponent(G.O.album) : '0', '-1' );
JsonProcessItems(0,true,-1,false);
break;

Expand Down Expand Up @@ -1600,6 +1607,7 @@ nanoGALLERY v5.9.2beta release notes.
// open URL
if( G.I[n].destinationURL !== undefined && G.I[n].destinationURL.length >0 ) {
window.location = G.I[n].destinationURL;
//window.open(G.I[n].destinationURL, '_blank');
return;
}

Expand Down Expand Up @@ -2032,7 +2040,7 @@ nanoGALLERY v5.9.2beta release notes.
if( G.O.whiteList != '' ) { G.whiteList=G.O.whiteList.toUpperCase().split('|'); }
if( G.O.albumList != '' ) { G.albumList=G.O.albumList.toUpperCase().split('|'); }

if( G.O.kind == 'picasa' || G.O.kind == 'flickr' ) {
if( G.O.kind == 'picasa' || G.O.kind == 'flickr' || G.O.kind == 'json' ) {
G.O.displayBreadcrumb=true;
}
// flickr
Expand Down Expand Up @@ -3158,6 +3166,7 @@ nanoGALLERY v5.9.2beta release notes.
}

var url = G.O.jsonProvider + '?albumID='+encodeURIComponent(G.I[albumIdx].GetID());
console.log(url);
PreloaderShow();

jQuery.ajaxSetup({ cache: false });
Expand Down Expand Up @@ -3246,48 +3255,56 @@ nanoGALLERY v5.9.2beta release notes.
if( description === undefined ) { description=''; }

var destinationURL='';

var albumID=0;
if( item.albumID !== undefined ) {
albumID=(item.albumID);
foundAlbumID=true;

var kind='image';
if( item.kind !== undefined && item.kind.length>0 ) {
kind=item.kind;
}

var ID=null;
if( item.ID !== undefined ) {
ID=(item.ID);
}

var kind='image';
if( item.kind !== undefined && item.kind.length>0 ) {
kind=item.kind;
var ok=true;
if( kind == 'album' ) {
if( !CheckAlbumName(title, ID) ) { ok=false; }
}

var newItem=NGAddItem(title, thumbsrc, src, description, destinationURL, kind, '', ID, albumID );
// thumbnail image size
var tw=item.imgtWidth;
var th=item.imgtHeight;
if( ok ) {
var albumID=0;
if( item.albumID !== undefined ) {
albumID=(item.albumID);
foundAlbumID=true;
}

newItem.thumbs = {
url: { l1 : { xs:thumbsrc, sm:thumbsrc, me:thumbsrc, la:thumbsrc, xl:thumbsrc }, lN : { xs:thumbsrc, sm:thumbsrc, me:thumbsrc, la:thumbsrc, xl:thumbsrc } },
width: { l1 : { xs:tw, sm:tw, me:tw, la:tw, xl:tw }, lN : { xs:tw, sm:tw, me:tw, la:tw, xl:tw } },
height: { l1 : { xs:th, sm:th, me:th, la:th, xl:th }, lN : { xs:th, sm:th, me:th, la:th, xl:th } }
};
var newItem=NGAddItem(title, thumbsrc, src, description, destinationURL, kind, '', ID, albumID );
// thumbnail image size
var tw=item.imgtWidth;
var th=item.imgtHeight;

if( typeof G.O.fnProcessData == 'function' ) {
G.O.fnProcessData(newItem, 'api', null);
}
newItem.thumbs = {
url: { l1 : { xs:thumbsrc, sm:thumbsrc, me:thumbsrc, la:thumbsrc, xl:thumbsrc }, lN : { xs:thumbsrc, sm:thumbsrc, me:thumbsrc, la:thumbsrc, xl:thumbsrc } },
width: { l1 : { xs:tw, sm:tw, me:tw, la:tw, xl:tw }, lN : { xs:tw, sm:tw, me:tw, la:tw, xl:tw } },
height: { l1 : { xs:th, sm:th, me:th, la:th, xl:th }, lN : { xs:th, sm:th, me:th, la:th, xl:th } }
};

if( kind == 'image' ) {
newItem.imageNumber=nb;
nb++;
if( nb >= G.maxAlbums ) {
return false;
if( typeof G.O.fnProcessData == 'function' ) {
G.O.fnProcessData(newItem, 'api', null);
}

if( kind == 'image' ) {
newItem.imageNumber=nb;
nb++;
if( nb >= G.maxAlbums ) {
return false;
}
}
}
});

if( foundAlbumID ) {
G.O.displayBreadcrumb=true;
// G.O.displayBreadcrumb=true;
}

G.I[albumIdx].contentIsLoaded=true;
Expand Down Expand Up @@ -4103,7 +4120,8 @@ nanoGALLERY v5.9.2beta release notes.
// check album name - blackList/whiteList
function CheckAlbumName( title, ID) {
var s=title.toUpperCase();

ID=ID.toUpperCase();

if( G.albumList !== null ) {
for( var j=0; j<G.albumList.length; j++) {
if( s == G.albumList[j].toUpperCase() || ID == G.albumList[j] ) {
Expand Down Expand Up @@ -5037,23 +5055,24 @@ nanoGALLERY v5.9.2beta release notes.
var firstPage=0;
// pagination - max lines per page mode
if( G.pgMaxLinesPerPage > 0 && G.tn.settings.getH() != 'auto' && G.tn.settings.getW() != 'auto' ) {
// number of pages
n2=Math.ceil(G.I[albumIdx].contentLength/(G.pgMaxLinesPerPage*G.pgMaxNbThumbnailsPerRow));
}


var vp=G.O.paginationVisiblePages;

// no previous/next
if( G.O.paginationDots ) {
firstPage=0;
}
else {
if( pageNumber >= 5 ) {
firstPage=pageNumber-5;
if( n2 > pageNumber+6 ) {
n2=pageNumber+6;
if( !G.O.paginationDots ) {
if( pageNumber >= (vp/2) ) {
firstPage=pageNumber-(vp/2)+1;
if( n2 > pageNumber+(G.O.paginationVisiblePages/2)+1 ) {
n2=pageNumber+(G.O.paginationVisiblePages/2)+1;
}
}
else {
if( n2 > 10 ) {
n2=10;
if( n2 > G.O.paginationVisiblePages ) {
n2=G.O.paginationVisiblePages;
}
}
}
Expand Down Expand Up @@ -5268,6 +5287,7 @@ nanoGALLERY v5.9.2beta release notes.
onComplete(albumIdx, pageNumber);
return;
}

var item=G.I[idx];
if( item.albumID == G.I[albumIdx].GetID() ) {
currentCounter++;
Expand Down

0 comments on commit 4a0e284

Please sign in to comment.