'wcf.editor.quote.title': '{jslang __literal=true}wcf.editor.quote.title{/jslang}',
'wcf.editor.quote.url': '{jslang}wcf.editor.quote.url{/jslang}',
'wcf.editor.quote.url.description': '{jslang}wcf.editor.quote.url.description{/jslang}',
- 'wcf.editor.quote.url.error.invalid': '{jslang}wcf.editor.quote.url.error.invalid{/jslang}',
'wcf.editor.table.cols': '{jslang}wcf.editor.table.cols{/jslang}',
'wcf.editor.table.insertTable': '{jslang}wcf.editor.table.insertTable{/jslang}',
const id = `redactor-quote-${this._elementId}`;
const urlInput = document.getElementById(`${id}-url`) as HTMLInputElement;
- const url = urlInput.value.replace(/\u200B/g, "").trim();
- // simple test to check if it at least looks like it could be a valid url
+ let url = urlInput.value.replace(/\u200B/g, "").trim();
if (url.length && !/^https?:\/\/[^/]+/.test(url)) {
- DomUtil.innerError(urlInput, Language.get("wcf.editor.quote.url.error.invalid"));
-
- return;
- } else {
- DomUtil.innerError(urlInput, false);
+ url = `https://${url}`
}
const quote = this._quote!;
'wcf.editor.quote.title': '{jslang __literal=true}wcf.editor.quote.title{/jslang}',
'wcf.editor.quote.url': '{jslang}wcf.editor.quote.url{/jslang}',
'wcf.editor.quote.url.description': '{jslang}wcf.editor.quote.url.description{/jslang}',
- 'wcf.editor.quote.url.error.invalid': '{jslang}wcf.editor.quote.url.error.invalid{/jslang}',
'wcf.editor.table.cols': '{jslang}wcf.editor.table.cols{/jslang}',
'wcf.editor.table.insertTable': '{jslang}wcf.editor.table.insertTable{/jslang}',
_dialogSubmit() {
const id = `redactor-quote-${this._elementId}`;
const urlInput = document.getElementById(`${id}-url`);
- const url = urlInput.value.replace(/\u200B/g, "").trim();
- // simple test to check if it at least looks like it could be a valid url
+ let url = urlInput.value.replace(/\u200B/g, "").trim();
if (url.length && !/^https?:\/\/[^/]+/.test(url)) {
- Util_1.default.innerError(urlInput, Language.get("wcf.editor.quote.url.error.invalid"));
- return;
- }
- else {
- Util_1.default.innerError(urlInput, false);
+ url = `https://${url}`;
}
const quote = this._quote;
// set author
<item name="wcf.editor.quote.title"><![CDATA[{if $author}Zitat von {@$author}{else}Zitat{/if}]]></item>
<item name="wcf.editor.quote.url"><![CDATA[Link]]></item>
<item name="wcf.editor.quote.url.description"><![CDATA[Optional: {if LANGUAGE_USE_INFORMAL_VARIANT}Gib{else}Geben Sie{/if} einen Link zu der Quelle an.]]></item>
- <item name="wcf.editor.quote.url.error.invalid"><![CDATA[Der eingegebene Link ist ungültig.]]></item>
<item name="wcf.editor.source.error.active"><![CDATA[Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}kehre{else}kehren Sie{/if} zum Absenden in die normale Ansicht zurück.]]></item>
<item name="wcf.editor.spoiler.label"><![CDATA[Beschriftung]]></item>
<item name="wcf.editor.spoiler.label.description"><![CDATA[Optional: {if LANGUAGE_USE_INFORMAL_VARIANT}Gib{else}Geben Sie{/if} eine Beschriftung für den Spoiler-Button ein.]]></item>
<item name="wcf.article.search.categories" />
<item name="wcf.global.button.showSidebarRight" />
<item name="wcf.style.colorPicker.alpha" />
+ <item name="wcf.editor.quote.url.error.invalid" />
</delete>
</language>
<item name="wcf.editor.quote.title"><![CDATA[{if $author}Quote from {@$author}{else}Quote{/if}]]></item>
<item name="wcf.editor.quote.url"><![CDATA[Link]]></item>
<item name="wcf.editor.quote.url.description"><![CDATA[Optional: Specify the link to the source.]]></item>
- <item name="wcf.editor.quote.url.error.invalid"><![CDATA[The entered link is invalid.]]></item>
<item name="wcf.editor.source.error.active"><![CDATA[Please return to the normal view before submitting.]]></item>
<item name="wcf.editor.spoiler.label"><![CDATA[Label]]></item>
<item name="wcf.editor.spoiler.label.description"><![CDATA[Optional: Specify the label for the spoiler toggle button.]]></item>
<item name="wcf.article.search.categories" />
<item name="wcf.global.button.showSidebarRight" />
<item name="wcf.style.colorPicker.alpha" />
+ <item name="wcf.editor.quote.url.error.invalid" />
</delete>
</language>