Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stray aloha-editing-p after table #1567

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b1d3dd6
remove aloha editng p inserted after table
bernhardriegler Apr 25, 2017
4b9c38a
add changelog for table-plugins placeholder paragraph bugfix
bernhardriegler Apr 25, 2017
ddef0f6
call jquery.children() as function not as porperty
bernhardriegler Apr 27, 2017
a69b778
add additional check to make sure aloha-end-br is only element
bernhardriegler Apr 27, 2017
1a2837b
Update focus point image and add i18n entries
Feb 26, 2018
a23ec7c
Merge pull request #1602 from alohaeditor/hotfix-gtxpe-165
Jotschi Feb 27, 2018
f43349c
Fix paste behaviour for directly nested lists. (#1603)
npomaroli Feb 28, 2018
046361c
Merge branch 'dev' into hotfix
Feb 28, 2018
c9dbbac
[Jenkins | hotfix] Release of version 1.4.44
GenticsDev Feb 28, 2018
909b824
[Jenkins | hotfix] Prepare for the next development iteration (1.4.45…
GenticsDev Feb 28, 2018
325c39a
Fix (forard)delete command for whitespace at the beginning of block e…
yrucrem Mar 9, 2018
d0e7e6d
Fix refreshing table info while table is selected (#1605)
npomaroli Mar 19, 2018
6369634
[Jenkins | hotfix] Release of version 1.4.45
Mar 21, 2018
31988ad
[Jenkins | hotfix] Prepare for the next development iteration (1.4.46…
Mar 21, 2018
4de152e
wordcontenthandler: Remove alignment (#1606)
rainerda May 2, 2018
4312c3e
[Jenkins | hotfix] Release of version 1.4.46
May 2, 2018
aa7abef
[Jenkins | hotfix] Prepare for the next development iteration (1.4.47…
May 2, 2018
5e682d8
resolve conflicts
bernhardriegler Jun 4, 2018
74d115e
call jquery.children() as function not as porperty
bernhardriegler Apr 27, 2017
d5450ea
add additional check to make sure aloha-end-br is only element
bernhardriegler Apr 27, 2017
ddbe349
Merge branch 'hotfix' of github.com:bernhardriegler/Aloha-Editor into…
bernhardriegler Jun 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The focal point button icon for the image plugin has been updated.
3 changes: 3 additions & 0 deletions build/changelog/entries/2018/02/12311.SUP-5908.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paste-plugin: When a list was pasted from Word, where items started a new list beginning at a level greater than 1, the list item was removed, because Aloha Editor
does not allow lists that start at a nesting level greater than 1.
The behaviour has been changed now, so that such lists will be pasted, so that the first item starts at level 1.
2 changes: 2 additions & 0 deletions build/changelog/entries/2018/02/12312.SUP-5908.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
list-plugin: The list plugin allowed to insert paragraphs or headers into list items, which caused unexpected editing behaviour.
This is now changed, so it is no longer possible to insert paragraphs or headers into list items.
4 changes: 4 additions & 0 deletions build/changelog/entries/2018/03/12326.SUP-5832.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
When a row of a table was transformed into a header, and afterwards all rows were deleted,
the table itself was not deleted. This has been fixed now.
Also, after the selected rows/columns were deleted, the floating menu still showed table related tabs, which was
incorrect, because the table was not selected any more.
1 change: 1 addition & 0 deletions build/changelog/entries/2018/03/12349.SUP-6082.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wordcontenthandler: Removed alignment when pasting aligned text from Word.
1 change: 1 addition & 0 deletions build/changelog/entries/2018/03/6133.SUP-5481.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In certain cases whitespace could not be deleted with the delete or backspace keys. This has been fixed.
12 changes: 12 additions & 0 deletions build/changelog/mappings/1.4.44.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "1.4.44",
"date": "28.02.2018",
"changeLogEntryFileNames": [
"12275.GTXPE-123.feature",
"12312.SUP-5908.bugfix",
"12311.SUP-5908.bugfix",
"12309.GTXPE-165.enhancement",
"12269.GTXPE-123.feature"
],
"genericProperties": {}
}
9 changes: 9 additions & 0 deletions build/changelog/mappings/1.4.45.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1.4.45",
"date": "21.03.2018",
"changeLogEntryFileNames": [
"6133.SUP-5481.bugfix",
"12326.SUP-5832.bugfix"
],
"genericProperties": {}
}
8 changes: 8 additions & 0 deletions build/changelog/mappings/1.4.46.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1.4.46",
"date": "02.05.2018",
"changeLogEntryFileNames": [
"12349.SUP-6082.bugfix"
],
"genericProperties": {}
}
5 changes: 5 additions & 0 deletions doc/guides/source/plugin_contenthandler.textile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ The Word Content Handler will detect content pasted from Microsoft Word 2003 and
* keep bold and italic formatting, headlines, tables and lists but get rid of all other formattings
* Remove links to local files (with file :// URLs), but it preserves the link contents

WARNING: Word supports much more formatting options than Aloha Editor. Therefore the content pasted from Word into Aloha Editor will be different, if its formatting or
structure in Word is not supported by Aloha Editor.
Additionally, the HTML produced by Word when doing Copy & Paste is generally of poor quality (or even invalid) and different depending on the used browser version. Therefore,
the resulting content can also be different across browsers and may not reflect the formatting or structure of the original content in Word.

h4. Generic Content Handler

The Generic Content Handler is a bit less generic than his name might suggest as he will apply the following cleaning actions:
Expand Down
2 changes: 2 additions & 0 deletions doc/guides/source/plugin_list.textile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ You can use the tab key to indent unordered and ordered lists or use shift-tab t

You can remove lists by clicking the applied list type a second time, which will turn individual list items back into paragraphs.

NOTE: Although allowed by the HTML specification, Aloha Editor will not allow nesting of paragraphs or headers in list items.

h4. List styles

If you open the dropdown next to the respective list icon, you can choose from a list of pre-defined list styles.
Expand Down
5 changes: 4 additions & 1 deletion doc/guides/source/plugin_paste.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ The Paste plugin enables copy and paste action for Aloha Editor editables.

endprologue.

The Paste plugin is used to handle the paste action in an editable. "ContentHanlder":plugin_contenthandler.html can be used to configure how pasted content will be handled.
The Paste plugin is used to handle the paste action in an editable. "ContentHandler":plugin_contenthandler.html can be used to configure how pasted content will be handled.

* The source of a pasted Microsoft Word(tm) document will be cleaned up
* URLs to media content can be embeded after the paste action using the oEmbed contentHandler

WARNING: Copy & Paste is generally handled by the browser itself. The paste plugin can only handle the content, which is provided by the browser. This means that copy & paste might
produce different results depending on the used browser.

h3. Configuration

Enable the paste plugin +common/paste+.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.alohaeditor</groupId>
<artifactId>alohaeditor</artifactId>
<version>1.4.44-SNAPSHOT</version>
<version>1.4.47-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Aloha Editor</name>
<url>http://aloha-editor.org</url>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/aloha/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ define([
reference = previousNode(reference);

// "If reference is a block node or a br, return true."
if (isBlockNode(reference) || isNamedHtmlElement(reference, 'br')) {
if (reference != ancestor && (isBlockNode(reference) || isNamedHtmlElement(reference, 'br'))) {
return true;
}

Expand Down
7 changes: 0 additions & 7 deletions src/lib/aloha/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,6 @@ define([
'img': true,
'ul': true,
'ol': true,
'h1': true,
'h2': true,
'h3': true,
'h4': true,
'h5': true,
'h6': true,
'p': true,
'del': true,
'ins': true,
'u': true,
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/common/contenthandler/lib/genericcontenthandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,16 @@ define([
cleanLists: function ($content) {
$content.find('ul,ol').filter(notAlohaBlockFilter).find('>:not(li)').remove();

// Remove paragraphs inside list elements, if they are
// the only child. e.g.: li > p > text
// Remove paragraphs and headers inside list elements
// This has been observed to happen with Word documents
$content.find("li").filter(notAlohaBlockFilter).each(function() {
var $li = $(this);
var $children = $li.children();
if ($children.length === 1 && $children.is("p")) {
$children.contents().appendTo($li);
$children.remove();
$content.find("li").filter(notAlohaBlockFilter).find('p,h1,h2,h3,h4,h5,h6').each(function() {
var $elem = $(this);
// when the paragraph has a sibling and it's content does not have a <br> as last child, we append a <br>
// in order to preserve the line break
if (!$elem.is(':last-child') && !$elem.contents().last().is('br')) {
$elem.append('<br>');
}
$elem.contents().unwrap();
});
},

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/common/contenthandler/lib/wordcontenthandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ define([

if (prev.length > 0) {
prev.append($node)
} else {
$node.contents().unwrap();
}
}
if (isEmpty($node)) {
Expand All @@ -228,6 +230,8 @@ define([
} else if (nodeName === 'a'
&& $node.attr('href') && $node.attr('href').match("^file://")) {
$node.contents().unwrap();
} else if (nodeName === 'p' && $node.attr('align')) {
$node.removeAttr('align');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/common/image/css/image.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

.aloha-img.aloha-image-set-focalpoint {
background: url(../img/set-focalpoint.gif);
background: url(../img/set-focalpoint.png);
}

.aloha-default-file-icon {
Expand Down
Binary file removed src/plugins/common/image/img/set-focalpoint.gif
Binary file not shown.
Binary file added src/plugins/common/image/img/set-focalpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/plugins/common/image/lib/image-floatingMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function (
Scopes.createScope('Aloha.img', ['Aloha.global']);

this._imageFocalPointButton = Ui.adopt("imageFocalPointButton", ToggleButton, {
tooltip: i18n.t('FocalPoint'),
tooltip: i18n.t('focalpoint'),
icon: 'aloha-img aloha-image-set-focalpoint',
scope: plugin.name,
click: function () {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/common/image/nls/de/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define({
"size.decrease ": "Bild verkleinern",
"Resize": "Größe anpassen",
"Crop": "Zuschneiden",
"focalpoint": "Fokus Punkt setzen",
"Reset": "Zurücksetzen",
"Accept": "Bestätigen",
"Cancel": "Abbrechen",
Expand Down
1 change: 1 addition & 0 deletions src/plugins/common/image/nls/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define({
"size.decrease ": "Decrease Size",
"Resize": "Resize",
"Crop": "Crop",
"focalpoint": "Set focal point",
"Reset": "Reset",
"Accept": "Accept",
"Cancel": "Cancel",
Expand Down
1 change: 1 addition & 0 deletions src/plugins/common/table/lib/table-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,7 @@ define([
} else {
// leave all scopes
TablePlugin.leaveTableScopes();
Scopes.setScope('Aloha.continuoustext');
}
};

Expand Down
9 changes: 1 addition & 8 deletions src/plugins/common/table/lib/table-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,7 @@ define([
this.selectedColumnIdxs = [];
this.selectedRowIdxs = [];
this.currentRectangle = {};

//we keep 'cell' as the default selection type instead of
//unsetting the selectionType to avoid an edge-case where a
//click into a cell doesn't trigger a call to
//TableCell.editableFocs (which would set the 'cell'
//selection type) which would result in the FloatingMenu
//losing the table scope.
this.selectionType = 'cell';
this.selectionType = undefined;

this._notifyCellsUnselected();
}
Expand Down
13 changes: 10 additions & 3 deletions src/plugins/common/table/lib/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ define([
// find the dimensions of the table
this.numCols = this.countVirtualCols();

var rows = this.getRows();
var rows = this.getRows(true);
this.numRows = rows.length;

// init the cell-attribute with an empty array
Expand Down Expand Up @@ -2225,13 +2225,20 @@ define([
};

/**
* @param {Boolean} filterSelectionRow filter selection row
* @return the rows of the table as an array of DOM nodes
*/
Table.prototype.getRows = function () {
Table.prototype.getRows = function (filterSelectionRow) {
//W3C DOM property .rows supported by all modern browsers
var rows = this.obj.get( 0 ).rows;
//converts the HTMLCollection to a real array
return jQuery.makeArray( rows );
rows = jQuery.makeArray(rows);
if (filterSelectionRow) {
rows = rows.filter(function(elt, i, array) {
return !jQuery(elt).hasClass('aloha-ephemera');
});
}
return rows;
};

return Table;
Expand Down
3 changes: 2 additions & 1 deletion src/test/unit/delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
<script src="../../lib/require.js"></script>
<script src="../../lib/aloha.js" data-aloha-plugins=""></script>

<script type="text/javascript" src="./deletetest.js"></script>
<script>
// load command test suite
require(['deletetest']);
require(['commandtest']);
</script>
<style type="text/css">
.aloha-editable ol li { list-style-type: decimal; margin: 1.5em; }
Expand Down
Loading