From bbe566f38299854a3a3c57433235940a1bd33f7a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 20 May 2017 14:23:59 +0200 Subject: [PATCH] Updated table plugin --- .../js/3rdParty/redactor2/plugins/table.js | 246 +++++++++--------- 1 file changed, 122 insertions(+), 124 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/table.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/table.js index 3c8ca3c525..b88e444201 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/table.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/table.js @@ -23,147 +23,148 @@ var dropdown = {}; dropdown.insert_table = { - title: this.lang.get('insert-table'), - func: this.table.insert, - observe: { - element: 'table', - in: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('insert-table'), + func: this.table.insert, + observe: { + element: 'table', + in: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.insert_row_above = { - title: this.lang.get('insert-row-above'), - func: this.table.addRowAbove, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('insert-row-above'), + func: this.table.addRowAbove, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.insert_row_below = { - title: this.lang.get('insert-row-below'), - func: this.table.addRowBelow, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('insert-row-below'), + func: this.table.addRowBelow, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.insert_column_left = { - title: this.lang.get('insert-column-left'), - func: this.table.addColumnLeft, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('insert-column-left'), + func: this.table.addColumnLeft, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.insert_column_right = { - title: this.lang.get('insert-column-right'), - func: this.table.addColumnRight, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('insert-column-right'), + func: this.table.addColumnRight, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.add_head = { - title: this.lang.get('add-head'), - func: this.table.addHead, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('add-head'), + func: this.table.addHead, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.delete_head = { - title: this.lang.get('delete-head'), - func: this.table.deleteHead, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('delete-head'), + func: this.table.deleteHead, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.delete_column = { - title: this.lang.get('delete-column'), - func: this.table.deleteColumn, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('delete-column'), + func: this.table.deleteColumn, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.delete_row = { - title: this.lang.get('delete-row'), - func: this.table.deleteRow, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('delete-row'), + func: this.table.deleteRow, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; dropdown.delete_table = { - title: this.lang.get('delete-table'), - func: this.table.deleteTable, - observe: { - element: 'table', - out: { - attr: { - 'class': 'redactor-dropdown-link-inactive', - 'aria-disabled': true, - } - } - } - }; + title: this.lang.get('delete-table'), + func: this.table.deleteTable, + observe: { + element: 'table', + out: { + attr: { + 'class': 'redactor-dropdown-link-inactive', + 'aria-disabled': true, + } + } + } + }; var button = this.button.addBefore('link', 'table', this.lang.get('table')); + this.button.setIcon(button, ''); this.button.addDropdown(button, dropdown); }, insert: function() @@ -180,7 +181,6 @@ var $tableBox = $('
'); var $table = $(''); - for (var i = 0; i < rows; i++) { var $row = $(''); @@ -207,9 +207,7 @@ this.buffer.set(); var current = this.selection.current(); - // see https://github.com/Redactor2/plugins/pull/3 - //if ($(current).closest('li').length !== 0) - if ($(current).closest('li', this.core.editor().get(0)).length !== 0) + if ($(current).closest('li', this.core.editor()[0]).length !== 0) { $(current).closest('ul, ol').first().after(html); } -- 2.20.1