Changeset 3110776
- Timestamp:
- 07/01/2024 11:47:57 PM (21 months ago)
- Location:
- tainacan-extra-view-modes/trunk
- Files:
-
- 4 edited
-
components/gallery-view-mode.bundle.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
tainacan-extra-viewmodes.php (modified) (3 diffs)
-
templates/view-mode-books.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tainacan-extra-view-modes/trunk/components/gallery-view-mode.bundle.js
r3075113 r3110776 390 390 391 391 "use strict"; 392 eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: \"ViewModeGallery\",\n data() {\n return {\n thumbPlaceholderPath: tainacan_plugin.base_url + '/assets/images/placeholder_square.png',\n isSlideshowViewModeEnabled: false,\n showMetadataPanel: false,\n CBPGridGalleryObject: null\n };\n },\n props: {\n collectionId: [Number, String],\n termId: [Number, String],\n displayedMetadata: Array,\n items: {\n type: Array,\n default: () => [],\n required: true\n },\n isLoading: false,\n totalItems: Number,\n isFiltersMenuCompressed: Boolean,\n enabledViewModes: Array\n },\n watch: {\n isFiltersMenuCompressed() {\n if (Masonry.currentMasonryInstance) {\n setTimeout(() => {\n Masonry.currentMasonryInstance.layout();\n }, 1000);\n }\n },\n isLoading: {\n handler(value) {\n const galleryElement = document.getElementById('grid-gallery');\n if (!value && galleryElement) {\n // Resets current\n if (Masonry.currentMasonryInstance) Masonry.currentMasonryInstance.destroy();\n this.showMetadataPanel = false;\n if (this.CBPGridGalleryObject === null) this.CBPGridGalleryObject = new CBPGridGallery(galleryElement);else this.CBPGridGalleryObject._init(galleryElement);\n }\n },\n immediate: true\n }\n },\n computed: {\n __() {\n return wp.i18n ? wp.i18n.__ : (str, ctx) => str;\n },\n queries() {\n let currentQueries = JSON.parse(JSON.stringify(this.$route.query));\n if (currentQueries) {\n delete currentQueries['view_mode'];\n delete currentQueries['fetch_only'];\n delete currentQueries['fetch_only_meta'];\n }\n return currentQueries;\n }\n },\n mounted() {\n this.isSlideshowViewModeEnabled = this.enabledViewModes.findIndex(viewMode => viewMode == 'slideshow') >= 0;\n },\n methods: {\n getItemLink(itemUrl, index) {\n if (this.queries) {\n // Inserts information necessary for item by item navigation on single pages\n this.queries['pos'] = (this.queries['paged'] - 1) * this.queries['perpage'] + index;\n this.queries['source_list'] = this.termId ? 'term' : !this.collectionId || this.collectionId == 'default' ? 'repository' : 'collection';\n this.queries['ref'] = this.$route.path;\n return itemUrl + '?' + qs__WEBPACK_IMPORTED_MODULE_0___default().stringify(this.queries);\n }\n return itemUrl;\n },\n renderMetadata(itemMetadata, metadatum) {\n let metadata = itemMetadata && itemMetadata[metadatum.slug] != undefined ? itemMetadata[metadatum.slug] : false;\n if (!metadata) return '';else return metadata.value_as_html;\n },\n renderTheSecondaryMetadata(item) {\n let metadataHtml = '';\n for (let i = 1; i < this.displayedMetadata.length; i++) {\n if (this.displayedMetadata[i].display && this.displayedMetadata[i].metadata_type_object != undefined && this.displayedMetadata[i].metadata_type_object.related_mapped_prop != 'title') return this.renderMetadata(item.metadata, this.displayedMetadata[i]);\n }\n return metadataHtml;\n },\n randomHeightForMasonryItem() {\n let min = 120;\n let max = 380;\n return Math.floor(Math.random() * (max - min + 1) + min);\n },\n async starSlideshowFromHere(index) {\nawait this.$router.replace({\n query: {\n ...this.$route.query,\n ...{\n 'slideshow-from': index\n }\n }\n }).catch(error => this.$console.log(error));\n }\n },\n beforeDestroy() {\n if (Masonry.currentMasonryInstance) Masonry.currentMasonryInstance.destroy();\n }\n});\n\n//# sourceURL=webpack://tainacan-extra-viewmodes/./gallery-view-mode.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet%5B1%5D.rules%5B4%5D.use%5B0%5D");392 eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: \"ViewModeGallery\",\n data() {\n return {\n thumbPlaceholderPath: tainacan_plugin.base_url + '/assets/images/placeholder_square.png',\n isSlideshowViewModeEnabled: false,\n showMetadataPanel: false,\n CBPGridGalleryObject: null\n };\n },\n props: {\n collectionId: [Number, String],\n termId: [Number, String],\n displayedMetadata: Array,\n items: {\n type: Array,\n default: () => [],\n required: true\n },\n isLoading: false,\n totalItems: Number,\n isFiltersMenuCompressed: Boolean,\n enabledViewModes: Array\n },\n watch: {\n isFiltersMenuCompressed() {\n if (Masonry.currentMasonryInstance) {\n setTimeout(() => {\n Masonry.currentMasonryInstance.layout();\n }, 1000);\n }\n },\n isLoading: {\n handler(value) {\n const galleryElement = document.getElementById('grid-gallery');\n if (!value && galleryElement) {\n // Resets current\n if (Masonry.currentMasonryInstance) Masonry.currentMasonryInstance.destroy();\n this.showMetadataPanel = false;\n if (this.CBPGridGalleryObject === null) this.CBPGridGalleryObject = new CBPGridGallery(galleryElement);else this.CBPGridGalleryObject._init(galleryElement);\n }\n },\n immediate: true\n }\n },\n computed: {\n __() {\n return wp.i18n ? wp.i18n.__ : (str, ctx) => str;\n },\n queries() {\n let currentQueries = this.$route && this.$route.query ? JSON.parse(JSON.stringify(this.$route.query)) : {};\n if (currentQueries) {\n delete currentQueries['view_mode'];\n delete currentQueries['fetch_only'];\n delete currentQueries['fetch_only_meta'];\n }\n return currentQueries;\n }\n },\n mounted() {\n this.isSlideshowViewModeEnabled = this.enabledViewModes.findIndex(viewMode => viewMode == 'slideshow') >= 0;\n },\n methods: {\n getItemLink(itemUrl, index) {\n if (this.queries) {\n // Inserts information necessary for item by item navigation on single pages\n this.queries['pos'] = (this.queries['paged'] - 1) * this.queries['perpage'] + index;\n this.queries['source_list'] = this.termId ? 'term' : !this.collectionId || this.collectionId == 'default' ? 'repository' : 'collection';\n if (this.$route && this.$route.path) this.queries['ref'] = this.$route.path;\n return itemUrl + '?' + qs__WEBPACK_IMPORTED_MODULE_0___default().stringify(this.queries);\n }\n return itemUrl;\n },\n renderMetadata(itemMetadata, metadatum) {\n let metadata = itemMetadata && itemMetadata[metadatum.slug] != undefined ? itemMetadata[metadatum.slug] : false;\n if (!metadata) return '';else return metadata.value_as_html;\n },\n renderTheSecondaryMetadata(item) {\n let metadataHtml = '';\n for (let i = 1; i < this.displayedMetadata.length; i++) {\n if (this.displayedMetadata[i].display && this.displayedMetadata[i].metadata_type_object != undefined && this.displayedMetadata[i].metadata_type_object.related_mapped_prop != 'title') return this.renderMetadata(item.metadata, this.displayedMetadata[i]);\n }\n return metadataHtml;\n },\n randomHeightForMasonryItem() {\n let min = 120;\n let max = 380;\n return Math.floor(Math.random() * (max - min + 1) + min);\n },\n async starSlideshowFromHere(index) {\n if (this.$router && this.$route && this.$route.query) await this.$router.replace({\n query: {\n ...this.$route.query,\n ...{\n 'slideshow-from': index\n }\n }\n }).catch(error => this.$console.log(error));\n }\n },\n beforeDestroy() {\n if (Masonry.currentMasonryInstance) Masonry.currentMasonryInstance.destroy();\n }\n});\n\n//# sourceURL=webpack://tainacan-extra-viewmodes/./gallery-view-mode.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet%5B1%5D.rules%5B4%5D.use%5B0%5D"); 393 393 394 394 /***/ }), -
tainacan-extra-view-modes/trunk/readme.txt
r3075113 r3110776 2 2 Author: tainacan 3 3 Contributors: wetah, vnmedeiros, leogermani, tainacan 4 Tags: museums, libraries, archives, GLAM, collections, repository, tainacan, view modes4 Tags: museums, archives, repository, tainacan, view modes 5 5 Requires at least: 5.9 6 6 Tested up to: 6.5 7 7 Requires PHP: 7.0 8 Stable tag: 0.0. 48 Stable tag: 0.0.5 9 9 Requires Plugins: tainacan 10 10 License: GPLv2 or later … … 100 100 == Changelog == 101 101 102 = 0.0.5 = 103 * Renames mosaic slug to mosaic-legacy to avoid conflicts with Tainacan 0.21.7 oficial new mosaic view mode 104 102 105 = 0.0.4 = 103 106 * Migrates Gallery View mode to Vue3 for supporting Tainacan 0.21.0 -
tainacan-extra-view-modes/trunk/tainacan-extra-viewmodes.php
r3075113 r3110776 5 5 Description: Adds extra viewmodes to be used by your theme 6 6 Author: tainacan 7 Version: 0.0. 47 Version: 0.0.5 8 8 Text Domain: tainacan-extra-viewmodes 9 9 License: GPLv2 or later … … 12 12 13 13 /** Plugin version */ 14 const TAINACAN_EXTRA_VIEWMODES_PLUGIN_VERSION = '0.0. 4';14 const TAINACAN_EXTRA_VIEWMODES_PLUGIN_VERSION = '0.0.5'; 15 15 16 16 /** … … 25 25 26 26 // Registering the view modes 27 tainacan_register_view_mode('mosaic ', [27 tainacan_register_view_mode('mosaic-legacy', [ 28 28 'label' => 'Mosaic', 29 29 'description' => __('A simple and marginless mosaic of item thumbnails.', 'tainacan-extra-viewmodes'), -
tainacan-extra-view-modes/trunk/templates/view-mode-books.php
r2565425 r3110776 8 8 <div class="tainacan-book" style="background-image: url('<?php 9 9 if ( has_post_thumbnail() ) { 10 echo esc_url(the_post_thumbnail_url('tainacan-medium-full'));10 echo get_the_post_thumbnail_url(null, 'tainacan-medium-full'); 11 11 } else { 12 echo get_stylesheet_directory_uri() . '/assets/images/thumbnail_placeholder.png';12 echo plugins_url('', __FILE__ ) . '/thumbnail_placeholder.png'; 13 13 } 14 14 ?>'), linear-gradient(90deg,#aaa 5px,#ccc 12px,#f2f2f2 20px), linear-gradient(0deg,#ddd 0px,#f2f2f2 6px)">
Note: See TracChangeset
for help on using the changeset viewer.