From 93a918f0f0ea569981cfd69cb5ffdda50ca137af Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Thu, 4 Feb 2021 11:17:51 -0800 Subject: [PATCH] auto load --- creator/index.php | 10 ++++++++-- css/style-8.css | 2 +- js/{creator-7.js => creator-8.js} | 18 ++++++++++++++---- js/frames/groupMargin.js | 3 +++ js/frames/groupMisc-1.js | 3 +-- 5 files changed, 27 insertions(+), 9 deletions(-) rename js/{creator-7.js => creator-8.js} (98%) create mode 100644 js/frames/groupMargin.js diff --git a/creator/index.php b/creator/index.php index 1ec9705c..52714cd6 100644 --- a/creator/index.php +++ b/creator/index.php @@ -99,12 +99,18 @@ include('../globalHTML/header-1.php'); + -
+
+
Automatically load Frame Version when loading Frame Packs
+
Select a Frame Image and a Mask, then add it to your card
@@ -414,5 +420,5 @@ include('../globalHTML/header-1.php');
- + \ No newline at end of file diff --git a/css/style-8.css b/css/style-8.css index f508c0de..624fc0a2 100644 --- a/css/style-8.css +++ b/css/style-8.css @@ -406,7 +406,7 @@ textarea.input { .checkbox-container { display: block; position: relative; - padding-left: 2rem; + padding-left: 2.25rem; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; diff --git a/js/creator-7.js b/js/creator-8.js similarity index 98% rename from js/creator-7.js rename to js/creator-8.js index ac4857d2..c56c0640 100644 --- a/js/creator-7.js +++ b/js/creator-8.js @@ -25,7 +25,7 @@ art.onload = artEdited; setSymbol = new Image(); setSymbol.crossOrigin = 'anonymous'; setSymbol.src = blank.src; setSymbol.onerror = function() { if (this.src.includes('gatherer.wizards.com')) { - notify('Loading the set symbol from Gatherer failed. Please check this link to see if it exists. If it does, it may be necessary to manually download and upload the image.', 30); + notify('Loading the set symbol from Gatherer failed. Please check this link to see if it exists. If it does, it may be necessary to manually download and upload the image.', 15); } if (!this.src.includes('/img/blank.png')) {this.src = fixUri('/img/blank.png');} } @@ -317,6 +317,12 @@ function loadFramePack(frameOptions = availableFrames) { }) document.querySelector('#frame-picker').children[0].click(); + if (localStorage.getItem('autoLoadFrameVersion') == 'true') { + document.querySelector('#loadFrameVersion').click(); + } +} +function autoLoadFrameVersion() { + localStorage.setItem('autoLoadFrameVersion', document.querySelector('#autoLoadFrameVersion').checked); } function frameOptionClicked(event) { var clickedFrameOption = event.target.closest('.frame-option'); @@ -1084,7 +1090,7 @@ function drawCard() { //DOWNLOADING async function downloadCard() { if (card.infoArtist.replace(/ /g, '') == '' && !card.artSource.includes('/img/blank.png') && !card.artZoom == 0) { - notify('You must credit an artist before downloading!', 10); + notify('You must credit an artist before downloading!', 5); } else { var download = document.createElement('a'); var imageName = card.text.title.text; @@ -1294,7 +1300,7 @@ async function loadCard(selectedCardKey) { watermarkEdited(); } } else { - notify(selectedCardKey + ' failed to load.', 10) + notify(selectedCardKey + ' failed to load.', 5) } } function deleteCard() { @@ -1379,13 +1385,17 @@ function fetchScryfallData(cardName, callback = console.log) { callback(JSON.parse(this.responseText)); // JSON.parse(this.responseText); } else if (this.readyState == 4 && this.status == 404) { - notify('No cards found for "' + cardName + '"', 10); + notify('No cards found for "' + cardName + '"', 5); } } xhttp.open('GET', 'https://api.scryfall.com/cards/search?order=released&unique=art&q=name%3D' + cardName.replace(/ /g, '_'), true); xhttp.send(); } //Initialization +if (!localStorage.getItem('autoLoadFrameVersion')) { + localStorage.setItem('autoLoadFrameVersion', document.querySelector('#autoLoadFrameVersion').checked); +} +document.querySelector('#autoLoadFrameVersion').checked = 'true' == localStorage.getItem('autoLoadFrameVersion'); document.querySelector('#info-number').value = date.getFullYear(); loadScript('/js/frames/groupStandard-2.js'); loadAvailableCards(); diff --git a/js/frames/groupMargin.js b/js/frames/groupMargin.js new file mode 100644 index 00000000..7c1e1d94 --- /dev/null +++ b/js/frames/groupMargin.js @@ -0,0 +1,3 @@ +loadFramePacks([ + {name:'1/8 Inch Margin', value:'Margin-1'} +]) \ No newline at end of file diff --git a/js/frames/groupMisc-1.js b/js/frames/groupMisc-1.js index 413a75a8..d3a75786 100644 --- a/js/frames/groupMisc-1.js +++ b/js/frames/groupMisc-1.js @@ -3,6 +3,5 @@ loadFramePacks([ {name:'Seventh Edition', value:'Seventh'}, {name:'Legends Multicolored', value:'Legends'}, {name:'Misc', value:'disabled'}, - {name:'Planechase', value:'Planechase'}, - {name:'1/8 Inch Margin', value:'Margin-1'} + {name:'Planechase', value:'Planechase'} ]) \ No newline at end of file