Update TinyMCE to 3.5.3, enable stripping of Word styles on paste

This commit is contained in:
grahamtriggs 2015-10-14 22:17:16 +01:00
parent 83404c2c80
commit 48790b7525
274 changed files with 25268 additions and 14504 deletions

13
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/abbr.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* abbr.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {
@ -13,7 +16,7 @@ function init() {
}
function insertAbbr() {
SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
SXE.insertElement('abbr');
tinyMCEPopup.close();
}

11
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/acronym.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* acronym.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {

28
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* attributes.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {
@ -50,7 +53,6 @@ function insertAction() {
var inst = tinyMCEPopup.editor;
var elm = inst.selection.getNode();
tinyMCEPopup.execCommand("mceBeginUndoLevel");
setAllAttribs(elm);
tinyMCEPopup.execCommand("mceEndUndoLevel");
tinyMCEPopup.close();
@ -69,21 +71,7 @@ function setAttrib(elm, attrib, value) {
value = valueElm.value;
}
if (value != "") {
dom.setAttrib(elm, attrib.toLowerCase(), value);
if (attrib == "style")
attrib = "style.cssText";
if (attrib.substring(0, 2) == 'on')
value = 'return true;' + value;
if (attrib == "class")
attrib = "className";
elm[attrib]=value;
} else
elm.removeAttribute(attrib);
dom.setAttrib(elm, attrib.toLowerCase(), value);
}
function setAllAttribs(elm) {

11
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/cite.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* cite.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {

17
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/del.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* del.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {
@ -18,17 +21,17 @@ function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
elm.removeAttribute('data-mce-new');
}
function insertDel() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
insertInlineElement('del');
var elementArray = SXE.inst.dom.select('del[data-mce-new]');
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);

48
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* element_common.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
tinyMCEPopup.requireLangPack();
@ -151,28 +154,24 @@ SXE.initElementDialog = function(element_name) {
SXE.insertElement = function(element_name) {
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
tagName = element_name;
if (tinymce.isIE && element_name.indexOf('html:') == 0)
element_name = element_name.substring(5).toLowerCase();
h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
tinyMCEPopup.execCommand('mceInsertContent', false, h);
var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});
insertInlineElement(element_name);
var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
elm.id = '';
elm.setAttribute('id', '');
elm.removeAttribute('id');
if (SXE.inst.dom.getAttrib(elm, 'data-mce-new')) {
elm.id = '';
elm.setAttribute('id', '');
elm.removeAttribute('id');
elm.removeAttribute('data-mce-new');
setAllCommonAttribs(elm);
setAllCommonAttribs(elm);
}
}
}
} else {
@ -186,7 +185,6 @@ SXE.removeElement = function(element_name){
element_name = element_name.toLowerCase();
elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
tinyMCEPopup.execCommand('mceBeginUndoLevel');
tinyMCE.execCommand('mceRemoveNode', false, elm);
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
@ -194,7 +192,7 @@ SXE.removeElement = function(element_name){
}
SXE.showRemoveButton = function() {
document.getElementById("remove").style.display = 'block';
document.getElementById("remove").style.display = '';
}
SXE.containsClass = function(elm,cl) {
@ -218,4 +216,14 @@ SXE.removeClass = function(elm,cl) {
SXE.addClass = function(elm,cl) {
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
return true;
}
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select('span,font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1);
});
}

18
webapp/web/js/tiny_mce/plugins/xhtmlxtras/js/ins.js vendored Executable file → Normal file
View file

@ -1,8 +1,11 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
/**
* ins.js
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
function init() {
@ -18,16 +21,17 @@ function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
elm.removeAttribute('data-mce-new');
}
function insertIns() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
insertInlineElement('ins');
var elementArray = SXE.inst.dom.select('ins[data-mce-new]');
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);