diff options
Diffstat (limited to 'ext/js/pages')
-rw-r--r-- | ext/js/pages/settings/anki-controller.js | 9 | ||||
-rw-r--r-- | ext/js/pages/settings/anki-templates-controller.js | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js index 26cab68f..509e263c 100644 --- a/ext/js/pages/settings/anki-controller.js +++ b/ext/js/pages/settings/anki-controller.js @@ -17,7 +17,7 @@ /* global * AnkiConnect - * AnkiNoteBuilder + * AnkiUtil * ObjectPropertyAccessor * SelectorObserver */ @@ -26,7 +26,6 @@ class AnkiController { constructor(settingsController) { this._settingsController = settingsController; this._ankiConnect = new AnkiConnect(); - this._ankiNoteBuilder = new AnkiNoteBuilder(false); this._selectorObserver = new SelectorObserver({ selector: '.anki-card', ignoreSelector: null, @@ -156,10 +155,6 @@ class AnkiController { return this._settingsController.permissionsUtil.getRequiredPermissionsForAnkiFieldValue(fieldValue); } - containsAnyMarker(field) { - return this._ankiNoteBuilder.containsAnyMarker(field); - } - // Private async _onOptionsChanged({options: {anki}}) { @@ -439,7 +434,7 @@ class AnkiCardController { _validateField(node, index) { let valid = (node.dataset.hasPermissions !== 'false'); - if (valid && index === 0 && !this._ankiController.containsAnyMarker(node.value)) { + if (valid && index === 0 && !AnkiUtil.stringContainsAnyFieldMarker(node.value)) { valid = false; } node.dataset.invalid = `${!valid}`; diff --git a/ext/js/pages/settings/anki-templates-controller.js b/ext/js/pages/settings/anki-templates-controller.js index 8e3a1a70..710946be 100644 --- a/ext/js/pages/settings/anki-templates-controller.js +++ b/ext/js/pages/settings/anki-templates-controller.js @@ -32,7 +32,7 @@ class AnkiTemplatesController { this._renderFieldInput = null; this._renderResult = null; this._fieldTemplateResetModal = null; - this._ankiNoteBuilder = new AnkiNoteBuilder(true); + this._ankiNoteBuilder = new AnkiNoteBuilder(); } async prepare() { |