From 95be66cb613ce28319ab2c19d9bd9ef679d3d5c7 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 14 Nov 2017 09:36:43 +0300 Subject: [PATCH] convert another tHTML in edit.js to $element --- edit/edit.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index 39de46bb..073db22f 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1643,19 +1643,27 @@ function toMozillaFormat() { } function fromMozillaFormat() { - const popup = showCodeMirrorPopup(t('styleFromMozillaFormatPrompt'), tHTML(`
- - -
` - )); + const popup = showCodeMirrorPopup(t('styleFromMozillaFormatPrompt'), + $element({appendChild: [ + $element({ + 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); contents.insertBefore(popup.codebox.display.wrapper, contents.firstElementChild); popup.codebox.focus(); - - $('[name="import-append"]', popup).addEventListener('click', doImport); - $('[name="import-replace"]', popup).addEventListener('click', doImport); - popup.codebox.on('change', () => { clearTimeout(popup.mozillaTimeout); popup.mozillaTimeout = setTimeout(() => {