diff --git a/scripts/3rd-party/backend.js b/scripts/3rd-party/backend.js index 99985a32..da45ced8 100644 --- a/scripts/3rd-party/backend.js +++ b/scripts/3rd-party/backend.js @@ -316,7 +316,7 @@ const SmartAlbumID = Object.freeze({ * @property {string} landing_page_enable - actually a boolean * @property {string} lang * @property {string[]} lang_available - * @property {string} layout - actually a number: `0`, `1` or `2` + * @property {string} layout - `square`, `justified` or `unjustified` * @property {string} [location] * @property {string} location_decoding - actually a boolean * @property {string} location_show - actually a boolean diff --git a/scripts/main/build.js b/scripts/main/build.js index 91a7caed..e5363977 100644 --- a/scripts/main/build.js +++ b/scripts/main/build.js @@ -287,7 +287,7 @@ build.photo = function (data, disabled = false) { lychee.locale["PHOTO_THUMBNAIL"] }' data-overlay='false' draggable='false' data-tabindex='${tabindex.get_next_tab_index()}'>`; } - } else if (lychee.layout === 0) { + } else if (lychee.layout === "square") { if (data.size_variants.thumb2x !== null) { thumb2x = data.size_variants.thumb2x.url; } diff --git a/scripts/main/lychee.js b/scripts/main/lychee.js index 45da9385..204b388e 100644 --- a/scripts/main/lychee.js +++ b/scripts/main/lychee.js @@ -32,13 +32,13 @@ const lychee = { /** * Values: * - * - `0`: Use default, "square" layout. - * - `1`: Use Flickr-like "justified" layout. - * - `2`: Use Google-like "unjustified" layout + * - `square`: Use default, "square" layout. + * - `justified`: Use Flickr-like "justified" layout. + * - `unjustified`: Use Google-like "unjustified" layout * - * @type {number} + * @type {string} */ - layout: 1, + layout: "justified", /** * Display search in public mode. * @type {boolean} @@ -546,8 +546,7 @@ lychee.parsePublicInitializationData = function (data) { lychee.album_decoration = data.config.album_decoration || "layers"; lychee.album_decoration_orientation = data.config.album_decoration_orientation || "row"; lychee.checkForUpdates = data.config.check_for_updates; - lychee.layout = Number.parseInt(data.config.layout, 10); - if (Number.isNaN(lychee.layout)) lychee.layout = 1; + lychee.layout = data.config.layout || "justified"; lychee.landing_page_enable = data.config.landing_page_enable; lychee.public_search = data.config.public_search; lychee.image_overlay_type = data.config.image_overlay_type || "exif"; diff --git a/scripts/main/search.js b/scripts/main/search.js index 1c452bae..30898fbd 100644 --- a/scripts/main/search.js +++ b/scripts/main/search.js @@ -90,9 +90,9 @@ search.find = function (term) { if (albumsData !== "") albums_divider += " (" + (search.json.tag_albums.length + search.json.albums.length) + ")"; if (photosData !== "") { photos_divider += " (" + search.json.photos.length + ")"; - if (lychee.layout === 1) { + if (lychee.layout === "justified") { photosData = '
${lychee.locale["LAYOUT_TYPE"]}