From a8bfa38a5032cf530c72a4db830fc0588297d56b Mon Sep 17 00:00:00 2001 From: crnormand Date: Thu, 10 Nov 2022 23:57:06 -0500 Subject: [PATCH] 0.10 --- image-previewer.js | 10 ++++++---- module.json | 42 +++++++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/image-previewer.js b/image-previewer.js index f0920fb..14aa206 100644 --- a/image-previewer.js +++ b/image-previewer.js @@ -11,7 +11,7 @@ class ImagePreviewer extends Application { } getData() { - return { preview: this.imageUrl} + return { preview: this.imageUrl } } showPreview(imageUrl, previewPos) { @@ -49,9 +49,11 @@ Hooks.on('renderFilePicker', (app, html, data) => { } // get the proper image path let path = ev.target.dataset.path; - let fileExtension = path.split('.')[path.split('.').length - 1].toLowerCase(); - if (fileExtension in CONST.IMAGE_FILE_EXTENSIONS) { - imagePreviewer.showPreview(path, previewPos); + if (path) { + let fileExtension = path.split('.')[path.split('.').length - 1].toLowerCase(); + if (fileExtension in CONST.IMAGE_FILE_EXTENSIONS) { + imagePreviewer.showPreview(path, previewPos); + } } }, ev => { imagePreviewer.hoverOff(); diff --git a/module.json b/module.json index 715afc5..132c4d7 100644 --- a/module.json +++ b/module.json @@ -1,15 +1,27 @@ -{ - "name": "image-previewer", - "title": "Image Previewer", - "description": "A little app to preview images when you hover over them in the file picker menu.", - "version": "0.9", - "author": "Chris Normand/Nose66#6689", - "scripts": ["./image-previewer.js"], - "styles": ["./image-previewer.css"], - "packs": [], - "url": "https://github.com/crnormand/image-previewer", - "manifest": "https://raw.githubusercontent.com/crnormand/image-previewer/release/module.json", - "download": "https://github.com/crnormand/image-previewer/archive/0.9.zip", - "minimumCoreVersion": "9", - "compatibleCoreVersion": "9" -} +{ + "title": "Image Previewer", + "description": "A little app to preview images when you hover over them in the file picker menu.", + "version": "0.10", + "scripts": [ + "image-previewer.js" + ], + "styles": [ + "image-previewer.css" + ], + "url": "https://github.com/crnormand/image-previewer", + "manifest": "https://raw.githubusercontent.com/crnormand/image-previewer/release/module.json", + "download": "https://github.com/crnormand/image-previewer/archive/0.10.zip", + "id": "image-previewer", + "authors": [ + { + "name": "Chris Normand", + "email": "nose66@bellsouth.net", + "discord": "Nose66#6689", + "flags": {} + } + ], + "compatibility": { + "minimum": "9", + "verified": "10" + } +} \ No newline at end of file