From a19d2ac480448afdbc9d8af30cbf94fd45c79c60 Mon Sep 17 00:00:00 2001 From: Alex Taxiera Date: Wed, 18 Sep 2024 01:57:50 +0000 Subject: [PATCH 1/2] Fix image url loading --- js/creator-23.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/creator-23.js b/js/creator-23.js index b2119dc2..9f5db645 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -4089,13 +4089,15 @@ async function addTextbox(textboxType) { } //ART TAB function uploadArt(imageSource, otherParams) { - art.src = imageSource; - if (otherParams && otherParams == 'autoFit') { - art.onload = function() { - autoFitArt(); - art.onload = artEdited; - }; - } + imageURL(imageSource, (src) => { + art.src = src + if (otherParams && otherParams == 'autoFit') { + art.onload = function() { + autoFitArt(); + art.onload = artEdited; + }; + } + }); } function artEdited() { card.artSource = art.src; From fe087e96eea3fe5a00f883c03936c032abaa5fad Mon Sep 17 00:00:00 2001 From: Alex Taxiera Date: Wed, 18 Sep 2024 13:07:10 +0000 Subject: [PATCH 2/2] fix loading saved art --- .vscode/settings.json | 16 ++++++++++++++++ js/creator-23.js | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..6419b77a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "workbench.colorCustomizations": { + "commandCenter.border": "#15202b99", + "sash.hoverBorder": "#65c89b", + "statusBar.background": "#42b883", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#359268", + "statusBarItem.remoteBackground": "#42b883", + "statusBarItem.remoteForeground": "#15202b", + "titleBar.activeBackground": "#42b883", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#42b88399", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.remoteColor": "#42b883" +} diff --git a/js/creator-23.js b/js/creator-23.js index 9f5db645..3bb0a1cb 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -4097,7 +4097,7 @@ function uploadArt(imageSource, otherParams) { art.onload = artEdited; }; } - }); + }, otherParams); } function artEdited() { card.artSource = art.src; @@ -5083,7 +5083,7 @@ async function loadCard(selectedCardKey) { document.querySelector('#art-y').value = scaleY(card.artY) - scaleHeight(card.marginY); document.querySelector('#art-zoom').value = card.artZoom * 100; document.querySelector('#art-rotate').value = card.artRotate || 0; - uploadArt(card.artSource); + uploadArt(card.artSource, 'noproxy'); document.querySelector('#setSymbol-x').value = scaleX(card.setSymbolX) - scaleWidth(card.marginX); document.querySelector('#setSymbol-y').value = scaleY(card.setSymbolY) - scaleHeight(card.marginY); document.querySelector('#setSymbol-zoom').value = card.setSymbolZoom * 100; @@ -5258,7 +5258,7 @@ function imageURL(url, destination, otherParams) { // If an image URL does not have HTTP in it, assume it's a local file in the repo local_art directory. if (!url.includes('http')) { imageurl = '/local_art/' + url; - } else if (params.get('noproxy') != '') { + } else if (params.get('noproxy') != '' && (!otherParams || otherParams != 'noproxy')) { //CORS PROXY LINKS //Previously: https://cors.bridged.cc/ imageurl = 'https://corsproxy.io/?' + encodeURIComponent(url);