forked from GithubMirrors/cardconjurer
		
	Support new collector info style
This commit is contained in:
		| @@ -562,6 +562,13 @@ | |||||||
| 								<span class='checkmark'></span> | 								<span class='checkmark'></span> | ||||||
| 							</label> | 							</label> | ||||||
| 						</div> | 						</div> | ||||||
|  | 						<div class='readable-background padding margin-bottom'> | ||||||
|  | 							<h5 class='input-description margin-bottom'>Collector info style</h5> | ||||||
|  | 							<label class='checkbox-container input margin-bottom'>Use new (post-ONE) collector info style | ||||||
|  | 								<input id='enableNewCollectorStyle' type='checkbox' onchange='enableNewCollectorInfoStyle();'> | ||||||
|  | 								<span class='checkmark'></span> | ||||||
|  | 							</label> | ||||||
|  | 						</div> | ||||||
| 						<div class='readable-background padding margin-bottom'> | 						<div class='readable-background padding margin-bottom'> | ||||||
| 							<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5> | 							<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5> | ||||||
| 							<div class='padding'> | 							<div class='padding'> | ||||||
|   | |||||||
| @@ -102,21 +102,33 @@ async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers | |||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
| 	if (resetOthers) { | 	if (resetOthers) { | ||||||
| 		//bottom info | 		setBottomInfoStyle();		 | ||||||
|  |  | ||||||
| 		await loadBottomInfo({ |  | ||||||
| 			midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language}  {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, |  | ||||||
| 			topLeft: {text:'{elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, |  | ||||||
| 			note: {text:'{loadx2}{elemidinfo-note}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, |  | ||||||
| 			rarity: {text:'{loadx}{elemidinfo-rarity}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, |  | ||||||
| 			bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003}, |  | ||||||
| 			wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003}, |  | ||||||
| 			bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003} |  | ||||||
| 		}); |  | ||||||
| 		//onload | 		//onload | ||||||
| 		card.onload = null; | 		card.onload = null; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | async function setBottomInfoStyle() { | ||||||
|  | 	if (document.querySelector('#enableNewCollectorStyle').checked) { | ||||||
|  | 			await loadBottomInfo({ | ||||||
|  | 				midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language}  {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				topLeft: {text:'{elemidinfo-rarity} {elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				note: {text:'{loadx}{elemidinfo-note}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003}, | ||||||
|  | 				wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003}, | ||||||
|  | 				bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003} | ||||||
|  | 			}); | ||||||
|  | 		} else { | ||||||
|  | 			await loadBottomInfo({ | ||||||
|  | 				midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language}  {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				topLeft: {text:'{elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				note: {text:'{loadx2}{elemidinfo-note}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				rarity: {text:'{loadx}{elemidinfo-rarity}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, | ||||||
|  | 				bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003}, | ||||||
|  | 				wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003}, | ||||||
|  | 				bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003} | ||||||
|  | 			}); | ||||||
|  | 		} | ||||||
|  | } | ||||||
| //Canvas management | //Canvas management | ||||||
| function sizeCanvas(name, width = Math.round(card.width * (1 + 2 * card.marginX)), height = Math.round(card.height * (1 + 2 * card.marginY))) { | function sizeCanvas(name, width = Math.round(card.width * (1 + 2 * card.marginX)), height = Math.round(card.height * (1 + 2 * card.marginY))) { | ||||||
| 	if (!window[name + 'Canvas']) { | 	if (!window[name + 'Canvas']) { | ||||||
| @@ -3294,11 +3306,15 @@ function toggleStarDot() { | |||||||
| 	defaultCollector.starDot = !defaultCollector.starDot; | 	defaultCollector.starDot = !defaultCollector.starDot; | ||||||
| 	bottomInfoEdited(); | 	bottomInfoEdited(); | ||||||
| } | } | ||||||
|  | function enableNewCollectorInfoStyle() { | ||||||
|  | 	localStorage.setItem('enableNewCollectorStyle', document.querySelector('#enableNewCollectorStyle').checked); | ||||||
|  | 	setBottomInfoStyle(); | ||||||
|  | 	bottomInfoEdited(); | ||||||
|  | } | ||||||
| function enableImportCollectorInfo() { | function enableImportCollectorInfo() { | ||||||
| 	localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked); | 	localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked); | ||||||
| } | } | ||||||
| function setAutoFrame() { | function setAutoFrame() { | ||||||
| 	localStorage.setItem('autoFrame', document.querySelector('#autoFrame').value); |  | ||||||
| 	var value = document.querySelector('#autoFrame').value; | 	var value = document.querySelector('#autoFrame').value; | ||||||
| 	localStorage.setItem('autoFrame', value); | 	localStorage.setItem('autoFrame', value); | ||||||
|  |  | ||||||
| @@ -3576,7 +3592,6 @@ function changeCardIndex() { | |||||||
| 		setXhttp.onreadystatechange = function() { | 		setXhttp.onreadystatechange = function() { | ||||||
| 			if (this.readyState == 4 && this.status == 200) { | 			if (this.readyState == 4 && this.status == 200) { | ||||||
| 				var setObject = JSON.parse(this.responseText) | 				var setObject = JSON.parse(this.responseText) | ||||||
| 				if (setObject.printed_size) { |  | ||||||
| 					var number = document.querySelector('#info-number').value; | 					var number = document.querySelector('#info-number').value; | ||||||
|  |  | ||||||
| 					while (number.length < 3) { | 					while (number.length < 3) { | ||||||
| @@ -4089,6 +4104,11 @@ if (!localStorage.getItem('enableImportCollectorInfo')) { | |||||||
| } else { | } else { | ||||||
| 	document.querySelector('#enableImportCollectorInfo').checked = (localStorage.getItem('enableImportCollectorInfo') == 'true'); | 	document.querySelector('#enableImportCollectorInfo').checked = (localStorage.getItem('enableImportCollectorInfo') == 'true'); | ||||||
| } | } | ||||||
|  | if (!localStorage.getItem('enableNewCollectorStyle')) { | ||||||
|  | 	localStorage.setItem('enableNewCollectorStyle', 'false'); | ||||||
|  | } else { | ||||||
|  | 	document.querySelector('#enableNewCollectorStyle').checked = (localStorage.getItem('enableNewCollectorStyle') == 'true'); | ||||||
|  | } | ||||||
| if (!localStorage.getItem('autoFrame')) { | if (!localStorage.getItem('autoFrame')) { | ||||||
| 	localStorage.setItem('autoFrame', 'false'); | 	localStorage.setItem('autoFrame', 'false'); | ||||||
| } else { | } else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Josh birnholz
					Josh birnholz