Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_createUrlInput() {
const t = this.locale.t;
const labeledInput = new LabeledInputView( this.locale, InputTextView );
const inputView = labeledInput.inputView;
this._urlInputViewInfoDefault = t( 'Paste the media URL in the input.' );
this._urlInputViewInfoTip = t( 'Tip: Paste the URL into the content to embed faster.' );
labeledInput.label = t( 'Media URL' );
labeledInput.infoText = this._urlInputViewInfoDefault;
inputView.placeholder = 'https://example.com';
inputView.on( 'input', () => {
// Display the tip text only when there's some value. Otherwise fall back to the default info text.
labeledInput.infoText = inputView.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;
} );
return labeledInput;
}
_createOnchangeInputView() {
const t = this.locale.t;
// const onchangeInput = new LabeledInputView( this.locale, InputTextView );
const onchangeInput = new LabeledInputView( this.locale, TextareaView );
onchangeInput.label = t( 'Onchange javascript' );
return onchangeInput;
}
}
_createLabeledInputView() {
const t = this.locale.t;
const labeledInput = new LabeledInputView( this.locale, InputTextView );
labeledInput.label = t( 'Text alternative' );
labeledInput.inputView.placeholder = t( 'Text alternative' );
return labeledInput;
}
}
_createFormIdInputView() {
const t = this.locale.t;
const formIdInput = new LabeledInputView( this.locale, InputTextView );
formIdInput.label = t( 'Form id' );
return formIdInput;
}
_createModeInput() {
const t = this.locale.t;
const optionInline = new LabeledInputView( this.locale, InputRadioView );
const optionDisplay = new LabeledInputView( this.locale, InputRadioView );
optionInline.labelView.text = "Inline";
optionInline.inputView.name = "latexmode";
optionInline.inputView.value = "inline";
optionInline.inputView.checked = true;
optionDisplay.labelView.text = "Display";
optionDisplay.inputView.name = "latexmode";
optionDisplay.inputView.value = "display";
optionDisplay.inputView.checked = false;
const radioGroup = new RadioGroup(t, [optionInline,optionDisplay] );
radioGroup.name = "latexmode";
return radioGroup;
}
}
_createNameInputView() {
const t = this.locale.t;
const nameInput = new LabeledInputView( this.locale, InputTextView );
nameInput.label = t( 'Name' );
return nameInput;
}
}
_createModeInput() {
const t = this.locale.t;
const optionInline = new LabeledInputView( this.locale, InputRadioView );
const optionDisplay = new LabeledInputView( this.locale, InputRadioView );
optionInline.labelView.text = "Inline";
optionInline.inputView.name = "latexmode";
optionInline.inputView.value = "inline";
optionInline.inputView.checked = true;
optionDisplay.labelView.text = "Display";
optionDisplay.inputView.name = "latexmode";
optionDisplay.inputView.value = "display";
optionDisplay.inputView.checked = false;
const radioGroup = new RadioGroup(t, [optionInline,optionDisplay] );
radioGroup.name = "latexmode";
return radioGroup;
}
}