curly quotes

This commit is contained in:
Kyle
2021-02-25 10:58:30 -08:00
parent 4464e23222
commit 0813143165
2 changed files with 5 additions and 2 deletions

View File

@@ -440,5 +440,5 @@ include('../globalHTML/header-1.php');
</h4> </h4>
</div> </div>
</div> </div>
<script defer src='/js/creator-9.js'></script> <script defer src='/js/creator-10.js'></script>
<?php include('../globalHTML/footer.php'); ?> <?php include('../globalHTML/footer.php'); ?>

View File

@@ -508,7 +508,7 @@ function textboxEditor() {
document.querySelector('#textbox-editor-height').onchange = (event) => {selectedTextbox.height = (event.target.value / card.height); textEdited();} document.querySelector('#textbox-editor-height').onchange = (event) => {selectedTextbox.height = (event.target.value / card.height); textEdited();}
} }
function textEdited() { function textEdited() {
card.text[Object.keys(card.text)[selectedTextIndex]].text = document.querySelector('#text-editor').value; card.text[Object.keys(card.text)[selectedTextIndex]].text = curlyQuotes(document.querySelector('#text-editor').value);
drawTextBuffer(); drawTextBuffer();
} }
function drawTextBuffer() { function drawTextBuffer() {
@@ -872,6 +872,9 @@ CanvasRenderingContext2D.prototype.drawImageArc = function(image, x, y, width, h
function widthToAngle(width, radius) { function widthToAngle(width, radius) {
return width / radius; return width / radius;
} }
function curlyQuotes(input) {
return input.replace(/ '/g, ' ').replace(/^'/, '').replace(/' /g, ' ').replace(/'$/, '').replace(/ "/g, ' “').replace(/^"/, '“').replace(/" /g, '” ').replace(/"$/, '”');
}
//ART TAB //ART TAB
function uploadArt(imageSource, otherParams) { function uploadArt(imageSource, otherParams) {
art.src = imageSource; art.src = imageSource;