diff --git a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss index 8ab375a4..dd878c5f 100644 --- a/dist/plugins/colors/ui/sass/trumbowyg.colors.scss +++ b/dist/plugins/colors/ui/sass/trumbowyg.colors.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/colors/ui/trumbowyg.colors.css b/dist/plugins/colors/ui/trumbowyg.colors.css index d22a2110..d1a55126 100644 --- a/dist/plugins/colors/ui/trumbowyg.colors.css +++ b/dist/plugins/colors/ui/trumbowyg.colors.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/colors/ui/trumbowyg.colors.min.css b/dist/plugins/colors/ui/trumbowyg.colors.min.css index 1d1823bf..7538bc03 100644 --- a/dist/plugins/colors/ui/trumbowyg.colors.min.css +++ b/dist/plugins/colors/ui/trumbowyg.colors.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-backColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-foreColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):focus::after,.trumbowyg-dropdown-backColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-backColorRemove-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff} \ No newline at end of file diff --git a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss index 7dce1491..20f5a709 100644 --- a/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss +++ b/dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.css b/dist/plugins/emoji/ui/trumbowyg.emoji.css index 94c59aae..56074229 100644 --- a/dist/plugins/emoji/ui/trumbowyg.emoji.css +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/emoji/ui/trumbowyg.emoji.min.css b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css index 1a86206a..f02e801d 100644 --- a/dist/plugins/emoji/ui/trumbowyg.emoji.min.css +++ b/dist/plugins/emoji/ui/trumbowyg.emoji.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-emoji{width:265px;padding:7px 0 7px 5px}.trumbowyg-dropdown-emoji svg{display:none!important}.trumbowyg-dropdown-emoji button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-emoji button:focus::after,.trumbowyg-dropdown-emoji button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .emoji{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss b/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss index 2168fee5..18b32aef 100644 --- a/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss +++ b/dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/giphy/ui/trumbowyg.giphy.css b/dist/plugins/giphy/ui/trumbowyg.giphy.css index 969ad3bb..779acc71 100644 --- a/dist/plugins/giphy/ui/trumbowyg.giphy.css +++ b/dist/plugins/giphy/ui/trumbowyg.giphy.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/giphy/ui/trumbowyg.giphy.min.css b/dist/plugins/giphy/ui/trumbowyg.giphy.min.css index 16a8fd23..48871565 100644 --- a/dist/plugins/giphy/ui/trumbowyg.giphy.min.css +++ b/dist/plugins/giphy/ui/trumbowyg.giphy.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-giphy-button svg{-webkit-transform:scale(1.22);-ms-transform:scale(1.22);-o-transform:scale(1.22);transform:scale(1.22)}.trumbowyg-giphy-search{display:block;width:80%;margin:5%;padding-left:10px;padding-right:150px}.trumbowyg-giphy-close{position:absolute;top:calc(5% + 8px);right:calc(5% - 2px);width:30px;height:30px;background:0 0;border:1px solid transparent}.trumbowyg-giphy-close:focus,.trumbowyg-giphy-close:hover{outline:0;background:#ecf0f1}.trumbowyg-giphy-close:focus{border-color:rgba(0,0,0,.3)}.trumbowyg-powered-by-giphy{position:absolute;top:calc(5% + 12px);right:calc(15% + 10px);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-powered-by-giphy span{text-transform:uppercase;font-weight:700;font-size:10px;opacity:.6}.trumbowyg-powered-by-giphy svg{width:66px;height:15px;vertical-align:bottom;margin-left:6px;opacity:.45}.trumbowyg-giphy-modal-scroll{overflow:auto;overflow-x:hidden;height:240px}.trumbowyg-giphy-modal{padding:0 5%;-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}.trumbowyg-giphy-modal .trumbowyg-giphy-no-result{width:250%;margin:13% 0 0 29%}.trumbowyg-giphy-modal .trumbowyg-giphy-offline{font-size:18px;width:305%;height:600px;margin-top:95px;text-align:center}.trumbowyg-giphy-modal .img-container{width:100%;margin-bottom:10px;background-color:#ecf0f1}.trumbowyg-giphy-modal .img-container img{width:100%;cursor:pointer;opacity:0;-webkit-transition:opacity 150ms;-o-transition:opacity 150ms;transition:opacity 150ms}.trumbowyg-giphy-modal .img-container img:focus,.trumbowyg-giphy-modal .img-container img:hover{border:#2ecc71 solid 3px}.trumbowyg-giphy-modal .img-container img.tbw-loaded{opacity:1} \ No newline at end of file diff --git a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss index 3369fc34..3787e6d9 100644 --- a/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss +++ b/dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.css b/dist/plugins/highlight/ui/trumbowyg.highlight.css index 1c14c998..c827e45d 100644 --- a/dist/plugins/highlight/ui/trumbowyg.highlight.css +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/highlight/ui/trumbowyg.highlight.min.css b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css index 4e6fc8fe..2ca6bc23 100644 --- a/dist/plugins/highlight/ui/trumbowyg.highlight.min.css +++ b/dist/plugins/highlight/ui/trumbowyg.highlight.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #dedede;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px} \ No newline at end of file diff --git a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss index 12f6bafd..6ee4f8dc 100644 --- a/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss +++ b/dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.css b/dist/plugins/mathml/ui/trumbowyg.mathml.css index d253184d..e562034d 100644 --- a/dist/plugins/mathml/ui/trumbowyg.mathml.css +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/mathml/ui/trumbowyg.mathml.min.css b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css index c6536c04..98793ac4 100644 --- a/dist/plugins/mathml/ui/trumbowyg.mathml.min.css +++ b/dist/plugins/mathml/ui/trumbowyg.mathml.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ @charset "UTF-8";[formulas]{position:relative;display:inline-block;pointer-events:none}[formulas][inline=false]{display:block;width:100%}[formulas]::after{content:"✎";position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;background-color:rgba(255,255,255,.83);-webkit-box-shadow:0 0 5px 5px rgba(255,255,255,.83);box-shadow:0 0 5px 5px rgba(255,255,255,.83);cursor:pointer;pointer-events:auto}[formulas]:hover::after{opacity:1} \ No newline at end of file diff --git a/dist/plugins/mention/ui/sass/trumbowyg.mention.scss b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss index 88581ce2..5725ba3b 100644 --- a/dist/plugins/mention/ui/sass/trumbowyg.mention.scss +++ b/dist/plugins/mention/ui/sass/trumbowyg.mention.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/mention/ui/trumbowyg.mention.css b/dist/plugins/mention/ui/trumbowyg.mention.css index 52c5b91a..095a6875 100644 --- a/dist/plugins/mention/ui/trumbowyg.mention.css +++ b/dist/plugins/mention/ui/trumbowyg.mention.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/mention/ui/trumbowyg.mention.min.css b/dist/plugins/mention/ui/trumbowyg.mention.min.css index d6409ca0..ac0b3f56 100644 --- a/dist/plugins/mention/ui/trumbowyg.mention.min.css +++ b/dist/plugins/mention/ui/trumbowyg.mention.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-mention button{position:relative;white-space:nowrap}.trumbowyg-dropdown-mention button:after{content:"";position:absolute;top:0;right:0;width:15%;height:100%;-webkit-background-size:100% 100%;background-size:100%;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),color-stop(80%,#fff),to(#fff));background-image:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);pointer-events:none} \ No newline at end of file diff --git a/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss index d40d9361..38ef1187 100644 --- a/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss +++ b/dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css index 7c09f744..33ad33ff 100644 --- a/dist/plugins/specialchars/ui/trumbowyg.specialchars.css +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css index cf5b16f3..b7972848 100644 --- a/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css +++ b/dist/plugins/specialchars/ui/trumbowyg.specialchars.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-symbol-\ -dropdown-button{display:none!important}.trumbowyg-symbol-\ -dropdown-button+button{clear:both}.trumbowyg-dropdown-specialChars{width:248px;padding:5px 3px 3px}.trumbowyg-dropdown-specialChars button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-specialChars button:focus::after,.trumbowyg-dropdown-specialChars button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .specialChars{width:22px;height:22px;display:inline-block} \ No newline at end of file diff --git a/dist/plugins/table/trumbowyg.table.js b/dist/plugins/table/trumbowyg.table.js index 0720d154..84316578 100644 --- a/dist/plugins/table/trumbowyg.table.js +++ b/dist/plugins/table/trumbowyg.table.js @@ -550,13 +550,17 @@ t.saveRange(); var node = t.doc.getSelection().anchorNode; - var $focusedRow = $(node).closest('tr'); var $table = $(node).closest('table'); if ($table.length === 0) { return; } + if (node.tagName === 'TR') { + node = $('td, th', node)[0]; + } + var $focusedRow = $(node).closest('tr'); + var tableState = getTableState($table); callback($table, $focusedRow, node, tableState); @@ -778,7 +782,7 @@ text: t.lang.tableDeleteRow, ico: 'row-delete', - fn: tableButtonAction(function ($table, $focusedRow) { + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { // Only one row is remaining in the table, remove the table if ($('tbody tr', $table).length === 1) { $table.remove(); @@ -791,7 +795,41 @@ if ($focusedRowParent.is('thead')) { $elementToRemove = $focusedRowParent; } + + // Manage merged cells + var $rows = $('tr', $table); + var rowIndex = $rows.index($(node).closest('tr')); + for (var y = 0; y < tableState[0].length; y += 1) { + var cellState = getCellState(tableState, [rowIndex, y], false); + + if (cellState.rowspan === 1) { + continue; + } + + var originCellState = getCellState(tableState, [rowIndex, y]); + originCellState.element.setAttribute('rowspan', originCellState.rowspan - 1); + + // If origin cell is not in this row, continue + if (cellState.mergedIn !== undefined) { + continue; + } + + // If origin cell is in this row, move it to the next row + var originCellIndex = getCellIndex(cellState.element, tableState[rowIndex]); + if (originCellIndex === 0) { + $($rows[rowIndex + 1]).prepend(originCellState.element); + continue; + } + var nextRowPreviousColumnCellState = getCellState(tableState, [ + rowIndex + 1, + originCellIndex - 1 + ]); + $(nextRowPreviousColumnCellState.element).after(originCellState.element); + } + $elementToRemove.remove(); + simplifyCells($table); + redrawResizeLayers(); }), }; @@ -800,12 +838,27 @@ text: t.lang.tableDeleteColumn, ico: 'col-delete', - fn: tableButtonAction(function ($table, $focusedRow, node) { - var cellIndex = $(node).closest('td').index(); + fn: tableButtonAction(function ($table, $focusedRow, node, tableState) { + var $rows = $('tr', $table); + var rowIndex = $rows.index($(node).closest('tr')); + var columnIndex = getCellIndex($(node).closest('td, th')[0], tableState[rowIndex]); - $table.find('tr').each(function () { - $(this).find('td:eq(' + cellIndex + '), th:eq(' + cellIndex + ')').remove(); - }); + for (var x = 0; x < tableState.length; x += 1) { + var cellState = getCellState(tableState, [x, columnIndex], false); + + // Reduce cell colspan by 1 + if (cellState.colspan > 1) { + var originCellState = getCellState(tableState, [x, columnIndex]); + originCellState.element.setAttribute('colspan', originCellState.colspan - 1); + continue; + } + + // Delete cell if not merged + cellState.element.remove(); + } + + simplifyCells(); + redrawResizeLayers(); }) }; @@ -1279,6 +1332,7 @@ // Update HTML t.syncCode(); + redrawResizeLayers(); }); $(window) diff --git a/dist/plugins/table/trumbowyg.table.min.js b/dist/plugins/table/trumbowyg.table.min.js index 64b5940f..65ef3e15 100644 --- a/dist/plugins/table/trumbowyg.table.min.js +++ b/dist/plugins/table/trumbowyg.table.min.js @@ -8,4 +8,4 @@ * Website : alex-d.fr * Original Author : Sven Dunemann [dunemann@forelabs.eu] */ -!function(e){"use strict";var t={rows:8,columns:8,allowHorizontalResize:!0,colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"],backgroundColorList:null,allowCustomBackgroundColor:!0,displayBackgroundColorsAsList:!1,borderColorList:null,allowCustomBorderColor:!0,displayBorderColorsAsList:!1,dropdown:[{title:"tableRows",buttons:["tableAddHeaderRow","tableAddRowAbove","tableAddRow","tableDeleteRow"]},{title:"tableColumns",buttons:["tableAddColumnLeft","tableAddColumn","tableDeleteColumn"]},{title:"tableVerticalAlign",buttons:["tableVerticalAlignTop","tableVerticalAlignMiddle","tableVerticalAlignBottom"]},{title:"tableOthers",buttons:["tableMergeCells","tableUnmergeCells","tableDestroy"]}]};function l(e){return e[0].toUpperCase()+e.slice(1)}function a(e){return("0"+parseInt(e).toString(16)).slice(-2)}function o(e){return-1===e.search("rgb")?e.replace("#",""):"rgba(0, 0, 0, 0)"===e||null==(e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/))?"transparent":a(e[1])+a(e[2])+a(e[3])}e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableRows:"Rows",tableColumns:"Columns",tableVerticalAlign:"Vertical align",tableOthers:"Others",tableAddHeaderRow:"Insert head row",tableAddRowAbove:"Insert row above",tableAddRow:"Insert row below",tableAddColumnLeft:"Insert column to the left",tableAddColumn:"Insert column to the right",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",tableMergeCells:"Merge cells",tableUnmergeCells:"Unmerge cells",tableVerticalAlignTop:"Align text to top",tableVerticalAlignMiddle:"Center text vertically",tableVerticalAlignBottom:"Align text to bottom",tableCellBackgroundColor:"Cell background color"},az:{table:"Cədvəl yerləşdir",tableAddRow:"Sətir əlavə et",tableAddRowAbove:"Yuxarı sətir əlavə et",tableAddColumnLeft:"Sola sütun əlavə et",tableAddColumn:"Sağa sütun əlavə et",tableDeleteRow:"Sətri sil",tableDeleteColumn:"Sütunu sil",tableDestroy:"Cədvəli sil"},ca:{table:"Inserir taula",tableAddRow:"Afegir fila",tableAddRowAbove:"Afegir fila a dalt",tableAddColumnLeft:"Afegir columna a l'esquerra",tableAddColumn:"Afegir columna a la dreta",tableDeleteRow:"Esborrar fila",tableDeleteColumn:"Esborrar columna",tableDestroy:"Esborrar taula",error:"Error"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddRowAbove:"Přidat řádek",tableAddColumnLeft:"Přidat sloupec",tableAddColumn:"Přidat sloupec"},da:{table:"Indsæt tabel",tableAddRow:"Tilføj række",tableAddRowAbove:"Tilføj række",tableAddColumnLeft:"Tilføj kolonne",tableAddColumn:"Tilføj kolonne",tableDeleteRow:"Slet række",tableDeleteColumn:"Slet kolonne",tableDestroy:"Slet tabel"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddRowAbove:"Zeile hinzufügen",tableAddColumnLeft:"Spalte hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen"},et:{table:"Sisesta tabel",tableAddRow:"Lisa rida",tableAddRowAbove:"Lisa rida üles",tableAddColumnLeft:"Lisa tulp vasakule",tableAddColumn:"Lisa tulp paremale",tableDeleteRow:"Kustuta rida",tableDeleteColumn:"Kustuta tulp",tableDestroy:"Kustuta tabel"},fr:{table:"Insérer un tableau",tableRows:"Lignes",tableColumns:"Colonnes",tableVerticalAlign:"Alignement vertical",tableOthers:"Autres",tableAddHeaderRow:"Insérer une line d'en-tête",tableAddRowAbove:"Insérer une ligne au dessus",tableAddRow:"Insérer une ligne en dessous",tableAddColumnLeft:"Insérer une colonne à gauche",tableAddColumn:"Insérer une colonne à droite",tableDeleteRow:"Supprimer la ligne",tableDeleteColumn:"Supprimer la colonne",tableDestroy:"Supprimer le tableau",tableMergeCells:"Fusionner les cellules",tableUnmergeCells:"Dissocier les cellules",tableVerticalAlignTop:"Aligner en haut",tableVerticalAlignMiddle:"Aligner au milieu",tableVerticalAlignBottom:"Aligner en bas",tableCellBackgroundColor:"Couleur de fond des cellules",tableBorderColor:"Couleur de la bordure du tableau"},hu:{table:"Táblázat beszúrás",tableAddRow:"Sor hozzáadás",tableAddRowAbove:"Sor beszúrás fönt",tableAddColumnLeft:"Sor beszúrás balra",tableAddColumn:"Sor beszúrás jobbra",tableDeleteRow:"Sor törlés",tableDeleteColumn:"Oszlop törlés",tableDestroy:"Táblázat törlés"},id:{table:"Sisipkan tabel",tableAddRow:"Sisipkan baris",tableAddRowAbove:"Sisipkan baris",tableAddColumnLeft:"Sisipkan kolom",tableAddColumn:"Sisipkan kolom",tableDeleteRow:"Hapus baris",tableDeleteColumn:"Hapus kolom",tableDestroy:"Hapus tabel"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddRowAbove:"行の追加",tableAddColumnLeft:"列の追加",tableAddColumn:"列の追加"},ko:{table:"표 넣기",tableAddRow:"줄 추가",tableAddRowAbove:"줄 추가",tableAddColumnLeft:"칸 추가",tableAddColumn:"칸 추가",tableDeleteRow:"줄 삭제",tableDeleteColumn:"칸 삭제",tableDestroy:"표 지우기"},pt_br:{table:"Inserir tabela",tableAddRow:"Adicionar linha",tableAddRowAbove:"Adicionar linha",tableAddColumnLeft:"Adicionar coluna",tableAddColumn:"Adicionar coluna",tableDeleteRow:"Deletar linha",tableDeleteColumn:"Deletar coluna",tableDestroy:"Deletar tabela"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строку",tableAddRowAbove:"Добавить строку",tableAddColumnLeft:"Добавить столбец",tableAddColumn:"Добавить столбец",tableDeleteRow:"Удалить строку",tableDeleteColumn:"Удалить столбец",tableDestroy:"Удалить таблицу"},sl:{table:"Dodaj tabelo",tableAddRow:"Dodaj vrstico",tableAddRowAbove:"Vrini vrstico",tableAddColumnLeft:"Vrini stolpec",tableAddColumn:"Dodaj stolpec",tableDeleteRow:"Izbriši vrstico",tableDeleteColumn:"Izbriši stolpec",tableDestroy:"Izbriši tabelo"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddRowAbove:"Pridať riadok",tableAddColumnLeft:"Pridať stĺpec",tableAddColumn:"Pridať stĺpec"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddRowAbove:"Yukarıya satır ekle",tableAddColumnLeft:"Sola sütun ekle",tableAddColumn:"Sağa sütun ekle",tableDeleteRow:"Satırı sil",tableDeleteColumn:"Sütunu sil",tableDestroy:"Tabloyu sil"},zh_tw:{table:"插入表格",tableAddRow:"加入行",tableAddRowAbove:"加入行",tableAddColumnLeft:"加入列",tableAddColumn:"加入列",tableDeleteRow:"刪除行",tableDeleteColumn:"刪除列",tableDestroy:"刪除表格"},es:{table:"Insertar tabla",tableAddRow:"Agregar fila",tableAddRowAbove:"Agregar fila arriba",tableAddColumnLeft:"Agregar columna a la izquierda",tableAddColumn:"Agregar columna a la derecha",tableDeleteRow:"Borrar fila",tableDeleteColumn:"Borrar columna",tableDestroy:"Borrar tabla"}},plugins:{table:{init:function(a){var o;a.o.plugins.table=e.extend(!0,{},t,a.o.plugins.table||{});var n={fn:function(){a.saveRange();var t="table",l=a.o.prefix+"dropdown",n={class:l+"-"+t+" "+l+" "+a.o.prefix+"fixed-top"};n["data-"+l]=t;var d=e("
",n);if(0===a.$box.find("."+l+"-"+t).length?a.$box.append(d.hide()):d=a.$box.find("."+l+"-"+t),d.html(""),a.$box.find("."+a.o.prefix+"table-button").hasClass(a.o.prefix+"active-button")){var i=e(a.doc.getSelection().anchorNode).closest("table"),c=b(i),u=void 0!==o;e(a.o.plugins.table.dropdown).each((function(t,l){d.append(e("
",{html:a.lang[l.title]?a.lang[l.title]:l.title,class:a.o.prefix+"table-dropdown-title"})).text();var o=e("
",{class:a.o.prefix+"dropdown-button-group"});e(l.buttons).each((function(t,l){if("tableAddHeaderRow"===l&&0!==e("thead",i).length)return;if("tableMergeCells"!==l||u){if("tableUnmergeCells"===l){var n=!1;if(L((function(e){var t=e.is("[colspan]")||e.is("[rowspan]");n=n||t}),c),!n)return}o.append(a.buildSubBtn(l))}})),d.append(o)}))}else{var f=e("");e("").appendTo(f);for(var g=0;g").appendTo(f),m=0;m").appendTo(p);f.find("td").on("mouseover",r),f.find("td").on("mousedown",s),d.append(f),d.append(e('
1x1
'))}a.dropdown(t)},class:a.o.prefix+"open-dropdown"},r=function(t){var l=e(t.target).closest("table"),a=this.cellIndex,o=this.parentNode.rowIndex;l.find("td").removeClass("active");for(var n=0;n<=o;n+=1)for(var r=0;r<=a;r+=1)l.find("tr:nth-of-type("+(n+1)+")").find("td:nth-of-type("+(r+1)+")").addClass("active");l.next(".trumbowyg-table-size").html(a+1+"x"+(o+1))},d=function(t){var l=a.o.tagClasses[t.tagName.toLowerCase()];l&&e(t).addClass(l)},i=function(t){d(t[0]),e("*",t).each((function(e,t){d(t)}))},s=function(){a.saveRange();var t=e("
"),l=e(""),o=e("");o.appendTo(l);for(var n=0;n<=this.cellIndex;n+=1)e(""),d=this.cellIndex,s=this.parentNode.rowIndex,b=0;b<=s;b+=1)for(var c=e("").appendTo(r),u=0;u<=d;u+=1)e(""),d=e("").appendTo(r),s=0;s").appendTo(d);t.prepend(r),i(t),z()}))},m=function(t=!1){return c((function(l,o,n,r){var d=r[e("tr",l).index(o)],s=e(n).closest("td, th"),b=B(s[0],d);if(t)b=Math.max(0,b-1);else{var c=s.attr("colspan");b+=parseInt(c||1,10)-1}for(var u=r.length,f=t&&0===b,g=0;g1&&i.attr("rowspan",f),g>1&&i.attr("colspan",g),R(t),z()}}}))},y={title:a.lang.tableUnmergeCells,text:a.lang.tableUnmergeCells,ico:"table-unmerge",fn:c((function(t,l,o,n){L((function(l){l.removeAttr("colspan").removeAttr("rowspan");for(var o=e("tr",t).index(l.closest("tr")),r=B(l[0],n[o]),d=n[o][r],i=0;i1){var d=t.getRangeAt(0),i=t.getRangeAt(l-1);n=d.startContainer.childNodes[d.startOffset],r=i.startContainer.childNodes[i.startOffset]}var s=e(n).closest("td, th"),c=e(r).closest("td, th"),u=s.closest("table"),f=c.closest("table");if(e('[class="'+I+'"]',a.$ed).removeAttr("class"),e("."+I,a.$ed).removeClass(I),0===u.length&&0===f.length||u[0]!==f[0]||s[0]===c[0])e("."+k,a.$ed).removeClass(k);else{u.addClass(k);var g=b(u),p=e("tr",u),m=s.closest("tr"),A=p.index(m),v=c.closest("tr"),h=p.index(v),w=B(s[0],g[A]),C=B(c[0],g[h]),D=Math.min(A,h),R=Math.max(A,h),x=Math.min(w,C),y=Math.max(w,C),T=[];p.each((function(t,l){tR||e("td, th",l).each((function(l,a){var o=B(a,g[t]);oy||(T.push([t,o]),e(a).addClass(I))}))})),o=T}}))}));var L=function(t,l){if(void 0!==o)e(o).each((function(a,o){var n=D(l,o,!1);void 0===n.mergedIn&&t(e(n.element))}));else{var n=e(a.doc.getSelection().anchorNode).closest("td, th");if(0===n.length)return;t(n)}},S="trumbowyg-table-handle-for",z=function(){if(a.o.plugins.table.allowHorizontalResize){var t,l,o,n=e(a.o.prefix+"table-resize-layers"),r=n.length>0;r||(n=e("
",{class:a.o.prefix+"table-resize-layers"}).appendTo(a.$edBox),e(a.o.prefix+"table-resize-vertical-handle",n).each((function(t,l){e(l).off().remove()}))),e("table",a.$ed).each((function(r,d){e("td, th",e(d)).each((function(r,d){e("
",{class:a.o.prefix+"table-resize-vertical-handle"}).prop(S,d).on("mousedown.tbwTable",(function(a){a.preventDefault(),a.stopPropagation();var n=e(a.target).prop(S);o=e(n).closest("table"),t=b(o);var r=e("tr",o),d=e(n).closest("tr"),i=r.index(d),s=t[i],c=B(n,s),u=t[i][c];void 0!==u.mergedIn&&(u=t[u.mergedIn[0]][u.mergedIn[1]]),l=c+u.colspan-1,M(o,t),E(o,t),o.css({maxWidth:""})})).appendTo(n)}))})),H(),r||(e(a.doc).on("mousemove.tbwTable",(function(a){if(void 0!==l){a.preventDefault(),a.stopPropagation();var n=o[0].getBoundingClientRect(),r=a.pageX-n.left-(V(t,l).element.getBoundingClientRect().left-n.left),d=e("col",o)[l];e(d).css({width:r}),H()}})).on("mouseup.tbwTable",(function(e){void 0!==l&&(e.preventDefault(),e.stopPropagation(),M(o,t),$(o,t),o=void 0,t=void 0,l=void 0,a.syncCode())})),e(window).on("resize.tbwTable",(function(){H()})))}},M=function(t,l){var a=e("colgroup",t);0===a.length&&(a=e("
").prependTo(t));for(var o=l[0].length,n=e("col",a).length;n").appendTo(a)},V=function(e,t){var l,a=0;do{l=e[a][t],a+=1}while(void 0===l.element||1!==l.colspan);return l},N=function(t,l,a=!1){var o=e("colgroup",t),n=e("col",o),r=t[0].offsetWidth;t.css({maxWidth:t[0].offsetWidth});for(var d=l[0].length,i=[],s=0;s=0?a.push("tableBorderColor"+r):a.push("freeTableBorderColor")}}if(!e.style)return a;var d=e.style.verticalAlign;""!==d&&a.push("tableVerticalAlign"+l(d));var i=e.style.backgroundColor;if(("TH"===e.tagName||"TD"===e.tagName)&&""!==i){var s=o(i);t.o.plugins.table.colorList.indexOf(s)>=0?a.push("tableCellBackgroundColor"+s):a.push("freeTableCellBackgroundColor")}return a}}}})}(jQuery); \ No newline at end of file +!function(e){"use strict";var t={rows:8,columns:8,allowHorizontalResize:!0,colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"],backgroundColorList:null,allowCustomBackgroundColor:!0,displayBackgroundColorsAsList:!1,borderColorList:null,allowCustomBorderColor:!0,displayBorderColorsAsList:!1,dropdown:[{title:"tableRows",buttons:["tableAddHeaderRow","tableAddRowAbove","tableAddRow","tableDeleteRow"]},{title:"tableColumns",buttons:["tableAddColumnLeft","tableAddColumn","tableDeleteColumn"]},{title:"tableVerticalAlign",buttons:["tableVerticalAlignTop","tableVerticalAlignMiddle","tableVerticalAlignBottom"]},{title:"tableOthers",buttons:["tableMergeCells","tableUnmergeCells","tableDestroy"]}]};function l(e){return e[0].toUpperCase()+e.slice(1)}function a(e){return("0"+parseInt(e).toString(16)).slice(-2)}function o(e){return-1===e.search("rgb")?e.replace("#",""):"rgba(0, 0, 0, 0)"===e||null==(e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/))?"transparent":a(e[1])+a(e[2])+a(e[3])}e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableRows:"Rows",tableColumns:"Columns",tableVerticalAlign:"Vertical align",tableOthers:"Others",tableAddHeaderRow:"Insert head row",tableAddRowAbove:"Insert row above",tableAddRow:"Insert row below",tableAddColumnLeft:"Insert column to the left",tableAddColumn:"Insert column to the right",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",tableMergeCells:"Merge cells",tableUnmergeCells:"Unmerge cells",tableVerticalAlignTop:"Align text to top",tableVerticalAlignMiddle:"Center text vertically",tableVerticalAlignBottom:"Align text to bottom",tableCellBackgroundColor:"Cell background color"},az:{table:"Cədvəl yerləşdir",tableAddRow:"Sətir əlavə et",tableAddRowAbove:"Yuxarı sətir əlavə et",tableAddColumnLeft:"Sola sütun əlavə et",tableAddColumn:"Sağa sütun əlavə et",tableDeleteRow:"Sətri sil",tableDeleteColumn:"Sütunu sil",tableDestroy:"Cədvəli sil"},ca:{table:"Inserir taula",tableAddRow:"Afegir fila",tableAddRowAbove:"Afegir fila a dalt",tableAddColumnLeft:"Afegir columna a l'esquerra",tableAddColumn:"Afegir columna a la dreta",tableDeleteRow:"Esborrar fila",tableDeleteColumn:"Esborrar columna",tableDestroy:"Esborrar taula",error:"Error"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddRowAbove:"Přidat řádek",tableAddColumnLeft:"Přidat sloupec",tableAddColumn:"Přidat sloupec"},da:{table:"Indsæt tabel",tableAddRow:"Tilføj række",tableAddRowAbove:"Tilføj række",tableAddColumnLeft:"Tilføj kolonne",tableAddColumn:"Tilføj kolonne",tableDeleteRow:"Slet række",tableDeleteColumn:"Slet kolonne",tableDestroy:"Slet tabel"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddRowAbove:"Zeile hinzufügen",tableAddColumnLeft:"Spalte hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen"},et:{table:"Sisesta tabel",tableAddRow:"Lisa rida",tableAddRowAbove:"Lisa rida üles",tableAddColumnLeft:"Lisa tulp vasakule",tableAddColumn:"Lisa tulp paremale",tableDeleteRow:"Kustuta rida",tableDeleteColumn:"Kustuta tulp",tableDestroy:"Kustuta tabel"},fr:{table:"Insérer un tableau",tableRows:"Lignes",tableColumns:"Colonnes",tableVerticalAlign:"Alignement vertical",tableOthers:"Autres",tableAddHeaderRow:"Insérer une line d'en-tête",tableAddRowAbove:"Insérer une ligne au dessus",tableAddRow:"Insérer une ligne en dessous",tableAddColumnLeft:"Insérer une colonne à gauche",tableAddColumn:"Insérer une colonne à droite",tableDeleteRow:"Supprimer la ligne",tableDeleteColumn:"Supprimer la colonne",tableDestroy:"Supprimer le tableau",tableMergeCells:"Fusionner les cellules",tableUnmergeCells:"Dissocier les cellules",tableVerticalAlignTop:"Aligner en haut",tableVerticalAlignMiddle:"Aligner au milieu",tableVerticalAlignBottom:"Aligner en bas",tableCellBackgroundColor:"Couleur de fond des cellules",tableBorderColor:"Couleur de la bordure du tableau"},hu:{table:"Táblázat beszúrás",tableAddRow:"Sor hozzáadás",tableAddRowAbove:"Sor beszúrás fönt",tableAddColumnLeft:"Sor beszúrás balra",tableAddColumn:"Sor beszúrás jobbra",tableDeleteRow:"Sor törlés",tableDeleteColumn:"Oszlop törlés",tableDestroy:"Táblázat törlés"},id:{table:"Sisipkan tabel",tableAddRow:"Sisipkan baris",tableAddRowAbove:"Sisipkan baris",tableAddColumnLeft:"Sisipkan kolom",tableAddColumn:"Sisipkan kolom",tableDeleteRow:"Hapus baris",tableDeleteColumn:"Hapus kolom",tableDestroy:"Hapus tabel"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddRowAbove:"行の追加",tableAddColumnLeft:"列の追加",tableAddColumn:"列の追加"},ko:{table:"표 넣기",tableAddRow:"줄 추가",tableAddRowAbove:"줄 추가",tableAddColumnLeft:"칸 추가",tableAddColumn:"칸 추가",tableDeleteRow:"줄 삭제",tableDeleteColumn:"칸 삭제",tableDestroy:"표 지우기"},pt_br:{table:"Inserir tabela",tableAddRow:"Adicionar linha",tableAddRowAbove:"Adicionar linha",tableAddColumnLeft:"Adicionar coluna",tableAddColumn:"Adicionar coluna",tableDeleteRow:"Deletar linha",tableDeleteColumn:"Deletar coluna",tableDestroy:"Deletar tabela"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строку",tableAddRowAbove:"Добавить строку",tableAddColumnLeft:"Добавить столбец",tableAddColumn:"Добавить столбец",tableDeleteRow:"Удалить строку",tableDeleteColumn:"Удалить столбец",tableDestroy:"Удалить таблицу"},sl:{table:"Dodaj tabelo",tableAddRow:"Dodaj vrstico",tableAddRowAbove:"Vrini vrstico",tableAddColumnLeft:"Vrini stolpec",tableAddColumn:"Dodaj stolpec",tableDeleteRow:"Izbriši vrstico",tableDeleteColumn:"Izbriši stolpec",tableDestroy:"Izbriši tabelo"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddRowAbove:"Pridať riadok",tableAddColumnLeft:"Pridať stĺpec",tableAddColumn:"Pridať stĺpec"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddRowAbove:"Yukarıya satır ekle",tableAddColumnLeft:"Sola sütun ekle",tableAddColumn:"Sağa sütun ekle",tableDeleteRow:"Satırı sil",tableDeleteColumn:"Sütunu sil",tableDestroy:"Tabloyu sil"},zh_tw:{table:"插入表格",tableAddRow:"加入行",tableAddRowAbove:"加入行",tableAddColumnLeft:"加入列",tableAddColumn:"加入列",tableDeleteRow:"刪除行",tableDeleteColumn:"刪除列",tableDestroy:"刪除表格"},es:{table:"Insertar tabla",tableAddRow:"Agregar fila",tableAddRowAbove:"Agregar fila arriba",tableAddColumnLeft:"Agregar columna a la izquierda",tableAddColumn:"Agregar columna a la derecha",tableDeleteRow:"Borrar fila",tableDeleteColumn:"Borrar columna",tableDestroy:"Borrar tabla"}},plugins:{table:{init:function(a){var o;a.o.plugins.table=e.extend(!0,{},t,a.o.plugins.table||{});var n={fn:function(){a.saveRange();var t="table",l=a.o.prefix+"dropdown",n={class:l+"-"+t+" "+l+" "+a.o.prefix+"fixed-top"};n["data-"+l]=t;var d=e("
",n);if(0===a.$box.find("."+l+"-"+t).length?a.$box.append(d.hide()):d=a.$box.find("."+l+"-"+t),d.html(""),a.$box.find("."+a.o.prefix+"table-button").hasClass(a.o.prefix+"active-button")){var i=e(a.doc.getSelection().anchorNode).closest("table"),c=b(i),u=void 0!==o;e(a.o.plugins.table.dropdown).each((function(t,l){d.append(e("
",{html:a.lang[l.title]?a.lang[l.title]:l.title,class:a.o.prefix+"table-dropdown-title"})).text();var o=e("
",{class:a.o.prefix+"dropdown-button-group"});e(l.buttons).each((function(t,l){if("tableAddHeaderRow"===l&&0!==e("thead",i).length)return;if("tableMergeCells"!==l||u){if("tableUnmergeCells"===l){var n=!1;if(L((function(e){var t=e.is("[colspan]")||e.is("[rowspan]");n=n||t}),c),!n)return}o.append(a.buildSubBtn(l))}})),d.append(o)}))}else{var f=e("
",{scope:"col"}).appendTo(o);l.appendTo(t);for(var r=e("
").appendTo(c);r.appendTo(t),i(t);for(var f=a.range.endContainer;f.nodeType!==Node.ELEMENT_NODE;)f=f.parentNode;f!==a.$ed[0]&&a.range.setEndAfter(f),a.range.collapse(),a.range.insertNode(t[0]),"P"===f.nodeName&&0===f.textContent.trim().length&&f.remove(),a.syncCode(),z()},b=function(t){for(var l=e("tr",t),a=[],o=0;o"),s=r.index(a);if(t)s=Math.max(0,s-1),a=e(r[s]);else{var b=e(o).closest("td, th").attr("rowspan"),c=parseInt(b||1,10);a=e(r[s+=c-1])}var u=e("tbody tr",l),f=0!==a.closest("thead").length;f&&(a=u.first());for(var g=n[s],p=n[s+1],m=n[0].length,A=0;A").appendTo(d)}0===s&&(t||f)?a.before(d):a.after(d),i(l),z()}))},f={title:a.lang.tableAddRowAbove,text:a.lang.tableAddRowAbove,ico:"row-above",fn:u(!0)},g={title:a.lang.tableAddRow,text:a.lang.tableAddRow,ico:"row-below",fn:u(!1)},p={title:a.lang.tableAddHeaderRow,text:a.lang.tableAddHeaderRow,ico:"header-row",fn:c((function(t,l,a,o){if(0!==e("thead",t).length)return!1;for(var n=o[0].length,r=e("
");e("").appendTo(f);for(var g=0;g").appendTo(f),m=0;m").appendTo(p);f.find("td").on("mouseover",r),f.find("td").on("mousedown",s),d.append(f),d.append(e('
1x1
'))}a.dropdown(t)},class:a.o.prefix+"open-dropdown"},r=function(t){var l=e(t.target).closest("table"),a=this.cellIndex,o=this.parentNode.rowIndex;l.find("td").removeClass("active");for(var n=0;n<=o;n+=1)for(var r=0;r<=a;r+=1)l.find("tr:nth-of-type("+(n+1)+")").find("td:nth-of-type("+(r+1)+")").addClass("active");l.next(".trumbowyg-table-size").html(a+1+"x"+(o+1))},d=function(t){var l=a.o.tagClasses[t.tagName.toLowerCase()];l&&e(t).addClass(l)},i=function(t){d(t[0]),e("*",t).each((function(e,t){d(t)}))},s=function(){a.saveRange();var t=e("
"),l=e(""),o=e("");o.appendTo(l);for(var n=0;n<=this.cellIndex;n+=1)e(""),d=this.cellIndex,s=this.parentNode.rowIndex,b=0;b<=s;b+=1)for(var c=e("").appendTo(r),u=0;u<=d;u+=1)e(""),d=e("").appendTo(r),s=0;s").appendTo(d);t.prepend(r),i(t),z()}))},m=function(t=!1){return c((function(l,o,n,r){var d=r[e("tr",l).index(o)],s=e(n).closest("td, th"),b=B(s[0],d);if(t)b=Math.max(0,b-1);else{var c=s.attr("colspan");b+=parseInt(c||1,10)-1}for(var u=r.length,f=t&&0===b,g=0;g1){var s=D(o,[d,r]);s.element.setAttribute("colspan",s.colspan-1)}else i.element.remove()}R(),H()}))},D=function(e,t,l=!0){if(void 0!==t){var a=e[t[0]][t[1]];return l&&void 0!==a.mergedIn&&(a=e[a.mergedIn[0]][a.mergedIn[1]]),a}},R=function(t){var l=b(t),a=e("tr",t);e(l).each((function(t,o){o.every((function(e){return void 0!==e.mergedIn}))&&(e(l[t-1]).each((function(e,t){void 0!==t.mergedIn&&(t=D(l,t.mergedIn)),t.rowspan-=1,t.rowspan<=1?t.element.removeAttribute("rowspan"):t.element.setAttribute("rowspan",t.rowspan)})),a[t].remove())})),e('[class=""]',t).removeAttr("class"),e('[style=""]',t).removeAttr("style")},x={title:a.lang.tableMergeCells,text:a.lang.tableMergeCells,ico:"table-merge",fn:c((function(t,l,a,n){if(function(t){if(0===o.length)return!1;var l=o[0],a=D(t,l).tag;if(!o.every((function(e){return D(t,e).tag===a})))return!1;var n=[],r=[];if(e(o).each((function(e,l){for(var a=l[0],o=l[1],d=t[a][o],i=a+d.rowspan;a1&&i.attr("rowspan",f),g>1&&i.attr("colspan",g),R(t),z()}}}))},y={title:a.lang.tableUnmergeCells,text:a.lang.tableUnmergeCells,ico:"table-unmerge",fn:c((function(t,l,o,n){L((function(l){l.removeAttr("colspan").removeAttr("rowspan");for(var o=e("tr",t).index(l.closest("tr")),r=B(l[0],n[o]),d=n[o][r],i=0;i1){var d=t.getRangeAt(0),i=t.getRangeAt(l-1);n=d.startContainer.childNodes[d.startOffset],r=i.startContainer.childNodes[i.startOffset]}var s=e(n).closest("td, th"),c=e(r).closest("td, th"),u=s.closest("table"),f=c.closest("table");if(e('[class="'+I+'"]',a.$ed).removeAttr("class"),e("."+I,a.$ed).removeClass(I),0===u.length&&0===f.length||u[0]!==f[0]||s[0]===c[0])e("."+k,a.$ed).removeClass(k);else{u.addClass(k);var g=b(u),p=e("tr",u),m=s.closest("tr"),A=p.index(m),v=c.closest("tr"),h=p.index(v),w=B(s[0],g[A]),C=B(c[0],g[h]),D=Math.min(A,h),R=Math.max(A,h),x=Math.min(w,C),y=Math.max(w,C),T=[];p.each((function(t,l){tR||e("td, th",l).each((function(l,a){var o=B(a,g[t]);oy||(T.push([t,o]),e(a).addClass(I))}))})),o=T}}))}));var L=function(t,l){if(void 0!==o)e(o).each((function(a,o){var n=D(l,o,!1);void 0===n.mergedIn&&t(e(n.element))}));else{var n=e(a.doc.getSelection().anchorNode).closest("td, th");if(0===n.length)return;t(n)}},S="trumbowyg-table-handle-for",z=function(){if(a.o.plugins.table.allowHorizontalResize){var t,l,o,n=e(a.o.prefix+"table-resize-layers"),r=n.length>0;r||(n=e("
",{class:a.o.prefix+"table-resize-layers"}).appendTo(a.$edBox),e(a.o.prefix+"table-resize-vertical-handle",n).each((function(t,l){e(l).off().remove()}))),e("table",a.$ed).each((function(r,d){e("td, th",e(d)).each((function(r,d){e("
",{class:a.o.prefix+"table-resize-vertical-handle"}).prop(S,d).on("mousedown.tbwTable",(function(a){a.preventDefault(),a.stopPropagation();var n=e(a.target).prop(S);o=e(n).closest("table"),t=b(o);var r=e("tr",o),d=e(n).closest("tr"),i=r.index(d),s=t[i],c=B(n,s),u=t[i][c];void 0!==u.mergedIn&&(u=t[u.mergedIn[0]][u.mergedIn[1]]),l=c+u.colspan-1,M(o,t),E(o,t),o.css({maxWidth:""})})).appendTo(n)}))})),H(),r||(e(a.doc).on("mousemove.tbwTable",(function(a){if(void 0!==l){a.preventDefault(),a.stopPropagation();var n=o[0].getBoundingClientRect(),r=a.pageX-n.left-(V(t,l).element.getBoundingClientRect().left-n.left),d=e("col",o)[l];e(d).css({width:r}),H()}})).on("mouseup.tbwTable",(function(e){void 0!==l&&(e.preventDefault(),e.stopPropagation(),M(o,t),$(o,t),o=void 0,t=void 0,l=void 0,a.syncCode(),H())})),e(window).on("resize.tbwTable",(function(){H()})))}},M=function(t,l){var a=e("colgroup",t);0===a.length&&(a=e("
").prependTo(t));for(var o=l[0].length,n=e("col",a).length;n").appendTo(a)},V=function(e,t){var l,a=0;do{l=e[a][t],a+=1}while(void 0===l.element||1!==l.colspan);return l},N=function(t,l,a=!1){var o=e("colgroup",t),n=e("col",o),r=t[0].offsetWidth;t.css({maxWidth:t[0].offsetWidth});for(var d=l[0].length,i=[],s=0;s=0?a.push("tableBorderColor"+r):a.push("freeTableBorderColor")}}if(!e.style)return a;var d=e.style.verticalAlign;""!==d&&a.push("tableVerticalAlign"+l(d));var i=e.style.backgroundColor;if(("TH"===e.tagName||"TD"===e.tagName)&&""!==i){var s=o(i);t.o.plugins.table.colorList.indexOf(s)>=0?a.push("tableCellBackgroundColor"+s):a.push("freeTableCellBackgroundColor")}return a}}}})}(jQuery); \ No newline at end of file diff --git a/dist/plugins/table/ui/sass/trumbowyg.table.scss b/dist/plugins/table/ui/sass/trumbowyg.table.scss index 81c86206..e0d8ee4d 100644 --- a/dist/plugins/table/ui/sass/trumbowyg.table.scss +++ b/dist/plugins/table/ui/sass/trumbowyg.table.scss @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Default stylesheet for Trumbowyg editor plugin * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/table/ui/trumbowyg.table.css b/dist/plugins/table/ui/trumbowyg.table.css index d5d942ae..44e155a9 100644 --- a/dist/plugins/table/ui/trumbowyg.table.css +++ b/dist/plugins/table/ui/trumbowyg.table.css @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg plugin stylesheet * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode diff --git a/dist/plugins/table/ui/trumbowyg.table.min.css b/dist/plugins/table/ui/trumbowyg.table.min.css index a004c8ab..a3c56e74 100644 --- a/dist/plugins/table/ui/trumbowyg.table.min.css +++ b/dist/plugins/table/ui/trumbowyg.table.min.css @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +/** Trumbowyg v2.27.2 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg/ - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ .trumbowyg-dropdown-table{max-height:unset}.trumbowyg-dropdown-table table{all:unset;display:inline-block;margin:10px;border-collapse:collapse}.trumbowyg-dropdown-table table td{all:unset;position:relative;display:table-cell;height:20px;width:20px;cursor:pointer;background:#fff}.trumbowyg-dropdown-table table td::after{content:"";display:block;position:absolute;top:1px;right:1px;bottom:1px;left:1px;border:1px solid #cecece;pointer-events:none}.trumbowyg-dropdown-table table td.active::after{background-color:#000;border-color:#000}.trumbowyg-dropdown-table .trumbowyg-table-size{text-align:center}.trumbowyg-table-dropdown-title{padding:8px 10px;font-size:12px;text-transform:uppercase;letter-spacing:2px;font-weight:700}.trumbowyg-dropdown-button-group+.trumbowyg-table-dropdown-title{margin-top:24px}.trumbowyg-table-cell-selection-mode ::-moz-selection{color:inherit;background-color:transparent}.trumbowyg-table-cell-selection-mode ::selection{color:inherit;background-color:transparent}.trumbowyg-table-cell-selected{background-color:#b4d3fe!important}.trumbowyg-table-resize-layers{position:absolute;top:0;left:0;width:0;height:0}.trumbowyg-table-resize-vertical-handle{position:absolute;width:5px;margin-left:-3px;cursor:col-resize}.trumbowyg-table-resize-vertical-handle::after{content:"";position:absolute;top:0;left:1px;width:3px;height:100%;background:#0073ff;border-radius:3px;pointer-events:none;opacity:0}.trumbowyg-table-resize-vertical-handle:hover::after{opacity:1}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list),.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list){max-width:276px;padding:7px 5px;overflow:initial}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button{display:block;position:relative;float:left;text-indent:-9999px;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px}.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-tableBorderColor:not(.trumbowyg-dropdown--color-list) button:hover::after,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:focus::after,.trumbowyg-dropdown-tableCellBackgroundColor:not(.trumbowyg-dropdown--color-list) button:hover::after{content:" ";display:block;position:absolute;top:-5px;left:-5px;width:27px;height:27px;background:inherit;border:1px solid #fff;-webkit-box-shadow:#000 0 0 2px;box-shadow:#000 0 0 2px;z-index:10}.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button),.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button){position:relative;color:#fff!important}.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after,.trumbowyg-dropdown-tableBorderColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after,.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):focus::after,.trumbowyg-dropdown-tableCellBackgroundColor.trumbowyg-dropdown--color-list button:not(.trumbowyg-removeTableCellBackgroundColor-dropdown-button):not(.trumbowyg-removeTableBorderColor-dropdown-button):hover::after{content:" ";display:block;position:absolute;top:13px;left:0;width:0;height:0;border:5px solid transparent;border-left-color:#fff} \ No newline at end of file diff --git a/dist/trumbowyg.js b/dist/trumbowyg.js index 8816ec89..04499e04 100644 --- a/dist/trumbowyg.js +++ b/dist/trumbowyg.js @@ -1,8 +1,8 @@ /** - * Trumbowyg v2.27.1 - A lightweight WYSIWYG editor + * Trumbowyg v2.27.2 - A lightweight WYSIWYG editor * Trumbowyg core file * ------------------------ - * @link http://alex-d.github.io/Trumbowyg + * @link https://alex-d.github.io/Trumbowyg/ * @license MIT * @author Alexandre Demode (Alex-D) * Twitter : @AlexandreDemode @@ -596,12 +596,6 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { t.$ed.addClass(prefix + 'reset-css'); } - if (!t.o.autogrow) { - t.$ta.add(t.$edBox).css({ - height: t.height - }); - } - t.semanticCode(); if (t.o.autogrowOnEnter) { diff --git a/dist/trumbowyg.min.js b/dist/trumbowyg.min.js index 46861cd4..63769139 100644 --- a/dist/trumbowyg.min.js +++ b/dist/trumbowyg.min.js @@ -1,2 +1,2 @@ -/** Trumbowyg v2.27.1 - A lightweight WYSIWYG editor - http://alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ -jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",undo:"Undo",redo:"Redo",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",superscript:"Superscript",subscript:"Subscript",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",link:"Link",createLink:"Insert link",unlink:"Remove link",_self:"Same tab (default)",_blank:"New tab",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",removeformat:"Remove format",fullscreen:"Fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",required:"Required",description:"Description",title:"Title",text:"Text",target:"Target",width:"Width"}},plugins:{},svgPath:null,svgAbsoluteUseHref:!1,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,hideButtonTexts:null,prefix:"trumbowyg-",tagClasses:{},semantic:!0,semanticKeepAttributes:!1,resetCss:!1,removeformatPasted:!1,tabToIndent:!1,tagsToRemove:[],tagsToKeep:["hr","img","embed","iframe","input"],btns:[["viewHTML"],["undo","redo"],["formatting"],["strong","em","del"],["superscript","subscript"],["link"],["insertImage"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["horizontalRule"],["removeformat"],["fullscreen"]],btnsDef:{},changeActiveDropdownIcon:!1,inlineElementsSelector:"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1,linkTargets:["_self","_blank"],svgPath:null},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,a){"use strict";var o="tbwconfirm",r="tbwcancel";a.fn.trumbowyg=function(e,t){var n="trumbowyg";if(e===Object(e)||!e)return this.each((function(){a(this).data(n)||a(this).data(n,new i(this,e))}));if(1===this.length)try{var o=a(this).data(n);switch(e){case"execCmd":return o.execCmd(t.cmd,t.param,t.forceCss,t.skipTrumbowyg);case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveRange":return o.saveRange();case"getRange":return o.range;case"getRangeText":return o.getRangeText();case"restoreRange":return o.restoreRange();case"enable":return o.setDisabled(!1);case"disable":return o.setDisabled(!0);case"toggle":return o.toggle();case"destroy":return o.destroy();case"empty":return o.empty();case"html":return o.html(t)}}catch(e){}return!1};var i=function(o,r){var i=this,s="trumbowyg-icons",l=a.trumbowyg;i.doc=o.ownerDocument||n,i.$ta=a(o),i.$c=a(o),null!=(r=r||{}).lang||null!=l.langs[r.lang]?i.lang=a.extend(!0,{},l.langs.en,l.langs[r.lang]):i.lang=l.langs.en,i.hideButtonTexts=null!=l.hideButtonTexts?l.hideButtonTexts:r.hideButtonTexts;var d=null!=l.svgPath?l.svgPath:r.svgPath;if(i.hasSvg=!1!==d,!1!==d&&(l.svgAbsoluteUseHref||0===a("#"+s,i.doc).length)){if(null==d)a("script[src]").each((function(e,t){var n=t.src,a=n.match("trumbowyg(.min)?.js");null!=a&&(d=n.substring(0,n.indexOf(a[0]))+"ui/icons.svg")}));if(null==d)console.warn("You must define svgPath: https://goo.gl/CfTY9U");else if(!l.svgAbsoluteUseHref){var c=i.doc.createElement("div");c.id=s,i.doc.body.insertBefore(c,i.doc.body.childNodes[0]),a.ajax({async:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"xml",crossDomain:!0,url:d,data:null,beforeSend:null,complete:null,success:function(e){c.innerHTML=(new XMLSerializer).serializeToString(e.documentElement)}})}}var u=i.doc.querySelector("base")?t.location.href.replace(t.location.hash,""):"";i.svgPath=l.svgAbsoluteUseHref?d:u;var g=i.lang.header,f=function(){return(t.chrome||t.Intl&&Intl.v8BreakIterator)&&"CSS"in t};i.btnsDef={viewHTML:{fn:"toggle",class:"trumbowyg-not-disable"},undo:{isSupported:f,key:"Z"},redo:{isSupported:f,key:"Y"},p:{fn:"formatBlock"},blockquote:{fn:"formatBlock"},h1:{fn:"formatBlock",title:g+" 1"},h2:{fn:"formatBlock",title:g+" 2"},h3:{fn:"formatBlock",title:g+" 3"},h4:{fn:"formatBlock",title:g+" 4"},h5:{fn:"formatBlock",title:g+" 5"},h6:{fn:"formatBlock",title:g+" 6"},subscript:{tag:"sub"},superscript:{tag:"sup"},bold:{key:"B",tag:"b"},italic:{key:"I",tag:"i"},underline:{tag:"u"},strikethrough:{tag:"strike"},strong:{fn:"bold",key:"B"},em:{fn:"italic",key:"I"},del:{fn:"strikethrough"},createLink:{key:"K",tag:"a"},unlink:{},insertImage:{},justifyLeft:{tag:"left",forceCss:!0},justifyCenter:{tag:"center",forceCss:!0},justifyRight:{tag:"right",forceCss:!0},justifyFull:{tag:"justify",forceCss:!0},unorderedList:{fn:"insertUnorderedList",tag:"ul"},orderedList:{fn:"insertOrderedList",tag:"ol"},horizontalRule:{fn:"insertHorizontalRule"},removeformat:{},fullscreen:{class:"trumbowyg-not-disable"},close:{fn:"destroy",class:"trumbowyg-not-disable"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"],ico:"p"},link:{dropdown:["createLink","unlink"]}},i.o=a.extend(!0,{},l.defaultOptions,r),i.o.hasOwnProperty("imgDblClickHandler")||(i.o.imgDblClickHandler=i.getDefaultImgDblClickHandler()),i.urlPrefix=i.setupUrlPrefix(),i.disabled=i.o.disabled||"TEXTAREA"===o.nodeName&&o.disabled,r.btns?i.o.btns=r.btns:i.o.semantic||(i.o.btns[3]=["bold","italic","underline","strikethrough"]),a.each(i.o.btnsDef,(function(e,t){i.addBtnDef(e,t)})),i.eventNamespace="trumbowyg-event",i.keys=[],i.tagToButton={},i.tagHandlers=[],i.pasteHandlers=[].concat(i.o.pasteHandlers),i.isIE=-1!==e.userAgent.indexOf("MSIE")||-1!==e.appVersion.indexOf("Trident/"),i.isMac=-1!==e.platform.toUpperCase().indexOf("MAC"),i.init()};i.prototype={DEFAULT_SEMANTIC_MAP:{b:"strong",i:"em",s:"del",strike:"del",div:"p"},init:function(){var e=this;e.height=e.$ta.outerHeight()-39,e.initPlugins();try{e.doc.execCommand("enableObjectResizing",!1,!1),e.doc.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){}e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay(),setTimeout((function(){e.disabled&&e.setDisabled(!0),e.$c.trigger("tbwinit")}))},addBtnDef:function(e,t){this.btnsDef[e]=a.extend(t,this.btnsDef[e]||{})},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(e)return"string"!=typeof e?"https://":e.replace("://","")+"://"},buildEditor:function(){var e=this,n=e.o.prefix,o="";e.$box=a("
",{class:n+"box "+n+"editor-visible "+n+e.o.lang+" trumbowyg"}),e.$edBox=a("
",{class:n+"editor-box"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(o=e.$ta.val(),e.$ed=a("
").appendTo(e.$edBox),e.$box.insertAfter(e.$ta).append(e.$edBox,e.$ta)):(e.$ed=e.$ta,o=e.$ed.html(),e.$ta=a("
",{scope:"col"}).appendTo(o);l.appendTo(t);for(var r=e("
").appendTo(c);r.appendTo(t),i(t);for(var f=a.range.endContainer;f.nodeType!==Node.ELEMENT_NODE;)f=f.parentNode;f!==a.$ed[0]&&a.range.setEndAfter(f),a.range.collapse(),a.range.insertNode(t[0]),"P"===f.nodeName&&0===f.textContent.trim().length&&f.remove(),a.syncCode(),z()},b=function(t){for(var l=e("tr",t),a=[],o=0;o"),s=r.index(a);if(t)s=Math.max(0,s-1),a=e(r[s]);else{var b=e(o).closest("td, th").attr("rowspan"),c=parseInt(b||1,10);a=e(r[s+=c-1])}var u=e("tbody tr",l),f=0!==a.closest("thead").length;f&&(a=u.first());for(var g=n[s],p=n[s+1],m=n[0].length,A=0;A").appendTo(d)}0===s&&(t||f)?a.before(d):a.after(d),i(l),z()}))},f={title:a.lang.tableAddRowAbove,text:a.lang.tableAddRowAbove,ico:"row-above",fn:u(!0)},g={title:a.lang.tableAddRow,text:a.lang.tableAddRow,ico:"row-below",fn:u(!1)},p={title:a.lang.tableAddHeaderRow,text:a.lang.tableAddHeaderRow,ico:"header-row",fn:c((function(t,l,a,o){if(0!==e("thead",t).length)return!1;for(var n=o[0].length,r=e("