diff --git a/css.css b/css/gal.css similarity index 100% rename from css.css rename to css/gal.css diff --git a/base.js b/js/base.js similarity index 96% rename from base.js rename to js/base.js index 87df304..d2a9e4c 100644 --- a/base.js +++ b/js/base.js @@ -8,6 +8,7 @@ function getWidget(type) { if (typeof imageViewElements !== "function") {getJavascript(path+"imageViewElements");} } if ("gallery" == type) { + window.g_Gallery = {"pageCount":5, "parentID":"body"}; if (typeof getGalleries !== "function") {getJavascript(path+"getGalleries");} if (typeof putGalleries !== "function") {getJavascript(path+"putGalleries");} if (typeof listGalleries !== "function") {getJavascript(path+"listGalleries");} @@ -19,4 +20,4 @@ function getWidget(type) { if (typeof imageViewElements !== "function") {getJavascript(path+"imageViewElements");} if (typeof refreshImage !== "function") {getJavascript(path+"refreshImage");} } -} \ No newline at end of file +} diff --git a/libs/j/ImageListSelection b/libs/j/ImageListSelection index de2992b..74ad7f4 100644 --- a/libs/j/ImageListSelection +++ b/libs/j/ImageListSelection @@ -1,5 +1,5 @@ function ImageListSelection(position,count) { - count = "number" == typeof count ? count : 5; + count = "number" == typeof count ? count : window.g_Gallery.pageCount; var selection = window.curGallery.imageList.slice(position,position+count); window.curGallery.container.list.innerHTML = ""; selection.forEach( function (e,i) { diff --git a/libs/j/initGalery b/libs/j/initGalery index 196baf1..b6531e4 100644 --- a/libs/j/initGalery +++ b/libs/j/initGalery @@ -1,5 +1,5 @@ function initGalery(galleryName, pageCount) { - pageCount = "number" == typeof pageCount ? pageCount : 5; + pageCount = "number" == typeof pageCount ? pageCount : window.g_Gallery.pageCount; window.curGallery = {}; getImageList(window.api_url, galleryName); window.curGallery.Position = 0; diff --git a/libs/j/listGalleries b/libs/j/listGalleries index ef6253a..3788154 100644 --- a/libs/j/listGalleries +++ b/libs/j/listGalleries @@ -1,5 +1,5 @@ function listGalleries() { - window.galleryBox = elementPlace("body","GalleryBox",null,"div"); + window.galleryBox = elementPlace(window.g_Gallery.parentID,"GalleryBox",null,"div"); window.galleryList = elementPlace("#GalleryBox","GalleryList",null,"ul"); window.galleryList.innerHTML = ""; window.galleriesList.forEach(function(e) {