From 959ac047d9653465de9b4df7c676dbb59a80540e Mon Sep 17 00:00:00 2001 From: Timo Dittmann Date: Tue, 4 Jan 2022 08:03:22 +0100 Subject: [PATCH 1/3] Changed Text Anchor to Dropdown --- .../ui/__snapshots__/scenario.js.snap | 147 +------ cypress/integration/ui/scenario.js | 18 - src/editor/panels/TopPanel.html | 362 +++++++++--------- src/editor/panels/TopPanel.js | 32 +- src/svgcanvas/elem-get-set.js | 2 +- 5 files changed, 194 insertions(+), 367 deletions(-) diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index d4e83eee..0eb0afbd 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -373,141 +373,6 @@ exports[`use various parts of svg-edit > check tool_text_change_stoke_fill_color `; -exports[`use various parts of svg-edit > check tool_text_anchor_start #0`] = ` - - - - Layer 1 - - AB - - - AB - - - - -`; - -exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = ` - - - - Layer 1 - - AB - - - AB - - - - -`; - -exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` - - - - Layer 1 - - AB - - - AB - - - - -`; - exports[`use various parts of svg-edit > check tool_text_change_rotation #0`] = ` check tool_text_change_rotation #0`] = font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" transform="matrix(1 0 0 1 0 0)" x="46" xml:space="preserve" @@ -572,7 +437,7 @@ exports[`use various parts of svg-edit > check tool_text_change_blur #0`] = ` font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" transform="matrix(1 0 0 1 0 0)" x="46" xml:space="preserve" @@ -624,7 +489,7 @@ exports[`use various parts of svg-edit > check tool_text_change_opacity #0`] = ` font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" transform="matrix(1 0 0 1 0 0)" x="46" xml:space="preserve" @@ -677,7 +542,7 @@ exports[`use various parts of svg-edit > check tool_text_align_to_page #0`] = ` font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" transform="matrix(1 0 0 1 0 0)" x="46" xml:space="preserve" @@ -730,7 +595,7 @@ exports[`use various parts of svg-edit > check tool_text_delete #0`] = ` font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" transform="matrix(1 0 0 1 0 0)" x="46" xml:space="preserve" @@ -761,7 +626,7 @@ exports[`use various parts of svg-edit > check tool_text_change_font_family #0`] font-weight="bold" id="svg_1" stroke="#0000bf" - text-anchor="end" + text-anchor="middle" x="46" xml:space="preserve" y="35" diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index 8015a2f0..ec90a08a 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -102,24 +102,6 @@ describe('use various parts of svg-edit', function () { .find('#Ok').eq(0).click({ force: true }) testSnapshot() }) - it('check tool_text_anchor_start', function () { - cy.get('#svg_1').click({ force: true }) - cy.get('#tool_text_anchor_start') - .click({ force: true }) - testSnapshot() - }) - it('check tool_text_anchor_middle', function () { - cy.get('#svg_1').click({ force: true }) - cy.get('#tool_text_anchor_middle') - .click({ force: true }) - testSnapshot() - }) - it('check tool_text_anchor_end', function () { - cy.get('#svg_1').click({ force: true }) - cy.get('#tool_text_anchor_end') - .click({ force: true }) - testSnapshot() - }) it('check tool_text_change_rotation', function () { cy.get('#svg_2').click({ force: true }) for (let n = 0; n < 5; n++) { diff --git a/src/editor/panels/TopPanel.html b/src/editor/panels/TopPanel.html index 3f010ac6..f9e0b531 100644 --- a/src/editor/panels/TopPanel.html +++ b/src/editor/panels/TopPanel.html @@ -1,181 +1,183 @@
-
-
- - -
-
-
- - -
- -
-
- - -
-
-
- - - -
-
- - - -
-
-
- -
-
- - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
-
-
- - - - - - - - - - - - -
-
- - - -
-
- - -
-
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - - - - - - - -
-
- - - - -
-
- - - - -
- - -
-
- -
-
- -
-
- -
- -
- -
-
-
- -
- - - - - - - - - -
-
-
\ No newline at end of file +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+
+
+ + + +
+
+ + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+
+
+ + + + + + + + + + + + +
+
+ + + +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + + + + + + +
+
+ + + + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+ +
+ + + + + + + + + +
+
+ diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index 1cb48d9d..bacf5a3b 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -353,28 +353,9 @@ class TopPanel { $id('tool_italic').pressed = this.editor.svgCanvas.getItalic() $id('tool_bold').pressed = this.editor.svgCanvas.getBold() $id('tool_font_family').setAttribute('value', elem.getAttribute('font-family')) + $id('tool_text_anchor').setAttribute('value', elem.getAttribute('text-anchor')) $id('font_size').value = elem.getAttribute('font-size') $id('text').value = elem.textContent - const textAnchorStart = $id('tool_text_anchor_start') - const textAnchorMiddle = $id('tool_text_anchor_middle') - const textAnchorEnd = $id('tool_text_anchor_end') - switch (elem.getAttribute('text-anchor')) { - case 'start': - textAnchorStart.pressed = true - textAnchorMiddle.pressed = false - textAnchorEnd.pressed = false - break - case 'middle': - textAnchorStart.pressed = false - textAnchorMiddle.pressed = true - textAnchorEnd.pressed = false - break - case 'end': - textAnchorStart.pressed = false - textAnchorMiddle.pressed = false - textAnchorEnd.pressed = true - break - } if (this.editor.svgCanvas.addedNew) { // Timeout needed for IE9 setTimeout(() => { @@ -764,13 +745,12 @@ class TopPanel { } /** + * Sets the text anchor value * - * @param {string} value "start","end" or "middle" * @returns {false} */ - clickTextAnchor (value) { - this.editor.svgCanvas.setTextAnchor(value) - this.updateContextPanel() + clickTextAnchor (evt) { + this.editor.svgCanvas.setTextAnchor(evt.detail.value) return false } @@ -889,9 +869,7 @@ class TopPanel { $id('tool_ungroup').addEventListener('click', this.clickGroup.bind(this)) $id('tool_bold').addEventListener('click', this.clickBold.bind(this)) $id('tool_italic').addEventListener('click', this.clickItalic.bind(this)) - $id('tool_text_anchor_start').addEventListener('click', () => this.clickTextAnchor.bind(this)('start')) - $id('tool_text_anchor_middle').addEventListener('click', () => this.clickTextAnchor.bind(this)('middle')) - $id('tool_text_anchor_end').addEventListener('click', () => this.clickTextAnchor.bind(this)('end')) + $id('tool_text_anchor').addEventListener('change', (evt) => this.clickTextAnchor.bind(this)(evt)) $id('tool_unlink_use').addEventListener('click', this.clickGroup.bind(this)) $id('image_url').addEventListener('change', (evt) => { this.setImageURL(evt.currentTarget.value) }); diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index 854c78bf..121b18a9 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -638,7 +638,7 @@ export const setTextAnchorMethod = function (value) { isNullish(selectedElements[1])) { svgCanvas.changeSelectedAttribute('text-anchor', value) } - if (!selectedElements[0].textContent) { + if (selectedElements.length > 0 && !selectedElements[0].textContent) { svgCanvas.textActions.setCursor() } } From 69e485352a50cab564e9fb4ffc2c829a889c9841 Mon Sep 17 00:00:00 2001 From: Timo Dittmann Date: Tue, 4 Jan 2022 10:42:22 +0100 Subject: [PATCH 2/3] Added Text Decoration options --- .../ui/__snapshots__/scenario.js.snap | 93 +++++++++++++++++++ cypress/integration/ui/scenario.js | 18 ++++ .../images/text_decoration_linethrough.svg | 6 ++ .../images/text_decoration_overline.svg | 6 ++ .../images/text_decoration_underline.svg | 6 ++ src/editor/locale/lang.af.js | 3 + src/editor/locale/lang.ar.js | 3 + src/editor/locale/lang.az.js | 3 + src/editor/locale/lang.be.js | 3 + src/editor/locale/lang.bg.js | 3 + src/editor/locale/lang.ca.js | 3 + src/editor/locale/lang.cs.js | 3 + src/editor/locale/lang.cy.js | 3 + src/editor/locale/lang.da.js | 3 + src/editor/locale/lang.de.js | 3 + src/editor/locale/lang.el.js | 3 + src/editor/locale/lang.en.js | 3 + src/editor/locale/lang.es.js | 3 + src/editor/locale/lang.et.js | 3 + src/editor/locale/lang.fa.js | 3 + src/editor/locale/lang.fi.js | 3 + src/editor/locale/lang.fr.js | 3 + src/editor/locale/lang.fy.js | 3 + src/editor/locale/lang.ga.js | 3 + src/editor/locale/lang.gl.js | 3 + src/editor/locale/lang.he.js | 3 + src/editor/locale/lang.hi.js | 3 + src/editor/locale/lang.hr.js | 3 + src/editor/locale/lang.hu.js | 3 + src/editor/locale/lang.hy.js | 3 + src/editor/locale/lang.id.js | 3 + src/editor/locale/lang.is.js | 3 + src/editor/locale/lang.it.js | 3 + src/editor/locale/lang.ja.js | 3 + src/editor/locale/lang.ko.js | 3 + src/editor/locale/lang.lt.js | 3 + src/editor/locale/lang.lv.js | 3 + src/editor/locale/lang.mk.js | 3 + src/editor/locale/lang.ms.js | 3 + src/editor/locale/lang.mt.js | 3 + src/editor/locale/lang.nl.js | 3 + src/editor/locale/lang.no.js | 3 + src/editor/locale/lang.pl.js | 3 + src/editor/locale/lang.pt-BR.js | 3 + src/editor/locale/lang.pt-PT.js | 3 + src/editor/locale/lang.ro.js | 3 + src/editor/locale/lang.ru.js | 3 + src/editor/locale/lang.sk.js | 3 + src/editor/locale/lang.sl.js | 3 + src/editor/locale/lang.sq.js | 3 + src/editor/locale/lang.sr.js | 3 + src/editor/locale/lang.sv.js | 3 + src/editor/locale/lang.sw.js | 3 + src/editor/locale/lang.test.js | 3 + src/editor/locale/lang.th.js | 3 + src/editor/locale/lang.tl.js | 3 + src/editor/locale/lang.tr.js | 3 + src/editor/locale/lang.uk.js | 3 + src/editor/locale/lang.vi.js | 3 + src/editor/locale/lang.yi.js | 3 + src/editor/locale/lang.zh-CN.js | 3 + src/editor/locale/lang.zh-HK.js | 3 + src/editor/locale/lang.zh-TW.js | 3 + src/editor/panels/TopPanel.html | 6 ++ src/editor/panels/TopPanel.js | 22 +++++ src/svgcanvas/elem-get-set.js | 50 ++++++++++ src/svgcanvas/sanitize.js | 2 +- src/svgcanvas/svgcanvas.js | 3 + 68 files changed, 385 insertions(+), 1 deletion(-) create mode 100644 src/editor/images/text_decoration_linethrough.svg create mode 100644 src/editor/images/text_decoration_overline.svg create mode 100644 src/editor/images/text_decoration_underline.svg diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index 0eb0afbd..db0a2bd4 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -637,3 +637,96 @@ exports[`use various parts of svg-edit > check tool_text_change_font_family #0`] `; + +exports[`use various parts of svg-edit > check tool_text_decoration_underline #0`] = ` + + + + Layer 1 + + AB + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_decoration_linethrough #0`] = ` + + + + Layer 1 + + AB + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_decoration_overline #0`] = ` + + + + Layer 1 + + AB + + + + +`; diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index ec90a08a..a741635d 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -163,4 +163,22 @@ describe('use various parts of svg-edit', function () { cy.get('#tool_font_family').shadow().find('select').select('Serif') testSnapshot() }) + it('check tool_text_decoration_underline', function () { + cy.get('#svg_1').click({ force: true }) + cy.get('#tool_text_decoration_underline') + .click({ force: true }) + testSnapshot() + }) + it('check tool_text_decoration_linethrough', function () { + cy.get('#svg_1').click({ force: true }) + cy.get('#tool_text_decoration_linethrough') + .click({ force: true }) + testSnapshot() + }) + it('check tool_text_decoration_overline', function () { + cy.get('#svg_1').click({ force: true }) + cy.get('#tool_text_decoration_overline') + .click({ force: true }) + testSnapshot() + }) }) diff --git a/src/editor/images/text_decoration_linethrough.svg b/src/editor/images/text_decoration_linethrough.svg new file mode 100644 index 00000000..1dda6e95 --- /dev/null +++ b/src/editor/images/text_decoration_linethrough.svg @@ -0,0 +1,6 @@ + + + + ab + + diff --git a/src/editor/images/text_decoration_overline.svg b/src/editor/images/text_decoration_overline.svg new file mode 100644 index 00000000..7d4aace4 --- /dev/null +++ b/src/editor/images/text_decoration_overline.svg @@ -0,0 +1,6 @@ + + + + ab + + diff --git a/src/editor/images/text_decoration_underline.svg b/src/editor/images/text_decoration_underline.svg new file mode 100644 index 00000000..f5f2a07b --- /dev/null +++ b/src/editor/images/text_decoration_underline.svg @@ -0,0 +1,6 @@ + + + + ab + + diff --git a/src/editor/locale/lang.af.js b/src/editor/locale/lang.af.js index 87b5bec0..a9c084b4 100644 --- a/src/editor/locale/lang.af.js +++ b/src/editor/locale/lang.af.js @@ -73,6 +73,9 @@ export default { font_family: 'Lettertipe verander Familie', font_size: 'Verandering Lettertipe Grootte', bold: 'Vetgedrukte teks', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ar.js b/src/editor/locale/lang.ar.js index 87b02377..5cae6a49 100644 --- a/src/editor/locale/lang.ar.js +++ b/src/editor/locale/lang.ar.js @@ -73,6 +73,9 @@ export default { font_family: 'تغيير الخط الأسرة', font_size: 'تغيير حجم الخط', bold: 'نص جريء', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'مائل نص', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.az.js b/src/editor/locale/lang.az.js index 3bb7d8e3..79262483 100644 --- a/src/editor/locale/lang.az.js +++ b/src/editor/locale/lang.az.js @@ -73,6 +73,9 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.be.js b/src/editor/locale/lang.be.js index bc0be1e7..39ccaa74 100644 --- a/src/editor/locale/lang.be.js +++ b/src/editor/locale/lang.be.js @@ -73,6 +73,9 @@ export default { font_family: 'Змены Сямейства шрыфтоў', font_size: 'Змяніць памер шрыфта', bold: 'Тоўсты тэкст', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Нахілены тэкст', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.bg.js b/src/editor/locale/lang.bg.js index c4a34d31..12316722 100644 --- a/src/editor/locale/lang.bg.js +++ b/src/editor/locale/lang.bg.js @@ -73,6 +73,9 @@ export default { font_family: 'Промяна на шрифта Семейство', font_size: 'Промени размера на буквите', bold: 'Получер текст', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Курсив текст', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ca.js b/src/editor/locale/lang.ca.js index d1d5fe19..a2a489cf 100644 --- a/src/editor/locale/lang.ca.js +++ b/src/editor/locale/lang.ca.js @@ -73,6 +73,9 @@ export default { font_family: 'Canviar la font Família', font_size: 'Change Font Size', bold: 'Text en negreta', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Text en cursiva', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.cs.js b/src/editor/locale/lang.cs.js index efbf18d7..eca7726d 100644 --- a/src/editor/locale/lang.cs.js +++ b/src/editor/locale/lang.cs.js @@ -73,6 +73,9 @@ export default { font_family: 'Změnit font', font_size: 'Změnit velikost písma', bold: 'Tučně', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kurzíva', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.cy.js b/src/editor/locale/lang.cy.js index 447df759..3b2f2974 100644 --- a/src/editor/locale/lang.cy.js +++ b/src/editor/locale/lang.cy.js @@ -73,6 +73,9 @@ export default { font_family: 'Newid Font Teulu', font_size: 'Newid Maint Ffont', bold: 'Testun Bras', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italig Testun', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.da.js b/src/editor/locale/lang.da.js index 767cd33e..e3b5bbd1 100644 --- a/src/editor/locale/lang.da.js +++ b/src/editor/locale/lang.da.js @@ -72,6 +72,9 @@ export default { font_family: 'Skift Font Family', font_size: 'Skift skriftstørrelse', bold: 'Fed tekst', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.de.js b/src/editor/locale/lang.de.js index bd86bcbc..e97e3a86 100644 --- a/src/editor/locale/lang.de.js +++ b/src/editor/locale/lang.de.js @@ -73,6 +73,9 @@ export default { font_family: 'Schriftart wählen', font_size: 'Schriftgröße einstellen', bold: 'Fetter Text', + text_decoration_underline: 'Unterstrichen', + text_decoration_linethrough: 'Durchgestrichen', + text_decoration_overline: 'Überstrichen', italic: 'Kursiver Text', text_anchor_start: 'Den Text linksbündig ausrichten', text_anchor_middle: 'Den Text zentriert ausrichten', diff --git a/src/editor/locale/lang.el.js b/src/editor/locale/lang.el.js index d3bd1078..2bb31742 100644 --- a/src/editor/locale/lang.el.js +++ b/src/editor/locale/lang.el.js @@ -73,6 +73,9 @@ export default { font_family: 'Αλλαγή γραμματοσειράς Οικογένεια', font_size: 'Αλλαγή μεγέθους γραμματοσειράς', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Πλάγιους', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.en.js b/src/editor/locale/lang.en.js index 688cceaa..7c542285 100644 --- a/src/editor/locale/lang.en.js +++ b/src/editor/locale/lang.en.js @@ -74,6 +74,9 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.es.js b/src/editor/locale/lang.es.js index 0de1cf7b..523dcc5c 100644 --- a/src/editor/locale/lang.es.js +++ b/src/editor/locale/lang.es.js @@ -73,6 +73,9 @@ export default { font_family: 'Tipo de fuente', font_size: 'Tamaño de la fuente', bold: 'Texto en negrita', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Texto en cursiva', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.et.js b/src/editor/locale/lang.et.js index c03f754a..122cab8d 100644 --- a/src/editor/locale/lang.et.js +++ b/src/editor/locale/lang.et.js @@ -73,6 +73,9 @@ export default { font_family: 'Muutke Kirjasinperhe', font_size: 'Change font size', bold: 'Rasvane kiri', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursiiv', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.fa.js b/src/editor/locale/lang.fa.js index 2eb539ee..ea901618 100644 --- a/src/editor/locale/lang.fa.js +++ b/src/editor/locale/lang.fa.js @@ -73,6 +73,9 @@ export default { font_family: '‫تغییر خانواده قلم‬', font_size: '‫تغییر اندازه قلم‬', bold: '‫متن توپر ‬', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: '‫متن کج ‬', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.fi.js b/src/editor/locale/lang.fi.js index 6e24556f..7701f6ed 100644 --- a/src/editor/locale/lang.fi.js +++ b/src/editor/locale/lang.fi.js @@ -73,6 +73,9 @@ export default { font_family: 'Muuta Font Family', font_size: 'Muuta fontin kokoa', bold: 'Lihavoitu teksti', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursivoitu', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.fr.js b/src/editor/locale/lang.fr.js index 1e5bf3ae..3257aefa 100644 --- a/src/editor/locale/lang.fr.js +++ b/src/editor/locale/lang.fr.js @@ -73,6 +73,9 @@ export default { font_family: 'Changer la famille de police', font_size: 'Changer la taille de la police', bold: 'Texte en gras', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Texte en italique', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.fy.js b/src/editor/locale/lang.fy.js index 6987168f..f4b08d24 100644 --- a/src/editor/locale/lang.fy.js +++ b/src/editor/locale/lang.fy.js @@ -73,6 +73,9 @@ export default { font_family: 'Lettertype oanpasse', font_size: 'Lettergrutte oanpasse', bold: 'Fet', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Skean', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ga.js b/src/editor/locale/lang.ga.js index 563383f5..acdefb4c 100644 --- a/src/editor/locale/lang.ga.js +++ b/src/editor/locale/lang.ga.js @@ -73,6 +73,9 @@ export default { font_family: 'Athraigh an Cló Teaghlaigh', font_size: 'Athraigh Clómhéid', bold: 'Trom Téacs', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Iodálach Téacs', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.gl.js b/src/editor/locale/lang.gl.js index 737df7ec..1bd5d5e8 100644 --- a/src/editor/locale/lang.gl.js +++ b/src/editor/locale/lang.gl.js @@ -73,6 +73,9 @@ export default { font_family: 'Cambiar fonte Familia', font_size: 'Mudar tamaño de letra', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Texto en cursiva', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.he.js b/src/editor/locale/lang.he.js index b2636ebf..c86d25a9 100755 --- a/src/editor/locale/lang.he.js +++ b/src/editor/locale/lang.he.js @@ -73,6 +73,9 @@ export default { font_family: 'שינוי גופן משפחה', font_size: 'שנה גודל גופן', bold: 'טקסט מודגש', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'טקסט נטוי', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.hi.js b/src/editor/locale/lang.hi.js index 33aa8040..caef85c2 100644 --- a/src/editor/locale/lang.hi.js +++ b/src/editor/locale/lang.hi.js @@ -73,6 +73,9 @@ export default { font_family: 'बदलें फ़ॉन्ट परिवार', font_size: 'फ़ॉन्ट का आकार बदलें', bold: 'मोटा पाठ', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'इटैलिक पाठ', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.hr.js b/src/editor/locale/lang.hr.js index 98910eda..e2b2fa83 100644 --- a/src/editor/locale/lang.hr.js +++ b/src/editor/locale/lang.hr.js @@ -72,6 +72,9 @@ export default { font_family: 'Promjena fontova', font_size: 'Change font size', bold: 'Podebljani tekst', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.hu.js b/src/editor/locale/lang.hu.js index 9b55ebae..c5f5d81d 100644 --- a/src/editor/locale/lang.hu.js +++ b/src/editor/locale/lang.hu.js @@ -73,6 +73,9 @@ export default { font_family: 'Change Betűcsalád', font_size: 'Change font size', bold: 'Félkövér szöveg', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Dőlt szöveg', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.hy.js b/src/editor/locale/lang.hy.js index 04feadc4..24847761 100644 --- a/src/editor/locale/lang.hy.js +++ b/src/editor/locale/lang.hy.js @@ -73,6 +73,9 @@ export default { font_family_label: 'Font:', font_size: 'Change Font Size', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.id.js b/src/editor/locale/lang.id.js index f41de36c..18cec39f 100644 --- a/src/editor/locale/lang.id.js +++ b/src/editor/locale/lang.id.js @@ -73,6 +73,9 @@ export default { font_family_label: 'Font:', font_size: 'Ubah Ukuran Font', bold: 'Bold Teks', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Teks', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.is.js b/src/editor/locale/lang.is.js index 3bddc05d..e133739f 100644 --- a/src/editor/locale/lang.is.js +++ b/src/editor/locale/lang.is.js @@ -73,6 +73,9 @@ export default { font_family: 'Change Leturfjölskylda', font_size: 'Breyta leturstærð', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.it.js b/src/editor/locale/lang.it.js index c20b3afb..6f846d2a 100644 --- a/src/editor/locale/lang.it.js +++ b/src/editor/locale/lang.it.js @@ -73,6 +73,9 @@ export default { font_family: 'Cambia il tipo di Font', font_size: 'Modifica dimensione carattere', bold: 'Grassetto', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Corsivo', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ja.js b/src/editor/locale/lang.ja.js index e402f66c..4983028a 100644 --- a/src/editor/locale/lang.ja.js +++ b/src/editor/locale/lang.ja.js @@ -73,6 +73,9 @@ export default { font_family: 'フォントファミリーの変更', font_size: '文字サイズの変更', bold: '太字', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'イタリック体', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ko.js b/src/editor/locale/lang.ko.js index 6aabdaa8..af1c90ff 100644 --- a/src/editor/locale/lang.ko.js +++ b/src/editor/locale/lang.ko.js @@ -73,6 +73,9 @@ export default { font_family: '글꼴 변경 패밀리', font_size: '글꼴 크기 변경', bold: '굵은 텍스트', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: '기울임꼴 텍스트', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.lt.js b/src/editor/locale/lang.lt.js index 22fa0937..128f9a0a 100644 --- a/src/editor/locale/lang.lt.js +++ b/src/editor/locale/lang.lt.js @@ -73,6 +73,9 @@ export default { font_family: 'Pakeistišriftą Šeima', font_size: 'Change font size', bold: 'Pusjuodis', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursyvas', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.lv.js b/src/editor/locale/lang.lv.js index e3aea3a5..4f0d93ab 100644 --- a/src/editor/locale/lang.lv.js +++ b/src/editor/locale/lang.lv.js @@ -73,6 +73,9 @@ export default { font_family: 'Mainīt fonta Family', font_size: 'Mainīt fonta izmēru', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursīvs', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.mk.js b/src/editor/locale/lang.mk.js index fab7935e..dfe10382 100644 --- a/src/editor/locale/lang.mk.js +++ b/src/editor/locale/lang.mk.js @@ -73,6 +73,9 @@ export default { font_family: 'Смени фонт Фамилија', font_size: 'Изменифонт Големина', bold: 'Задебелен текст', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic текст', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ms.js b/src/editor/locale/lang.ms.js index 85de8294..7431710b 100644 --- a/src/editor/locale/lang.ms.js +++ b/src/editor/locale/lang.ms.js @@ -73,6 +73,9 @@ export default { font_family: 'Tukar Font Keluarga', font_size: 'Ubah Saiz Font', bold: 'Bold Teks', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Teks', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.mt.js b/src/editor/locale/lang.mt.js index fffa4223..f1f12d8e 100644 --- a/src/editor/locale/lang.mt.js +++ b/src/editor/locale/lang.mt.js @@ -73,6 +73,9 @@ export default { font_family: 'Bidla Font Familja', font_size: 'Change font size', bold: 'Bold Test', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Test korsiv', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.nl.js b/src/editor/locale/lang.nl.js index 005de475..cacb9dbe 100644 --- a/src/editor/locale/lang.nl.js +++ b/src/editor/locale/lang.nl.js @@ -73,6 +73,9 @@ export default { font_family: 'Verander lettertype', font_size: 'Verander lettertype grootte', bold: 'Vet', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Cursief', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.no.js b/src/editor/locale/lang.no.js index a17e787b..e956cb42 100644 --- a/src/editor/locale/lang.no.js +++ b/src/editor/locale/lang.no.js @@ -73,6 +73,9 @@ export default { font_family: 'Change Font Family', font_size: 'Endre skriftstørrelse', bold: 'Fet tekst', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursiv tekst', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.pl.js b/src/editor/locale/lang.pl.js index 68fc49e0..78b2bb9e 100644 --- a/src/editor/locale/lang.pl.js +++ b/src/editor/locale/lang.pl.js @@ -74,6 +74,9 @@ export default { font_family: 'Zmień krój czcionki', font_size: 'Zmień rozmiar czcionki', bold: 'Pogrubienie textu', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursywa', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.pt-BR.js b/src/editor/locale/lang.pt-BR.js index d12fcee2..e7d0511e 100644 --- a/src/editor/locale/lang.pt-BR.js +++ b/src/editor/locale/lang.pt-BR.js @@ -73,6 +73,9 @@ export default { font_family: 'Mudar o estilo da fonte', font_size: 'Mudar o tamanho da fonte', bold: 'Negrito', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italico', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.pt-PT.js b/src/editor/locale/lang.pt-PT.js index 7ad581af..87a3d00b 100644 --- a/src/editor/locale/lang.pt-PT.js +++ b/src/editor/locale/lang.pt-PT.js @@ -73,6 +73,9 @@ export default { font_family: 'Alterar fonte Família', font_size: 'Alterar tamanho de letra', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Texto em itálico', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ro.js b/src/editor/locale/lang.ro.js index d31be102..0083cad0 100644 --- a/src/editor/locale/lang.ro.js +++ b/src/editor/locale/lang.ro.js @@ -73,6 +73,9 @@ export default { font_family: 'Modificare familie de fonturi', font_size: 'Schimbă dimensiunea fontului', bold: 'Text Îngroşat', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Text Înclinat', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.ru.js b/src/editor/locale/lang.ru.js index 186855c3..820fe60f 100644 --- a/src/editor/locale/lang.ru.js +++ b/src/editor/locale/lang.ru.js @@ -73,6 +73,9 @@ export default { font_family: 'Изменить семейство шрифтов', font_size: 'Изменить размер шрифта', bold: 'Жирный', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Курсив', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sk.js b/src/editor/locale/lang.sk.js index 9a1c09b7..6d1916f0 100644 --- a/src/editor/locale/lang.sk.js +++ b/src/editor/locale/lang.sk.js @@ -73,6 +73,9 @@ export default { font_family: 'Zmeniť font', font_size: 'Zmeniť veľkosť písma', bold: 'Tučné', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kurzíva', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sl.js b/src/editor/locale/lang.sl.js index 538e0bbb..63eedcfe 100644 --- a/src/editor/locale/lang.sl.js +++ b/src/editor/locale/lang.sl.js @@ -73,6 +73,9 @@ export default { font_family: 'Spremeni tip pisave', font_size: 'Spremeni velikost pisave', bold: 'Krepko', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Poševno', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sq.js b/src/editor/locale/lang.sq.js index 2c248d41..def95fff 100644 --- a/src/editor/locale/lang.sq.js +++ b/src/editor/locale/lang.sq.js @@ -73,6 +73,9 @@ export default { font_family: 'Ndryshimi Font Family', font_size: 'Ndryshimi Font Size', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sr.js b/src/editor/locale/lang.sr.js index 8ef5443d..9ceb0c35 100644 --- a/src/editor/locale/lang.sr.js +++ b/src/editor/locale/lang.sr.js @@ -73,6 +73,9 @@ export default { font_family: 'Цханге фонт породицу', font_size: 'Цханге фонт сизе', bold: 'Подебљан текст', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Италиц текст', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sv.js b/src/editor/locale/lang.sv.js index 6d8ebc67..22e76ee0 100644 --- a/src/editor/locale/lang.sv.js +++ b/src/editor/locale/lang.sv.js @@ -73,6 +73,9 @@ export default { font_family: 'Ändra Typsnitt', font_size: 'Ändra textstorlek', bold: 'Fet text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Kursiv text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.sw.js b/src/editor/locale/lang.sw.js index 43cddb3c..64b1748d 100644 --- a/src/editor/locale/lang.sw.js +++ b/src/editor/locale/lang.sw.js @@ -73,6 +73,9 @@ export default { font_family: 'Change font Family', font_size: 'Change font Size', bold: 'Bold Nakala', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italiki Nakala', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.test.js b/src/editor/locale/lang.test.js index e090dc94..bd3144fe 100644 --- a/src/editor/locale/lang.test.js +++ b/src/editor/locale/lang.test.js @@ -73,6 +73,9 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.th.js b/src/editor/locale/lang.th.js index ce3adcb5..99b946fa 100644 --- a/src/editor/locale/lang.th.js +++ b/src/editor/locale/lang.th.js @@ -73,6 +73,9 @@ export default { font_family: 'ครอบครัว Change Font', font_size: 'เปลี่ยนขนาดตัวอักษร', bold: 'ข้อความตัวหนา', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'ข้อความตัวเอียง', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.tl.js b/src/editor/locale/lang.tl.js index ad9756ad..42746dd2 100644 --- a/src/editor/locale/lang.tl.js +++ b/src/editor/locale/lang.tl.js @@ -73,6 +73,9 @@ export default { font_family: 'Baguhin ang Pamilya ng Font', font_size: 'Baguhin ang Laki ng Font', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.tr.js b/src/editor/locale/lang.tr.js index 18386b7c..8b34c4dc 100644 --- a/src/editor/locale/lang.tr.js +++ b/src/editor/locale/lang.tr.js @@ -73,6 +73,9 @@ export default { font_family: 'Font değiştir Aile', font_size: 'Change font size', bold: 'Kalın Yazı', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italik yazı', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.uk.js b/src/editor/locale/lang.uk.js index b1982e22..f7f7d0d9 100644 --- a/src/editor/locale/lang.uk.js +++ b/src/editor/locale/lang.uk.js @@ -73,6 +73,9 @@ export default { font_family: 'Зміни Сімейство шрифтів', font_size: 'Змінити розмір шрифту', bold: 'Товстий текст', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Похилий текст', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.vi.js b/src/editor/locale/lang.vi.js index 373a44e3..a38951c7 100644 --- a/src/editor/locale/lang.vi.js +++ b/src/editor/locale/lang.vi.js @@ -73,6 +73,9 @@ export default { font_family: 'Thay đổi Font Gia đình', font_size: 'Thay đổi cỡ chữ', bold: 'Bold Text', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'Italic Text', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.yi.js b/src/editor/locale/lang.yi.js index 439f6ead..02bef593 100644 --- a/src/editor/locale/lang.yi.js +++ b/src/editor/locale/lang.yi.js @@ -73,6 +73,9 @@ export default { font_family: 'ענדערן פאָנט פאַמילי', font_size: 'בייטן פאָנט גרייס', bold: 'דרייסט טעקסט', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: 'יטאַליק טעקסט', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.zh-CN.js b/src/editor/locale/lang.zh-CN.js index b8983f5b..8b29fdad 100644 --- a/src/editor/locale/lang.zh-CN.js +++ b/src/editor/locale/lang.zh-CN.js @@ -73,6 +73,9 @@ export default { font_family: '更改字体样式', font_size: '更改字体大小', bold: '粗体', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: '斜体', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.zh-HK.js b/src/editor/locale/lang.zh-HK.js index c0d50070..03dd1f63 100644 --- a/src/editor/locale/lang.zh-HK.js +++ b/src/editor/locale/lang.zh-HK.js @@ -73,6 +73,9 @@ export default { font_family: '更改字体家族', font_size: '更改字体大小', bold: '粗体', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: '斜体文本', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/locale/lang.zh-TW.js b/src/editor/locale/lang.zh-TW.js index 4df994be..74a99ce7 100644 --- a/src/editor/locale/lang.zh-TW.js +++ b/src/editor/locale/lang.zh-TW.js @@ -73,6 +73,9 @@ export default { font_family: '更改字體', font_size: '更改字體大小', bold: '粗體', + text_decoration_underline: 'Underline', + text_decoration_linethrough: 'Line-Through', + text_decoration_overline: 'Overline', italic: '斜體', text_anchor_start: 'Align the text in start', text_anchor_middle: 'Align the text in middle', diff --git a/src/editor/panels/TopPanel.html b/src/editor/panels/TopPanel.html index f9e0b531..89254031 100644 --- a/src/editor/panels/TopPanel.html +++ b/src/editor/panels/TopPanel.html @@ -129,8 +129,13 @@
+ + + + + +
diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index bacf5a3b..539f550b 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -352,6 +352,9 @@ class TopPanel { this.displayTool('text_panel') $id('tool_italic').pressed = this.editor.svgCanvas.getItalic() $id('tool_bold').pressed = this.editor.svgCanvas.getBold() + $id('tool_text_decoration_underline').pressed = this.editor.svgCanvas.hasTextDecoration('underline') + $id('tool_text_decoration_linethrough').pressed = this.editor.svgCanvas.hasTextDecoration('line-through') + $id('tool_text_decoration_overline').pressed = this.editor.svgCanvas.hasTextDecoration('overline') $id('tool_font_family').setAttribute('value', elem.getAttribute('font-family')) $id('tool_text_anchor').setAttribute('value', elem.getAttribute('text-anchor')) $id('font_size').value = elem.getAttribute('font-size') @@ -744,6 +747,22 @@ class TopPanel { return false } + /** + * Handles the click on the text decoration buttons + * + * @param value The text decoration value + * @returns {boolean} false + */ + clickTextDecoration(value) { + if(this.editor.svgCanvas.hasTextDecoration(value)) { + this.editor.svgCanvas.removeTextDecoration(value) + } else { + this.editor.svgCanvas.addTextDecoration(value) + } + this.updateContextPanel(); + return false; + } + /** * Sets the text anchor value * @@ -869,6 +888,9 @@ class TopPanel { $id('tool_ungroup').addEventListener('click', this.clickGroup.bind(this)) $id('tool_bold').addEventListener('click', this.clickBold.bind(this)) $id('tool_italic').addEventListener('click', this.clickItalic.bind(this)) + $id('tool_text_decoration_underline').addEventListener('click', () => this.clickTextDecoration.bind(this)('underline')) + $id('tool_text_decoration_linethrough').addEventListener('click', () => this.clickTextDecoration.bind(this)('line-through')) + $id('tool_text_decoration_overline').addEventListener('click', () => this.clickTextDecoration.bind(this)('overline')) $id('tool_text_anchor').addEventListener('change', (evt) => this.clickTextAnchor.bind(this)(evt)) $id('tool_unlink_use').addEventListener('click', this.clickGroup.bind(this)) $id('image_url').addEventListener('change', (evt) => { this.setImageURL(evt.currentTarget.value) }); diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index 121b18a9..e989ade3 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -593,6 +593,56 @@ export const setBoldMethod = function (b) { } } +/** + * Check whether selected element has the given text decoration value or not. + * @returns {boolean} Indicates whether or not element has the text decoration value + */ +export const hasTextDecorationMethod = function (value) { + const selectedElements = svgCanvas.getSelectedElements(); + const selected = selectedElements[0]; + + if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { + const attribute = selected.getAttribute('text-decoration') || ''; + return attribute.includes(value); + } + + return false; +} + +/** + * Adds the given text decoration value + * @param value The text decoration value + * @returns {void} + */ +export const addTextDecorationMethod = function (value) { + const selectedElements = svgCanvas.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { + const oldValue = selected.getAttribute('text-decoration') || ''; + svgCanvas.changeSelectedAttribute('text-decoration', (oldValue + ' ' + value).trim()) + } + if (selectedElements.length > 0 && !selectedElements[0].textContent) { + svgCanvas.textActions.setCursor() + } +} + +/** + * Removes the given text decoration value + * @param value The text decoration value + * @returns {void} + */ +export const removeTextDecorationMethod = function (value) { + const selectedElements = svgCanvas.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { + const actualValues = selected.getAttribute('text-decoration') || ''; + svgCanvas.changeSelectedAttribute('text-decoration', actualValues.replace(value, '').trim()) + } + if (selectedElements.length > 0 && !selectedElements[0].textContent) { + svgCanvas.textActions.setCursor() + } +} + /** * Check whether selected element is in italics or not. * @function module:svgcanvas.SvgCanvas#getItalic diff --git a/src/svgcanvas/sanitize.js b/src/svgcanvas/sanitize.js index 496f3a2e..09d3cd6d 100644 --- a/src/svgcanvas/sanitize.js +++ b/src/svgcanvas/sanitize.js @@ -56,7 +56,7 @@ const svgWhiteList_ = { svg: ['clip-path', 'clip-rule', 'enable-background', 'filter', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'systemLanguage', 'version', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'xmlns:oi', 'oi:animations', 'y', 'stroke-linejoin', 'fill-rule', 'aria-label', 'stroke-width', 'fill-rule', 'xml:space'], switch: ['requiredFeatures', 'systemLanguage'], symbol: ['fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'opacity', 'overflow', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'systemLanguage', 'viewBox', 'width', 'height'], - text: ['clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'systemLanguage', 'text-anchor', 'x', 'xml:space', 'y'], + text: ['clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'systemLanguage', 'text-anchor', 'text-decoration', 'x', 'xml:space', 'y'], textPath: ['method', 'requiredFeatures', 'spacing', 'startOffset', 'systemLanguage', 'xlink:href'], title: [], tspan: ['clip-path', 'clip-rule', 'dx', 'dy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'mask', 'opacity', 'requiredFeatures', 'rotate', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'systemLanguage', 'text-anchor', 'textLength', 'x', 'xml:space', 'y'], diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index ad78176a..4fc1d80b 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -923,6 +923,9 @@ class SvgCanvas { this.setBold = elemGetSet.setBoldMethod // Make the selected element bold or normal. this.getItalic = elemGetSet.getItalicMethod // Check whether selected element is in italics or not. this.setItalic = elemGetSet.setItalicMethod // Make the selected element italic or normal. + this.hasTextDecoration = elemGetSet.hasTextDecorationMethod // Check whether the selected element has the given text decoration or not. + this.addTextDecoration = elemGetSet.addTextDecorationMethod // Adds the given value to the text decoration + this.removeTextDecoration = elemGetSet.removeTextDecorationMethod // Removes the given value from the text decoration this.setTextAnchor = elemGetSet.setTextAnchorMethod // Set the new text anchor. this.getFontFamily = elemGetSet.getFontFamilyMethod // The current font family this.setFontFamily = elemGetSet.setFontFamilyMethod // Set the new font family. From 613e33da3334e3ec55e1ddf66f1961d0c32e4820 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:22:17 -0300 Subject: [PATCH 3/3] fix linter issues --- cypress/integration/ui/scenario.js | 6 +++--- src/editor/panels/TopPanel.js | 10 +++++----- src/svgcanvas/elem-get-set.js | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index a741635d..bb3f424c 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -166,19 +166,19 @@ describe('use various parts of svg-edit', function () { it('check tool_text_decoration_underline', function () { cy.get('#svg_1').click({ force: true }) cy.get('#tool_text_decoration_underline') - .click({ force: true }) + .click({ force: true }) testSnapshot() }) it('check tool_text_decoration_linethrough', function () { cy.get('#svg_1').click({ force: true }) cy.get('#tool_text_decoration_linethrough') - .click({ force: true }) + .click({ force: true }) testSnapshot() }) it('check tool_text_decoration_overline', function () { cy.get('#svg_1').click({ force: true }) cy.get('#tool_text_decoration_overline') - .click({ force: true }) + .click({ force: true }) testSnapshot() }) }) diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index 539f550b..faa84768 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -96,7 +96,7 @@ class TopPanel { break case 'g': case 'a': { - // Look for common styles + // Look for common styles const childs = this.selectedElement.getElementsByTagName('*') let gWidth = null for (i = 0, len = childs.length; i < len; i++) { @@ -753,14 +753,14 @@ class TopPanel { * @param value The text decoration value * @returns {boolean} false */ - clickTextDecoration(value) { - if(this.editor.svgCanvas.hasTextDecoration(value)) { + clickTextDecoration (value) { + if (this.editor.svgCanvas.hasTextDecoration(value)) { this.editor.svgCanvas.removeTextDecoration(value) } else { this.editor.svgCanvas.addTextDecoration(value) } - this.updateContextPanel(); - return false; + this.updateContextPanel() + return false } /** diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index e989ade3..d098ceaa 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -598,15 +598,15 @@ export const setBoldMethod = function (b) { * @returns {boolean} Indicates whether or not element has the text decoration value */ export const hasTextDecorationMethod = function (value) { - const selectedElements = svgCanvas.getSelectedElements(); - const selected = selectedElements[0]; + const selectedElements = svgCanvas.getSelectedElements() + const selected = selectedElements[0] if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { - const attribute = selected.getAttribute('text-decoration') || ''; - return attribute.includes(value); + const attribute = selected.getAttribute('text-decoration') || '' + return attribute.includes(value) } - return false; + return false } /** @@ -615,10 +615,10 @@ export const hasTextDecorationMethod = function (value) { * @returns {void} */ export const addTextDecorationMethod = function (value) { - const selectedElements = svgCanvas.getSelectedElements(); - const selected = selectedElements[0]; + const selectedElements = svgCanvas.getSelectedElements() + const selected = selectedElements[0] if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { - const oldValue = selected.getAttribute('text-decoration') || ''; + const oldValue = selected.getAttribute('text-decoration') || '' svgCanvas.changeSelectedAttribute('text-decoration', (oldValue + ' ' + value).trim()) } if (selectedElements.length > 0 && !selectedElements[0].textContent) { @@ -632,10 +632,10 @@ export const addTextDecorationMethod = function (value) { * @returns {void} */ export const removeTextDecorationMethod = function (value) { - const selectedElements = svgCanvas.getSelectedElements(); - const selected = selectedElements[0]; + const selectedElements = svgCanvas.getSelectedElements() + const selected = selectedElements[0] if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { - const actualValues = selected.getAttribute('text-decoration') || ''; + const actualValues = selected.getAttribute('text-decoration') || '' svgCanvas.changeSelectedAttribute('text-decoration', actualValues.replace(value, '').trim()) } if (selectedElements.length > 0 && !selectedElements[0].textContent) {