Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hotfix-1.0.x' into hotfix-1.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Kaszt committed Apr 1, 2015
2 parents 8738b37 + 134363f commit c440b8a
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 7 deletions.
3 changes: 3 additions & 0 deletions build/changelog/entries/2015/03/10205.SUP-675.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Improve text of tooltips for the buttons which increase/decrease indentation
in lists. Escpecially the German tooltips where unclear in regard to the
expected action of the buttons.
5 changes: 5 additions & 0 deletions build/changelog/entries/2015/03/10206.SUP-503.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Selecting cells in tables has been improved:
When dragging the mouse over table cells, it is no
longer necessary to drag over the editable element in the cell.
Also selecting a cell range by clicking with the mouse (while holding
the SHIFT-key) has been improved when using Internet Explorer.
2 changes: 2 additions & 0 deletions build/changelog/entries/2015/03/10209.SUP-645.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
After forward-deleting the last letter of a link, the cursor disappeared from the editable.
This has been fixed.
9 changes: 8 additions & 1 deletion src/lib/aloha/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -7284,6 +7284,7 @@ define([
//@{
commands.forwarddelete = {
action: function (value, range) {
var deleteContentsRange;
// special behaviour for skipping zero-width whitespaces in IE7
if (Aloha.browser.msie && Aloha.browser.version <= 7) {
moveOverZWSP(range, true);
Expand Down Expand Up @@ -7402,8 +7403,14 @@ define([

// "Delete the contents of the range with start (node, offset) and
// end (node, end offset)."
deleteContents(node, offset, node, endOffset);
deleteContentsRange = deleteContents(node, offset, node, endOffset);

if (deleteContentsRange) {
// The new range position can only be determined inside deleteContents,
// that's why it's necessary to take over the range if one was returned.
range.setStart(deleteContentsRange.startContainer, deleteContentsRange.startOffset);
range.setEnd(deleteContentsRange.endContainer, deleteContentsRange.endOffset);
}
// "Abort these steps."
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/common/list/nls/de/i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define({
"button.createulist.tooltip": "Unsortierte Liste einfügen",
"button.createolist.tooltip": "Sortierte Liste einfügen",
"button.indentlist.tooltip": "Liste einrücken",
"button.outdentlist.tooltip": "Liste ausrücken",
"button.indentlist.tooltip": "Einzug vergrößern",
"button.outdentlist.tooltip": "Einzug verkleinern",
"floatingmenu.tab.list": "Listen"
});
4 changes: 2 additions & 2 deletions src/plugins/common/list/nls/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ define({
"root": {
"button.createulist.tooltip": "Insert Unordered List",
"button.createolist.tooltip": "Insert Ordered List",
"button.indentlist.tooltip": "Indent List",
"button.outdentlist.tooltip": "Outdent List",
"button.indentlist.tooltip": "Increase Indent",
"button.outdentlist.tooltip": "Decrease Indent",
"floatingmenu.tab.list": "Lists"
},
"ca": true,
Expand Down
56 changes: 54 additions & 2 deletions src/plugins/common/table/lib/table-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ define([
$wrapper.bind('mouseover', function ($event) {
cell._selectCellRange();
});
$elem.bind('mouseover', function ($event) {
cell._selectCellRange();
});

// we will treat the wrapper just like an editable
$wrapper.contentEditableSelectionChange(function ($event) {
Expand All @@ -178,8 +181,57 @@ define([
cell.wrapper.trigger('focus');
cell._selectAll($wrapper);
}, 1);
if (!$event.shiftKey) {
cell.tableObj.selection.unselectCells();
cell.tableObj.selection.baseCellPosition = [cell._virtualY(), cell._virtualX()];

if (!cell.tableObj.selection.lastBaseCellPosition) {
cell.tableObj.selection.lastBaseCellPosition = cell.tableObj.selection.baseCellPosition;
}

if ($event.shiftKey) {
// shift-click to select a coherent cell range
//
// in IE it's not possible to select multiple cells when you "select+drag" over other cells
// click into the first cell and then "shift-click" into the last cell of the coherent cell range you want to select
var right = cell.tableObj.selection.lastBaseCellPosition[1];
var bottom = cell.tableObj.selection.lastBaseCellPosition[0];
var topLeft = cell.tableObj.selection.baseCellPosition;
var left = topLeft[1];
if (left > right) {
left = right;
right = topLeft[1];
}
var top = topLeft[0];
if (top > bottom) {
top = bottom;
bottom = topLeft[0];
}
var rect = {
"top": top,
"right": right,
"bottom": bottom,
"left": left
};

var table = cell.tableObj;
var $rows = table.obj.children().children('tr');
var grid = Utils.makeGrid($rows);

table.selection.selectedCells = [];
var selectClass = table.get('classCellSelected');
Utils.walkGrid(grid, function (cellInfo, j, i) {
if (Utils.containsDomCell(cellInfo)) {
if (i >= rect.top && i <= rect.bottom && j >= rect.left && j <= rect.right) {
jQuery(cellInfo.cell).addClass(selectClass);
table.selection.selectedCells.push(cellInfo.cell);
} else {
jQuery(cellInfo.cell).removeClass(selectClass);
}
}
});

table.selection.notifyCellsSelected();
} else {
cell.tableObj.selection.lastBaseCellPosition = cell.tableObj.selection.baseCellPosition;
cell._startCellSelection();
}
$event.stopPropagation();
Expand Down

0 comments on commit c440b8a

Please sign in to comment.