Loading package.json +1 −1 Original line number Diff line number Diff line { "name": "@pdn-certic/vue-jama", "version": "0.5.2", "version": "0.5.3", "scripts": { "serve": "rimraf -rf ./node_modules/.cache/vue-loader && vue-cli-service serve", "build": "vue-cli-service build", Loading src/components/JamaCollectionSeadragon.vue +27 −22 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ <div :id="'collection-seadragon-'+collection.id" class="ma-0 pa-0 collection-seadragon flex-grow-1" @keyup.right="nextResource()" @keyup.left="previousResource()" /> </v-container> </template> Loading @@ -50,6 +49,8 @@ import OpenSeadragon from 'openseadragon'; import {mapGetters} from "vuex"; //next / prev key handler export default { name: "JamaCollectionSeadragon", Loading @@ -68,6 +69,21 @@ export default { return { viewer: null, fullscreen: false, keyHandler: (e) => { // if (e.defaultPrevented) { // return; // } // handler stopped if dialog box is displayed if (document.querySelector('.v-dialog.v-dialog--active')) return; if (e.key === 'ArrowRight') { this.nextResource(); e.preventDefault(); } else if (e.key === 'ArrowLeft') { this.previousResource(); e.preventDefault(); } } } }, Loading @@ -80,12 +96,10 @@ export default { this.updateViewerImages(); }, // page() { // this.updateViewerImages(); // }, resources(newResources, oldResources){ if(newResources[0].id !== oldResources[0].id) { if(newResources && newResources.length > 0 && newResources[0].id !== oldResources[0].id) { this.updateViewerImages(); } }, Loading Loading @@ -130,22 +144,12 @@ export default { }) //next / prev key bindings let keyHandler = (e) => { if (e.defaultPrevented) { return; } // handler stopped if dialog box is displayed if (document.querySelector('.v-dialog.v-dialog--active')) return; if (e.key === 'ArrowRight') { this.nextResource() } else if (e.key === 'ArrowLeft') { this.previousResource() } } document.addEventListener('keydown', keyHandler); document.addEventListener('keyup', this.keyHandler); }, beforeDestroy() { document.removeEventListener('keyup', this.keyHandler); }, methods: { Loading Loading @@ -173,10 +177,11 @@ export default { nextResource() { if (this.viewer.currentPage() + 1 === this.resources.length) { this.$emit('page-after') } else } else { this.viewer.goToPage(this.viewer.currentPage() + 1); } } } } </script> Loading src/components/VueJama.vue +45 −37 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ <v-pagination v-model="currentPage" :length="nbPages" @input="gotoPage" @input="gotoPage()" /> </v-row> </v-col> Loading Loading @@ -457,6 +457,35 @@ export default { hiddenRightPanel: false, rightPaneMaximized: false, rootCollectionInfos: null,//usefull for root coll pagination navHandler : (e) => { if (!this.currentResource || this.promptOptions) { return; } let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if (offset) { let target = this.resources[this.currentResourceIndex + offset]; if (target) { try { document.querySelector('#jama-resource-tile-' + target.id).click(); } catch (e) { return false } } } } } }, Loading Loading @@ -618,35 +647,11 @@ export default { Vue.prototype.$jamaPrompt = this.jamaPrompt Vue.prototype.$jamaConfirm = this.jamaConfirm document.addEventListener('keydown', (e) => { if (!this.currentResource || this.promptOptions) { return; } let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if (offset) { let target = this.resources[this.currentResourceIndex + offset]; if (target) { try { document.querySelector('#jama-resource-tile-' + target.id).click(); } catch (e) { return false } } } document.addEventListener('keyup', this.navHandler) }, }) beforeDestroy() { document.removeEventListener('keyup', this.navHandler) }, methods: { Loading Loading @@ -826,7 +831,6 @@ export default { resumeFileUpload(uploadInfos, file) { console.log("resume upload", uploadInfos) this.$jamaClient.resumeUpload(file, uploadInfos).then(() => this.loadCollection(this.currentCollection)); }, Loading Loading @@ -889,7 +893,7 @@ export default { }, //pagination async gotoPage(selectedIndex = -1) { async gotoPage(selectedIndex = null) { let start = (this.currentPage - 1) * this.pageLength; let end = start + this.pageLength; this.loading = true; Loading @@ -903,11 +907,15 @@ export default { } ).then(() => { this.loading = false; if(selectedIndex > -1) if(selectedIndex !== null) { if(selectedIndex >= 0) this.resourceSelected(this.resources[selectedIndex]) // if(lastItemSelect){ // this.$store.commit('setCurrentResource', this.resources[this.resources.length - 1]) // } else this.resourceSelected(this.resources[this.resources.length + selectedIndex]) } else { console.debug('no preselected resouces in page.') } }); Loading @@ -922,7 +930,7 @@ export default { tryPreviousPage() { if(this.currentPage > 1){ this.currentPage--; this.gotoPage(this.resources.length-1); this.gotoPage(-1); } } Loading Loading
package.json +1 −1 Original line number Diff line number Diff line { "name": "@pdn-certic/vue-jama", "version": "0.5.2", "version": "0.5.3", "scripts": { "serve": "rimraf -rf ./node_modules/.cache/vue-loader && vue-cli-service serve", "build": "vue-cli-service build", Loading
src/components/JamaCollectionSeadragon.vue +27 −22 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ <div :id="'collection-seadragon-'+collection.id" class="ma-0 pa-0 collection-seadragon flex-grow-1" @keyup.right="nextResource()" @keyup.left="previousResource()" /> </v-container> </template> Loading @@ -50,6 +49,8 @@ import OpenSeadragon from 'openseadragon'; import {mapGetters} from "vuex"; //next / prev key handler export default { name: "JamaCollectionSeadragon", Loading @@ -68,6 +69,21 @@ export default { return { viewer: null, fullscreen: false, keyHandler: (e) => { // if (e.defaultPrevented) { // return; // } // handler stopped if dialog box is displayed if (document.querySelector('.v-dialog.v-dialog--active')) return; if (e.key === 'ArrowRight') { this.nextResource(); e.preventDefault(); } else if (e.key === 'ArrowLeft') { this.previousResource(); e.preventDefault(); } } } }, Loading @@ -80,12 +96,10 @@ export default { this.updateViewerImages(); }, // page() { // this.updateViewerImages(); // }, resources(newResources, oldResources){ if(newResources[0].id !== oldResources[0].id) { if(newResources && newResources.length > 0 && newResources[0].id !== oldResources[0].id) { this.updateViewerImages(); } }, Loading Loading @@ -130,22 +144,12 @@ export default { }) //next / prev key bindings let keyHandler = (e) => { if (e.defaultPrevented) { return; } // handler stopped if dialog box is displayed if (document.querySelector('.v-dialog.v-dialog--active')) return; if (e.key === 'ArrowRight') { this.nextResource() } else if (e.key === 'ArrowLeft') { this.previousResource() } } document.addEventListener('keydown', keyHandler); document.addEventListener('keyup', this.keyHandler); }, beforeDestroy() { document.removeEventListener('keyup', this.keyHandler); }, methods: { Loading Loading @@ -173,10 +177,11 @@ export default { nextResource() { if (this.viewer.currentPage() + 1 === this.resources.length) { this.$emit('page-after') } else } else { this.viewer.goToPage(this.viewer.currentPage() + 1); } } } } </script> Loading
src/components/VueJama.vue +45 −37 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ <v-pagination v-model="currentPage" :length="nbPages" @input="gotoPage" @input="gotoPage()" /> </v-row> </v-col> Loading Loading @@ -457,6 +457,35 @@ export default { hiddenRightPanel: false, rightPaneMaximized: false, rootCollectionInfos: null,//usefull for root coll pagination navHandler : (e) => { if (!this.currentResource || this.promptOptions) { return; } let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if (offset) { let target = this.resources[this.currentResourceIndex + offset]; if (target) { try { document.querySelector('#jama-resource-tile-' + target.id).click(); } catch (e) { return false } } } } } }, Loading Loading @@ -618,35 +647,11 @@ export default { Vue.prototype.$jamaPrompt = this.jamaPrompt Vue.prototype.$jamaConfirm = this.jamaConfirm document.addEventListener('keydown', (e) => { if (!this.currentResource || this.promptOptions) { return; } let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if (offset) { let target = this.resources[this.currentResourceIndex + offset]; if (target) { try { document.querySelector('#jama-resource-tile-' + target.id).click(); } catch (e) { return false } } } document.addEventListener('keyup', this.navHandler) }, }) beforeDestroy() { document.removeEventListener('keyup', this.navHandler) }, methods: { Loading Loading @@ -826,7 +831,6 @@ export default { resumeFileUpload(uploadInfos, file) { console.log("resume upload", uploadInfos) this.$jamaClient.resumeUpload(file, uploadInfos).then(() => this.loadCollection(this.currentCollection)); }, Loading Loading @@ -889,7 +893,7 @@ export default { }, //pagination async gotoPage(selectedIndex = -1) { async gotoPage(selectedIndex = null) { let start = (this.currentPage - 1) * this.pageLength; let end = start + this.pageLength; this.loading = true; Loading @@ -903,11 +907,15 @@ export default { } ).then(() => { this.loading = false; if(selectedIndex > -1) if(selectedIndex !== null) { if(selectedIndex >= 0) this.resourceSelected(this.resources[selectedIndex]) // if(lastItemSelect){ // this.$store.commit('setCurrentResource', this.resources[this.resources.length - 1]) // } else this.resourceSelected(this.resources[this.resources.length + selectedIndex]) } else { console.debug('no preselected resouces in page.') } }); Loading @@ -922,7 +930,7 @@ export default { tryPreviousPage() { if(this.currentPage > 1){ this.currentPage--; this.gotoPage(this.resources.length-1); this.gotoPage(-1); } } Loading