Commit 5c57d3dc authored by Stefan Galinski's avatar Stefan Galinski 🎮

[TASK] Update tinymce to version 4.3.2

parent 8b9fc894
## How to update the sources?
# How to update the sources?
1. Update tinymce with npm
2. Download the latest language pack from "http://archive.tinymce.com/i18n/index.php".
......@@ -7,5 +7,4 @@
$('input[type=checkbox]').attr('checked', 1)
3. Add the "langs" directory inside node_modules/tinymce with the downloaded languages
4. Update the VERSIONS.md file
\ No newline at end of file
3. Add the "langs" directory inside node_modules/tinymce with the downloaded languages
\ No newline at end of file
### Used Versions
- TinyMCE - 4.3.1
- Languages - 12.12.2015
\ No newline at end of file
Version 4.3.2 (2015-12-14)
Fixed bug where the resize bars for table cells were not affected by the object_resizing property.
Fixed bug where the contextual table toolbar would appear incorrectly if TinyMCE was initialized inline inside a table.
Fixed bug where resizing table cells did not fire a node change event or add an undo level.
Fixed bug where double click selection of text on IE 11 wouldn't work properly.
Fixed bug where codesample plugin would incorrectly produce br elements inside code elements.
Fixed bug where media plugin would strip dashes from youtube urls.
Fixed bug where it was possible to move the caret into the table resize bars.
Fixed bug where drag/drop into a cE=false element was possible on IE.
Version 4.3.1 (2015-11-30)
Fixed so it's possible to disable the table inline toolbar by setting it to false or an empty string.
Fixed bug where it wasn't possible to resize some tables using the drag handles.
......
{
"name": "tinymce",
"version": "4.3.1",
"version": "4.3.2",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": "LGPL-2.1",
"keywords": [
......@@ -14,16 +14,21 @@
"bugs": {
"url": "http://www.tinymce.com/develop/bugtracker.php"
},
"gitHead": "321f1f97f903fd2ea2430a6b1bf995c7bbd1ab2f",
"_id": "tinymce@4.3.1",
"gitHead": "6597b4bd83169d6f10887a8bc1e7d218a1453b0e",
"_id": "tinymce@4.3.2",
"scripts": {},
"_shasum": "a035ae47072d122e4ebf1d0db01823e34d2b2f7d",
"_from": "tinymce@*",
"_npmVersion": "1.4.28",
"_shasum": "679bca13c07dfd9b12acad8416497d6cc7c787a2",
"_from": "tinymce@>=4.3.2 <5.0.0",
"_npmVersion": "3.3.12",
"_nodeVersion": "5.1.1",
"_npmUser": {
"name": "ephox",
"email": "is-accounts@ephox.com"
},
"dist": {
"shasum": "679bca13c07dfd9b12acad8416497d6cc7c787a2",
"tarball": "http://registry.npmjs.org/tinymce/-/tinymce-4.3.2.tgz"
},
"maintainers": [
{
"name": "ephox",
......@@ -34,10 +39,6 @@
"email": "spocke@moxiecode.com"
}
],
"dist": {
"shasum": "a035ae47072d122e4ebf1d0db01823e34d2b2f7d",
"tarball": "http://registry.npmjs.org/tinymce/-/tinymce-4.3.1.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/tinymce/-/tinymce-4.3.1.tgz"
"_resolved": "https://registry.npmjs.org/tinymce/-/tinymce-4.3.2.tgz"
}
......@@ -1253,7 +1253,11 @@ define("tinymce/codesampleplugin/Plugin", [
$elm.attr('class', $.trim($elm.attr('class')));
$elm.removeAttr('contentEditable');
$elm.empty().append($('<code></code>').text(code));
$elm.empty().append($('<code></code>').each(function() {
// Needs to be textContent since innerText produces BR:s
this.textContent = code;
}));
});
});
......
......@@ -16,7 +16,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
var urlPatterns = [
{regex: /youtu\.be\/([\w\-.]+)/, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
{regex: /youtube\.com(.+)v=([^&]+)/, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$2', allowFullscreen: true},
{regex: /youtube.com\/embed\/([a-z0-9]+)/i, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
{regex: /youtube.com\/embed\/([a-z0-9\-]+)/i, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', allowfullscreen: true},
{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&amp;byline=0", allowfullscreen: true},
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false}
......@@ -225,43 +225,6 @@ tinymce.PluginManager.add('media', function(editor, url) {
}
}
function getEmbedHtmlFromUrl(url) {
var data = {};
tinymce.each(urlPatterns, function(pattern) {
var match, i, patternUrl;
if ((match = pattern.regex.exec(url))) {
patternUrl = pattern.url;
for (i = 0; match[i]; i++) {
/*jshint loopfunc:true*/
/*eslint no-loop-func:0 */
patternUrl = patternUrl.replace('$' + i, function() {
return match[i];
});
}
data.url = patternUrl;
data.type = pattern.type;
data.allowFullscreen = pattern.allowFullscreen;
data.width = pattern.w;
data.height = pattern.h;
}
});
if (!data.url) {
return null;
}
return editor.dom.createHTML('iframe', {
src: data.url,
width: data.width,
height: data.height,
allowFullscreen: data.allowFullscreen ? '1' : null
}, '');
}
function dataToHtml(data) {
var html = '';
......@@ -846,14 +809,6 @@ tinymce.PluginManager.add('media', function(editor, url) {
node.replace(realElm);
}
});
editor.on('PastePreProcess', function(e) {
var html = getEmbedHtmlFromUrl(e.content);
if (html) {
e.content = html;
}
});
});
editor.on('ObjectSelected', function(e) {
......
......@@ -2468,8 +2468,9 @@ define("tinymce/tableplugin/Dialogs", [
* @private
*/
define("tinymce/tableplugin/ResizeBars", [
"tinymce/util/Tools"
], function(Tools) {
"tinymce/util/Tools",
"tinymce/util/VK"
], function(Tools, VK) {
return function(editor) {
var RESIZE_BAR_CLASS = 'mce-resize-bar',
RESIZE_BAR_ROW_CLASS = 'mce-resize-bar-row',
......@@ -3171,13 +3172,13 @@ define("tinymce/tableplugin/ResizeBars", [
var newSizes = recalculateWidths(tableGrid, newWidths);
var styleExtension = percentageBased ? '%' : 'px';
setSizes(newSizes, styleExtension);
var newTableWidth = percentageBased ? getNewTablePercentWidth() :
getNewTablePixelWidth();
setTableSize(newTableWidth, styleExtension, percentageBased);
getNewTablePixelWidth();
editor.undoManager.transact(function() {
setSizes(newSizes, styleExtension);
setTableSize(newTableWidth, styleExtension, percentageBased);
});
}
// Adjust the height of the row of table at index, with delta.
......@@ -3197,18 +3198,21 @@ define("tinymce/tableplugin/ResizeBars", [
var newCellSizes = recalculateCellHeights(tableGrid, newHeights);
var newRowSizes = recalculateRowHeights(tableGrid, newHeights);
Tools.each(newRowSizes, function(row) {
editor.dom.setStyle(row.element, 'height', row.height + 'px');
editor.dom.setAttrib(row.element, 'height', null);
});
editor.undoManager.transact(function() {
Tools.each(newCellSizes, function(cell) {
editor.dom.setStyle(cell.element, 'height', cell.height + 'px');
editor.dom.setAttrib(cell.element, 'height', null);
});
Tools.each(newRowSizes, function(row) {
editor.dom.setStyle(row.element, 'height', row.height + 'px');
editor.dom.setAttrib(row.element, 'height', null);
});
editor.dom.setStyle(table, 'height', newTotalHeight + 'px');
editor.dom.setAttrib(table, 'height', null);
Tools.each(newCellSizes, function(cell) {
editor.dom.setStyle(cell.element, 'height', cell.height + 'px');
editor.dom.setAttrib(cell.element, 'height', null);
});
editor.dom.setStyle(table, 'height', newTotalHeight + 'px');
editor.dom.setAttrib(table, 'height', null);
});
}
function scheduleDelayedDropEvent() {
......@@ -3278,6 +3282,7 @@ define("tinymce/tableplugin/ResizeBars", [
adjustHeight(hoverTable, delta, index);
}
refreshBars(hoverTable);
editor.nodeChanged();
}
}
......@@ -3375,6 +3380,20 @@ define("tinymce/tableplugin/ResizeBars", [
}
});
// Prevents the user from moving the caret inside the resize bars on Chrome
// Only does it on arrow keys since clearBars might be an epxensive operation
// since it's querying the DOM
editor.on('keydown', function(e) {
switch (e.keyCode) {
case VK.LEFT:
case VK.RIGHT:
case VK.UP:
case VK.DOWN:
clearBars();
break;
}
});
return {
adjustWidth: adjustWidth,
adjustHeight: adjustHeight,
......@@ -3426,7 +3445,12 @@ define("tinymce/tableplugin/Plugin", [
var each = Tools.each;
function Plugin(editor) {
var clipboardRows, self = this, dialogs = new Dialogs(editor), resizeBars = ResizeBars(editor);
var clipboardRows, self = this, dialogs = new Dialogs(editor), resizeBars;
if (editor.settings.object_resizing &&
(editor.settings.object_resizing === true || editor.settings.object_resizing === 'table')) {
resizeBars = ResizeBars(editor);
}
function cmd(command) {
return function() {
......@@ -3775,7 +3799,9 @@ define("tinymce/tableplugin/Plugin", [
},
mceTableDelete: function(grid) {
resizeBars.clearBars();
if (resizeBars) {
resizeBars.clearBars();
}
grid.deleteTable();
}
}, function(func, name) {
......@@ -3890,7 +3916,7 @@ define("tinymce/tableplugin/Plugin", [
function isTable(table) {
var selectorMatched = editor.dom.is(table, 'table');
var selectorMatched = editor.dom.is(table, 'table') && editor.getBody().contains(table);
return selectorMatched;
}
......
// 4.3.1 (2015-11-30)
// 4.3.2 (2015-12-14)
/**
* Compiled inline version. (Library mode)
......@@ -1306,7 +1306,11 @@ define("tinymce/dom/Sizzle", [], function() {
*/
define("tinymce/Env", [], function() {
var nav = navigator, userAgent = nav.userAgent;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet;
function matchMediaQuery(query) {
return "matchMedia" in window ? matchMedia(query).matches : false;
}
opera = window.opera && window.opera.buildNumber;
android = /Android/.test(userAgent);
......@@ -1320,6 +1324,8 @@ define("tinymce/Env", [], function() {
mac = userAgent.indexOf('Mac') != -1;
iDevice = /(iPad|iPhone)/.test(userAgent);
fileApi = "FormData" in window && "FileReader" in window && "URL" in window && !!URL.createObjectURL;
phone = matchMediaQuery("only screen and (max-device-width: 480px)") && (android || iDevice);
tablet = matchMediaQuery("only screen and (min-width: 800px)") && (android || iDevice);
if (ie12) {
webkit = false;
......@@ -1450,7 +1456,9 @@ define("tinymce/Env", [], function() {
* @property ceFalse
* @type Boolean
*/
ceFalse: (ie === false || ie > 8)
ceFalse: (ie === false || ie > 8),
desktop: !phone && !tablet
};
});
......@@ -19781,6 +19789,8 @@ define("tinymce/EnterKey", [
emptyBlock(parentBlock);
}
newBlock.normalize();
// New block might become empty if it's <p><b>a |</b></p>
if (dom.isEmpty(newBlock)) {
dom.remove(newBlock);
......@@ -26972,7 +26982,7 @@ define("tinymce/ui/Window", [
$(window).trigger('resize');
}
});
}, 100);
function reposition() {
var i, rect = DomUtils.getWindowSize(), layoutRect;
......@@ -32592,6 +32602,15 @@ define("tinymce/DragDropOverrides", [
}
editor.on('mousedown', start);
// Blocks drop inside cE=false on IE
editor.on('drop', function(e) {
var realTarget = editor.getDoc().elementFromPoint(e.clientX, e.clientY);
if (isContentEditableFalse(realTarget) || isContentEditableFalse(editor.dom.getContentEditableParent(realTarget))) {
e.preventDefault();
}
});
}
return {
......@@ -32676,7 +32695,9 @@ define("tinymce/SelectionOverrides", [
function setRange(range) {
//console.log('setRange', range);
editor.selection.setRng(range);
if (range) {
editor.selection.setRng(range);
}
}
function getRange() {
......@@ -32936,17 +32957,9 @@ define("tinymce/SelectionOverrides", [
}
}
function renderRangeCaret(range) {
function renderCaretAtRange(range) {
var caretPosition;
if (!range) {
return range;
}
if (!range.collapsed) {
return range;
}
range = CaretUtils.normalizeRange(1, rootNode, range);
caretPosition = CaretPosition.fromRangeStart(range);
......@@ -32960,6 +32973,21 @@ define("tinymce/SelectionOverrides", [
fakeCaret.hide();
return null;
}
function renderRangeCaret(range) {
var caretRange;
if (!range || !range.collapsed) {
return range;
}
caretRange = renderCaretAtRange(range);
if (caretRange) {
return caretRange;
}
return range;
}
......@@ -33069,7 +33097,7 @@ define("tinymce/SelectionOverrides", [
var range = getRange();
if (range.collapsed) {
setRange(renderRangeCaret(range));
setRange(renderCaretAtRange(range));
}
});
......@@ -36098,7 +36126,7 @@ define("tinymce/EditorManager", [
* @property minorVersion
* @type String
*/
minorVersion: '3.1',
minorVersion: '3.2',
/**
* Release date of TinyMCE build.
......@@ -36106,7 +36134,7 @@ define("tinymce/EditorManager", [
* @property releaseDate
* @type String
*/
releaseDate: '2015-11-30',
releaseDate: '2015-12-14',
/**
* Collection of editor instances.
This diff is collapsed.
// 4.3.1 (2015-11-30)
// 4.3.2 (2015-12-14)
/**
* Compiled inline version. (Library mode)
......@@ -3322,7 +3322,11 @@ return Sizzle;
*/
define("tinymce/Env", [], function() {
var nav = navigator, userAgent = nav.userAgent;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet;
function matchMediaQuery(query) {
return "matchMedia" in window ? matchMedia(query).matches : false;
}
opera = window.opera && window.opera.buildNumber;
android = /Android/.test(userAgent);
......@@ -3336,6 +3340,8 @@ define("tinymce/Env", [], function() {
mac = userAgent.indexOf('Mac') != -1;
iDevice = /(iPad|iPhone)/.test(userAgent);
fileApi = "FormData" in window && "FileReader" in window && "URL" in window && !!URL.createObjectURL;
phone = matchMediaQuery("only screen and (max-device-width: 480px)") && (android || iDevice);
tablet = matchMediaQuery("only screen and (min-width: 800px)") && (android || iDevice);
if (ie12) {
webkit = false;
......@@ -3466,7 +3472,9 @@ define("tinymce/Env", [], function() {
* @property ceFalse
* @type Boolean
*/
ceFalse: (ie === false || ie > 8)
ceFalse: (ie === false || ie > 8),
desktop: !phone && !tablet
};
});
......@@ -21797,6 +21805,8 @@ define("tinymce/EnterKey", [
emptyBlock(parentBlock);
}
newBlock.normalize();
// New block might become empty if it's <p><b>a |</b></p>
if (dom.isEmpty(newBlock)) {
dom.remove(newBlock);
......@@ -28988,7 +28998,7 @@ define("tinymce/ui/Window", [
$(window).trigger('resize');
}
});
}, 100);
function reposition() {
var i, rect = DomUtils.getWindowSize(), layoutRect;
......@@ -34608,6 +34618,15 @@ define("tinymce/DragDropOverrides", [
}
editor.on('mousedown', start);
// Blocks drop inside cE=false on IE
editor.on('drop', function(e) {
var realTarget = editor.getDoc().elementFromPoint(e.clientX, e.clientY);
if (isContentEditableFalse(realTarget) || isContentEditableFalse(editor.dom.getContentEditableParent(realTarget))) {
e.preventDefault();
}
});
}
return {
......@@ -34692,7 +34711,9 @@ define("tinymce/SelectionOverrides", [
function setRange(range) {
//console.log('setRange', range);
editor.selection.setRng(range);
if (range) {
editor.selection.setRng(range);
}
}
function getRange() {
......@@ -34952,17 +34973,9 @@ define("tinymce/SelectionOverrides", [
}
}
function renderRangeCaret(range) {
function renderCaretAtRange(range) {
var caretPosition;
if (!range) {
return range;
}
if (!range.collapsed) {
return range;
}
range = CaretUtils.normalizeRange(1, rootNode, range);
caretPosition = CaretPosition.fromRangeStart(range);
......@@ -34976,6 +34989,21 @@ define("tinymce/SelectionOverrides", [
fakeCaret.hide();
return null;
}
function renderRangeCaret(range) {
var caretRange;
if (!range || !range.collapsed) {
return range;
}
caretRange = renderCaretAtRange(range);
if (caretRange) {
return caretRange;
}
return range;
}
......@@ -35085,7 +35113,7 @@ define("tinymce/SelectionOverrides", [
var range = getRange();
if (range.collapsed) {
setRange(renderRangeCaret(range));
setRange(renderCaretAtRange(range));
}
});
......@@ -38114,7 +38142,7 @@ define("tinymce/EditorManager", [
* @property minorVersion
* @type String
*/
minorVersion: '3.1',
minorVersion: '3.2',
/**
* Release date of TinyMCE build.
......@@ -38122,7 +38150,7 @@ define("tinymce/EditorManager", [
* @property releaseDate
* @type String
*/
releaseDate: '2015-11-30',
releaseDate: '2015-12-14',
/**
* Collection of editor instances.
This diff is collapsed.
......@@ -2,6 +2,6 @@
"name": "sg_tinymce",
"description": "",
"dependencies": {
"tinymce": "^4.3.1"
"tinymce": "^4.3.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment