diff --git a/assets/js/ttveditor.js b/assets/js/ttveditor.js index bd5700c..3190fdb 100644 --- a/assets/js/ttveditor.js +++ b/assets/js/ttveditor.js @@ -1,10 +1,10 @@ (function(){ // Character limit settings from localized script data - var softLimitText = parseInt(ttveditorData.soft_limit_text, 10); - var hardLimitText = parseInt(ttveditorData.hard_limit_text, 10); + var softLimitText = parseInt(teksttveditor_options.soft_limit_text, 10); + var hardLimitText = parseInt(teksttveditor_options.hard_limit_text, 10); - var softLimitTitle = parseInt(ttveditorData.soft_limit_title, 10); - var hardLimitTitle = parseInt(ttveditorData.hard_limit_title, 10); + var softLimitTitle = parseInt(teksttveditor_options.soft_limit_title, 10); + var hardLimitTitle = parseInt(teksttveditor_options.hard_limit_title, 10); function wpautop(text, br = true) { if (text.trim() === '') return ''; @@ -88,7 +88,7 @@ "body": wpautop(pageContent), "title": titleValue, "duration": 5000, - "image": ttveditorData.image_url + "image": teksttveditor_options.image_url }; var jsonString = JSON.stringify(data); @@ -129,12 +129,12 @@ var pageNum = index + 1; var length = pageText.trim().length; - // Soft limit warning in gray if (length >= softLimitText && length < hardLimitText) { + // Soft limit warning in gray warnings.push('
  • Pagina ' + pageNum + ' nadert de limiet van ' + hardLimitText + ' tekens (' + length + ' tekens).
  • '); } - // Hard limit warning in red if (length >= hardLimitText) { + // Hard limit warning in red warnings.push('
  • Pagina ' + pageNum + ' heeft de limiet van ' + hardLimitText + ' tekens overschreden! (' + length + ' tekens).
  • '); overHardLimit = true; } @@ -183,11 +183,9 @@ if (overHardLimit) { if (textArea) { textArea.style.backgroundColor = '#ffe6e6'; // Light red - textArea.style.backgroundColor = '#ffe6e6'; } if (titleInput) { titleInput.style.backgroundColor = '#ffe6e6'; // Light red - titleInput.style.backgroundColor = '#ffe6e6'; } } else { if (textArea) { @@ -238,7 +236,7 @@ var base64Strings = generateBase64(); if (base64Strings.length > 0) { base64Strings.forEach(function(base64String) { - var previewUrl = ttveditorData.preview_url + encodeURIComponent(base64String); + var previewUrl = teksttveditor_options.preview_url + encodeURIComponent(base64String); window.open(previewUrl, '_blank'); }); }