Browse Source

Added 4.2.1 release

pull/16/head 4.2.1
Spocke 10 years ago
parent
commit
905eb7e791
  1. 2
      bower.json
  2. 13
      changelog.txt
  3. 2
      composer.json
  4. 2
      package.json
  5. 5
      plugins/contextmenu/plugin.js
  6. 2
      plugins/contextmenu/plugin.min.js
  7. 2
      plugins/image/plugin.min.js
  8. 24
      plugins/imagetools/plugin.js
  9. 2
      plugins/imagetools/plugin.min.js
  10. 2
      plugins/legacyoutput/plugin.min.js
  11. 2
      plugins/pagebreak/plugin.min.js
  12. 2
      plugins/table/plugin.min.js
  13. 2
      skins/lightgray/skin.ie7.min.css
  14. 2
      skins/lightgray/skin.min.css
  15. 25
      themes/modern/theme.js
  16. 2
      themes/modern/theme.min.js
  17. 91
      tinymce.jquery.js
  18. 20
      tinymce.jquery.min.js
  19. 91
      tinymce.js
  20. 20
      tinymce.min.js

2
bower.json

@ -1,6 +1,6 @@
{
"name": "tinymce",
"version": "4.2.0",
"version": "4.2.1",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": "http://www.tinymce.com/license",
"keywords": [

13
changelog.txt

@ -1,3 +1,16 @@
Version 4.2.1 (2015-06-29)
Fixed bug where back/forward buttons in the browser would render blob images as broken images.
Fixed bug where Firefox would throw regexp to big error when replacing huge base64 chunks.
Fixed bug rendering issues with resize and context toolbars not being placed properly until next animation frame.
Fixed bug where the rendering of the image while cropping would some times not be centered correctly.
Fixed bug where listbox items with submenus would me selected as active.
Fixed bug where context menu where throwing an error when rendering.
Fixed bug where resize both option wasn't working due to resent addClass API change. Patch contributed by Jogai.
Fixed bug where a hideAll call for container rendered inline toolbars would throw an error.
Fixed bug where onclick event handler on combobox could cause issues if element.id was a function by some polluting libraries.
Fixed bug where listboxes wouldn't get proper selected sub menu item when using link_list or image_list.
Fixed so the UI controls are as wide as 4.1.x to avoid wrapping controls in toolbars.
Fixed so the imagetools dialog is adaptive for smaller screen sizes.
Version 4.2.0 (2015-06-25)
Added new flat default skin to make the UI more modern.
Added new imagetools plugin, lets you crop/resize and apply filters to images.

2
composer.json

@ -1,6 +1,6 @@
{
"name": "tinymce/tinymce",
"version": "4.2.0",
"version": "4.2.1",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": [
"LGPL-2.1"

2
package.json

@ -1,6 +1,6 @@
{
"name": "tinymce",
"version": "4.2.0",
"version": "4.2.1",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": "LGPL-2.1",
"keywords": [

5
plugins/contextmenu/plugin.js

@ -62,8 +62,9 @@ tinymce.PluginManager.add('contextmenu', function(editor) {
menu = new tinymce.ui.Menu({
items: items,
context: 'contextmenu'
}).addClass('contextmenu').renderTo();
context: 'contextmenu',
classes: 'contextmenu'
}).renderTo();
editor.on('remove', function() {
menu.remove();

2
plugins/contextmenu/plugin.min.js

@ -1 +1 @@
tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu"}).addClass("contextmenu").renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});
tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu",classes:"contextmenu"}).renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});

2
plugins/image/plugin.min.js
File diff suppressed because it is too large
View File

24
plugins/imagetools/plugin.js

@ -835,8 +835,8 @@ define("tinymce/imagetoolsplugin/ImagePanel", [
zoom = this.zoom();
rect = this.state.get('rect');
$img = this.$el.find('img');
pw = elm.clientWidth;
ph = elm.clientHeight;
pw = elm.offsetWidth;
ph = elm.offsetHeight;
w = $img[0].naturalWidth * zoom;
h = $img[0].naturalHeight * zoom;
x = Math.max(0, pw / 2 - w / 2);
@ -865,10 +865,10 @@ define("tinymce/imagetoolsplugin/ImagePanel", [
});
this.cropRect.setViewPortRect({
x: x,
y: y,
w: w,
h: h
x: 0,
y: 0,
w: pw,
h: ph
});
}
},
@ -1447,6 +1447,7 @@ define("tinymce/imagetoolsplugin/UndoStack", [
* ...
*/
define("tinymce/imagetoolsplugin/Dialog", [
"tinymce/dom/DOMUtils",
"tinymce/util/Tools",
"tinymce/util/Promise",
"tinymce/ui/Factory",
@ -1457,7 +1458,7 @@ define("tinymce/imagetoolsplugin/Dialog", [
"tinymce/imagetoolsplugin/Filters",
"tinymce/imagetoolsplugin/Conversions",
"tinymce/imagetoolsplugin/UndoStack"
], function(Tools, Promise, Factory, Form, Container, ImagePanel, ImageTools, Filters, Conversions, UndoStack) {
], function(DOMUtils, Tools, Promise, Factory, Form, Container, ImagePanel, ImageTools, Filters, Conversions, UndoStack) {
function createState(blob) {
return {
blob: blob,
@ -1640,6 +1641,7 @@ define("tinymce/imagetoolsplugin/Dialog", [
pack: 'center',
padding: '0 10 0 10',
spacing: 5,
flex: 0,
minHeight: 60,
defaults: {
classes: 'imagetool',
@ -1822,9 +1824,7 @@ define("tinymce/imagetoolsplugin/Dialog", [
imagePanel = new ImagePanel({
flex: 1,
imageSrc: currentState.url,
minWidth: 800,
minHeight: 600
imageSrc: currentState.url
});
sidePanel = new Container({
@ -1874,8 +1874,8 @@ define("tinymce/imagetoolsplugin/Dialog", [
layout: 'flex',
direction: 'column',
align: 'stretch',
minWidth: 800,
minHeight: 600,
minWidth: Math.min(DOMUtils.DOM.getViewPort().w, 800),
minHeight: Math.min(DOMUtils.DOM.getViewPort().h, 650),
title: 'Edit image',
items: panels.concat([mainViewContainer]),
buttons: [

2
plugins/imagetools/plugin.min.js
File diff suppressed because it is too large
View File

2
plugins/legacyoutput/plugin.min.js

@ -1 +1 @@
!function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.size):a.value("")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.face):a.value("")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce);
!function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.size:"")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.face:"")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce);

2
plugins/pagebreak/plugin.min.js

@ -1 +1 @@
tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator","<!-- pagebreak -->"),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='<img src="'+tinymce.Env.transparentSrc+'" class="'+b+'" data-mce-resize="false" />';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("<p>"+e+"</p>"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})});
tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator","<!-- pagebreak -->"),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='<img src="'+tinymce.Env.transparentSrc+'" class="'+b+'" data-mce-resize="false" />';a.addCommand("mcePageBreak",function(){a.insertContent(a.settings.pagebreak_split_block?"<p>"+e+"</p>":e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})});

2
plugins/table/plugin.min.js
File diff suppressed because it is too large
View File

2
skins/lightgray/skin.ie7.min.css
File diff suppressed because it is too large
View File

2
skins/lightgray/skin.min.css
File diff suppressed because it is too large
View File

25
themes/modern/theme.js

@ -408,6 +408,10 @@ tinymce.ThemeManager.add('modern', function(editor) {
function reposition(match) {
var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions;
if (editor.removed) {
return;
}
if (!match || !match.toolbar.panel) {
hideAllFloatingPanels();
return;
@ -475,7 +479,15 @@ tinymce.ThemeManager.add('modern', function(editor) {
}
function repositionHandler() {
reposition(findFrontMostMatch(editor.selection.getNode()));
function execute() {
reposition(findFrontMostMatch(editor.selection.getNode()));
}
if (window.requestAnimationFrame) {
window.requestAnimationFrame(execute);
} else {
execute();
}
}
function bindScrollEvent() {
@ -623,10 +635,15 @@ tinymce.ThemeManager.add('modern', function(editor) {
function hide() {
if (panel) {
//We require two events as the inline float panel based toolbar does not have autohide=true
// We require two events as the inline float panel based toolbar does not have autohide=true
panel.hide();
//All other autohidden float panels will be closed below.
panel.hideAll();
// All other autohidden float panels will be closed below.
// Need to check for hideAll since it might be a normal panel
if (panel.hideAll) {
panel.hideAll();
}
DOM.removeClass(editor.getBody(), 'mce-edit-focus');
}
}

2
themes/modern/theme.min.js
File diff suppressed because it is too large
View File

91
tinymce.jquery.js

@ -1,4 +1,4 @@
// 4.2.0 (2015-06-25)
// 4.2.1 (2015-06-29)
/**
* Compiled inline version. (Library mode)
@ -7048,6 +7048,7 @@ define("tinymce/dom/RangeUtils", [
/**
* Walks the specified range like object and executes the callback for each sibling collection it finds.
*
* @private
* @method walk
* @param {Object} rng Range like object.
* @param {function} callback Callback function to execute for each sibling collection.
@ -12205,8 +12206,8 @@ define("tinymce/dom/ControlSelection", [
}
}
// Ignore all events while resizing
if (resizeStarted) {
// Ignore all events while resizing or if the editor instance was removed
if (resizeStarted || editor.removed) {
return;
}
@ -12383,7 +12384,15 @@ define("tinymce/dom/ControlSelection", [
}
}
editor.on('nodechange ResizeEditor ResizeWindow', updateResizeRect);
editor.on('nodechange ResizeEditor ResizeWindow', function(e) {
if (window.requestAnimationFrame) {
window.requestAnimationFrame(function() {
updateResizeRect(e);
});
} else {
updateResizeRect(e);
}
});
// Update resize rect while typing in a table
editor.on('keydown keyup', function(e) {
@ -27240,6 +27249,7 @@ define("tinymce/EditorObservable", [
/**
* Contains all logic for handling of keyboard shortcuts.
*
* @class tinymce.Shortcuts
* @example
* editor.shortcuts.add('ctrl+a', function() {});
* editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
@ -28068,22 +28078,25 @@ define("tinymce/EditorUpload", [
return function(editor) {
var blobCache = new BlobCache();
function regExpEscape(str) {
return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
// Replaces strings without regexps to avoid FF regexp to big issue
function replaceString(content, search, replace) {
var index = 0;
do {
index = content.indexOf(search, index);
function replaceAttribValue(content, name, targetValue, newValue) {
return content.replace(
new RegExp(name + '="' + regExpEscape(targetValue) + '"', 'g'),
function() {
return name + '="' + newValue + '"';
if (index !== -1) {
content = content.substring(0, index) + replace + content.substr(index + search.length);
index += replace.length - search.length + 1;
}
);
} while (index !== -1);
return content;
}
function replaceImageUrl(content, targetUrl, replacementUrl) {
content = replaceAttribValue(content, "src", targetUrl, replacementUrl);
content = replaceAttribValue(content, "data-mce-src", targetUrl, replacementUrl);
content = replaceString(content, 'src="' + targetUrl + '"', 'src="' + replacementUrl + '"');
content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
return content;
}
@ -28155,18 +28168,26 @@ define("tinymce/EditorUpload", [
blobCache.destroy();
}
function replaceBlobWithBase64(content) {
return content.replace(/src="(blob:[^"]+)"/g, function(match, blobUri) {
var blobInfo = blobCache.getByUri(blobUri);
return 'src="data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64() + '"';
});
}
editor.on('setContent paste', scanForImages);
editor.on('RawSaveContent', function(e) {
e.content = replaceBlobWithBase64(e.content);
});
editor.on('getContent', function(e) {
if (e.source_view || e.format == 'raw') {
return;
}
e.content = e.content.replace(/src="(blob:[^"]+)"/g, function(match, blobUri) {
var blobInfo = blobCache.getByUri(blobUri);
return 'src="data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64() + '"';
});
e.content = replaceBlobWithBase64(e.content);
});
return {
@ -29786,6 +29807,11 @@ define("tinymce/Editor", [
self.fire('SaveContent', args);
}
// Always run this internal event
if (args.format == 'raw') {
self.fire('RawSaveContent', args);
}
html = args.content;
if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
@ -30344,6 +30370,7 @@ define("tinymce/util/I18n", [], function() {
/**
* Returns the current language code.
*
* @method getCode
* @return {String} Current language code.
*/
getCode: function() {
@ -30805,7 +30832,7 @@ define("tinymce/EditorManager", [
* @property minorVersion
* @type String
*/
minorVersion: '2.0',
minorVersion: '2.1',
/**
* Release date of TinyMCE build.
@ -30813,7 +30840,7 @@ define("tinymce/EditorManager", [
* @property releaseDate
* @type String
*/
releaseDate: '2015-06-25',
releaseDate: '2015-06-29',
/**
* Collection of editor instances.
@ -33017,6 +33044,10 @@ define("tinymce/ui/ComboBox", [
self.on('click', function(e) {
var elm = e.target, root = self.getEl();
if (!$.contains(root, elm) && elm != root) {
return;
}
while (elm && elm != root) {
if (elm.id && elm.id.indexOf('-open') != -1) {
self.fire('action');
@ -36785,12 +36816,14 @@ define("tinymce/ui/ListBox", [
if (selected) {
selectedText = selectedText || menuValues[i].text;
self.state.set('value', menuValues[i].value);
break;
return true;
}
// If the value has a submenu, try to find the selected values in that menu
if (menuValues[i].menu) {
setSelected(menuValues[i].menu);
if (setSelected(menuValues[i].menu)) {
return true;
}
}
}
}
@ -36847,7 +36880,9 @@ define("tinymce/ui/ListBox", [
function activateMenuItemsByValue(menu, value) {
if (menu instanceof Menu) {
menu.items().each(function(ctrl) {
ctrl.active(ctrl.value() === value);
if (!ctrl.hasMenus()) {
ctrl.active(ctrl.value() === value);
}
});
}
}
@ -36860,12 +36895,12 @@ define("tinymce/ui/ListBox", [
}
for (var i = 0; i < menuValues.length; i++) {
if (menuValues[i].value == value) {
if (menuValues[i].value === value) {
return menuValues[i];
}
if (menuValues[i].menu) {
selectedItem = getSelectedItem(menuValues[i].menu);
selectedItem = getSelectedItem(menuValues[i].menu, value);
if (selectedItem) {
return selectedItem;
}
@ -37155,7 +37190,7 @@ define("tinymce/ui/ResizeHandle", [
self.classes.add('resizehandle');
if (self.settings.direction == "both") {
self.addClass('resizehandle-both');
self.classes.add('resizehandle-both');
}
self.canFocus = false;

20
tinymce.jquery.min.js
File diff suppressed because it is too large
View File

91
tinymce.js

@ -1,4 +1,4 @@
// 4.2.0 (2015-06-25)
// 4.2.1 (2015-06-29)
/**
* Compiled inline version. (Library mode)
@ -9063,6 +9063,7 @@ define("tinymce/dom/RangeUtils", [
/**
* Walks the specified range like object and executes the callback for each sibling collection it finds.
*
* @private
* @method walk
* @param {Object} rng Range like object.
* @param {function} callback Callback function to execute for each sibling collection.
@ -14220,8 +14221,8 @@ define("tinymce/dom/ControlSelection", [
}
}
// Ignore all events while resizing
if (resizeStarted) {
// Ignore all events while resizing or if the editor instance was removed
if (resizeStarted || editor.removed) {
return;
}
@ -14398,7 +14399,15 @@ define("tinymce/dom/ControlSelection", [
}
}
editor.on('nodechange ResizeEditor ResizeWindow', updateResizeRect);
editor.on('nodechange ResizeEditor ResizeWindow', function(e) {
if (window.requestAnimationFrame) {
window.requestAnimationFrame(function() {
updateResizeRect(e);
});
} else {
updateResizeRect(e);
}
});
// Update resize rect while typing in a table
editor.on('keydown keyup', function(e) {
@ -29255,6 +29264,7 @@ define("tinymce/EditorObservable", [
/**
* Contains all logic for handling of keyboard shortcuts.
*
* @class tinymce.Shortcuts
* @example
* editor.shortcuts.add('ctrl+a', function() {});
* editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
@ -30083,22 +30093,25 @@ define("tinymce/EditorUpload", [
return function(editor) {
var blobCache = new BlobCache();
function regExpEscape(str) {
return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
// Replaces strings without regexps to avoid FF regexp to big issue
function replaceString(content, search, replace) {
var index = 0;
do {
index = content.indexOf(search, index);
function replaceAttribValue(content, name, targetValue, newValue) {
return content.replace(
new RegExp(name + '="' + regExpEscape(targetValue) + '"', 'g'),
function() {
return name + '="' + newValue + '"';
if (index !== -1) {
content = content.substring(0, index) + replace + content.substr(index + search.length);
index += replace.length - search.length + 1;
}
);
} while (index !== -1);
return content;
}
function replaceImageUrl(content, targetUrl, replacementUrl) {
content = replaceAttribValue(content, "src", targetUrl, replacementUrl);
content = replaceAttribValue(content, "data-mce-src", targetUrl, replacementUrl);
content = replaceString(content, 'src="' + targetUrl + '"', 'src="' + replacementUrl + '"');
content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
return content;
}
@ -30170,18 +30183,26 @@ define("tinymce/EditorUpload", [
blobCache.destroy();
}
function replaceBlobWithBase64(content) {
return content.replace(/src="(blob:[^"]+)"/g, function(match, blobUri) {
var blobInfo = blobCache.getByUri(blobUri);
return 'src="data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64() + '"';
});
}
editor.on('setContent paste', scanForImages);
editor.on('RawSaveContent', function(e) {
e.content = replaceBlobWithBase64(e.content);
});
editor.on('getContent', function(e) {
if (e.source_view || e.format == 'raw') {
return;
}
e.content = e.content.replace(/src="(blob:[^"]+)"/g, function(match, blobUri) {
var blobInfo = blobCache.getByUri(blobUri);
return 'src="data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64() + '"';
});
e.content = replaceBlobWithBase64(e.content);
});
return {
@ -31801,6 +31822,11 @@ define("tinymce/Editor", [
self.fire('SaveContent', args);
}
// Always run this internal event
if (args.format == 'raw') {
self.fire('RawSaveContent', args);
}
html = args.content;
if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
@ -32359,6 +32385,7 @@ define("tinymce/util/I18n", [], function() {
/**
* Returns the current language code.
*
* @method getCode
* @return {String} Current language code.
*/
getCode: function() {
@ -32820,7 +32847,7 @@ define("tinymce/EditorManager", [
* @property minorVersion
* @type String
*/
minorVersion: '2.0',
minorVersion: '2.1',
/**
* Release date of TinyMCE build.
@ -32828,7 +32855,7 @@ define("tinymce/EditorManager", [
* @property releaseDate
* @type String
*/
releaseDate: '2015-06-25',
releaseDate: '2015-06-29',
/**
* Collection of editor instances.
@ -35032,6 +35059,10 @@ define("tinymce/ui/ComboBox", [
self.on('click', function(e) {
var elm = e.target, root = self.getEl();
if (!$.contains(root, elm) && elm != root) {
return;
}
while (elm && elm != root) {
if (elm.id && elm.id.indexOf('-open') != -1) {
self.fire('action');
@ -38800,12 +38831,14 @@ define("tinymce/ui/ListBox", [
if (selected) {
selectedText = selectedText || menuValues[i].text;
self.state.set('value', menuValues[i].value);
break;
return true;
}
// If the value has a submenu, try to find the selected values in that menu
if (menuValues[i].menu) {
setSelected(menuValues[i].menu);
if (setSelected(menuValues[i].menu)) {
return true;
}
}
}
}
@ -38862,7 +38895,9 @@ define("tinymce/ui/ListBox", [
function activateMenuItemsByValue(menu, value) {
if (menu instanceof Menu) {
menu.items().each(function(ctrl) {
ctrl.active(ctrl.value() === value);
if (!ctrl.hasMenus()) {
ctrl.active(ctrl.value() === value);
}
});
}
}
@ -38875,12 +38910,12 @@ define("tinymce/ui/ListBox", [
}
for (var i = 0; i < menuValues.length; i++) {
if (menuValues[i].value == value) {
if (menuValues[i].value === value) {
return menuValues[i];
}
if (menuValues[i].menu) {
selectedItem = getSelectedItem(menuValues[i].menu);
selectedItem = getSelectedItem(menuValues[i].menu, value);
if (selectedItem) {
return selectedItem;
}
@ -39170,7 +39205,7 @@ define("tinymce/ui/ResizeHandle", [
self.classes.add('resizehandle');
if (self.settings.direction == "both") {
self.addClass('resizehandle-both');
self.classes.add('resizehandle-both');
}
self.canFocus = false;

20
tinymce.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save