convert another tHTML in edit.js to $element
This commit is contained in:
parent
417d6855ff
commit
95be66cb61
26
edit/edit.js
26
edit/edit.js
|
@ -1643,19 +1643,27 @@ function toMozillaFormat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromMozillaFormat() {
|
function fromMozillaFormat() {
|
||||||
const popup = showCodeMirrorPopup(t('styleFromMozillaFormatPrompt'), tHTML(`<div>
|
const popup = showCodeMirrorPopup(t('styleFromMozillaFormatPrompt'),
|
||||||
<button name="import-append" i18n-text="importAppendLabel" i18n-title="importAppendTooltip"></button>
|
$element({appendChild: [
|
||||||
<button name="import-replace" i18n-text="importReplaceLabel" i18n-title="importReplaceTooltip"></button>
|
$element({
|
||||||
</div>`
|
tag: 'button',
|
||||||
));
|
name: 'import-append',
|
||||||
|
textContent: t('importAppendLabel'),
|
||||||
|
title: t('importAppendTooltip'),
|
||||||
|
onclick: doImport,
|
||||||
|
}),
|
||||||
|
$element({
|
||||||
|
tag: 'button',
|
||||||
|
name: 'import-replace',
|
||||||
|
textContent: t('importReplaceLabel'),
|
||||||
|
title: t('importReplaceTooltip'),
|
||||||
|
onclick: doImport,
|
||||||
|
}),
|
||||||
|
]}));
|
||||||
|
|
||||||
const contents = $('.contents', popup);
|
const contents = $('.contents', popup);
|
||||||
contents.insertBefore(popup.codebox.display.wrapper, contents.firstElementChild);
|
contents.insertBefore(popup.codebox.display.wrapper, contents.firstElementChild);
|
||||||
popup.codebox.focus();
|
popup.codebox.focus();
|
||||||
|
|
||||||
$('[name="import-append"]', popup).addEventListener('click', doImport);
|
|
||||||
$('[name="import-replace"]', popup).addEventListener('click', doImport);
|
|
||||||
|
|
||||||
popup.codebox.on('change', () => {
|
popup.codebox.on('change', () => {
|
||||||
clearTimeout(popup.mozillaTimeout);
|
clearTimeout(popup.mozillaTimeout);
|
||||||
popup.mozillaTimeout = setTimeout(() => {
|
popup.mozillaTimeout = setTimeout(() => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user