FBI-1646: Updates tinyMCE library from v3.5.7 to v.3.5.12
This commit is contained in:
@@ -1,4 +1,52 @@
|
||||
Version 3.5.12 (2016-10-31)
|
||||
Added new option table_style_by_css for the table plugin to set table styling with css rather than table attributes.
|
||||
Added new option theme_advanced_default_font_size allows you to specify a default font size for the body.
|
||||
Added new option theme_advanced_default_font_family allows you to specify a default font family for the body.
|
||||
Fixed bug where params tags for width and height were being stripped from object tags in the media plugin.
|
||||
Fixed font families in order to provide appropriate web-safe fonts.
|
||||
Version 3.5.11 (2014-05-08)
|
||||
Added new option noneditable_prevent_delete to the non-editable plugin to prevent deletion of non-editable text.
|
||||
Added functionality to the media plugin to handle objects without source attributes correctly.
|
||||
Fixed bug in paste plugin word import with lists that have strikethrough on numbers.
|
||||
Fixed bug in word count plugin where characters with diacritical marks were split as seperate words.
|
||||
Fixed bug in IE 11 where the selection of images would fail when they where at the end of blocks.
|
||||
Fixed bug where input method would produce new lines when inserting contents to an empty editor.
|
||||
Fixed bug in non-editable plugin where backspace deletes too much text.
|
||||
Fixed bug where formatting a nested list would break the list moving list items.
|
||||
Fixed bug where the caret were not appended as child of the body but as sibling.
|
||||
Fixed bug where nested lists did not get the style updated.
|
||||
Fixed bug where the isDirty method would report a false positive when a plugin modifies the initial content.
|
||||
Fixed bug where empty tag doesn't preserve inner whitespace.
|
||||
Version 3.5.10 (2013-10-24)
|
||||
Fixed bug where dialogs using inlinepopups plugin would display incorrectly sometimes
|
||||
Fixed bug in paste plugin word import that was removing type from lists
|
||||
Fixed bug where IE 11 wouldn't be properly detected if IE 10 emulation was enabled.
|
||||
Version 3.5.9 (2013-10-10)
|
||||
Added IE 11 compatibility. IE 11 is treated as Gecko but it has still many IE bugs.
|
||||
Fixed bug where importing CSS classes would fail if it contained @import rules to remote domain on Gecko.
|
||||
Fixed bug in spelling plugin where misspelt words are not always marked.
|
||||
Fixed bug where script tag was removed when nested inside a div or p.
|
||||
Fixed full screen plugin state migration from original editor.
|
||||
Fixed edgecase on up/down arrow keys scrolling with native lists.
|
||||
Fixed bug where space can scroll webpage when using keyboard to access toolbar buttons.
|
||||
Fixed bug where up/down arrow keys scroll entire webpage when using keyboard nav in menu ui.
|
||||
Fixed bug where applying ins/del as inline elements would apply them as blocks.
|
||||
Fixed bug where backspace on a space after an image would produce a BR on WebKit.
|
||||
Fixed bug where it wasn't possible to change block type of text blocks.
|
||||
Version 3.5.8 (2012-11-20)
|
||||
Fixed bug where html5 data attributes where stripped from contents.
|
||||
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
|
||||
Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
|
||||
Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
|
||||
Fixed bug with auto detection logic for youtube urls in the media plugin.
|
||||
Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
|
||||
Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
|
||||
Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
|
||||
Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
|
||||
Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
|
||||
Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
|
||||
Version 3.5.7 (2012-09-20)
|
||||
Changed table row properties dialog to not update multiple rows when row type is header or footer.
|
||||
Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
|
||||
Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
|
||||
Fixed bug where applying formatting to an empty block element would produce redundant spans.
|
||||
@@ -157,7 +205,7 @@ Version 3.5b1 (2012-03-08)
|
||||
Added new types and selector options to make it easier to create editor instances with different configs.
|
||||
Added new preview of formatting options in various listboxes.
|
||||
Added new preview_styles option that enables control over what gets previewed.
|
||||
Fixed bug where content css would be loaded twice into iframe.
|
||||
Fixed bug where content css would be loaded twice into iframe.
|
||||
Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
|
||||
Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
|
||||
Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
|
||||
@@ -165,7 +213,7 @@ Version 3.5b1 (2012-03-08)
|
||||
Version 3.4.9 (2012-02-23)
|
||||
Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
|
||||
Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
|
||||
Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
|
||||
Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
|
||||
Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
|
||||
Fixed bug in Gecko where undo wasn't added when focus was lost.
|
||||
Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
|
||||
@@ -192,8 +240,8 @@ Version 3.4.8 (2012-02-02)
|
||||
Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
|
||||
Fixed bug where a stranded bullet point would get created in WebKit.
|
||||
Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
|
||||
Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
|
||||
Fix white space in between spans from being deleted.
|
||||
Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
|
||||
Fix white space in between spans from being deleted.
|
||||
Fixed bug where scrollbars where visible in the character map dialog on Gecko.
|
||||
Fixed issue with missing translation for one of the emoticons.
|
||||
Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
|
||||
|
||||
@@ -20,7 +20,7 @@ free software--to make sure the software is free for all its users.
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
can use it too, but we suggest you first think carefuly about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -107,8 +107,8 @@
|
||||
do
|
||||
{
|
||||
// Move the selection one character backwards.
|
||||
r.setStart(endContainer, end - 2);
|
||||
r.setEnd(endContainer, end - 1);
|
||||
r.setStart(endContainer, end >= 2 ? end - 2 : 0);
|
||||
r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
|
||||
end -= 1;
|
||||
|
||||
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates control instances based in the incomming name. This method is normally not
|
||||
* Creates control instances based in the incoming name. This method is normally not
|
||||
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
||||
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
||||
* method can be used to create those.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -50,13 +50,13 @@
|
||||
// Private plugin internal methods
|
||||
|
||||
_htmlToData : function() {
|
||||
var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;
|
||||
var headerFragment = this._parseHeader(), data = {}, elm, matches, editor = this.editor;
|
||||
|
||||
function getAttr(elm, name) {
|
||||
var value = elm.attr(name);
|
||||
|
||||
return value || '';
|
||||
};
|
||||
}
|
||||
|
||||
// Default some values
|
||||
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
||||
@@ -67,14 +67,16 @@
|
||||
if (elm.type == 7) {
|
||||
data.xml_pi = true;
|
||||
matches = /encoding="([^"]+)"/.exec(elm.value);
|
||||
if (matches)
|
||||
if (matches) {
|
||||
data.docencoding = matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Parse doctype
|
||||
elm = headerFragment.getAll('#doctype')[0];
|
||||
if (elm)
|
||||
if (elm) {
|
||||
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
||||
}
|
||||
|
||||
// Parse title element
|
||||
elm = headerFragment.getAll('title')[0];
|
||||
@@ -86,25 +88,28 @@
|
||||
each(headerFragment.getAll('meta'), function(meta) {
|
||||
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
||||
|
||||
if (name)
|
||||
if (name) {
|
||||
data['meta' + name.toLowerCase()] = meta.attr('content');
|
||||
else if (httpEquiv == "Content-Type") {
|
||||
} else if (httpEquiv == "Content-Type") {
|
||||
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
||||
|
||||
if (matches)
|
||||
if (matches) {
|
||||
data.docencoding = matches[1];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Parse html attribs
|
||||
elm = headerFragment.getAll('html')[0];
|
||||
if (elm)
|
||||
if (elm) {
|
||||
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
||||
}
|
||||
|
||||
// Parse stylesheet
|
||||
elm = headerFragment.getAll('link')[0];
|
||||
if (elm && elm.attr('rel') == 'stylesheet')
|
||||
if (elm && elm.attr('rel') == 'stylesheet') {
|
||||
data.stylesheet = elm.attr('href');
|
||||
}
|
||||
|
||||
// Parse body parts
|
||||
elm = headerFragment.getAll('body')[0];
|
||||
@@ -124,14 +129,15 @@
|
||||
|
||||
function setAttr(elm, name, value) {
|
||||
elm.attr(name, value ? value : undefined);
|
||||
};
|
||||
}
|
||||
|
||||
function addHeadNode(node) {
|
||||
if (headElement.firstChild)
|
||||
if (headElement.firstChild) {
|
||||
headElement.insert(node, headElement.firstChild);
|
||||
else
|
||||
} else {
|
||||
headElement.append(node);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
headerFragment = this._parseHeader();
|
||||
headElement = headerFragment.getAll('head')[0];
|
||||
@@ -139,10 +145,11 @@
|
||||
elm = headerFragment.getAll('html')[0];
|
||||
headElement = new Node('head', 1);
|
||||
|
||||
if (elm.firstChild)
|
||||
if (elm.firstChild) {
|
||||
elm.insert(headElement, elm.firstChild, true);
|
||||
else
|
||||
} else {
|
||||
elm.append(headElement);
|
||||
}
|
||||
}
|
||||
|
||||
// Add/update/remove XML-PI
|
||||
@@ -150,8 +157,9 @@
|
||||
if (data.xml_pi) {
|
||||
value = 'version="1.0"';
|
||||
|
||||
if (data.docencoding)
|
||||
if (data.docencoding) {
|
||||
value += ' encoding="' + data.docencoding + '"';
|
||||
}
|
||||
|
||||
if (elm.type != 7) {
|
||||
elm = new Node('xml', 7);
|
||||
@@ -159,8 +167,9 @@
|
||||
}
|
||||
|
||||
elm.value = value;
|
||||
} else if (elm && elm.type == 7)
|
||||
} else if (elm && elm.type == 7) {
|
||||
elm.remove();
|
||||
}
|
||||
|
||||
// Add/update/remove doctype
|
||||
elm = headerFragment.getAll('#doctype')[0];
|
||||
@@ -168,15 +177,17 @@
|
||||
if (!elm) {
|
||||
elm = new Node('#doctype', 10);
|
||||
|
||||
if (data.xml_pi)
|
||||
if (data.xml_pi) {
|
||||
headerFragment.insert(elm, headerFragment.firstChild);
|
||||
else
|
||||
} else {
|
||||
addHeadNode(elm);
|
||||
}
|
||||
}
|
||||
|
||||
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
||||
} else if (elm)
|
||||
} else if (elm) {
|
||||
elm.remove();
|
||||
}
|
||||
|
||||
// Add/update/remove title
|
||||
elm = headerFragment.getAll('title')[0];
|
||||
@@ -192,8 +203,9 @@
|
||||
if (data.docencoding) {
|
||||
elm = null;
|
||||
each(headerFragment.getAll('meta'), function(meta) {
|
||||
if (meta.attr('http-equiv') == 'Content-Type')
|
||||
if (meta.attr('http-equiv') == 'Content-Type') {
|
||||
elm = meta;
|
||||
}
|
||||
});
|
||||
|
||||
if (!elm) {
|
||||
@@ -214,10 +226,11 @@
|
||||
meta = nodes[i];
|
||||
|
||||
if (meta.attr('name') == name) {
|
||||
if (value)
|
||||
if (value) {
|
||||
meta.attr('content', value);
|
||||
else
|
||||
} else {
|
||||
meta.remove();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -236,10 +249,11 @@
|
||||
// Add/update/delete link
|
||||
elm = headerFragment.getAll('link')[0];
|
||||
if (elm && elm.attr('rel') == 'stylesheet') {
|
||||
if (data.stylesheet)
|
||||
if (data.stylesheet) {
|
||||
elm.attr('href', data.stylesheet);
|
||||
else
|
||||
} else {
|
||||
elm.remove();
|
||||
}
|
||||
} else if (data.stylesheet) {
|
||||
elm = new Node('link', 1);
|
||||
elm.attr({
|
||||
@@ -304,15 +318,17 @@
|
||||
function low(s) {
|
||||
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
||||
return a.toLowerCase();
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
||||
if (o.format == 'raw' && self.head)
|
||||
if (o.format == 'raw' && self.head) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
|
||||
if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse out head, body and footer
|
||||
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
||||
@@ -323,8 +339,9 @@
|
||||
self.head = low(content.substring(0, startPos + 1));
|
||||
|
||||
endPos = content.indexOf('</body', startPos);
|
||||
if (endPos == -1)
|
||||
if (endPos == -1) {
|
||||
endPos = content.length;
|
||||
}
|
||||
|
||||
o.content = content.substring(startPos + 1, endPos);
|
||||
self.foot = low(content.substring(endPos));
|
||||
@@ -336,8 +353,9 @@
|
||||
// Parse header and update iframe
|
||||
headerFragment = self._parseHeader();
|
||||
each(headerFragment.getAll('style'), function(node) {
|
||||
if (node.firstChild)
|
||||
if (node.firstChild) {
|
||||
styles += node.firstChild.value;
|
||||
}
|
||||
});
|
||||
|
||||
elm = headerFragment.getAll('body')[0];
|
||||
@@ -358,34 +376,41 @@
|
||||
|
||||
// Needed for IE 6/7
|
||||
elm = dom.get('fullpage_styles');
|
||||
if (elm.styleSheet)
|
||||
if (elm.styleSheet) {
|
||||
elm.styleSheet.cssText = styles;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_getDefaultHeader : function() {
|
||||
var header = '', editor = this.editor, value, styles = '';
|
||||
|
||||
if (editor.getParam('fullpage_default_xml_pi'))
|
||||
if (editor.getParam('fullpage_default_xml_pi')) {
|
||||
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
||||
}
|
||||
|
||||
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
|
||||
header += '\n<html>\n<head>\n';
|
||||
|
||||
if (value = editor.getParam('fullpage_default_title'))
|
||||
if (value = editor.getParam('fullpage_default_title')) {
|
||||
header += '<title>' + value + '</title>\n';
|
||||
}
|
||||
|
||||
if (value = editor.getParam('fullpage_default_encoding'))
|
||||
if (value = editor.getParam('fullpage_default_encoding')) {
|
||||
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
||||
}
|
||||
|
||||
if (value = editor.getParam('fullpage_default_font_family'))
|
||||
if (value = editor.getParam('fullpage_default_font_family')) {
|
||||
styles += 'font-family: ' + value + ';';
|
||||
}
|
||||
|
||||
if (value = editor.getParam('fullpage_default_font_size'))
|
||||
if (value = editor.getParam('fullpage_default_font_size')) {
|
||||
styles += 'font-size: ' + value + ';';
|
||||
}
|
||||
|
||||
if (value = editor.getParam('fullpage_default_text_color'))
|
||||
if (value = editor.getParam('fullpage_default_text_color')) {
|
||||
styles += 'color: ' + value + ';';
|
||||
}
|
||||
|
||||
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
||||
|
||||
@@ -395,8 +420,9 @@
|
||||
_getContent : function(ed, o) {
|
||||
var self = this;
|
||||
|
||||
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
|
||||
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) {
|
||||
o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
(function() {
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var defaultDocTypes =
|
||||
var defaultDocTypes =
|
||||
'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
|
||||
'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
|
||||
'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
|
||||
@@ -20,7 +20,7 @@
|
||||
'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
|
||||
'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
|
||||
|
||||
var defaultEncodings =
|
||||
var defaultEncodings =
|
||||
'Western european (iso-8859-1)=iso-8859-1,' +
|
||||
'Central European (iso-8859-2)=iso-8859-2,' +
|
||||
'Unicode (UTF-8)=utf-8,' +
|
||||
@@ -31,7 +31,7 @@
|
||||
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
||||
'ASCII (us-ascii)=us-ascii';
|
||||
|
||||
var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
|
||||
var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact,sans-serif;WingDings=wingdings';
|
||||
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
|
||||
|
||||
function setVal(id, value) {
|
||||
@@ -40,26 +40,29 @@
|
||||
if (elm) {
|
||||
value = value || '';
|
||||
|
||||
if (elm.nodeName == "SELECT")
|
||||
if (elm.nodeName == "SELECT") {
|
||||
selectByValue(document.forms[0], id, value);
|
||||
else if (elm.type == "checkbox")
|
||||
} else if (elm.type == "checkbox") {
|
||||
elm.checked = !!value;
|
||||
else
|
||||
} else {
|
||||
elm.value = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getVal(id) {
|
||||
var elm = document.getElementById(id);
|
||||
|
||||
if (elm.nodeName == "SELECT")
|
||||
if (elm.nodeName == "SELECT") {
|
||||
return elm.options[elm.selectedIndex].value;
|
||||
}
|
||||
|
||||
if (elm.type == "checkbox")
|
||||
if (elm.type == "checkbox") {
|
||||
return elm.checked;
|
||||
}
|
||||
|
||||
return elm.value;
|
||||
};
|
||||
}
|
||||
|
||||
window.FullPageDialog = {
|
||||
changedStyle : function() {
|
||||
@@ -69,10 +72,11 @@
|
||||
setVal('fontsize', styles['font-size']);
|
||||
setVal('textcolor', styles['color']);
|
||||
|
||||
if (val = styles['background-image'])
|
||||
if (val = styles['background-image']) {
|
||||
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
||||
else
|
||||
} else {
|
||||
setVal('bgimage', '');
|
||||
}
|
||||
|
||||
setVal('bgcolor', styles['background-color']);
|
||||
|
||||
@@ -91,17 +95,21 @@
|
||||
styles['margin-left'] = val[3] || val[0] || '';
|
||||
}
|
||||
|
||||
if (val = styles['margin-top'])
|
||||
if (val = styles['margin-top']) {
|
||||
setVal('topmargin', val.replace(/px/, ''));
|
||||
}
|
||||
|
||||
if (val = styles['margin-right'])
|
||||
if (val = styles['margin-right']) {
|
||||
setVal('rightmargin', val.replace(/px/, ''));
|
||||
}
|
||||
|
||||
if (val = styles['margin-bottom'])
|
||||
if (val = styles['margin-bottom']) {
|
||||
setVal('bottommargin', val.replace(/px/, ''));
|
||||
}
|
||||
|
||||
if (val = styles['margin-left'])
|
||||
if (val = styles['margin-left']) {
|
||||
setVal('leftmargin', val.replace(/px/, ''));
|
||||
}
|
||||
|
||||
updateColor('bgcolor_pick', 'bgcolor');
|
||||
updateColor('textcolor_pick', 'textcolor');
|
||||
@@ -109,7 +117,7 @@
|
||||
|
||||
changedStyleProp : function() {
|
||||
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
||||
|
||||
|
||||
styles['font-face'] = getVal('fontface');
|
||||
styles['font-size'] = getVal('fontsize');
|
||||
styles['color'] = getVal('textcolor');
|
||||
@@ -146,7 +154,7 @@
|
||||
setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
|
||||
this.changedStyle();
|
||||
},
|
||||
|
||||
|
||||
update : function() {
|
||||
var data = {};
|
||||
|
||||
@@ -158,7 +166,7 @@
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function init() {
|
||||
var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -11,29 +11,48 @@
|
||||
(function() {
|
||||
var DOM = tinymce.DOM;
|
||||
|
||||
// State Transfer function
|
||||
var transferState = function(oldEditor, newEditor, bookmark) {
|
||||
var transferColorButtonState = function(swapme) {
|
||||
var c = oldEditor.controlManager.get(swapme);
|
||||
var newC = newEditor.controlManager.get(swapme);
|
||||
|
||||
if (c && newC) {
|
||||
newC.displayColor(c.value);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
transferColorButtonState('forecolor');
|
||||
transferColorButtonState('backcolor');
|
||||
newEditor.setContent(oldEditor.getContent({format : 'raw'}), {format : 'raw'});
|
||||
newEditor.selection.moveToBookmark(bookmark);
|
||||
|
||||
if (oldEditor.plugins.spellchecker && newEditor.plugins.spellchecker) {
|
||||
newEditor.plugins.spellchecker.setLanguage(oldEditor.plugins.spellchecker.selectedLang);
|
||||
}
|
||||
};
|
||||
|
||||
tinymce.create('tinymce.plugins.FullScreenPlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, s = {}, vp, posCss;
|
||||
|
||||
t.editor = ed;
|
||||
var t = this, s = {}, de = DOM.doc.documentElement, vp, fullscreen_overflow, fullscreen_html_overflow, fullscreen_scrollx, fullscreen_scrolly, posCss, bookmark;
|
||||
|
||||
// Register commands
|
||||
ed.addCommand('mceFullScreen', function() {
|
||||
var win, de = DOM.doc.documentElement;
|
||||
var win, oed;
|
||||
|
||||
if (ed.getParam('fullscreen_is_enabled')) {
|
||||
if (ed.getParam('fullscreen_new_window'))
|
||||
closeFullscreen(); // Call to close in new window
|
||||
closeFullscreen(); // Call to close in fullscreen.htm
|
||||
else {
|
||||
DOM.win.setTimeout(function() {
|
||||
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
||||
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
|
||||
tinyMCE.remove(ed);
|
||||
DOM.remove('mce_fullscreen_container');
|
||||
de.style.overflow = ed.getParam('fullscreen_html_overflow');
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
|
||||
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
|
||||
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
||||
var fullscreenEditor = ed;
|
||||
|
||||
// find the editor that opened this one, execute restore function there
|
||||
var originalEditor = tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));
|
||||
originalEditor.plugins.fullscreen.saveState(fullscreenEditor);
|
||||
|
||||
tinyMCE.remove(fullscreenEditor);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
@@ -41,6 +60,9 @@
|
||||
}
|
||||
|
||||
if (ed.getParam('fullscreen_new_window')) {
|
||||
t.fullscreenSettings = {
|
||||
bookmark: ed.selection.getBookmark()
|
||||
};
|
||||
win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
|
||||
try {
|
||||
win.resizeTo(screen.availWidth, screen.availHeight);
|
||||
@@ -48,27 +70,26 @@
|
||||
// Ignore
|
||||
}
|
||||
} else {
|
||||
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
|
||||
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
||||
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
||||
fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
||||
fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
||||
vp = DOM.getViewPort();
|
||||
s.fullscreen_scrollx = vp.x;
|
||||
s.fullscreen_scrolly = vp.y;
|
||||
fullscreen_scrollx = vp.x;
|
||||
fullscreen_scrolly = vp.y;
|
||||
|
||||
// Fixes an Opera bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
|
||||
s.fullscreen_overflow = 'auto';
|
||||
if (tinymce.isOpera && fullscreen_overflow == 'visible')
|
||||
fullscreen_overflow = 'auto';
|
||||
|
||||
// Fixes an IE bug where horizontal scrollbars would appear
|
||||
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
|
||||
s.fullscreen_overflow = 'auto';
|
||||
if (tinymce.isIE && fullscreen_overflow == 'scroll')
|
||||
fullscreen_overflow = 'auto';
|
||||
|
||||
// Fixes an IE bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
if (tinymce.isIE && (fullscreen_html_overflow == 'visible' || fullscreen_html_overflow == 'scroll'))
|
||||
fullscreen_html_overflow = 'auto';
|
||||
|
||||
if (s.fullscreen_overflow == '0px')
|
||||
s.fullscreen_overflow = '';
|
||||
if (fullscreen_overflow == '0px')
|
||||
fullscreen_overflow = '';
|
||||
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
||||
de.style.overflow = 'hidden'; //Fix for IE6/7
|
||||
@@ -108,13 +129,21 @@
|
||||
s[k] = v;
|
||||
});
|
||||
|
||||
t.fullscreenSettings = {
|
||||
bookmark: ed.selection.getBookmark(),
|
||||
fullscreen_overflow: fullscreen_overflow,
|
||||
fullscreen_html_overflow: fullscreen_html_overflow,
|
||||
fullscreen_scrollx: fullscreen_scrollx,
|
||||
fullscreen_scrolly: fullscreen_scrolly
|
||||
};
|
||||
|
||||
if (s.theme_advanced_toolbar_location === 'external')
|
||||
s.theme_advanced_toolbar_location = 'top';
|
||||
|
||||
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings, the Editor constructor overwrites them
|
||||
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
|
||||
t.fullscreenEditor.onInit.add(function() {
|
||||
t.fullscreenEditor.setContent(ed.getContent());
|
||||
t.fullscreenEditor.focus();
|
||||
t.loadState(t.fullscreenEditor);
|
||||
});
|
||||
|
||||
t.fullscreenEditor.render();
|
||||
@@ -141,6 +170,52 @@
|
||||
ed.onNodeChange.add(function(ed, cm) {
|
||||
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
|
||||
});
|
||||
|
||||
// fullscreenEditor is a param here because in window mode we don't create it
|
||||
t.loadState = function(fullscreenEditor) {
|
||||
if (!(fullscreenEditor && t.fullscreenSettings)) {
|
||||
throw "No fullscreen editor to load to";
|
||||
}
|
||||
|
||||
transferState(ed, fullscreenEditor, t.fullscreenSettings.bookmark);
|
||||
fullscreenEditor.focus();
|
||||
|
||||
};
|
||||
|
||||
// fullscreenEditor is a param here because in window mode we don't create it
|
||||
t.saveState = function(fullscreenEditor) {
|
||||
if (!(fullscreenEditor && t.fullscreenSettings)) {
|
||||
throw "No fullscreen editor to restore from";
|
||||
}
|
||||
var settings = t.fullscreenSettings;
|
||||
|
||||
transferState(fullscreenEditor, ed, fullscreenEditor.selection.getBookmark());
|
||||
|
||||
// cleanup only required if window mode isn't used
|
||||
if (!ed.getParam('fullscreen_new_window')) {
|
||||
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
||||
delete t.resizeFunc;
|
||||
|
||||
DOM.remove('mce_fullscreen_container');
|
||||
|
||||
DOM.doc.documentElement.style.overflow = settings.fullscreen_html_overflow;
|
||||
DOM.setStyle(DOM.doc.body, 'overflow', settings.fullscreen_overflow);
|
||||
DOM.win.scrollTo(settings.fullscreen_scrollx, settings.fullscreen_scrolly);
|
||||
}
|
||||
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
||||
|
||||
// clear variables
|
||||
delete tinyMCE.oldSettings;
|
||||
delete t.fullscreenEditor;
|
||||
delete t.fullscreenElement;
|
||||
delete t.fullscreenSettings;
|
||||
|
||||
// allow the fullscreen editor to be removed before restoring focus and selection
|
||||
DOM.win.setTimeout(function() {
|
||||
ed.selection.moveToBookmark(bookmark);
|
||||
ed.focus();
|
||||
}, 10);
|
||||
};
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
settings['strict_loading_mode'] = true;
|
||||
|
||||
settings.save_onsavecallback = function() {
|
||||
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
|
||||
moveContent();
|
||||
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
|
||||
window.close();
|
||||
};
|
||||
@@ -56,11 +56,15 @@
|
||||
}
|
||||
|
||||
function moveContent() {
|
||||
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
|
||||
// find the original editor, execute restore state in it's plugin instance
|
||||
window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
|
||||
|
||||
// prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
|
||||
tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
|
||||
}
|
||||
|
||||
function closeFullscreen() {
|
||||
moveContent();
|
||||
// moveContent() will be called by the unload handler
|
||||
window.close();
|
||||
}
|
||||
|
||||
@@ -78,17 +82,20 @@
|
||||
function render() {
|
||||
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
|
||||
|
||||
e.value = window.opener.tinyMCE.get(oeID).getContent();
|
||||
|
||||
vp = dom.getViewPort();
|
||||
settings.width = vp.w;
|
||||
settings.height = vp.h - 15;
|
||||
|
||||
tinymce.dom.Event.add(window, 'resize', function() {
|
||||
var vp = dom.getViewPort();
|
||||
settings.oninit = function() {
|
||||
var ed = tinyMCE.activeEditor;
|
||||
window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
|
||||
|
||||
tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
|
||||
});
|
||||
tinymce.dom.Event.add(window, 'resize', function() {
|
||||
var vp = dom.getViewPort();
|
||||
|
||||
tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
|
||||
});
|
||||
}
|
||||
|
||||
tinyMCE.init(settings);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -55,12 +55,12 @@
|
||||
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
|
||||
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
||||
}
|
||||
|
||||
|
||||
// Only store selection if the type is a normal window
|
||||
if (!f.type)
|
||||
t.bookmark = ed.selection.getBookmark(1);
|
||||
|
||||
id = DOM.uniqueId();
|
||||
id = DOM.uniqueId("mce_inlinepopups_"); // Use a prefix so this can't conflict with other ids
|
||||
vp = DOM.getViewPort();
|
||||
f.width = parseInt(f.width || 320);
|
||||
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
||||
@@ -111,17 +111,17 @@
|
||||
opt += ' mceMovable';
|
||||
|
||||
// Create DOM objects
|
||||
t._addAll(DOM.doc.body,
|
||||
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
||||
t._addAll(DOM.doc.body,
|
||||
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
||||
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
|
||||
['div', {id : id + '_top', 'class' : 'mceTop'},
|
||||
['div', {id : id + '_top', 'class' : 'mceTop'},
|
||||
['div', {'class' : 'mceLeft'}],
|
||||
['div', {'class' : 'mceCenter'}],
|
||||
['div', {'class' : 'mceRight'}],
|
||||
['span', {id : id + '_title'}, f.title || '']
|
||||
],
|
||||
|
||||
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
||||
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
||||
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
|
||||
['span', {id : id + '_content'}],
|
||||
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
||||
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
||||
|
||||
|
||||
Event.add(id, 'keyup', function(evt) {
|
||||
var VK_ESCAPE = 27;
|
||||
if (evt.keyCode === VK_ESCAPE) {
|
||||
@@ -268,7 +268,7 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Make sure the tab order loops within the dialog.
|
||||
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
||||
var iframe = DOM.get(id + '_ifr');
|
||||
@@ -284,7 +284,7 @@
|
||||
DOM.get(id + '_ok').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Add window
|
||||
w = t.windows[id] = {
|
||||
id : id,
|
||||
@@ -341,7 +341,7 @@
|
||||
DOM.removeClass(t.lastId, 'mceFocus');
|
||||
DOM.addClass(id, 'mceFocus');
|
||||
t.lastId = id;
|
||||
|
||||
|
||||
if (w.focussedElement) {
|
||||
w.focussedElement.focus();
|
||||
} else if (DOM.get(id + '_ok')) {
|
||||
@@ -486,7 +486,7 @@
|
||||
|
||||
dw = v;
|
||||
}
|
||||
|
||||
|
||||
if (dh < (v = w.features.min_height - sz.h)) {
|
||||
if (dy !== 0)
|
||||
dy += dh - v;
|
||||
@@ -505,7 +505,7 @@
|
||||
if (dx + dy !== 0) {
|
||||
if (sx + dx < 0)
|
||||
dx = 0;
|
||||
|
||||
|
||||
if (sy + dy < 0)
|
||||
dy = 0;
|
||||
|
||||
@@ -567,7 +567,7 @@
|
||||
t.focus(fw.id);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Find front most window
|
||||
_frontWindow : function() {
|
||||
var fw, ix = 0;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -295,30 +295,40 @@
|
||||
} else {
|
||||
src = getVal("src");
|
||||
|
||||
// YouTube *NEW*
|
||||
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
||||
// YouTube Embed
|
||||
if (src.match(/youtube\.com\/embed\/\w+/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
} else {
|
||||
// YouTube *NEW*
|
||||
if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
// YouTube
|
||||
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
// YouTube
|
||||
if (src.match(/youtube\.com(.+)v=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
}
|
||||
|
||||
// Google video
|
||||
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
||||
if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 326;
|
||||
data.type = 'flash';
|
||||
@@ -328,7 +338,7 @@
|
||||
}
|
||||
|
||||
// Vimeo
|
||||
if (src.match(/vimeo.com\/([0-9]+)/)) {
|
||||
if (src.match(/vimeo\.com\/([0-9]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
@@ -339,7 +349,7 @@
|
||||
}
|
||||
|
||||
// stream.cz
|
||||
if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
|
||||
if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
@@ -350,7 +360,7 @@
|
||||
}
|
||||
|
||||
// Google maps
|
||||
if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
|
||||
if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -12,9 +12,12 @@
|
||||
var TreeWalker = tinymce.dom.TreeWalker;
|
||||
var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
|
||||
var VK = tinymce.VK;
|
||||
var editClass, nonEditClass, nonEditableRegExps;
|
||||
|
||||
function handleContentEditableSelection(ed) {
|
||||
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
|
||||
var dom = ed.dom, selection = ed.selection, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF',
|
||||
nondeletable = ed.getParam('noneditable_prevent_delete');
|
||||
|
||||
|
||||
// Returns the content editable state of a node "true/false" or null
|
||||
function getContentEditable(node) {
|
||||
@@ -119,7 +122,7 @@
|
||||
|
||||
// Removes any caret container except the one we might be in
|
||||
function removeCaretContainer(caretContainer) {
|
||||
var child, currentCaretContainer, lastContainer;
|
||||
var child, currentCaretContainer, lastContainer, rng;
|
||||
|
||||
if (caretContainer) {
|
||||
rng = selection.getRng(true);
|
||||
@@ -213,11 +216,13 @@
|
||||
// If it's a caret selection then look left/right to see if we need to move the caret out side or expand
|
||||
if (isCollapsed) {
|
||||
nonEditableStart = nonEditableStart || nonEditableEnd;
|
||||
var start = selection.getStart();
|
||||
if (element = hasSideContent(nonEditableStart, true)) {
|
||||
|
||||
if (hasSideContent(nonEditableStart, true)) {
|
||||
element = hasSideContent(nonEditableStart, true);
|
||||
// We have no contents to the left of the caret then insert a caret container before the noneditable element
|
||||
insertCaretContainerOrExpandToBlock(element, true);
|
||||
} else if (element = hasSideContent(nonEditableStart, false)) {
|
||||
} else if (hasSideContent(nonEditableStart, false)) {
|
||||
element = hasSideContent(nonEditableStart, false);
|
||||
// We have no contents to the right of the caret then insert a caret container after the noneditable element
|
||||
insertCaretContainerOrExpandToBlock(element, false);
|
||||
} else {
|
||||
@@ -243,7 +248,8 @@
|
||||
};
|
||||
|
||||
function handleKey(ed, e) {
|
||||
var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement;
|
||||
var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement, htmlSelection,
|
||||
selectionContainsNonEditable = false, selectedRegion;
|
||||
|
||||
function getNonEmptyTextNodeSibling(node, prev) {
|
||||
while (node = node[prev ? 'previousSibling' : 'nextSibling']) {
|
||||
@@ -293,7 +299,9 @@
|
||||
|
||||
// Found non editable node
|
||||
if (getContentEditable(node) === "false") {
|
||||
removeNodeIfNotParent(node);
|
||||
if (!nondeletable)
|
||||
removeNodeIfNotParent(node);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -306,12 +314,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (selection.isCollapsed()) {
|
||||
rng = selection.getRng(true);
|
||||
container = rng.startContainer;
|
||||
offset = rng.startOffset;
|
||||
container = getParentCaretContainer(container) || container;
|
||||
rng = selection.getRng(true);
|
||||
container = rng.startContainer;
|
||||
offset = rng.startOffset;
|
||||
container = getParentCaretContainer(container) || container;
|
||||
|
||||
if (selection.isCollapsed()) {
|
||||
// Is in noneditable parent
|
||||
if (nonEditableParent = getNonEditableParent(container)) {
|
||||
removeNodeIfNotParent(nonEditableParent);
|
||||
@@ -334,14 +342,79 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is in noneditable parent
|
||||
if (getNonEditableParent(container)) {
|
||||
nonEditableParent = getNonEditableParent(container);
|
||||
removeNodeIfNotParent(nonEditableParent);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* handleDirectionalStroke handles when the user presses a button within a caret container, and
|
||||
* make sure the direction of the cursor or of the deletion is within the
|
||||
* user expectations.
|
||||
*
|
||||
* @param {string} keyCode is the current keycode
|
||||
* @param {object} caretContainer is the caretContainer
|
||||
* @param {string} side left (backspace and left arrow) or right (delete and right arrow)
|
||||
* @param {object} e is the currenlty handled event
|
||||
* @return {null}
|
||||
*/
|
||||
function handleDirectionalStroke(keyCode, caretContainer, e) {
|
||||
var nonEditableParent;
|
||||
var side = (keyCode === VK.LEFT) || (keyCode === VK.BACKSPACE) ? 'left' : 'right';
|
||||
var arrow = side === 'left' ? VK.LEFT : VK.RIGHT;
|
||||
var action = side === 'left' ? VK.BACKSPACE : VK.DELETE;
|
||||
var next = side === 'left' ? true : false;
|
||||
var caret = selection.getRng(true);
|
||||
|
||||
|
||||
if (keyCode === arrow || keyCode === action) {
|
||||
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, next);
|
||||
|
||||
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
||||
|
||||
if (keyCode === arrow) {
|
||||
positionCaretOnElement(nonEditableParent, next);
|
||||
}
|
||||
|
||||
if (keyCode === action && (caretContainer.innerHTML === invisibleChar || !tinymce.trim(caretContainer.innerText || caretContainer.textContent)) ) {
|
||||
e.preventDefault();
|
||||
positionCaretOnElement(nonEditableParent, next);
|
||||
if (!nondeletable) {
|
||||
dom.remove(nonEditableParent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (!nondeletable) {
|
||||
removeCaretContainer(caretContainer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
startElement = selection.getStart()
|
||||
|
||||
startElement = selection.getStart();
|
||||
endElement = selection.getEnd();
|
||||
|
||||
// Disable all key presses in contentEditable=false except delete or backspace
|
||||
nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);
|
||||
|
||||
if (nondeletable && !selection.isCollapsed()) {
|
||||
var rng = selection.getRng(true);
|
||||
var rngContents = rng.cloneContents();
|
||||
|
||||
var selectionContainsNonEditable = false;
|
||||
tinymce.walk(rngContents, function(n) {
|
||||
selectionContainsNonEditable = getContentEditable(n) === 'false';
|
||||
return !selectionContainsNonEditable;
|
||||
}, 'childNodes');
|
||||
}
|
||||
|
||||
if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {
|
||||
// Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior
|
||||
if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {
|
||||
@@ -368,68 +441,42 @@
|
||||
if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {
|
||||
caretContainer = getParentCaretContainer(startElement);
|
||||
if (caretContainer) {
|
||||
// Arrow left or backspace
|
||||
if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) {
|
||||
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);
|
||||
|
||||
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
||||
e.preventDefault();
|
||||
|
||||
if (keyCode == VK.LEFT) {
|
||||
positionCaretOnElement(nonEditableParent, true);
|
||||
} else {
|
||||
dom.remove(nonEditableParent);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
removeCaretContainer(caretContainer);
|
||||
}
|
||||
}
|
||||
|
||||
// Arrow right or delete
|
||||
if (keyCode == VK.RIGHT || keyCode == VK.DELETE) {
|
||||
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer);
|
||||
|
||||
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
||||
e.preventDefault();
|
||||
|
||||
if (keyCode == VK.RIGHT) {
|
||||
positionCaretOnElement(nonEditableParent, false);
|
||||
} else {
|
||||
dom.remove(nonEditableParent);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
removeCaretContainer(caretContainer);
|
||||
}
|
||||
}
|
||||
handleDirectionalStroke(keyCode, caretContainer, e);
|
||||
}
|
||||
|
||||
if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nondeletable && selectionContainsNonEditable) {
|
||||
var confirmDeleting = confirm(ed.getLang("noneditable.confirm_delete"));
|
||||
if (!confirmDeleting) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ed.onMouseDown.addToTop(function(ed, e) {
|
||||
var node = ed.selection.getNode();
|
||||
|
||||
if (getContentEditable(node) === "false" && node == e.target) {
|
||||
// Expand selection on mouse down we can't block the default event since it's used for drag/drop
|
||||
moveSelection();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ed.onMouseUp.addToTop(moveSelection);
|
||||
ed.onMouseDown.addToTop(moveSelection);
|
||||
ed.onKeyDown.addToTop(handleKey);
|
||||
ed.onKeyUp.addToTop(moveSelection);
|
||||
};
|
||||
|
||||
function getEditClass(ed) {
|
||||
return " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";
|
||||
}
|
||||
function getNonEditClass(ed) {
|
||||
return " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
|
||||
}
|
||||
|
||||
tinymce.PluginManager.requireLangPack('noneditable');
|
||||
|
||||
tinymce.create('tinymce.plugins.NonEditablePlugin', {
|
||||
init : function(ed, url) {
|
||||
var editClass, nonEditClass, nonEditableRegExps;
|
||||
init : function(ed) {
|
||||
|
||||
// Converts configured regexps to noneditable span items
|
||||
function convertRegExpsToNonEditable(ed, args) {
|
||||
@@ -454,10 +501,10 @@
|
||||
}
|
||||
|
||||
args.content = content;
|
||||
};
|
||||
}
|
||||
|
||||
editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";
|
||||
nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
|
||||
editClass = getEditClass(ed);
|
||||
nonEditClass = getNonEditClass(ed);
|
||||
|
||||
// Setup noneditable regexps array
|
||||
nonEditableRegExps = ed.getParam("noneditable_regexp");
|
||||
@@ -490,7 +537,7 @@
|
||||
});
|
||||
|
||||
// Remove internal name
|
||||
ed.serializer.addAttributeFilter(internalName, function(nodes, name) {
|
||||
ed.serializer.addAttributeFilter(internalName, function(nodes) {
|
||||
var i = nodes.length, node;
|
||||
|
||||
while (i--) {
|
||||
@@ -509,7 +556,7 @@
|
||||
});
|
||||
|
||||
// Convert external name into internal name
|
||||
ed.parser.addAttributeFilter(externalName, function(nodes, name) {
|
||||
ed.parser.addAttributeFilter(externalName, function(nodes) {
|
||||
var i = nodes.length, node;
|
||||
|
||||
while (i--) {
|
||||
|
||||
1
gulliver/js/tinymce/jscripts/tiny_mce/plugins/noneditable/langs/en.js
vendored
Normal file
1
gulliver/js/tinymce/jscripts/tiny_mce/plugins/noneditable/langs/en.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
tinyMCE.addI18n('en.noneditable',{ confirm_delete : 'The selection contains non-editable text. Are you sure you want to continue?' });
|
||||
File diff suppressed because one or more lines are too long
@@ -291,7 +291,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we should use the new auto process method
|
||||
// Check if we should use the new auto process method
|
||||
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
||||
// Is it's Opera or older FF use key handler
|
||||
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
||||
@@ -354,7 +354,7 @@
|
||||
h = h.replace(v[0], v[1]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (ed.settings.paste_enable_default_filters == false) {
|
||||
return;
|
||||
}
|
||||
@@ -413,7 +413,9 @@
|
||||
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
|
||||
do {
|
||||
len = h.length;
|
||||
h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
// Don't remove the type attribute for lists so that non-default list types display correctly.
|
||||
h = h.replace(/(<?!(ol|ul)[^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
h = h.replace(/(<(ol|ul)[^>]*\s)(?:id|name|language|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
||||
} while (len != h.length);
|
||||
|
||||
// Remove all spans if no styles is to be retained
|
||||
@@ -589,7 +591,7 @@
|
||||
if (ed.settings.paste_enable_default_filters == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (o.wordContent) {
|
||||
// Remove named anchors or TOC links
|
||||
each(dom.select('a', o.node), function(a) {
|
||||
@@ -717,7 +719,7 @@
|
||||
if (type == 'ul')
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
||||
else
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');
|
||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*[\w|'<'|'>']+\.( |\u00a0)+\s*/, '');;
|
||||
|
||||
// Create li and add paragraph data into the new li
|
||||
li = listElm.appendChild(dom.create('li', 0, html));
|
||||
|
||||
@@ -14,6 +14,7 @@ var SearchReplaceDialog = {
|
||||
mcTabs.onChange.add(function(tab_id, panel_id) {
|
||||
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
switchMode : function(m) {
|
||||
@@ -39,6 +40,10 @@ var SearchReplaceDialog = {
|
||||
searchNext : function(a) {
|
||||
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
|
||||
|
||||
function createTextRange() {
|
||||
return ed.getDoc().selection ? ed.getDoc().selection.createRange() : ed.getDoc().body.createTextRange();
|
||||
}
|
||||
|
||||
// Get input
|
||||
f = document.forms[0];
|
||||
s = f[m + '_panel_searchstring'].value;
|
||||
@@ -47,7 +52,7 @@ var SearchReplaceDialog = {
|
||||
rs = f['replace_panel_replacestring'].value;
|
||||
|
||||
if (tinymce.isIE) {
|
||||
r = ed.getDoc().selection.createRange();
|
||||
r = createTextRange();
|
||||
}
|
||||
|
||||
if (s == '')
|
||||
@@ -77,7 +82,7 @@ var SearchReplaceDialog = {
|
||||
|
||||
if (tinymce.isIE) {
|
||||
ed.focus();
|
||||
r = ed.getDoc().selection.createRange();
|
||||
r = createTextRange();
|
||||
|
||||
while (r.findText(s, b ? -1 : 1, fl)) {
|
||||
r.scrollIntoView();
|
||||
@@ -87,6 +92,10 @@ var SearchReplaceDialog = {
|
||||
|
||||
if (b) {
|
||||
r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
|
||||
} else {
|
||||
// to avoid looping for ever in MSIE 9/10 when just
|
||||
// changing the case
|
||||
r.moveStart("character", rs.length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +130,7 @@ var SearchReplaceDialog = {
|
||||
|
||||
if (tinymce.isIE) {
|
||||
ed.focus();
|
||||
r = ed.getDoc().selection.createRange();
|
||||
r = createTextRange();
|
||||
|
||||
if (r.findText(s, b ? -1 : 1, fl)) {
|
||||
r.scrollIntoView();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -126,6 +126,7 @@
|
||||
|
||||
c.onRenderMenu.add(function(c, m) {
|
||||
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
t.menuItems = {};
|
||||
each(t.languages, function(v, k) {
|
||||
var o = {icon : 1}, mi;
|
||||
|
||||
@@ -133,27 +134,60 @@
|
||||
if (v == t.selectedLang) {
|
||||
return;
|
||||
}
|
||||
mi.setSelected(1);
|
||||
t.selectedItem.setSelected(0);
|
||||
t.selectedItem = mi;
|
||||
t._updateMenu(mi);
|
||||
t.selectedLang = v;
|
||||
};
|
||||
|
||||
o.title = k;
|
||||
mi = m.add(o);
|
||||
mi.setSelected(v == t.selectedLang);
|
||||
|
||||
t.menuItems[v] = mi;
|
||||
if (v == t.selectedLang)
|
||||
t.selectedItem = mi;
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
},
|
||||
|
||||
setLanguage: function(lang) {
|
||||
var t = this;
|
||||
|
||||
if (lang == t.selectedLang) {
|
||||
// allowed
|
||||
return;
|
||||
}
|
||||
|
||||
if (tinymce.grep(t.languages, function(v) { return v === lang; }).length === 0) {
|
||||
throw "Unknown language: " + lang;
|
||||
}
|
||||
|
||||
t.selectedLang = lang;
|
||||
|
||||
// if the menu has been shown, update it as well
|
||||
if (t.menuItems) {
|
||||
t._updateMenu(t.menuItems[lang]);
|
||||
}
|
||||
|
||||
if (t.active) {
|
||||
// clear error in the old language.
|
||||
t._done();
|
||||
|
||||
// Don't immediately block the UI to check spelling in the new language, this is an API not a user action.
|
||||
}
|
||||
},
|
||||
|
||||
// Internal functions
|
||||
|
||||
_updateMenu: function(mi) {
|
||||
mi.setSelected(1);
|
||||
this.selectedItem.setSelected(0);
|
||||
this.selectedItem = mi;
|
||||
},
|
||||
|
||||
_walk : function(n, f) {
|
||||
var d = this.editor.getDoc(), w;
|
||||
|
||||
@@ -235,6 +269,7 @@
|
||||
each(nl, function(n) {
|
||||
var node, elem, txt, pos, v = n.nodeValue;
|
||||
|
||||
rx.lastIndex = 0;
|
||||
if (rx.test(v)) {
|
||||
// Encode the content
|
||||
v = dom.encode(v);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<option value="right">{#table_dlg.align_right}</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
|
||||
<td><label for="celltype">{#table_dlg.cell_type}</label></td>
|
||||
<td>
|
||||
<select id="celltype" name="celltype">
|
||||
@@ -76,7 +76,6 @@
|
||||
<td><label for="height">{#table_dlg.height}</label></td>
|
||||
<td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
|
||||
</tr>
|
||||
|
||||
<tr id="styleSelectRow">
|
||||
<td><label for="class">{#class_name}</label></td>
|
||||
<td colspan="3">
|
||||
@@ -95,8 +94,8 @@
|
||||
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -105,25 +104,25 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
@@ -131,11 +130,11 @@
|
||||
<td id="backgroundimagebrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr role="group" aria-labelledby="bordercolor_label">
|
||||
<td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
|
||||
<td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
|
||||
<td>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
@@ -143,11 +142,11 @@
|
||||
<td id="bordercolor_pickcontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr role="group" aria-labelledby="bgcolor_label">
|
||||
<td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
|
||||
<td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
|
||||
<td>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
@@ -155,7 +154,7 @@
|
||||
<td id="bgcolor_pickcontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#action {
|
||||
margin-bottom: 3px;
|
||||
margin-up: 3px;
|
||||
}
|
||||
|
||||
#class {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#action {
|
||||
margin-bottom: 3px;
|
||||
margin-up: 3px;
|
||||
}
|
||||
|
||||
#rowtype,#align,#valign,#class,#height {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,8 @@ function init() {
|
||||
|
||||
// Get table cell data
|
||||
var celltype = tdElm.nodeName.toLowerCase();
|
||||
var align = ed.dom.getAttrib(tdElm, 'align');
|
||||
var valign = ed.dom.getAttrib(tdElm, 'valign');
|
||||
var align = ed.dom.getAttrib(tdElm, 'align') || getStyle(tdElm, 'text-align');
|
||||
var valign = ed.dom.getAttrib(tdElm, 'valign') || getStyle(tdElm, 'vertical-align');
|
||||
var width = trimSize(getStyle(tdElm, 'width', 'width'));
|
||||
var height = trimSize(getStyle(tdElm, 'height', 'height'));
|
||||
var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
|
||||
@@ -201,8 +201,6 @@ function updateCell(td, skip_id) {
|
||||
if (!skip_id)
|
||||
dom.setAttrib(td, 'id', formObj.id.value);
|
||||
|
||||
dom.setAttrib(td, 'align', formObj.align.value);
|
||||
dom.setAttrib(td, 'vAlign', formObj.valign.value);
|
||||
dom.setAttrib(td, 'lang', formObj.lang.value);
|
||||
dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));
|
||||
dom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
|
||||
@@ -210,6 +208,8 @@ function updateCell(td, skip_id) {
|
||||
dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
|
||||
|
||||
// Clear deprecated attributes
|
||||
ed.dom.setAttrib(td, 'align', '');
|
||||
ed.dom.setAttrib(td, 'vAlign', '');
|
||||
ed.dom.setAttrib(td, 'width', '');
|
||||
ed.dom.setAttrib(td, 'height', '');
|
||||
ed.dom.setAttrib(td, 'bgColor', '');
|
||||
@@ -219,13 +219,9 @@ function updateCell(td, skip_id) {
|
||||
// Set styles
|
||||
td.style.width = getCSSSize(formObj.width.value);
|
||||
td.style.height = getCSSSize(formObj.height.value);
|
||||
if (formObj.bordercolor.value != "") {
|
||||
td.style.borderColor = formObj.bordercolor.value;
|
||||
td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
|
||||
td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
|
||||
} else
|
||||
td.style.borderColor = '';
|
||||
|
||||
td.style.textAlign = formObj.align.value;
|
||||
td.style.verticalAlign = formObj.valign.value;
|
||||
td.style.borderColor = formObj.bordercolor.value;
|
||||
td.style.backgroundColor = formObj.bgcolor.value;
|
||||
|
||||
if (formObj.backgroundimage.value != "")
|
||||
@@ -314,6 +310,12 @@ function changedStyle() {
|
||||
formObj.bordercolor.value = st['border-color'];
|
||||
updateColor('bordercolor_pick','bordercolor');
|
||||
}
|
||||
|
||||
if (st['text-align'])
|
||||
formObj.align.value = st['text-align'];
|
||||
|
||||
if (st['vertical-align'])
|
||||
formObj.valign.value = st['vertical-align'];
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user