Skip to content

Commit

Permalink
sepc out TVG Binary feature
Browse files Browse the repository at this point in the history
removed TVG related utilities

issue: #2721
  • Loading branch information
tinyjin authored and hermet committed Oct 18, 2024
1 parent db84d4a commit 31e4cc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<section>
<div id="image-area">
<lottie-player class="hidden" autoPlay loop></lottie-player>
<div id="image-placeholder">Drop a file here or click to browse (.tvg, .svg, .json, .jpg, .png, .webp)<br/><small>ThorVG Viewer works on your local device. File(s) won't be uploaded to the internet.</small></div>
<input id="image-file-selector" type="file" accept=".tvg,.svg,.json,.jpg,.png" multiple>
<div id="image-placeholder">Drop a file here or click to browse (.svg, .json, .jpg, .png, .webp)<br/><small>ThorVG Viewer works on your local device. File(s) won't be uploaded to the internet.</small></div>
<input id="image-file-selector" type="file" accept=".svg,.json,.jpg,.png" multiple>
</div>
<div id="console-area" class="hidden">
<a id="console-bottom-scroll" title="Scroll to the bottom"><i class="fa fa-chevron-down"></i></a>
Expand Down
15 changes: 1 addition & 14 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const ConsoleLogTypes = { None : '', Inner : 'console-type-inner', Error : 'cons
if (args[0] && typeof args[0] === 'string') {
//slice at the log reset color: "\033[0m"
if (filetype === "svg" && args[0].indexOf("SVG") > 0) consoleLog(args[0].slice(args[0].lastIndexOf("") + 4), ConsoleLogTypes.Warning);
else if (filetype === "tvg" && args[0].indexOf("TVG") > 0) consoleLog(args[0].slice(args[0].lastIndexOf("") + 4), ConsoleLogTypes.Warning);
else if (filetype === "json" && args[0].indexOf("LOTTIE") > 0) consoleLog(args[0].slice(args[0].lastIndexOf("") + 4), ConsoleLogTypes.Warning);
}
//baseConsole(...args);
Expand Down Expand Up @@ -66,18 +65,6 @@ function createTabs() {
file.appendChild(createTitleLine("Filename", filename));
file.appendChild(createTitleLine("Resolution", sizeText));
file.appendChild(createHeader("Export"));

var lineExportTvg = createPropertyLine("Export .tvg file");
lineExportTvg.addEventListener("click", async () => {
try {
await player.save('tvg');
} catch (err) {
let message = "Unable to save the TVG data.";
consoleLog(message, ConsoleLogTypes.Error);
alert(message);
}
}, false);
file.appendChild(lineExportTvg);

var lineExportPng = createPropertyLine("Export .png file");
lineExportPng.addEventListener("click", async () => {
Expand Down Expand Up @@ -162,7 +149,7 @@ function openFileBrowse() {
document.getElementById('image-file-selector').click();
}

const allowedExtensionList = ['tvg', 'svg', 'json', 'png', 'jpg', 'jpeg', 'webp'];
const allowedExtensionList = ['svg', 'json', 'png', 'jpg', 'jpeg', 'webp'];

function allowedFileExtension(filename) {
filetype = filename.split('.').pop().toLowerCase();
Expand Down

0 comments on commit 31e4cc1

Please sign in to comment.