mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-14 20:29:07 +00:00
Rename SvgViewer.init to render and update usage
This commit is contained in:
@@ -5,15 +5,15 @@
|
|||||||
<title>LottieFiles Preview</title>
|
<title>LottieFiles Preview</title>
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height:100%;
|
height:100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bm {
|
#bm {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@@ -242,10 +242,10 @@ class SvgViewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize SVG viewer.
|
* Render SVG file.
|
||||||
* @async
|
* @async
|
||||||
*/
|
*/
|
||||||
async init() {
|
async render() {
|
||||||
const rawSvg = await chrome.webview.hostObjects.external.GetSvgContent();
|
const rawSvg = await chrome.webview.hostObjects.external.GetSvgContent();
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
||||||
@@ -263,5 +263,5 @@ class SvgViewer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and initialize the SVG viewer
|
// Create the SVG viewer and render
|
||||||
new SvgViewer().init();
|
new SvgViewer().render();
|
Reference in New Issue
Block a user