|
|
@ -5,9 +5,9 @@
|
|
|
|
var tinymce = {
|
|
|
|
var tinymce = {
|
|
|
|
majorVersion : '3',
|
|
|
|
majorVersion : '3',
|
|
|
|
|
|
|
|
|
|
|
|
minorVersion : '3.1',
|
|
|
|
minorVersion : '3.2',
|
|
|
|
|
|
|
|
|
|
|
|
releaseDate : '2010-03-18',
|
|
|
|
releaseDate : '2010-03-25',
|
|
|
|
|
|
|
|
|
|
|
|
_init : function() {
|
|
|
|
_init : function() {
|
|
|
|
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
|
|
|
|
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
|
|
|
@ -2406,7 +2406,7 @@ tinymce.create('static tinymce.util.XHR', {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
nodeIndex : function(node, normalized) {
|
|
|
|
nodeIndex : function(node, normalized) {
|
|
|
|
var idx = 0, lastNodeType, nodeType;
|
|
|
|
var idx = 0, lastNodeType, lastNode, nodeType;
|
|
|
|
|
|
|
|
|
|
|
|
if (node) {
|
|
|
|
if (node) {
|
|
|
|
for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {
|
|
|
|
for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {
|
|
|
@ -5102,7 +5102,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|
|
|
getStart : function() {
|
|
|
|
getStart : function() {
|
|
|
|
var t = this, r = t.getRng(), e;
|
|
|
|
var t = this, r = t.getRng(), e;
|
|
|
|
|
|
|
|
|
|
|
|
if (isIE) {
|
|
|
|
if (r.duplicate || r.item) {
|
|
|
|
if (r.item)
|
|
|
|
if (r.item)
|
|
|
|
return r.item(0);
|
|
|
|
return r.item(0);
|
|
|
|
|
|
|
|
|
|
|
@ -5130,7 +5130,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|
|
|
getEnd : function() {
|
|
|
|
getEnd : function() {
|
|
|
|
var t = this, r = t.getRng(), e, eo;
|
|
|
|
var t = this, r = t.getRng(), e, eo;
|
|
|
|
|
|
|
|
|
|
|
|
if (isIE) {
|
|
|
|
if (r.duplicate || r.item) {
|
|
|
|
if (r.item)
|
|
|
|
if (r.item)
|
|
|
|
return r.item(0);
|
|
|
|
return r.item(0);
|
|
|
|
|
|
|
|
|
|
|
@ -5176,7 +5176,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|
|
|
|
|
|
|
|
|
|
|
function getPoint(rng, start) {
|
|
|
|
function getPoint(rng, start) {
|
|
|
|
var container = rng[start ? 'startContainer' : 'endContainer'],
|
|
|
|
var container = rng[start ? 'startContainer' : 'endContainer'],
|
|
|
|
offset = rng[start ? 'startOffset' : 'endOffset'], point = [], childNodes, after = 0;
|
|
|
|
offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (container.nodeType == 3) {
|
|
|
|
if (container.nodeType == 3) {
|
|
|
|
if (normalized) {
|
|
|
|
if (normalized) {
|
|
|
@ -5467,7 +5467,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|
|
|
// This can occur when the editor is placed in a hidden container element on Gecko
|
|
|
|
// This can occur when the editor is placed in a hidden container element on Gecko
|
|
|
|
// Or on IE when there was an exception
|
|
|
|
// Or on IE when there was an exception
|
|
|
|
if (!r)
|
|
|
|
if (!r)
|
|
|
|
r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange();
|
|
|
|
r = t.win.document.createRange ? t.win.document.createRange() : t.win.document.body.createTextRange();
|
|
|
|
|
|
|
|
|
|
|
|
return r;
|
|
|
|
return r;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -5509,7 +5509,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|
|
|
getNode : function() {
|
|
|
|
getNode : function() {
|
|
|
|
var t = this, rng = t.getRng(), sel = t.getSel(), elm;
|
|
|
|
var t = this, rng = t.getRng(), sel = t.getSel(), elm;
|
|
|
|
|
|
|
|
|
|
|
|
if (!isIE) {
|
|
|
|
if (rng.setStart) {
|
|
|
|
// Range maybe lost after the editor is made visible again
|
|
|
|
// Range maybe lost after the editor is made visible again
|
|
|
|
if (!rng)
|
|
|
|
if (!rng)
|
|
|
|
return t.dom.getRoot();
|
|
|
|
return t.dom.getRoot();
|
|
|
@ -8179,7 +8179,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
getLength : function() {
|
|
|
|
getLength : function() {
|
|
|
|
return DOM.get(this.id).options.length - 1;
|
|
|
|
return this.items.length;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
renderHTML : function() {
|
|
|
|
renderHTML : function() {
|
|
|
@ -9522,7 +9522,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},
|
|
|
|
hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},
|
|
|
|
fontname : {inline : 'span', styles : {fontFamily : '%value'}},
|
|
|
|
fontname : {inline : 'span', styles : {fontFamily : '%value'}},
|
|
|
|
fontsize : {inline : 'span', styles : {fontSize : '%value'}},
|
|
|
|
fontsize : {inline : 'span', styles : {fontSize : '%value'}},
|
|
|
|
blockquote : {block : 'blockquote', wrapper : 1},
|
|
|
|
blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},
|
|
|
|
|
|
|
|
|
|
|
|
removeformat : [
|
|
|
|
removeformat : [
|
|
|
|
{selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},
|
|
|
|
{selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},
|
|
|
@ -9533,7 +9533,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
|
|
|
|
|
|
|
|
// Register default block formats
|
|
|
|
// Register default block formats
|
|
|
|
each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {
|
|
|
|
each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {
|
|
|
|
t.formatter.register(name, {block : name});
|
|
|
|
t.formatter.register(name, {block : name, remove : 'all'});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Register user defined formats
|
|
|
|
// Register user defined formats
|
|
|
@ -9882,7 +9882,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
nodeChanged : function(o) {
|
|
|
|
nodeChanged : function(o) {
|
|
|
|
var t = this, s = t.selection, n = s.getNode() || t.getBody();
|
|
|
|
var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody();
|
|
|
|
|
|
|
|
|
|
|
|
// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
|
|
|
|
// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
|
|
|
|
if (t.initialized) {
|
|
|
|
if (t.initialized) {
|
|
|
@ -12562,6 +12562,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
pendingFormats = {apply : [], remove : []};
|
|
|
|
pendingFormats = {apply : [], remove : []};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isArray(obj) {
|
|
|
|
|
|
|
|
return obj instanceof Array;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function getParents(node, selector) {
|
|
|
|
function getParents(node, selector) {
|
|
|
|
return dom.getParents(node, selector, dom.getRoot());
|
|
|
|
return dom.getParents(node, selector, dom.getRoot());
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -13106,6 +13110,54 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function matchAll(names, vars) {
|
|
|
|
|
|
|
|
var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If the selection is collapsed then check pending formats
|
|
|
|
|
|
|
|
if (selection.isCollapsed()) {
|
|
|
|
|
|
|
|
for (ni = 0; ni < names.length; ni++) {
|
|
|
|
|
|
|
|
// If the name is to be removed, then stop it from being added
|
|
|
|
|
|
|
|
for (i = pendingFormats.remove.length - 1; i >= 0; i--) {
|
|
|
|
|
|
|
|
name = names[ni];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pendingFormats.remove[i].name == name) {
|
|
|
|
|
|
|
|
checkedMap[name] = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If the format is to be applied
|
|
|
|
|
|
|
|
for (i = pendingFormats.apply.length - 1; i >= 0; i--) {
|
|
|
|
|
|
|
|
for (ni = 0; ni < names.length; ni++) {
|
|
|
|
|
|
|
|
name = names[ni];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!checkedMap[name] && pendingFormats.apply[i].name == name) {
|
|
|
|
|
|
|
|
checkedMap[name] = true;
|
|
|
|
|
|
|
|
matchedFormatNames.push(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check start of selection for formats
|
|
|
|
|
|
|
|
startElement = selection.getStart();
|
|
|
|
|
|
|
|
dom.getParent(startElement, function(node) {
|
|
|
|
|
|
|
|
var i, name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < names.length; i++) {
|
|
|
|
|
|
|
|
name = names[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!checkedMap[name] && matchNode(node, name, vars)) {
|
|
|
|
|
|
|
|
checkedMap[name] = true;
|
|
|
|
|
|
|
|
matchedFormatNames.push(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return matchedFormatNames;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function canApply(name) {
|
|
|
|
function canApply(name) {
|
|
|
|
var formatList = get(name), startNode, parents, i, x, selector;
|
|
|
|
var formatList = get(name), startNode, parents, i, x, selector;
|
|
|
|
|
|
|
|
|
|
|
@ -13138,6 +13190,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
remove : remove,
|
|
|
|
remove : remove,
|
|
|
|
toggle : toggle,
|
|
|
|
toggle : toggle,
|
|
|
|
match : match,
|
|
|
|
match : match,
|
|
|
|
|
|
|
|
matchAll : matchAll,
|
|
|
|
matchNode : matchNode,
|
|
|
|
matchNode : matchNode,
|
|
|
|
canApply : canApply
|
|
|
|
canApply : canApply
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -13162,8 +13215,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|
|
|
str1 = str1 || '';
|
|
|
|
str1 = str1 || '';
|
|
|
|
str2 = str2 || '';
|
|
|
|
str2 = str2 || '';
|
|
|
|
|
|
|
|
|
|
|
|
str1 = str1.nodeName || str1;
|
|
|
|
str1 = '' + (str1.nodeName || str1);
|
|
|
|
str2 = str2.nodeName || str2;
|
|
|
|
str2 = '' + (str2.nodeName || str2);
|
|
|
|
|
|
|
|
|
|
|
|
return str1.toLowerCase() == str2.toLowerCase();
|
|
|
|
return str1.toLowerCase() == str2.toLowerCase();
|
|
|
|
};
|
|
|
|
};
|
|
|
|