Skip to content

Commit

Permalink
build: 2.27.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Feb 27, 2023
1 parent e1cc2c2 commit f84c846
Show file tree
Hide file tree
Showing 32 changed files with 199 additions and 92 deletions.
4 changes: 2 additions & 2 deletions dist/plugins/colors/ui/sass/trumbowyg.colors.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/colors/ui/trumbowyg.colors.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/emoji/ui/trumbowyg.emoji.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/trumbowyg.emoji.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/giphy/ui/trumbowyg.giphy.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/giphy/ui/trumbowyg.giphy.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/highlight/ui/sass/trumbowyg.highlight.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/highlight/ui/trumbowyg.highlight.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/highlight/ui/trumbowyg.highlight.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/mathml/ui/sass/trumbowyg.mathml.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/mathml/ui/trumbowyg.mathml.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/mathml/ui/trumbowyg.mathml.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/mention/ui/sass/trumbowyg.mention.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/mention/ui/trumbowyg.mention.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/mention/ui/trumbowyg.mention.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/specialchars/ui/trumbowyg.specialchars.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 61 additions & 7 deletions dist/plugins/table/trumbowyg.table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}),
};

Expand All @@ -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();
})
};

Expand Down Expand Up @@ -1279,6 +1332,7 @@

// Update HTML
t.syncCode();
redrawResizeLayers();
});

$(window)
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/table/trumbowyg.table.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/plugins/table/ui/sass/trumbowyg.table.scss
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/table/ui/trumbowyg.table.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit f84c846

Please sign in to comment.