diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5368772 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 usero2 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1be30b9..a60f0e7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A powerful and fast native CBZ (Comic Book Archive) reader for Obsidian. Read your favorite mangas, comics, and graphic novels directly inside your Obsidian vault with a beautifully crafted, high-performance interface. -![](images/Obsidian_TMmY6ZAHJQ.png) +![](images/) ## ✨ Features diff --git a/main.js b/main.js index 4517614..a94462e 100644 --- a/main.js +++ b/main.js @@ -119,8 +119,10 @@ class CbzView extends ItemView { const exactPosition = p * maxThumbTop; // Update UI instantly - minimapThumb.style.top = exactPosition + 'px'; - minimapThumb.style.height = tHeight + 'px'; + minimapThumb.setCssStyles({ + top: exactPosition + 'px', + height: tHeight + 'px' + }); minimapView.scrollTop = exactPosition - yScreen; // Map exactPosition back to targetIndex and percentage for mainView @@ -148,7 +150,7 @@ class CbzView extends ItemView { const onMouseUp = () => { if (isDown) { isDown = false; - minimapThumb.style.cursor = ''; + minimapThumb.setCssStyles({ cursor: '' }); setTimeout(() => { isDraggingThumb = false; }, 50); } document.removeEventListener('mousemove', onMouseMove); @@ -167,7 +169,7 @@ class CbzView extends ItemView { const parentRect = minimapView.getBoundingClientRect(); startYScreen = rect.top - parentRect.top; - minimapThumb.style.cursor = 'grabbing'; + minimapThumb.setCssStyles({ cursor: 'grabbing' }); document.addEventListener('mousemove', onMouseMove); document.addEventListener('mouseup', onMouseUp); @@ -301,8 +303,10 @@ class CbzView extends ItemView { const exactPosition = parseInt(indexStr) * currentItemHeight + (percentage * currentItemHeight); const tHeight = updateThumbHeight(); - minimapThumb.style.height = tHeight + 'px'; - minimapThumb.style.top = exactPosition + 'px'; + minimapThumb.setCssStyles({ + height: tHeight + 'px', + top: exactPosition + 'px' + }); const trackContentHeight = Math.max(minimapView.scrollHeight, (this.imageFiles ? this.imageFiles.length : 0) * currentItemHeight); const trackViewHeight = minimapView.clientHeight; @@ -432,7 +436,7 @@ class CbzView extends ItemView { img.src = url; if (img.parentElement) { - img.parentElement.style.minHeight = 'auto'; + img.parentElement.setCssStyles({ minHeight: 'auto' }); } } catch (err) { console.error(`Failed to load image at index ${index}`, err); @@ -446,7 +450,7 @@ class CbzView extends ItemView { URL.revokeObjectURL(url); img.removeAttribute("src"); if (img.parentElement) { - img.parentElement.style.minHeight = `${img.height || 800}px`; + img.parentElement.setCssStyles({ minHeight: `${img.height || 800}px` }); } } this.loadedImages.delete(index); diff --git a/manifest.json b/manifest.json index f5e8308..a4fdc47 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "cbz-reader", "name": "CBZ Reader", - "version": "1.0.0", + "version": "1.0.1", "minAppVersion": "1.0.0", "description": "A powerful and fast native CBZ (Comic Book Archive) reader", "author": "usero2-endofday", diff --git a/plugin.js b/plugin.js index f91ed3e..1bfefcb 100644 --- a/plugin.js +++ b/plugin.js @@ -100,8 +100,10 @@ class CbzView extends ItemView { const exactPosition = p * maxThumbTop; // Update UI instantly - minimapThumb.style.top = exactPosition + 'px'; - minimapThumb.style.height = tHeight + 'px'; + minimapThumb.setCssStyles({ + top: exactPosition + 'px', + height: tHeight + 'px' + }); minimapView.scrollTop = exactPosition - yScreen; // Map exactPosition back to targetIndex and percentage for mainView @@ -129,7 +131,7 @@ class CbzView extends ItemView { const onMouseUp = () => { if (isDown) { isDown = false; - minimapThumb.style.cursor = ''; + minimapThumb.setCssStyles({ cursor: '' }); setTimeout(() => { isDraggingThumb = false; }, 50); } document.removeEventListener('mousemove', onMouseMove); @@ -148,7 +150,7 @@ class CbzView extends ItemView { const parentRect = minimapView.getBoundingClientRect(); startYScreen = rect.top - parentRect.top; - minimapThumb.style.cursor = 'grabbing'; + minimapThumb.setCssStyles({ cursor: 'grabbing' }); document.addEventListener('mousemove', onMouseMove); document.addEventListener('mouseup', onMouseUp); @@ -282,8 +284,10 @@ class CbzView extends ItemView { const exactPosition = parseInt(indexStr) * currentItemHeight + (percentage * currentItemHeight); const tHeight = updateThumbHeight(); - minimapThumb.style.height = tHeight + 'px'; - minimapThumb.style.top = exactPosition + 'px'; + minimapThumb.setCssStyles({ + height: tHeight + 'px', + top: exactPosition + 'px' + }); const trackContentHeight = Math.max(minimapView.scrollHeight, (this.imageFiles ? this.imageFiles.length : 0) * currentItemHeight); const trackViewHeight = minimapView.clientHeight; @@ -413,7 +417,7 @@ class CbzView extends ItemView { img.src = url; if (img.parentElement) { - img.parentElement.style.minHeight = 'auto'; + img.parentElement.setCssStyles({ minHeight: 'auto' }); } } catch (err) { console.error(`Failed to load image at index ${index}`, err); @@ -427,7 +431,7 @@ class CbzView extends ItemView { URL.revokeObjectURL(url); img.removeAttribute("src"); if (img.parentElement) { - img.parentElement.style.minHeight = `${img.height || 800}px`; + img.parentElement.setCssStyles({ minHeight: `${img.height || 800}px` }); } } this.loadedImages.delete(index);