Merged in bugfix/FBI-1646 (pull request #6209)
FBI-1646: Updates tinyMCE library from v3.5.7 to v.3.5.12 Approved-by: Rodrigo Quelca <rockoinfo@yahoo.com>
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)
|
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 --
|
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.
|
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.
|
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 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 of formatting options in various listboxes.
|
||||||
Added new preview_styles option that enables control over what gets previewed.
|
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 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 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.
|
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)
|
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.
|
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 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 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 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.
|
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.
|
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 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 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.
|
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.
|
Fix white space in between spans from being deleted.
|
||||||
Fixed bug where scrollbars where visible in the character map dialog on Gecko.
|
Fixed bug where scrollbars where visible in the character map dialog on Gecko.
|
||||||
Fixed issue with missing translation for one of the emoticons.
|
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.
|
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
|
This license, the Lesser General Public License, applies to some
|
||||||
specially designated software packages--typically libraries--of the
|
specially designated software packages--typically libraries--of the
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
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
|
this license or the ordinary General Public License is the better
|
||||||
strategy to use in any particular case, based on the explanations below.
|
strategy to use in any particular case, based on the explanations below.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
|
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
|
||||||
@@ -107,8 +107,8 @@
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Move the selection one character backwards.
|
// Move the selection one character backwards.
|
||||||
r.setStart(endContainer, end - 2);
|
r.setStart(endContainer, end >= 2 ? end - 2 : 0);
|
||||||
r.setEnd(endContainer, end - 1);
|
r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
|
||||||
end -= 1;
|
end -= 1;
|
||||||
|
|
||||||
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
// 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
|
* 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
|
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
||||||
* method can be used to create those.
|
* 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
|
// Private plugin internal methods
|
||||||
|
|
||||||
_htmlToData : function() {
|
_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) {
|
function getAttr(elm, name) {
|
||||||
var value = elm.attr(name);
|
var value = elm.attr(name);
|
||||||
|
|
||||||
return value || '';
|
return value || '';
|
||||||
};
|
}
|
||||||
|
|
||||||
// Default some values
|
// Default some values
|
||||||
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
||||||
@@ -67,14 +67,16 @@
|
|||||||
if (elm.type == 7) {
|
if (elm.type == 7) {
|
||||||
data.xml_pi = true;
|
data.xml_pi = true;
|
||||||
matches = /encoding="([^"]+)"/.exec(elm.value);
|
matches = /encoding="([^"]+)"/.exec(elm.value);
|
||||||
if (matches)
|
if (matches) {
|
||||||
data.docencoding = matches[1];
|
data.docencoding = matches[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse doctype
|
// Parse doctype
|
||||||
elm = headerFragment.getAll('#doctype')[0];
|
elm = headerFragment.getAll('#doctype')[0];
|
||||||
if (elm)
|
if (elm) {
|
||||||
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
||||||
|
}
|
||||||
|
|
||||||
// Parse title element
|
// Parse title element
|
||||||
elm = headerFragment.getAll('title')[0];
|
elm = headerFragment.getAll('title')[0];
|
||||||
@@ -86,25 +88,28 @@
|
|||||||
each(headerFragment.getAll('meta'), function(meta) {
|
each(headerFragment.getAll('meta'), function(meta) {
|
||||||
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
||||||
|
|
||||||
if (name)
|
if (name) {
|
||||||
data['meta' + name.toLowerCase()] = meta.attr('content');
|
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'));
|
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
||||||
|
|
||||||
if (matches)
|
if (matches) {
|
||||||
data.docencoding = matches[1];
|
data.docencoding = matches[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse html attribs
|
// Parse html attribs
|
||||||
elm = headerFragment.getAll('html')[0];
|
elm = headerFragment.getAll('html')[0];
|
||||||
if (elm)
|
if (elm) {
|
||||||
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
||||||
|
}
|
||||||
|
|
||||||
// Parse stylesheet
|
// Parse stylesheet
|
||||||
elm = headerFragment.getAll('link')[0];
|
elm = headerFragment.getAll('link')[0];
|
||||||
if (elm && elm.attr('rel') == 'stylesheet')
|
if (elm && elm.attr('rel') == 'stylesheet') {
|
||||||
data.stylesheet = elm.attr('href');
|
data.stylesheet = elm.attr('href');
|
||||||
|
}
|
||||||
|
|
||||||
// Parse body parts
|
// Parse body parts
|
||||||
elm = headerFragment.getAll('body')[0];
|
elm = headerFragment.getAll('body')[0];
|
||||||
@@ -124,14 +129,15 @@
|
|||||||
|
|
||||||
function setAttr(elm, name, value) {
|
function setAttr(elm, name, value) {
|
||||||
elm.attr(name, value ? value : undefined);
|
elm.attr(name, value ? value : undefined);
|
||||||
};
|
}
|
||||||
|
|
||||||
function addHeadNode(node) {
|
function addHeadNode(node) {
|
||||||
if (headElement.firstChild)
|
if (headElement.firstChild) {
|
||||||
headElement.insert(node, headElement.firstChild);
|
headElement.insert(node, headElement.firstChild);
|
||||||
else
|
} else {
|
||||||
headElement.append(node);
|
headElement.append(node);
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
headerFragment = this._parseHeader();
|
headerFragment = this._parseHeader();
|
||||||
headElement = headerFragment.getAll('head')[0];
|
headElement = headerFragment.getAll('head')[0];
|
||||||
@@ -139,10 +145,11 @@
|
|||||||
elm = headerFragment.getAll('html')[0];
|
elm = headerFragment.getAll('html')[0];
|
||||||
headElement = new Node('head', 1);
|
headElement = new Node('head', 1);
|
||||||
|
|
||||||
if (elm.firstChild)
|
if (elm.firstChild) {
|
||||||
elm.insert(headElement, elm.firstChild, true);
|
elm.insert(headElement, elm.firstChild, true);
|
||||||
else
|
} else {
|
||||||
elm.append(headElement);
|
elm.append(headElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/update/remove XML-PI
|
// Add/update/remove XML-PI
|
||||||
@@ -150,8 +157,9 @@
|
|||||||
if (data.xml_pi) {
|
if (data.xml_pi) {
|
||||||
value = 'version="1.0"';
|
value = 'version="1.0"';
|
||||||
|
|
||||||
if (data.docencoding)
|
if (data.docencoding) {
|
||||||
value += ' encoding="' + data.docencoding + '"';
|
value += ' encoding="' + data.docencoding + '"';
|
||||||
|
}
|
||||||
|
|
||||||
if (elm.type != 7) {
|
if (elm.type != 7) {
|
||||||
elm = new Node('xml', 7);
|
elm = new Node('xml', 7);
|
||||||
@@ -159,8 +167,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
elm.value = value;
|
elm.value = value;
|
||||||
} else if (elm && elm.type == 7)
|
} else if (elm && elm.type == 7) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
|
}
|
||||||
|
|
||||||
// Add/update/remove doctype
|
// Add/update/remove doctype
|
||||||
elm = headerFragment.getAll('#doctype')[0];
|
elm = headerFragment.getAll('#doctype')[0];
|
||||||
@@ -168,15 +177,17 @@
|
|||||||
if (!elm) {
|
if (!elm) {
|
||||||
elm = new Node('#doctype', 10);
|
elm = new Node('#doctype', 10);
|
||||||
|
|
||||||
if (data.xml_pi)
|
if (data.xml_pi) {
|
||||||
headerFragment.insert(elm, headerFragment.firstChild);
|
headerFragment.insert(elm, headerFragment.firstChild);
|
||||||
else
|
} else {
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
||||||
} else if (elm)
|
} else if (elm) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
|
}
|
||||||
|
|
||||||
// Add/update/remove title
|
// Add/update/remove title
|
||||||
elm = headerFragment.getAll('title')[0];
|
elm = headerFragment.getAll('title')[0];
|
||||||
@@ -192,8 +203,9 @@
|
|||||||
if (data.docencoding) {
|
if (data.docencoding) {
|
||||||
elm = null;
|
elm = null;
|
||||||
each(headerFragment.getAll('meta'), function(meta) {
|
each(headerFragment.getAll('meta'), function(meta) {
|
||||||
if (meta.attr('http-equiv') == 'Content-Type')
|
if (meta.attr('http-equiv') == 'Content-Type') {
|
||||||
elm = meta;
|
elm = meta;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!elm) {
|
if (!elm) {
|
||||||
@@ -214,10 +226,11 @@
|
|||||||
meta = nodes[i];
|
meta = nodes[i];
|
||||||
|
|
||||||
if (meta.attr('name') == name) {
|
if (meta.attr('name') == name) {
|
||||||
if (value)
|
if (value) {
|
||||||
meta.attr('content', value);
|
meta.attr('content', value);
|
||||||
else
|
} else {
|
||||||
meta.remove();
|
meta.remove();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -236,10 +249,11 @@
|
|||||||
// Add/update/delete link
|
// Add/update/delete link
|
||||||
elm = headerFragment.getAll('link')[0];
|
elm = headerFragment.getAll('link')[0];
|
||||||
if (elm && elm.attr('rel') == 'stylesheet') {
|
if (elm && elm.attr('rel') == 'stylesheet') {
|
||||||
if (data.stylesheet)
|
if (data.stylesheet) {
|
||||||
elm.attr('href', data.stylesheet);
|
elm.attr('href', data.stylesheet);
|
||||||
else
|
} else {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
|
}
|
||||||
} else if (data.stylesheet) {
|
} else if (data.stylesheet) {
|
||||||
elm = new Node('link', 1);
|
elm = new Node('link', 1);
|
||||||
elm.attr({
|
elm.attr({
|
||||||
@@ -304,15 +318,17 @@
|
|||||||
function low(s) {
|
function low(s) {
|
||||||
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
||||||
return a.toLowerCase();
|
return a.toLowerCase();
|
||||||
})
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
// 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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
|
if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Parse out head, body and footer
|
// Parse out head, body and footer
|
||||||
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
||||||
@@ -323,8 +339,9 @@
|
|||||||
self.head = low(content.substring(0, startPos + 1));
|
self.head = low(content.substring(0, startPos + 1));
|
||||||
|
|
||||||
endPos = content.indexOf('</body', startPos);
|
endPos = content.indexOf('</body', startPos);
|
||||||
if (endPos == -1)
|
if (endPos == -1) {
|
||||||
endPos = content.length;
|
endPos = content.length;
|
||||||
|
}
|
||||||
|
|
||||||
o.content = content.substring(startPos + 1, endPos);
|
o.content = content.substring(startPos + 1, endPos);
|
||||||
self.foot = low(content.substring(endPos));
|
self.foot = low(content.substring(endPos));
|
||||||
@@ -336,8 +353,9 @@
|
|||||||
// Parse header and update iframe
|
// Parse header and update iframe
|
||||||
headerFragment = self._parseHeader();
|
headerFragment = self._parseHeader();
|
||||||
each(headerFragment.getAll('style'), function(node) {
|
each(headerFragment.getAll('style'), function(node) {
|
||||||
if (node.firstChild)
|
if (node.firstChild) {
|
||||||
styles += node.firstChild.value;
|
styles += node.firstChild.value;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
elm = headerFragment.getAll('body')[0];
|
elm = headerFragment.getAll('body')[0];
|
||||||
@@ -358,34 +376,41 @@
|
|||||||
|
|
||||||
// Needed for IE 6/7
|
// Needed for IE 6/7
|
||||||
elm = dom.get('fullpage_styles');
|
elm = dom.get('fullpage_styles');
|
||||||
if (elm.styleSheet)
|
if (elm.styleSheet) {
|
||||||
elm.styleSheet.cssText = styles;
|
elm.styleSheet.cssText = styles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_getDefaultHeader : function() {
|
_getDefaultHeader : function() {
|
||||||
var header = '', editor = this.editor, value, styles = '';
|
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 += '<?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 += 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';
|
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';
|
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';
|
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 + ';';
|
styles += 'font-family: ' + value + ';';
|
||||||
|
}
|
||||||
|
|
||||||
if (value = editor.getParam('fullpage_default_font_size'))
|
if (value = editor.getParam('fullpage_default_font_size')) {
|
||||||
styles += 'font-size: ' + value + ';';
|
styles += 'font-size: ' + value + ';';
|
||||||
|
}
|
||||||
|
|
||||||
if (value = editor.getParam('fullpage_default_text_color'))
|
if (value = editor.getParam('fullpage_default_text_color')) {
|
||||||
styles += 'color: ' + value + ';';
|
styles += 'color: ' + value + ';';
|
||||||
|
}
|
||||||
|
|
||||||
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
||||||
|
|
||||||
@@ -395,8 +420,9 @@
|
|||||||
_getContent : function(ed, o) {
|
_getContent : function(ed, o) {
|
||||||
var self = this;
|
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);
|
o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
tinyMCEPopup.requireLangPack();
|
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 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 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">,' +
|
'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 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">';
|
'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,' +
|
'Western european (iso-8859-1)=iso-8859-1,' +
|
||||||
'Central European (iso-8859-2)=iso-8859-2,' +
|
'Central European (iso-8859-2)=iso-8859-2,' +
|
||||||
'Unicode (UTF-8)=utf-8,' +
|
'Unicode (UTF-8)=utf-8,' +
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
||||||
'ASCII (us-ascii)=us-ascii';
|
'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';
|
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
|
||||||
|
|
||||||
function setVal(id, value) {
|
function setVal(id, value) {
|
||||||
@@ -40,26 +40,29 @@
|
|||||||
if (elm) {
|
if (elm) {
|
||||||
value = value || '';
|
value = value || '';
|
||||||
|
|
||||||
if (elm.nodeName == "SELECT")
|
if (elm.nodeName == "SELECT") {
|
||||||
selectByValue(document.forms[0], id, value);
|
selectByValue(document.forms[0], id, value);
|
||||||
else if (elm.type == "checkbox")
|
} else if (elm.type == "checkbox") {
|
||||||
elm.checked = !!value;
|
elm.checked = !!value;
|
||||||
else
|
} else {
|
||||||
elm.value = value;
|
elm.value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function getVal(id) {
|
function getVal(id) {
|
||||||
var elm = document.getElementById(id);
|
var elm = document.getElementById(id);
|
||||||
|
|
||||||
if (elm.nodeName == "SELECT")
|
if (elm.nodeName == "SELECT") {
|
||||||
return elm.options[elm.selectedIndex].value;
|
return elm.options[elm.selectedIndex].value;
|
||||||
|
}
|
||||||
|
|
||||||
if (elm.type == "checkbox")
|
if (elm.type == "checkbox") {
|
||||||
return elm.checked;
|
return elm.checked;
|
||||||
|
}
|
||||||
|
|
||||||
return elm.value;
|
return elm.value;
|
||||||
};
|
}
|
||||||
|
|
||||||
window.FullPageDialog = {
|
window.FullPageDialog = {
|
||||||
changedStyle : function() {
|
changedStyle : function() {
|
||||||
@@ -69,10 +72,11 @@
|
|||||||
setVal('fontsize', styles['font-size']);
|
setVal('fontsize', styles['font-size']);
|
||||||
setVal('textcolor', styles['color']);
|
setVal('textcolor', styles['color']);
|
||||||
|
|
||||||
if (val = styles['background-image'])
|
if (val = styles['background-image']) {
|
||||||
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
||||||
else
|
} else {
|
||||||
setVal('bgimage', '');
|
setVal('bgimage', '');
|
||||||
|
}
|
||||||
|
|
||||||
setVal('bgcolor', styles['background-color']);
|
setVal('bgcolor', styles['background-color']);
|
||||||
|
|
||||||
@@ -91,17 +95,21 @@
|
|||||||
styles['margin-left'] = val[3] || val[0] || '';
|
styles['margin-left'] = val[3] || val[0] || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val = styles['margin-top'])
|
if (val = styles['margin-top']) {
|
||||||
setVal('topmargin', val.replace(/px/, ''));
|
setVal('topmargin', val.replace(/px/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (val = styles['margin-right'])
|
if (val = styles['margin-right']) {
|
||||||
setVal('rightmargin', val.replace(/px/, ''));
|
setVal('rightmargin', val.replace(/px/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (val = styles['margin-bottom'])
|
if (val = styles['margin-bottom']) {
|
||||||
setVal('bottommargin', val.replace(/px/, ''));
|
setVal('bottommargin', val.replace(/px/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (val = styles['margin-left'])
|
if (val = styles['margin-left']) {
|
||||||
setVal('leftmargin', val.replace(/px/, ''));
|
setVal('leftmargin', val.replace(/px/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
updateColor('bgcolor_pick', 'bgcolor');
|
updateColor('bgcolor_pick', 'bgcolor');
|
||||||
updateColor('textcolor_pick', 'textcolor');
|
updateColor('textcolor_pick', 'textcolor');
|
||||||
@@ -109,7 +117,7 @@
|
|||||||
|
|
||||||
changedStyleProp : function() {
|
changedStyleProp : function() {
|
||||||
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
||||||
|
|
||||||
styles['font-face'] = getVal('fontface');
|
styles['font-face'] = getVal('fontface');
|
||||||
styles['font-size'] = getVal('fontsize');
|
styles['font-size'] = getVal('fontsize');
|
||||||
styles['color'] = getVal('textcolor');
|
styles['color'] = getVal('textcolor');
|
||||||
@@ -146,7 +154,7 @@
|
|||||||
setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
|
setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
|
||||||
this.changedStyle();
|
this.changedStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
update : function() {
|
update : function() {
|
||||||
var data = {};
|
var data = {};
|
||||||
|
|
||||||
@@ -158,7 +166,7 @@
|
|||||||
tinyMCEPopup.close();
|
tinyMCEPopup.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
|
var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
|
(function(){var b=tinymce.DOM;var a=function(d,f,e){var c=function(g){var i=d.controlManager.get(g);var h=f.controlManager.get(g);if(i&&h){h.displayColor(i.value)}};c("forecolor");c("backcolor");f.setContent(d.getContent({format:"raw"}),{format:"raw"});f.selection.moveToBookmark(e);if(d.plugins.spellchecker&&f.plugins.spellchecker){f.plugins.spellchecker.setLanguage(d.plugins.spellchecker.selectedLang)}};tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(i,c){var l=this,m={},k=b.doc.documentElement,d,o,h,g,f,e,j;i.addCommand("mceFullScreen",function(){var q,r;if(i.getParam("fullscreen_is_enabled")){if(i.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){var t=i;var s=tinyMCE.get(t.getParam("fullscreen_editor_id"));s.plugins.fullscreen.saveState(t);tinyMCE.remove(t)},10)}return}if(i.getParam("fullscreen_new_window")){l.fullscreenSettings={bookmark:i.selection.getBookmark()};q=b.win.open(c+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{q.resizeTo(screen.availWidth,screen.availHeight)}catch(p){}}else{o=b.getStyle(b.doc.body,"overflow",1)||"auto";h=b.getStyle(k,"overflow",1);d=b.getViewPort();g=d.x;f=d.y;if(tinymce.isOpera&&o=="visible"){o="auto"}if(tinymce.isIE&&o=="scroll"){o="auto"}if(tinymce.isIE&&(h=="visible"||h=="scroll")){h="auto"}if(o=="0px"){o=""}b.setStyle(b.doc.body,"overflow","hidden");k.style.overflow="hidden";d=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){d.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){e="absolute;top:"+d.y}else{e="fixed;top:0"}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+e+";left:0;width:"+d.w+"px;height:"+d.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(i.settings,function(s,t){m[t]=s});m.id="mce_fullscreen";m.width=n.clientWidth;m.height=n.clientHeight-15;m.fullscreen_is_enabled=true;m.fullscreen_editor_id=i.id;m.theme_advanced_resizing=false;m.save_onsavecallback=function(){i.setContent(tinyMCE.get(m.id).getContent());i.execCommand("mceSave")};tinymce.each(i.getParam("fullscreen_settings"),function(t,s){m[s]=t});l.fullscreenSettings={bookmark:i.selection.getBookmark(),fullscreen_overflow:o,fullscreen_html_overflow:h,fullscreen_scrollx:g,fullscreen_scrolly:f};if(m.theme_advanced_toolbar_location==="external"){m.theme_advanced_toolbar_location="top"}tinyMCE.oldSettings=tinyMCE.settings;l.fullscreenEditor=new tinymce.Editor("mce_fullscreen",m);l.fullscreenEditor.onInit.add(function(){l.loadState(l.fullscreenEditor)});l.fullscreenEditor.render();l.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");l.fullscreenElement.update();l.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var v=tinymce.DOM.getViewPort(),t=l.fullscreenEditor,s,u;s=t.dom.getSize(t.getContainer().getElementsByTagName("table")[0]);u=t.dom.getSize(t.getContainer().getElementsByTagName("iframe")[0]);t.theme.resizeTo(v.w-s.w+u.w,v.h-s.h+u.h)})}});i.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});i.onNodeChange.add(function(q,p){p.setActive("fullscreen",q.getParam("fullscreen_is_enabled"))});l.loadState=function(p){if(!(p&&l.fullscreenSettings)){throw"No fullscreen editor to load to"}a(i,p,l.fullscreenSettings.bookmark);p.focus()};l.saveState=function(q){if(!(q&&l.fullscreenSettings)){throw"No fullscreen editor to restore from"}var p=l.fullscreenSettings;a(q,i,q.selection.getBookmark());if(!i.getParam("fullscreen_new_window")){tinymce.dom.Event.remove(b.win,"resize",l.resizeFunc);delete l.resizeFunc;b.remove("mce_fullscreen_container");b.doc.documentElement.style.overflow=p.fullscreen_html_overflow;b.setStyle(b.doc.body,"overflow",p.fullscreen_overflow);b.win.scrollTo(p.fullscreen_scrollx,p.fullscreen_scrolly)}tinyMCE.settings=tinyMCE.oldSettings;delete tinyMCE.oldSettings;delete l.fullscreenEditor;delete l.fullscreenElement;delete l.fullscreenSettings;b.win.setTimeout(function(){i.selection.moveToBookmark(j);i.focus()},10)}},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
|
||||||
@@ -11,29 +11,48 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var DOM = tinymce.DOM;
|
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', {
|
tinymce.create('tinymce.plugins.FullScreenPlugin', {
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
var t = this, s = {}, vp, posCss;
|
var t = this, s = {}, de = DOM.doc.documentElement, vp, fullscreen_overflow, fullscreen_html_overflow, fullscreen_scrollx, fullscreen_scrolly, posCss, bookmark;
|
||||||
|
|
||||||
t.editor = ed;
|
|
||||||
|
|
||||||
// Register commands
|
// Register commands
|
||||||
ed.addCommand('mceFullScreen', function() {
|
ed.addCommand('mceFullScreen', function() {
|
||||||
var win, de = DOM.doc.documentElement;
|
var win, oed;
|
||||||
|
|
||||||
if (ed.getParam('fullscreen_is_enabled')) {
|
if (ed.getParam('fullscreen_is_enabled')) {
|
||||||
if (ed.getParam('fullscreen_new_window'))
|
if (ed.getParam('fullscreen_new_window'))
|
||||||
closeFullscreen(); // Call to close in new window
|
closeFullscreen(); // Call to close in fullscreen.htm
|
||||||
else {
|
else {
|
||||||
DOM.win.setTimeout(function() {
|
DOM.win.setTimeout(function() {
|
||||||
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
var fullscreenEditor = ed;
|
||||||
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
|
|
||||||
tinyMCE.remove(ed);
|
// find the editor that opened this one, execute restore function there
|
||||||
DOM.remove('mce_fullscreen_container');
|
var originalEditor = tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));
|
||||||
de.style.overflow = ed.getParam('fullscreen_html_overflow');
|
originalEditor.plugins.fullscreen.saveState(fullscreenEditor);
|
||||||
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
|
|
||||||
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
|
tinyMCE.remove(fullscreenEditor);
|
||||||
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +60,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ed.getParam('fullscreen_new_window')) {
|
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);
|
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 {
|
try {
|
||||||
win.resizeTo(screen.availWidth, screen.availHeight);
|
win.resizeTo(screen.availWidth, screen.availHeight);
|
||||||
@@ -48,27 +70,26 @@
|
|||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
|
fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
||||||
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
||||||
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
|
||||||
vp = DOM.getViewPort();
|
vp = DOM.getViewPort();
|
||||||
s.fullscreen_scrollx = vp.x;
|
fullscreen_scrollx = vp.x;
|
||||||
s.fullscreen_scrolly = vp.y;
|
fullscreen_scrolly = vp.y;
|
||||||
|
|
||||||
// Fixes an Opera bug where the scrollbars doesn't reappear
|
// Fixes an Opera bug where the scrollbars doesn't reappear
|
||||||
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
|
if (tinymce.isOpera && fullscreen_overflow == 'visible')
|
||||||
s.fullscreen_overflow = 'auto';
|
fullscreen_overflow = 'auto';
|
||||||
|
|
||||||
// Fixes an IE bug where horizontal scrollbars would appear
|
// Fixes an IE bug where horizontal scrollbars would appear
|
||||||
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
|
if (tinymce.isIE && fullscreen_overflow == 'scroll')
|
||||||
s.fullscreen_overflow = 'auto';
|
fullscreen_overflow = 'auto';
|
||||||
|
|
||||||
// Fixes an IE bug where the scrollbars doesn't reappear
|
// Fixes an IE bug where the scrollbars doesn't reappear
|
||||||
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
if (tinymce.isIE && (fullscreen_html_overflow == 'visible' || fullscreen_html_overflow == 'scroll'))
|
||||||
s.fullscreen_html_overflow = 'auto';
|
fullscreen_html_overflow = 'auto';
|
||||||
|
|
||||||
if (s.fullscreen_overflow == '0px')
|
if (fullscreen_overflow == '0px')
|
||||||
s.fullscreen_overflow = '';
|
fullscreen_overflow = '';
|
||||||
|
|
||||||
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
||||||
de.style.overflow = 'hidden'; //Fix for IE6/7
|
de.style.overflow = 'hidden'; //Fix for IE6/7
|
||||||
@@ -108,13 +129,21 @@
|
|||||||
s[k] = v;
|
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')
|
if (s.theme_advanced_toolbar_location === 'external')
|
||||||
s.theme_advanced_toolbar_location = 'top';
|
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 = new tinymce.Editor('mce_fullscreen', s);
|
||||||
t.fullscreenEditor.onInit.add(function() {
|
t.fullscreenEditor.onInit.add(function() {
|
||||||
t.fullscreenEditor.setContent(ed.getContent());
|
t.loadState(t.fullscreenEditor);
|
||||||
t.fullscreenEditor.focus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
t.fullscreenEditor.render();
|
t.fullscreenEditor.render();
|
||||||
@@ -141,6 +170,52 @@
|
|||||||
ed.onNodeChange.add(function(ed, cm) {
|
ed.onNodeChange.add(function(ed, cm) {
|
||||||
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
|
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() {
|
getInfo : function() {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
settings['strict_loading_mode'] = true;
|
settings['strict_loading_mode'] = true;
|
||||||
|
|
||||||
settings.save_onsavecallback = function() {
|
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.opener.tinyMCE.get(oeID).execCommand('mceSave');
|
||||||
window.close();
|
window.close();
|
||||||
};
|
};
|
||||||
@@ -56,11 +56,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function moveContent() {
|
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() {
|
function closeFullscreen() {
|
||||||
moveContent();
|
// moveContent() will be called by the unload handler
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,17 +82,20 @@
|
|||||||
function render() {
|
function render() {
|
||||||
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
|
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
|
||||||
|
|
||||||
e.value = window.opener.tinyMCE.get(oeID).getContent();
|
|
||||||
|
|
||||||
vp = dom.getViewPort();
|
vp = dom.getViewPort();
|
||||||
settings.width = vp.w;
|
settings.width = vp.w;
|
||||||
settings.height = vp.h - 15;
|
settings.height = vp.h - 15;
|
||||||
|
|
||||||
tinymce.dom.Event.add(window, 'resize', function() {
|
settings.oninit = function() {
|
||||||
var vp = dom.getViewPort();
|
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);
|
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')) {
|
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
|
||||||
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only store selection if the type is a normal window
|
// Only store selection if the type is a normal window
|
||||||
if (!f.type)
|
if (!f.type)
|
||||||
t.bookmark = ed.selection.getBookmark(1);
|
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();
|
vp = DOM.getViewPort();
|
||||||
f.width = parseInt(f.width || 320);
|
f.width = parseInt(f.width || 320);
|
||||||
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
||||||
@@ -111,17 +111,17 @@
|
|||||||
opt += ' mceMovable';
|
opt += ' mceMovable';
|
||||||
|
|
||||||
// Create DOM objects
|
// Create DOM objects
|
||||||
t._addAll(DOM.doc.body,
|
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, 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 + '_wrapper', 'class' : 'mceWrapper' + opt},
|
||||||
['div', {id : id + '_top', 'class' : 'mceTop'},
|
['div', {id : id + '_top', 'class' : 'mceTop'},
|
||||||
['div', {'class' : 'mceLeft'}],
|
['div', {'class' : 'mceLeft'}],
|
||||||
['div', {'class' : 'mceCenter'}],
|
['div', {'class' : 'mceCenter'}],
|
||||||
['div', {'class' : 'mceRight'}],
|
['div', {'class' : 'mceRight'}],
|
||||||
['span', {id : id + '_title'}, f.title || '']
|
['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'}],
|
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
|
||||||
['span', {id : id + '_content'}],
|
['span', {id : id + '_content'}],
|
||||||
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
||||||
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
||||||
|
|
||||||
Event.add(id, 'keyup', function(evt) {
|
Event.add(id, 'keyup', function(evt) {
|
||||||
var VK_ESCAPE = 27;
|
var VK_ESCAPE = 27;
|
||||||
if (evt.keyCode === VK_ESCAPE) {
|
if (evt.keyCode === VK_ESCAPE) {
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure the tab order loops within the dialog.
|
// Make sure the tab order loops within the dialog.
|
||||||
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
||||||
var iframe = DOM.get(id + '_ifr');
|
var iframe = DOM.get(id + '_ifr');
|
||||||
@@ -284,7 +284,7 @@
|
|||||||
DOM.get(id + '_ok').focus();
|
DOM.get(id + '_ok').focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add window
|
// Add window
|
||||||
w = t.windows[id] = {
|
w = t.windows[id] = {
|
||||||
id : id,
|
id : id,
|
||||||
@@ -341,7 +341,7 @@
|
|||||||
DOM.removeClass(t.lastId, 'mceFocus');
|
DOM.removeClass(t.lastId, 'mceFocus');
|
||||||
DOM.addClass(id, 'mceFocus');
|
DOM.addClass(id, 'mceFocus');
|
||||||
t.lastId = id;
|
t.lastId = id;
|
||||||
|
|
||||||
if (w.focussedElement) {
|
if (w.focussedElement) {
|
||||||
w.focussedElement.focus();
|
w.focussedElement.focus();
|
||||||
} else if (DOM.get(id + '_ok')) {
|
} else if (DOM.get(id + '_ok')) {
|
||||||
@@ -486,7 +486,7 @@
|
|||||||
|
|
||||||
dw = v;
|
dw = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dh < (v = w.features.min_height - sz.h)) {
|
if (dh < (v = w.features.min_height - sz.h)) {
|
||||||
if (dy !== 0)
|
if (dy !== 0)
|
||||||
dy += dh - v;
|
dy += dh - v;
|
||||||
@@ -505,7 +505,7 @@
|
|||||||
if (dx + dy !== 0) {
|
if (dx + dy !== 0) {
|
||||||
if (sx + dx < 0)
|
if (sx + dx < 0)
|
||||||
dx = 0;
|
dx = 0;
|
||||||
|
|
||||||
if (sy + dy < 0)
|
if (sy + dy < 0)
|
||||||
dy = 0;
|
dy = 0;
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@
|
|||||||
t.focus(fw.id);
|
t.focus(fw.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Find front most window
|
// Find front most window
|
||||||
_frontWindow : function() {
|
_frontWindow : function() {
|
||||||
var fw, ix = 0;
|
var fw, ix = 0;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -9,8 +9,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
|
var subRootAttributes = tinymce.explode('id,name,style,align,class,hspace,vspace,bgcolor,type'), subExcludedAttrs = tinymce.makeMap(subRootAttributes.join(',')),
|
||||||
mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
|
rootAttributes = subRootAttributes.concat(tinymce.explode('width, height')), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
|
||||||
|
mediaTypes, scriptRegExp, JSON = tinymce.util.JSON;
|
||||||
|
|
||||||
// Media types supported by this plugin
|
// Media types supported by this plugin
|
||||||
mediaTypes = [
|
mediaTypes = [
|
||||||
@@ -25,7 +26,8 @@
|
|||||||
["Iframe"],
|
["Iframe"],
|
||||||
["Video"],
|
["Video"],
|
||||||
["EmbeddedAudio"],
|
["EmbeddedAudio"],
|
||||||
["Audio"]
|
["Audio"],
|
||||||
|
["Object"]
|
||||||
];
|
];
|
||||||
|
|
||||||
function normalizeSize(size) {
|
function normalizeSize(size) {
|
||||||
@@ -33,23 +35,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toArray(obj) {
|
function toArray(obj) {
|
||||||
var undef, out, i;
|
var out, i;
|
||||||
|
|
||||||
if (obj && !obj.splice) {
|
if (obj && !obj.splice) {
|
||||||
out = [];
|
out = [];
|
||||||
|
|
||||||
for (i = 0; true; i++) {
|
for (i = 0; true; i++) {
|
||||||
if (obj[i])
|
if (obj[i]) {
|
||||||
out[i] = obj[i];
|
out[i] = obj[i];
|
||||||
else
|
} else {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
};
|
}
|
||||||
|
|
||||||
tinymce.create('tinymce.plugins.MediaPlugin', {
|
tinymce.create('tinymce.plugins.MediaPlugin', {
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
@@ -57,7 +56,7 @@
|
|||||||
|
|
||||||
function isMediaImg(node) {
|
function isMediaImg(node) {
|
||||||
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
||||||
};
|
}
|
||||||
|
|
||||||
self.editor = ed;
|
self.editor = ed;
|
||||||
self.url = url;
|
self.url = url;
|
||||||
@@ -74,11 +73,13 @@
|
|||||||
codebase : mediaTypes[i][3]
|
codebase : mediaTypes[i][3]
|
||||||
};
|
};
|
||||||
|
|
||||||
for (y = 0; y < item.clsids.length; y++)
|
for (y = 0; y < item.clsids.length; y++) {
|
||||||
lookup['clsid:' + item.clsids[y]] = item;
|
lookup['clsid:' + item.clsids[y]] = item;
|
||||||
|
}
|
||||||
|
|
||||||
for (y = 0; y < item.mimes.length; y++)
|
for (y = 0; y < item.mimes.length; y++) {
|
||||||
lookup[item.mimes[y]] = item;
|
lookup[item.mimes[y]] = item;
|
||||||
|
}
|
||||||
|
|
||||||
lookup['mceItem' + name] = item;
|
lookup['mceItem' + name] = item;
|
||||||
lookup[name.toLowerCase()] = item;
|
lookup[name.toLowerCase()] = item;
|
||||||
@@ -106,8 +107,9 @@
|
|||||||
for (i = 0; i < extensions.length; i++) {
|
for (i = 0; i < extensions.length; i++) {
|
||||||
type = lookup[item[0].toLowerCase()];
|
type = lookup[item[0].toLowerCase()];
|
||||||
|
|
||||||
if (type)
|
if (type) {
|
||||||
lookup[extensions[i]] = type;
|
lookup[extensions[i]] = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,8 +124,9 @@
|
|||||||
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
||||||
var i = nodes.length;
|
var i = nodes.length;
|
||||||
|
|
||||||
while (i--)
|
while (i--) {
|
||||||
self.objectToImg(nodes[i]);
|
self.objectToImg(nodes[i]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Convert image placeholders to video elements
|
// Convert image placeholders to video elements
|
||||||
@@ -132,8 +135,9 @@
|
|||||||
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
node = nodes[i];
|
node = nodes[i];
|
||||||
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
|
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1) {
|
||||||
self.imgToObject(node, args);
|
self.imgToObject(node, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -142,16 +146,18 @@
|
|||||||
// Display "media" instead of "img" in element path
|
// Display "media" instead of "img" in element path
|
||||||
if (ed.theme && ed.theme.onResolveName) {
|
if (ed.theme && ed.theme.onResolveName) {
|
||||||
ed.theme.onResolveName.add(function(theme, path_object) {
|
ed.theme.onResolveName.add(function(theme, path_object) {
|
||||||
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
|
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia')) {
|
||||||
path_object.name = 'media';
|
path_object.name = 'media';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add contect menu if it's loaded
|
// Add contect menu if it's loaded
|
||||||
if (ed && ed.plugins.contextmenu) {
|
if (ed && ed.plugins.contextmenu) {
|
||||||
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
||||||
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
|
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1) {
|
||||||
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -170,8 +176,9 @@
|
|||||||
tinymce.each(rootAttributes, function(name) {
|
tinymce.each(rootAttributes, function(name) {
|
||||||
var value = ed.dom.getAttrib(img, name);
|
var value = ed.dom.getAttrib(img, name);
|
||||||
|
|
||||||
if (value)
|
if (value) {
|
||||||
data[name] = value;
|
data[name] = value;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
data.type = self.getType(img.className).name.toLowerCase();
|
data.type = self.getType(img.className).name.toLowerCase();
|
||||||
@@ -211,11 +218,13 @@
|
|||||||
urlConverter = settings.url_converter,
|
urlConverter = settings.url_converter,
|
||||||
urlConverterScope = settings.url_converter_scope || self;
|
urlConverterScope = settings.url_converter_scope || self;
|
||||||
|
|
||||||
if (!url)
|
if (!url) {
|
||||||
return url;
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
if (force_absolute)
|
if (force_absolute) {
|
||||||
return editor.documentBaseURI.toAbsolute(url);
|
return editor.documentBaseURI.toAbsolute(url);
|
||||||
|
}
|
||||||
|
|
||||||
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
||||||
},
|
},
|
||||||
@@ -234,21 +243,24 @@
|
|||||||
* Converts the JSON data object to an img node.
|
* Converts the JSON data object to an img node.
|
||||||
*/
|
*/
|
||||||
dataToImg : function(data, force_absolute) {
|
dataToImg : function(data, force_absolute) {
|
||||||
var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
|
var self = this, sources, attrs, img, i;
|
||||||
|
|
||||||
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
||||||
|
|
||||||
attrs = data.video.attrs;
|
attrs = data.video.attrs;
|
||||||
if (attrs)
|
if (attrs) {
|
||||||
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
||||||
|
}
|
||||||
|
|
||||||
if (attrs)
|
if (attrs) {
|
||||||
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
||||||
|
}
|
||||||
|
|
||||||
sources = toArray(data.video.sources);
|
sources = toArray(data.video.sources);
|
||||||
if (sources) {
|
if (sources) {
|
||||||
for (i = 0; i < sources.length; i++)
|
for (i = 0; i < sources.length; i++) {
|
||||||
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img = self.editor.dom.create('img', {
|
img = self.editor.dom.create('img', {
|
||||||
@@ -298,8 +310,9 @@
|
|||||||
tinymce.each(rootAttributes, function(name) {
|
tinymce.each(rootAttributes, function(name) {
|
||||||
var value = img.attr(name);
|
var value = img.attr(name);
|
||||||
|
|
||||||
if (value)
|
if (value) {
|
||||||
data[name] = value;
|
data[name] = value;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,17 +334,19 @@
|
|||||||
for (i = 0; i < values.length; i++) {
|
for (i = 0; i < values.length; i++) {
|
||||||
typeItem = this.lookup[values[i]];
|
typeItem = this.lookup[values[i]];
|
||||||
|
|
||||||
if (typeItem)
|
if (typeItem) {
|
||||||
return typeItem;
|
return typeItem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a tinymce.html.Node image element to video/object/embed.
|
* Converts a tinymce.html.Node image element to video/object/embed.
|
||||||
*/
|
*/
|
||||||
imgToObject : function(node, args) {
|
imgToObject : function(node, args) {
|
||||||
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
|
var self = this, editor = self.editor, video, object, embed, name, value, data,
|
||||||
source, sources, params, param, typeItem, i, item, mp4Source, replacement,
|
source, sources, param, typeItem, i, mp4Source, replacement,
|
||||||
posterSrc, style, audio;
|
posterSrc, style, audio;
|
||||||
|
|
||||||
// Adds the flash player
|
// Adds the flash player
|
||||||
@@ -357,12 +372,14 @@
|
|||||||
value = value.replace(/\$url/, video_src || '');
|
value = value.replace(/\$url/, video_src || '');
|
||||||
value = value.replace(/\$poster/, poster_src || '');
|
value = value.replace(/\$poster/, poster_src || '');
|
||||||
|
|
||||||
if (value.length > 0)
|
if (value.length > 0) {
|
||||||
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (flashVarsOutput.length)
|
if (flashVarsOutput.length) {
|
||||||
data.params.flashvars = flashVarsOutput;
|
data.params.flashvars = flashVarsOutput;
|
||||||
|
}
|
||||||
|
|
||||||
params = editor.getParam('flash_video_player_params', {
|
params = editor.getParam('flash_video_player_params', {
|
||||||
allowfullscreen: true,
|
allowfullscreen: true,
|
||||||
@@ -373,11 +390,62 @@
|
|||||||
data.params[name] = "" + value;
|
data.params[name] = "" + value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
function createObject (node, style, rootAttributes, data) {
|
||||||
|
object = new Node('object', 1).attr({
|
||||||
|
id : node.attr('id'),
|
||||||
|
width: normalizeSize(node.attr('width')),
|
||||||
|
height: normalizeSize(node.attr('height')),
|
||||||
|
style : style
|
||||||
|
});
|
||||||
|
|
||||||
|
tinymce.each(rootAttributes, function(name) {
|
||||||
|
var value = data[name];
|
||||||
|
|
||||||
|
if (name == 'class' && value) {
|
||||||
|
value = value.replace(/mceItem.+ ?/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value && name != 'type') {
|
||||||
|
object.attr(name, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (var name in data.params) {
|
||||||
|
var param;
|
||||||
|
param = new Node('param', 1);
|
||||||
|
param.shortEnded = true;
|
||||||
|
value = data.params[name];
|
||||||
|
|
||||||
|
// Windows media needs to use url instead of src for the media URL
|
||||||
|
if (name === 'src' && typeItem.name === 'WindowsMedia') {
|
||||||
|
name = 'url';
|
||||||
|
}
|
||||||
|
|
||||||
|
param.attr({name: name, value: value});
|
||||||
|
object.append(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.object_html) {
|
||||||
|
value = new Node('#text', 3);
|
||||||
|
value.raw = true;
|
||||||
|
value.value = data.object_html;
|
||||||
|
object.append(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append object to video element if it exists
|
||||||
|
if (video) {
|
||||||
|
video.append(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
data = node.attr('data-mce-json');
|
data = node.attr('data-mce-json');
|
||||||
if (!data)
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
typeItem = this.getType(node.attr('class'));
|
typeItem = this.getType(node.attr('class'));
|
||||||
@@ -386,8 +454,9 @@
|
|||||||
if (!style) {
|
if (!style) {
|
||||||
style = node.attr('style');
|
style = node.attr('style');
|
||||||
|
|
||||||
if (style)
|
if (style) {
|
||||||
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use node width/height to override the data width/height when the placeholder is resized
|
// Use node width/height to override the data width/height when the placeholder is resized
|
||||||
@@ -401,15 +470,18 @@
|
|||||||
tinymce.each(rootAttributes, function(name) {
|
tinymce.each(rootAttributes, function(name) {
|
||||||
var value = node.attr(name);
|
var value = node.attr(name);
|
||||||
|
|
||||||
if (name == 'class' && value)
|
if (name == 'class' && value) {
|
||||||
value = value.replace(/mceItem.+ ?/g, '');
|
value = value.replace(/mceItem.+ ?/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
if (value && value.length > 0)
|
if (value && value.length > 0) {
|
||||||
replacement.attr(name, value);
|
replacement.attr(name, value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (name in data.params)
|
for (name in data.params) {
|
||||||
replacement.attr(name, data.params[name]);
|
replacement.attr(name, data.params[name]);
|
||||||
|
}
|
||||||
|
|
||||||
replacement.attr({
|
replacement.attr({
|
||||||
style: style,
|
style: style,
|
||||||
@@ -448,13 +520,15 @@
|
|||||||
}, data.video.attrs));
|
}, data.video.attrs));
|
||||||
|
|
||||||
// Get poster source and use that for flash fallback
|
// Get poster source and use that for flash fallback
|
||||||
if (data.video.attrs)
|
if (data.video.attrs) {
|
||||||
posterSrc = data.video.attrs.poster;
|
posterSrc = data.video.attrs.poster;
|
||||||
|
}
|
||||||
|
|
||||||
sources = data.video.sources = toArray(data.video.sources);
|
sources = data.video.sources = toArray(data.video.sources);
|
||||||
for (i = 0; i < sources.length; i++) {
|
for (i = 0; i < sources.length; i++) {
|
||||||
if (/\.mp4$/.test(sources[i].src))
|
if (/\.mp4$/.test(sources[i].src)) {
|
||||||
mp4Source = sources[i].src;
|
mp4Source = sources[i].src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sources[0].type) {
|
if (!sources[0].type) {
|
||||||
@@ -472,8 +546,9 @@
|
|||||||
if (mp4Source) {
|
if (mp4Source) {
|
||||||
addPlayer(mp4Source, posterSrc);
|
addPlayer(mp4Source, posterSrc);
|
||||||
typeItem = self.getType('flash');
|
typeItem = self.getType('flash');
|
||||||
} else
|
} else {
|
||||||
data.params.src = '';
|
data.params.src = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add HTML5 audio element
|
// Add HTML5 audio element
|
||||||
@@ -487,8 +562,9 @@
|
|||||||
}, data.video.attrs));
|
}, data.video.attrs));
|
||||||
|
|
||||||
// Get poster source and use that for flash fallback
|
// Get poster source and use that for flash fallback
|
||||||
if (data.video.attrs)
|
if (data.video.attrs) {
|
||||||
posterSrc = data.video.attrs.poster;
|
posterSrc = data.video.attrs.poster;
|
||||||
|
}
|
||||||
|
|
||||||
sources = data.video.sources = toArray(data.video.sources);
|
sources = data.video.sources = toArray(data.video.sources);
|
||||||
if (!sources[0].type) {
|
if (!sources[0].type) {
|
||||||
@@ -516,12 +592,14 @@
|
|||||||
type: node.attr('type')
|
type: node.attr('type')
|
||||||
});
|
});
|
||||||
|
|
||||||
for (name in data.params)
|
for (name in data.params) {
|
||||||
embed.attr(name, data.params[name]);
|
embed.attr(name, data.params[name]);
|
||||||
|
}
|
||||||
|
|
||||||
tinymce.each(rootAttributes, function(name) {
|
tinymce.each(rootAttributes, function(name) {
|
||||||
if (data[name] && name != 'type')
|
if (data[name] && name != 'type') {
|
||||||
embed.attr(name, data[name]);
|
embed.attr(name, data[name]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
data.params.src = '';
|
data.params.src = '';
|
||||||
@@ -530,44 +608,16 @@
|
|||||||
// Do we have a params src then we can generate object
|
// Do we have a params src then we can generate object
|
||||||
if (data.params.src) {
|
if (data.params.src) {
|
||||||
// Is flv movie add player for it
|
// Is flv movie add player for it
|
||||||
if (/\.flv$/i.test(data.params.src))
|
if (/\.flv$/i.test(data.params.src)) {
|
||||||
addPlayer(data.params.src, '');
|
addPlayer(data.params.src, '');
|
||||||
|
|
||||||
if (args && args.force_absolute)
|
|
||||||
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
|
||||||
|
|
||||||
// Create new object element
|
|
||||||
object = new Node('object', 1).attr({
|
|
||||||
id : node.attr('id'),
|
|
||||||
width: normalizeSize(node.attr('width')),
|
|
||||||
height: normalizeSize(node.attr('height')),
|
|
||||||
style : style
|
|
||||||
});
|
|
||||||
|
|
||||||
tinymce.each(rootAttributes, function(name) {
|
|
||||||
var value = data[name];
|
|
||||||
|
|
||||||
if (name == 'class' && value)
|
|
||||||
value = value.replace(/mceItem.+ ?/g, '');
|
|
||||||
|
|
||||||
if (value && name != 'type')
|
|
||||||
object.attr(name, value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add params
|
|
||||||
for (name in data.params) {
|
|
||||||
param = new Node('param', 1);
|
|
||||||
param.shortEnded = true;
|
|
||||||
value = data.params[name];
|
|
||||||
|
|
||||||
// Windows media needs to use url instead of src for the media URL
|
|
||||||
if (name === 'src' && typeItem.name === 'WindowsMedia')
|
|
||||||
name = 'url';
|
|
||||||
|
|
||||||
param.attr({name: name, value: value});
|
|
||||||
object.append(param);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args && args.force_absolute) {
|
||||||
|
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
||||||
|
}
|
||||||
|
|
||||||
|
object = createObject(node, style, rootAttributes, data, video);
|
||||||
|
|
||||||
// Setup add type and classid if strict is disabled
|
// Setup add type and classid if strict is disabled
|
||||||
if (this.editor.getParam('media_strict', true)) {
|
if (this.editor.getParam('media_strict', true)) {
|
||||||
object.attr({
|
object.attr({
|
||||||
@@ -575,10 +625,12 @@
|
|||||||
type: typeItem.mimes[0]
|
type: typeItem.mimes[0]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
object.attr({
|
if(typeItem.clsids[0]) {
|
||||||
classid: "clsid:" + typeItem.clsids[0],
|
object.attr({
|
||||||
codebase: typeItem.codebase
|
classid: "clsid:" + typeItem.clsids[0],
|
||||||
});
|
codebase: typeItem.codebase
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
embed = new Node('embed', 1);
|
embed = new Node('embed', 1);
|
||||||
embed.shortEnded = true;
|
embed.shortEnded = true;
|
||||||
@@ -590,28 +642,22 @@
|
|||||||
type: typeItem.mimes[0]
|
type: typeItem.mimes[0]
|
||||||
});
|
});
|
||||||
|
|
||||||
for (name in data.params)
|
for (name in data.params) {
|
||||||
embed.attr(name, data.params[name]);
|
embed.attr(name, data.params[name]);
|
||||||
|
}
|
||||||
|
|
||||||
tinymce.each(rootAttributes, function(name) {
|
tinymce.each(rootAttributes, function(name) {
|
||||||
if (data[name] && name != 'type')
|
if (data[name] && name != 'type') {
|
||||||
embed.attr(name, data[name]);
|
embed.attr(name, data[name]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
object.append(embed);
|
object.append(embed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert raw HTML
|
} else if (typeItem.name === 'Object') {
|
||||||
if (data.object_html) {
|
// Remove data.params.src since not in the original object
|
||||||
value = new Node('#text', 3);
|
delete data.params.src;
|
||||||
value.raw = true;
|
object = createObject(node, style, rootAttributes, data, video);
|
||||||
value.value = data.object_html;
|
|
||||||
object.append(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Append object to video element if it exists
|
|
||||||
if (video)
|
|
||||||
video.append(object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video) {
|
if (video) {
|
||||||
@@ -635,10 +681,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var n = video || audio || object || embed;
|
var n = video || audio || object || embed;
|
||||||
if (n)
|
if (n) {
|
||||||
node.replace(n);
|
node.replace(n);
|
||||||
else
|
} else {
|
||||||
node.remove();
|
node.remove();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -662,7 +709,7 @@
|
|||||||
inner: true,
|
inner: true,
|
||||||
validate: false
|
validate: false
|
||||||
}).serialize(node);
|
}).serialize(node);
|
||||||
};
|
}
|
||||||
|
|
||||||
function lookupAttribute(o, attr) {
|
function lookupAttribute(o, attr) {
|
||||||
return lookup[(o.attr(attr) || '').toLowerCase()];
|
return lookup[(o.attr(attr) || '').toLowerCase()];
|
||||||
@@ -674,16 +721,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If node isn't in document
|
// If node isn't in document
|
||||||
if (!node.parent)
|
if (!node.parent) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Handle media scripts
|
// Handle media scripts
|
||||||
if (node.name === 'script') {
|
if (node.name === 'script') {
|
||||||
if (node.firstChild)
|
if (node.firstChild) {
|
||||||
matches = scriptRegExp.exec(node.firstChild.value);
|
matches = scriptRegExp.exec(node.firstChild.value);
|
||||||
|
}
|
||||||
|
|
||||||
if (!matches)
|
if (!matches) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
type = matches[1];
|
type = matches[1];
|
||||||
data = {video : {}, params : JSON.parse(matches[2])};
|
data = {video : {}, params : JSON.parse(matches[2])};
|
||||||
@@ -716,12 +766,14 @@
|
|||||||
|
|
||||||
// Get all video attributes
|
// Get all video attributes
|
||||||
attrs = data.video.attrs;
|
attrs = data.video.attrs;
|
||||||
for (name in video.attributes.map)
|
for (name in video.attributes.map) {
|
||||||
attrs[name] = video.attributes.map[name];
|
attrs[name] = video.attributes.map[name];
|
||||||
|
}
|
||||||
|
|
||||||
source = node.attr('src');
|
source = node.attr('src');
|
||||||
if (source)
|
if (source) {
|
||||||
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
|
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
|
||||||
|
}
|
||||||
|
|
||||||
// Get all sources
|
// Get all sources
|
||||||
sources = video.getAll("source");
|
sources = video.getAll("source");
|
||||||
@@ -736,8 +788,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert the poster URL
|
// Convert the poster URL
|
||||||
if (attrs.poster)
|
if (attrs.poster) {
|
||||||
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
|
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object element
|
// Object element
|
||||||
@@ -747,8 +800,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Embed element
|
// Embed element
|
||||||
if (node.name === 'embed')
|
if (node.name === 'embed') {
|
||||||
embed = node;
|
embed = node;
|
||||||
|
}
|
||||||
|
|
||||||
// Iframe element
|
// Iframe element
|
||||||
if (node.name === 'iframe') {
|
if (node.name === 'iframe') {
|
||||||
@@ -758,8 +812,6 @@
|
|||||||
|
|
||||||
if (object) {
|
if (object) {
|
||||||
// Get width/height
|
// Get width/height
|
||||||
width = width || object.attr('width');
|
|
||||||
height = height || object.attr('height');
|
|
||||||
style = style || object.attr('style');
|
style = style || object.attr('style');
|
||||||
id = id || object.attr('id');
|
id = id || object.attr('id');
|
||||||
hspace = hspace || object.attr('hspace');
|
hspace = hspace || object.attr('hspace');
|
||||||
@@ -767,17 +819,23 @@
|
|||||||
align = align || object.attr('align');
|
align = align || object.attr('align');
|
||||||
bgcolor = bgcolor || object.attr('bgcolor');
|
bgcolor = bgcolor || object.attr('bgcolor');
|
||||||
data.name = object.attr('name');
|
data.name = object.attr('name');
|
||||||
|
data["class"] = object.attr('class');
|
||||||
|
|
||||||
// Get all object params
|
// Get all object params
|
||||||
params = object.getAll("param");
|
params = object.getAll("param");
|
||||||
|
|
||||||
for (i = 0; i < params.length; i++) {
|
for (i = 0; i < params.length; i++) {
|
||||||
param = params[i];
|
param = params[i];
|
||||||
name = param.remove().attr('name');
|
name = param.remove().attr('name');
|
||||||
|
|
||||||
if (!excludedAttrs[name])
|
if (!subExcludedAttrs[name]) {
|
||||||
data.params[name] = param.attr('value');
|
data.params[name] = param.attr('value');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
width = width || object.attr('width') || data.params.width;
|
||||||
|
height = height || object.attr('height') || data.params.height;
|
||||||
|
|
||||||
data.params.src = data.params.src || object.attr('data');
|
data.params.src = data.params.src || object.attr('data');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -794,9 +852,11 @@
|
|||||||
|
|
||||||
// Get all embed attributes
|
// Get all embed attributes
|
||||||
for (name in embed.attributes.map) {
|
for (name in embed.attributes.map) {
|
||||||
if (!excludedAttrs[name] && !data.params[name])
|
if (!excludedAttrs[name] && !data.params[name]) {
|
||||||
data.params[name] = embed.attributes.map[name];
|
data.params[name] = embed.attributes.map[name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
@@ -816,8 +876,9 @@
|
|||||||
|
|
||||||
// Get all iframe attributes
|
// Get all iframe attributes
|
||||||
for (name in iframe.attributes.map) {
|
for (name in iframe.attributes.map) {
|
||||||
if (!excludedAttrs[name] && !data.params[name])
|
if (!excludedAttrs[name] && !data.params[name]) {
|
||||||
data.params[name] = iframe.attributes.map[name];
|
data.params[name] = iframe.attributes.map[name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -828,22 +889,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert the URL to relative/absolute depending on configuration
|
// Convert the URL to relative/absolute depending on configuration
|
||||||
if (data.params.src)
|
if (data.params.src) {
|
||||||
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
||||||
|
|
||||||
if (video) {
|
|
||||||
if (node.name === 'video')
|
|
||||||
type = lookup.video.name;
|
|
||||||
else if (node.name === 'audio')
|
|
||||||
type = lookup.audio.name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object && !type)
|
if (video) {
|
||||||
type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
|
if (node.name === 'video') {
|
||||||
|
type = lookup.video.name;
|
||||||
|
} else if (node.name === 'audio') {
|
||||||
|
type = lookup.audio.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (embed && !type)
|
if (embed && !type) {
|
||||||
type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
|
type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (object && !type) {
|
||||||
|
type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {name: 'Object'}).name;
|
||||||
|
}
|
||||||
// for embedded audio we preserve the original specified type
|
// for embedded audio we preserve the original specified type
|
||||||
if (embed && type == 'EmbeddedAudio') {
|
if (embed && type == 'EmbeddedAudio') {
|
||||||
data.params.type = embed.attr('type');
|
data.params.type = embed.attr('type');
|
||||||
@@ -852,24 +916,25 @@
|
|||||||
// Replace the video/object/embed element with a placeholder image containing the data
|
// Replace the video/object/embed element with a placeholder image containing the data
|
||||||
node.replace(img);
|
node.replace(img);
|
||||||
|
|
||||||
// Remove embed
|
if (embed) {
|
||||||
if (embed)
|
|
||||||
embed.remove();
|
embed.remove();
|
||||||
|
}
|
||||||
|
|
||||||
// Serialize the inner HTML of the object element
|
// Serialize the inner HTML of the object element
|
||||||
if (object) {
|
if (object) {
|
||||||
html = getInnerHTML(object.remove());
|
html = getInnerHTML(object.remove());
|
||||||
|
if (html) {
|
||||||
if (html)
|
|
||||||
data.object_html = html;
|
data.object_html = html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize the inner HTML of the video element
|
// Serialize the inner HTML of the video element
|
||||||
if (video) {
|
if (video) {
|
||||||
html = getInnerHTML(video.remove());
|
html = getInnerHTML(video.remove());
|
||||||
|
|
||||||
if (html)
|
if (html) {
|
||||||
data.video_html = html;
|
data.video_html = html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.hspace = hspace;
|
data.hspace = hspace;
|
||||||
|
|||||||
@@ -295,30 +295,40 @@
|
|||||||
} else {
|
} else {
|
||||||
src = getVal("src");
|
src = getVal("src");
|
||||||
|
|
||||||
// YouTube *NEW*
|
// YouTube Embed
|
||||||
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
if (src.match(/youtube\.com\/embed\/\w+/)) {
|
||||||
data.width = 425;
|
data.width = 425;
|
||||||
data.height = 350;
|
data.height = 350;
|
||||||
data.params.frameborder = '0';
|
data.params.frameborder = '0';
|
||||||
data.type = 'iframe';
|
data.type = 'iframe';
|
||||||
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
|
||||||
setVal('src', src);
|
setVal('src', src);
|
||||||
setVal('media_type', data.type);
|
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
|
// YouTube
|
||||||
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
if (src.match(/youtube\.com(.+)v=([^&]+)/)) {
|
||||||
data.width = 425;
|
data.width = 425;
|
||||||
data.height = 350;
|
data.height = 350;
|
||||||
data.params.frameborder = '0';
|
data.params.frameborder = '0';
|
||||||
data.type = 'iframe';
|
data.type = 'iframe';
|
||||||
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
||||||
setVal('src', src);
|
setVal('src', src);
|
||||||
setVal('media_type', data.type);
|
setVal('media_type', data.type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Google video
|
// Google video
|
||||||
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {
|
||||||
data.width = 425;
|
data.width = 425;
|
||||||
data.height = 326;
|
data.height = 326;
|
||||||
data.type = 'flash';
|
data.type = 'flash';
|
||||||
@@ -328,7 +338,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Vimeo
|
// Vimeo
|
||||||
if (src.match(/vimeo.com\/([0-9]+)/)) {
|
if (src.match(/vimeo\.com\/([0-9]+)/)) {
|
||||||
data.width = 425;
|
data.width = 425;
|
||||||
data.height = 350;
|
data.height = 350;
|
||||||
data.params.frameborder = '0';
|
data.params.frameborder = '0';
|
||||||
@@ -339,7 +349,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// stream.cz
|
// stream.cz
|
||||||
if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
|
if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {
|
||||||
data.width = 425;
|
data.width = 425;
|
||||||
data.height = 350;
|
data.height = 350;
|
||||||
data.params.frameborder = '0';
|
data.params.frameborder = '0';
|
||||||
@@ -350,7 +360,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Google maps
|
// 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.width = 425;
|
||||||
data.height = 350;
|
data.height = 350;
|
||||||
data.params.frameborder = '0';
|
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 TreeWalker = tinymce.dom.TreeWalker;
|
||||||
var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
|
var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
|
||||||
var VK = tinymce.VK;
|
var VK = tinymce.VK;
|
||||||
|
var editClass, nonEditClass, nonEditableRegExps;
|
||||||
|
|
||||||
function handleContentEditableSelection(ed) {
|
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
|
// Returns the content editable state of a node "true/false" or null
|
||||||
function getContentEditable(node) {
|
function getContentEditable(node) {
|
||||||
@@ -119,7 +122,7 @@
|
|||||||
|
|
||||||
// Removes any caret container except the one we might be in
|
// Removes any caret container except the one we might be in
|
||||||
function removeCaretContainer(caretContainer) {
|
function removeCaretContainer(caretContainer) {
|
||||||
var child, currentCaretContainer, lastContainer;
|
var child, currentCaretContainer, lastContainer, rng;
|
||||||
|
|
||||||
if (caretContainer) {
|
if (caretContainer) {
|
||||||
rng = selection.getRng(true);
|
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 it's a caret selection then look left/right to see if we need to move the caret out side or expand
|
||||||
if (isCollapsed) {
|
if (isCollapsed) {
|
||||||
nonEditableStart = nonEditableStart || nonEditableEnd;
|
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
|
// We have no contents to the left of the caret then insert a caret container before the noneditable element
|
||||||
insertCaretContainerOrExpandToBlock(element, true);
|
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
|
// We have no contents to the right of the caret then insert a caret container after the noneditable element
|
||||||
insertCaretContainerOrExpandToBlock(element, false);
|
insertCaretContainerOrExpandToBlock(element, false);
|
||||||
} else {
|
} else {
|
||||||
@@ -243,7 +248,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
function handleKey(ed, e) {
|
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) {
|
function getNonEmptyTextNodeSibling(node, prev) {
|
||||||
while (node = node[prev ? 'previousSibling' : 'nextSibling']) {
|
while (node = node[prev ? 'previousSibling' : 'nextSibling']) {
|
||||||
@@ -293,7 +299,9 @@
|
|||||||
|
|
||||||
// Found non editable node
|
// Found non editable node
|
||||||
if (getContentEditable(node) === "false") {
|
if (getContentEditable(node) === "false") {
|
||||||
removeNodeIfNotParent(node);
|
if (!nondeletable)
|
||||||
|
removeNodeIfNotParent(node);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,12 +314,12 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.isCollapsed()) {
|
rng = selection.getRng(true);
|
||||||
rng = selection.getRng(true);
|
container = rng.startContainer;
|
||||||
container = rng.startContainer;
|
offset = rng.startOffset;
|
||||||
offset = rng.startOffset;
|
container = getParentCaretContainer(container) || container;
|
||||||
container = getParentCaretContainer(container) || container;
|
|
||||||
|
|
||||||
|
if (selection.isCollapsed()) {
|
||||||
// Is in noneditable parent
|
// Is in noneditable parent
|
||||||
if (nonEditableParent = getNonEditableParent(container)) {
|
if (nonEditableParent = getNonEditableParent(container)) {
|
||||||
removeNodeIfNotParent(nonEditableParent);
|
removeNodeIfNotParent(nonEditableParent);
|
||||||
@@ -334,14 +342,79 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Is in noneditable parent
|
||||||
|
if (getNonEditableParent(container)) {
|
||||||
|
nonEditableParent = getNonEditableParent(container);
|
||||||
|
removeNodeIfNotParent(nonEditableParent);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
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();
|
endElement = selection.getEnd();
|
||||||
|
|
||||||
// Disable all key presses in contentEditable=false except delete or backspace
|
// Disable all key presses in contentEditable=false except delete or backspace
|
||||||
nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);
|
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) {
|
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
|
// 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)) {
|
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) {
|
if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {
|
||||||
caretContainer = getParentCaretContainer(startElement);
|
caretContainer = getParentCaretContainer(startElement);
|
||||||
if (caretContainer) {
|
if (caretContainer) {
|
||||||
// Arrow left or backspace
|
handleDirectionalStroke(keyCode, caretContainer, e);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
|
if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
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.onMouseUp.addToTop(moveSelection);
|
||||||
|
ed.onMouseDown.addToTop(moveSelection);
|
||||||
ed.onKeyDown.addToTop(handleKey);
|
ed.onKeyDown.addToTop(handleKey);
|
||||||
ed.onKeyUp.addToTop(moveSelection);
|
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', {
|
tinymce.create('tinymce.plugins.NonEditablePlugin', {
|
||||||
init : function(ed, url) {
|
init : function(ed) {
|
||||||
var editClass, nonEditClass, nonEditableRegExps;
|
|
||||||
|
|
||||||
// Converts configured regexps to noneditable span items
|
// Converts configured regexps to noneditable span items
|
||||||
function convertRegExpsToNonEditable(ed, args) {
|
function convertRegExpsToNonEditable(ed, args) {
|
||||||
@@ -454,10 +501,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
args.content = content;
|
args.content = content;
|
||||||
};
|
}
|
||||||
|
|
||||||
editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";
|
editClass = getEditClass(ed);
|
||||||
nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
|
nonEditClass = getNonEditClass(ed);
|
||||||
|
|
||||||
// Setup noneditable regexps array
|
// Setup noneditable regexps array
|
||||||
nonEditableRegExps = ed.getParam("noneditable_regexp");
|
nonEditableRegExps = ed.getParam("noneditable_regexp");
|
||||||
@@ -490,7 +537,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Remove internal name
|
// Remove internal name
|
||||||
ed.serializer.addAttributeFilter(internalName, function(nodes, name) {
|
ed.serializer.addAttributeFilter(internalName, function(nodes) {
|
||||||
var i = nodes.length, node;
|
var i = nodes.length, node;
|
||||||
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
@@ -509,7 +556,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Convert external name into internal name
|
// Convert external name into internal name
|
||||||
ed.parser.addAttributeFilter(externalName, function(nodes, name) {
|
ed.parser.addAttributeFilter(externalName, function(nodes) {
|
||||||
var i = nodes.length, node;
|
var i = nodes.length, node;
|
||||||
|
|
||||||
while (i--) {
|
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")) {
|
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
||||||
// Is it's Opera or older FF use key handler
|
// Is it's Opera or older FF use key handler
|
||||||
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
||||||
@@ -354,7 +354,7 @@
|
|||||||
h = h.replace(v[0], v[1]);
|
h = h.replace(v[0], v[1]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ed.settings.paste_enable_default_filters == false) {
|
if (ed.settings.paste_enable_default_filters == false) {
|
||||||
return;
|
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.
|
// 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 {
|
do {
|
||||||
len = h.length;
|
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);
|
} while (len != h.length);
|
||||||
|
|
||||||
// Remove all spans if no styles is to be retained
|
// Remove all spans if no styles is to be retained
|
||||||
@@ -589,7 +591,7 @@
|
|||||||
if (ed.settings.paste_enable_default_filters == false) {
|
if (ed.settings.paste_enable_default_filters == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o.wordContent) {
|
if (o.wordContent) {
|
||||||
// Remove named anchors or TOC links
|
// Remove named anchors or TOC links
|
||||||
each(dom.select('a', o.node), function(a) {
|
each(dom.select('a', o.node), function(a) {
|
||||||
@@ -717,7 +719,7 @@
|
|||||||
if (type == 'ul')
|
if (type == 'ul')
|
||||||
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
||||||
else
|
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
|
// Create li and add paragraph data into the new li
|
||||||
li = listElm.appendChild(dom.create('li', 0, html));
|
li = listElm.appendChild(dom.create('li', 0, html));
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ var SearchReplaceDialog = {
|
|||||||
mcTabs.onChange.add(function(tab_id, panel_id) {
|
mcTabs.onChange.add(function(tab_id, panel_id) {
|
||||||
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
|
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
switchMode : function(m) {
|
switchMode : function(m) {
|
||||||
@@ -39,6 +40,10 @@ var SearchReplaceDialog = {
|
|||||||
searchNext : function(a) {
|
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;
|
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
|
// Get input
|
||||||
f = document.forms[0];
|
f = document.forms[0];
|
||||||
s = f[m + '_panel_searchstring'].value;
|
s = f[m + '_panel_searchstring'].value;
|
||||||
@@ -47,7 +52,7 @@ var SearchReplaceDialog = {
|
|||||||
rs = f['replace_panel_replacestring'].value;
|
rs = f['replace_panel_replacestring'].value;
|
||||||
|
|
||||||
if (tinymce.isIE) {
|
if (tinymce.isIE) {
|
||||||
r = ed.getDoc().selection.createRange();
|
r = createTextRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s == '')
|
if (s == '')
|
||||||
@@ -77,7 +82,7 @@ var SearchReplaceDialog = {
|
|||||||
|
|
||||||
if (tinymce.isIE) {
|
if (tinymce.isIE) {
|
||||||
ed.focus();
|
ed.focus();
|
||||||
r = ed.getDoc().selection.createRange();
|
r = createTextRange();
|
||||||
|
|
||||||
while (r.findText(s, b ? -1 : 1, fl)) {
|
while (r.findText(s, b ? -1 : 1, fl)) {
|
||||||
r.scrollIntoView();
|
r.scrollIntoView();
|
||||||
@@ -87,6 +92,10 @@ var SearchReplaceDialog = {
|
|||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
|
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) {
|
if (tinymce.isIE) {
|
||||||
ed.focus();
|
ed.focus();
|
||||||
r = ed.getDoc().selection.createRange();
|
r = createTextRange();
|
||||||
|
|
||||||
if (r.findText(s, b ? -1 : 1, fl)) {
|
if (r.findText(s, b ? -1 : 1, fl)) {
|
||||||
r.scrollIntoView();
|
r.scrollIntoView();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -126,6 +126,7 @@
|
|||||||
|
|
||||||
c.onRenderMenu.add(function(c, m) {
|
c.onRenderMenu.add(function(c, m) {
|
||||||
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||||
|
t.menuItems = {};
|
||||||
each(t.languages, function(v, k) {
|
each(t.languages, function(v, k) {
|
||||||
var o = {icon : 1}, mi;
|
var o = {icon : 1}, mi;
|
||||||
|
|
||||||
@@ -133,27 +134,60 @@
|
|||||||
if (v == t.selectedLang) {
|
if (v == t.selectedLang) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mi.setSelected(1);
|
t._updateMenu(mi);
|
||||||
t.selectedItem.setSelected(0);
|
|
||||||
t.selectedItem = mi;
|
|
||||||
t.selectedLang = v;
|
t.selectedLang = v;
|
||||||
};
|
};
|
||||||
|
|
||||||
o.title = k;
|
o.title = k;
|
||||||
mi = m.add(o);
|
mi = m.add(o);
|
||||||
mi.setSelected(v == t.selectedLang);
|
mi.setSelected(v == t.selectedLang);
|
||||||
|
t.menuItems[v] = mi;
|
||||||
if (v == t.selectedLang)
|
if (v == t.selectedLang)
|
||||||
t.selectedItem = mi;
|
t.selectedItem = mi;
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return c;
|
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
|
// Internal functions
|
||||||
|
|
||||||
|
_updateMenu: function(mi) {
|
||||||
|
mi.setSelected(1);
|
||||||
|
this.selectedItem.setSelected(0);
|
||||||
|
this.selectedItem = mi;
|
||||||
|
},
|
||||||
|
|
||||||
_walk : function(n, f) {
|
_walk : function(n, f) {
|
||||||
var d = this.editor.getDoc(), w;
|
var d = this.editor.getDoc(), w;
|
||||||
|
|
||||||
@@ -235,6 +269,7 @@
|
|||||||
each(nl, function(n) {
|
each(nl, function(n) {
|
||||||
var node, elem, txt, pos, v = n.nodeValue;
|
var node, elem, txt, pos, v = n.nodeValue;
|
||||||
|
|
||||||
|
rx.lastIndex = 0;
|
||||||
if (rx.test(v)) {
|
if (rx.test(v)) {
|
||||||
// Encode the content
|
// Encode the content
|
||||||
v = dom.encode(v);
|
v = dom.encode(v);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<option value="right">{#table_dlg.align_right}</option>
|
<option value="right">{#table_dlg.align_right}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td><label for="celltype">{#table_dlg.cell_type}</label></td>
|
<td><label for="celltype">{#table_dlg.cell_type}</label></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="celltype" name="celltype">
|
<select id="celltype" name="celltype">
|
||||||
@@ -76,7 +76,6 @@
|
|||||||
<td><label for="height">{#table_dlg.height}</label></td>
|
<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>
|
<td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr id="styleSelectRow">
|
<tr id="styleSelectRow">
|
||||||
<td><label for="class">{#class_name}</label></td>
|
<td><label for="class">{#class_name}</label></td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
@@ -95,8 +94,8 @@
|
|||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="id">{#table_dlg.id}</label></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>
|
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -105,25 +104,25 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<select id="dir" name="dir" style="width: 200px">
|
<select id="dir" name="dir" style="width: 200px">
|
||||||
<option value="">{#not_set}</option>
|
<option value="">{#not_set}</option>
|
||||||
<option value="ltr">{#table_dlg.ltr}</option>
|
<option value="ltr">{#table_dlg.ltr}</option>
|
||||||
<option value="rtl">{#table_dlg.rtl}</option>
|
<option value="rtl">{#table_dlg.rtl}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -131,11 +130,11 @@
|
|||||||
<td id="backgroundimagebrowsercontainer"> </td>
|
<td id="backgroundimagebrowsercontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr role="group" aria-labelledby="bordercolor_label">
|
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -143,11 +142,11 @@
|
|||||||
<td id="bordercolor_pickcontainer"> </td>
|
<td id="bordercolor_pickcontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr role="group" aria-labelledby="bgcolor_label">
|
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -155,7 +154,7 @@
|
|||||||
<td id="bgcolor_pickcontainer"> </td>
|
<td id="bgcolor_pickcontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#action {
|
#action {
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
margin-up: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#class {
|
#class {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#action {
|
#action {
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
margin-up: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#rowtype,#align,#valign,#class,#height {
|
#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
|
// Get table cell data
|
||||||
var celltype = tdElm.nodeName.toLowerCase();
|
var celltype = tdElm.nodeName.toLowerCase();
|
||||||
var align = ed.dom.getAttrib(tdElm, 'align');
|
var align = ed.dom.getAttrib(tdElm, 'align') || getStyle(tdElm, 'text-align');
|
||||||
var valign = ed.dom.getAttrib(tdElm, 'valign');
|
var valign = ed.dom.getAttrib(tdElm, 'valign') || getStyle(tdElm, 'vertical-align');
|
||||||
var width = trimSize(getStyle(tdElm, 'width', 'width'));
|
var width = trimSize(getStyle(tdElm, 'width', 'width'));
|
||||||
var height = trimSize(getStyle(tdElm, 'height', 'height'));
|
var height = trimSize(getStyle(tdElm, 'height', 'height'));
|
||||||
var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
|
var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
|
||||||
@@ -201,8 +201,6 @@ function updateCell(td, skip_id) {
|
|||||||
if (!skip_id)
|
if (!skip_id)
|
||||||
dom.setAttrib(td, 'id', formObj.id.value);
|
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, 'lang', formObj.lang.value);
|
||||||
dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));
|
dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));
|
||||||
dom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
|
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'));
|
dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
|
||||||
|
|
||||||
// Clear deprecated attributes
|
// Clear deprecated attributes
|
||||||
|
ed.dom.setAttrib(td, 'align', '');
|
||||||
|
ed.dom.setAttrib(td, 'vAlign', '');
|
||||||
ed.dom.setAttrib(td, 'width', '');
|
ed.dom.setAttrib(td, 'width', '');
|
||||||
ed.dom.setAttrib(td, 'height', '');
|
ed.dom.setAttrib(td, 'height', '');
|
||||||
ed.dom.setAttrib(td, 'bgColor', '');
|
ed.dom.setAttrib(td, 'bgColor', '');
|
||||||
@@ -219,13 +219,9 @@ function updateCell(td, skip_id) {
|
|||||||
// Set styles
|
// Set styles
|
||||||
td.style.width = getCSSSize(formObj.width.value);
|
td.style.width = getCSSSize(formObj.width.value);
|
||||||
td.style.height = getCSSSize(formObj.height.value);
|
td.style.height = getCSSSize(formObj.height.value);
|
||||||
if (formObj.bordercolor.value != "") {
|
td.style.textAlign = formObj.align.value;
|
||||||
td.style.borderColor = formObj.bordercolor.value;
|
td.style.verticalAlign = formObj.valign.value;
|
||||||
td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
|
td.style.borderColor = formObj.bordercolor.value;
|
||||||
td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
|
|
||||||
} else
|
|
||||||
td.style.borderColor = '';
|
|
||||||
|
|
||||||
td.style.backgroundColor = formObj.bgcolor.value;
|
td.style.backgroundColor = formObj.bgcolor.value;
|
||||||
|
|
||||||
if (formObj.backgroundimage.value != "")
|
if (formObj.backgroundimage.value != "")
|
||||||
@@ -314,6 +310,12 @@ function changedStyle() {
|
|||||||
formObj.bordercolor.value = st['border-color'];
|
formObj.bordercolor.value = st['border-color'];
|
||||||
updateColor('bordercolor_pick','bordercolor');
|
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);
|
tinyMCEPopup.onInit.add(init);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ function init() {
|
|||||||
var dir = dom.getAttrib(trElm, 'dir');
|
var dir = dom.getAttrib(trElm, 'dir');
|
||||||
|
|
||||||
selectByValue(formObj, 'rowtype', rowtype);
|
selectByValue(formObj, 'rowtype', rowtype);
|
||||||
|
setActionforRowType(formObj, rowtype);
|
||||||
|
|
||||||
// Any cells selected
|
// Any cells selected
|
||||||
if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
|
if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
|
||||||
@@ -234,4 +235,20 @@ function changedColor() {
|
|||||||
formObj.style.value = dom.serializeStyle(st);
|
formObj.style.value = dom.serializeStyle(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changedRowType() {
|
||||||
|
var formObj = document.forms[0];
|
||||||
|
var rowtype = getSelectValue(formObj, 'rowtype');
|
||||||
|
|
||||||
|
setActionforRowType(formObj, rowtype);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function setActionforRowType(formObj, rowtype) {
|
||||||
|
if (rowtype === "tbody") {
|
||||||
|
formObj.action.disabled = false;
|
||||||
|
} else {
|
||||||
|
selectByValue(formObj, 'action', "row");
|
||||||
|
formObj.action.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
tinyMCEPopup.onInit.add(init);
|
tinyMCEPopup.onInit.add(init);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ function insertTable() {
|
|||||||
var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
|
var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
|
||||||
var html = '', capEl, elm;
|
var html = '', capEl, elm;
|
||||||
var cellLimit, rowLimit, colLimit;
|
var cellLimit, rowLimit, colLimit;
|
||||||
|
var cellStyles, newCellStyles, parsedStyles;
|
||||||
|
|
||||||
tinyMCEPopup.restoreSelection();
|
tinyMCEPopup.restoreSelection();
|
||||||
|
|
||||||
@@ -21,9 +22,9 @@ function insertTable() {
|
|||||||
// Get form data
|
// Get form data
|
||||||
cols = formObj.elements['cols'].value;
|
cols = formObj.elements['cols'].value;
|
||||||
rows = formObj.elements['rows'].value;
|
rows = formObj.elements['rows'].value;
|
||||||
border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
|
border = formObj.elements['border'].value !== "" ? formObj.elements['border'].value : "";
|
||||||
cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
|
cellpadding = formObj.elements['cellpadding'].value !== "" ? formObj.elements['cellpadding'].value : "";
|
||||||
cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
|
cellspacing = formObj.elements['cellspacing'].value !== "" ? formObj.elements['cellspacing'].value : "";
|
||||||
align = getSelectValue(formObj, "align");
|
align = getSelectValue(formObj, "align");
|
||||||
frame = getSelectValue(formObj, "tframe");
|
frame = getSelectValue(formObj, "tframe");
|
||||||
rules = getSelectValue(formObj, "rules");
|
rules = getSelectValue(formObj, "rules");
|
||||||
@@ -58,20 +59,6 @@ function insertTable() {
|
|||||||
|
|
||||||
// Update table
|
// Update table
|
||||||
if (action == "update") {
|
if (action == "update") {
|
||||||
dom.setAttrib(elm, 'cellPadding', cellpadding, true);
|
|
||||||
dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
|
|
||||||
|
|
||||||
if (!isCssSize(border)) {
|
|
||||||
dom.setAttrib(elm, 'border', border);
|
|
||||||
} else {
|
|
||||||
dom.setAttrib(elm, 'border', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (border == '') {
|
|
||||||
dom.setStyle(elm, 'border-width', '');
|
|
||||||
dom.setStyle(elm, 'border', '');
|
|
||||||
dom.setAttrib(elm, 'border', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
dom.setAttrib(elm, 'align', align);
|
dom.setAttrib(elm, 'align', align);
|
||||||
dom.setAttrib(elm, 'frame', frame);
|
dom.setAttrib(elm, 'frame', frame);
|
||||||
@@ -91,7 +78,7 @@ function insertTable() {
|
|||||||
if (!capEl && caption) {
|
if (!capEl && caption) {
|
||||||
capEl = elm.ownerDocument.createElement('caption');
|
capEl = elm.ownerDocument.createElement('caption');
|
||||||
|
|
||||||
if (!tinymce.isIE)
|
if (!tinymce.isIE || tinymce.isIE11)
|
||||||
capEl.innerHTML = '<br data-mce-bogus="1"/>';
|
capEl.innerHTML = '<br data-mce-bogus="1"/>';
|
||||||
|
|
||||||
elm.insertBefore(capEl, elm.firstChild);
|
elm.insertBefore(capEl, elm.firstChild);
|
||||||
@@ -128,12 +115,54 @@ function insertTable() {
|
|||||||
elm.style.width = getCSSSize(width);
|
elm.style.width = getCSSSize(width);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (bordercolor != "") {
|
if (!inst.settings.table_style_by_css) {
|
||||||
elm.style.borderColor = bordercolor;
|
dom.setAttrib(elm, 'cellPadding', nonCssSize(cellpadding), true);
|
||||||
elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
|
} else {
|
||||||
elm.style.borderWidth = cssSize(border);
|
dom.setAttrib(elm, 'cellPadding', '');
|
||||||
} else
|
}
|
||||||
elm.style.borderColor = '';
|
|
||||||
|
if (cellspacing !== "") {
|
||||||
|
elm.style.borderSpacing = cssSize(cellspacing);
|
||||||
|
} else {
|
||||||
|
elm.style.borderSpacing = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inst.settings.table_style_by_css && !isCssSize(border)) {
|
||||||
|
dom.setAttrib(elm, 'border', border);
|
||||||
|
} else if (inst.settings.table_style_by_css || (border !== '' && isCssSize(border))) {
|
||||||
|
dom.setAttrib(elm, 'border', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (border === "") {
|
||||||
|
dom.setStyle(elm, 'border-width', '');
|
||||||
|
dom.setStyle(elm, 'border', '');
|
||||||
|
dom.setAttrib(elm, 'border', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
elm.style.borderColor = bordercolor;
|
||||||
|
|
||||||
|
if (inst.settings.table_style_by_css) {
|
||||||
|
|
||||||
|
parsedStyles = dom.parseStyle(style);
|
||||||
|
|
||||||
|
if (parsedStyles.border) {
|
||||||
|
styleTDTH(elm, "border", parsedStyles.border);
|
||||||
|
}
|
||||||
|
if (border !== "") {
|
||||||
|
styleTDTH(elm, "border-width", cssSize(border));
|
||||||
|
} else {
|
||||||
|
styleTDTH(elm, "border-width", '');
|
||||||
|
}
|
||||||
|
if (cellpadding !== "") {
|
||||||
|
styleTDTH(elm, "padding", cssSize(cellpadding));
|
||||||
|
} else {
|
||||||
|
styleTDTH(elm, "padding", '');
|
||||||
|
}
|
||||||
|
|
||||||
|
styleTDTH(elm, "border-color", bordercolor);
|
||||||
|
|
||||||
|
styleTDTH(elm, "border-style", elm.style.borderStyle);
|
||||||
|
}
|
||||||
|
|
||||||
elm.style.backgroundColor = bgcolor;
|
elm.style.backgroundColor = bgcolor;
|
||||||
elm.style.height = getCSSSize(height);
|
elm.style.height = getCSSSize(height);
|
||||||
@@ -158,12 +187,14 @@ function insertTable() {
|
|||||||
html += '<table';
|
html += '<table';
|
||||||
|
|
||||||
html += makeAttrib('id', id);
|
html += makeAttrib('id', id);
|
||||||
if (!isCssSize(border)) {
|
if (!inst.settings.table_style_by_css && !isCssSize(border)) {
|
||||||
html += makeAttrib('border', border);
|
html += makeAttrib('border', border);
|
||||||
}
|
}
|
||||||
|
|
||||||
html += makeAttrib('cellpadding', cellpadding);
|
if (!inst.settings.table_style_by_css) {
|
||||||
html += makeAttrib('cellspacing', cellspacing);
|
html += makeAttrib('cellpadding', nonCssSize(cellpadding));
|
||||||
|
}
|
||||||
|
|
||||||
html += makeAttrib('data-mce-new', '1');
|
html += makeAttrib('data-mce-new', '1');
|
||||||
|
|
||||||
if (width && inst.settings.inline_styles) {
|
if (width && inst.settings.inline_styles) {
|
||||||
@@ -199,20 +230,51 @@ function insertTable() {
|
|||||||
html += '>';
|
html += '>';
|
||||||
|
|
||||||
if (caption) {
|
if (caption) {
|
||||||
if (!tinymce.isIE)
|
if (!tinymce.isIE || tinymce.isIE11)
|
||||||
html += '<caption><br data-mce-bogus="1"/></caption>';
|
html += '<caption><br data-mce-bogus="1"/></caption>';
|
||||||
else
|
else
|
||||||
html += '<caption></caption>';
|
html += '<caption></caption>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inst.settings.table_style_by_css) {
|
||||||
|
|
||||||
|
parsedStyles = dom.parseStyle(style);
|
||||||
|
|
||||||
|
newCellStyles = {};
|
||||||
|
if (parsedStyles.border) {
|
||||||
|
newCellStyles.border = parsedStyles.border;
|
||||||
|
}
|
||||||
|
if (border !== "") {
|
||||||
|
newCellStyles["border-width"] = cssSize(border);
|
||||||
|
}
|
||||||
|
if (cellpadding !== "") {
|
||||||
|
newCellStyles.padding = cssSize(cellpadding);
|
||||||
|
}
|
||||||
|
if (bordercolor !== "") {
|
||||||
|
newCellStyles["border-color"] = bordercolor;
|
||||||
|
}
|
||||||
|
if (parsedStyles["border-style"]) {
|
||||||
|
newCellStyles["border-style"] = parsedStyles["border-style"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dom.serializeStyle(newCellStyles) !== "") {
|
||||||
|
cellStyles = " style='" + dom.serializeStyle(newCellStyles) +"'";
|
||||||
|
} else {
|
||||||
|
cellStyles = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cellStyles = "";
|
||||||
|
}
|
||||||
|
|
||||||
for (var y=0; y<rows; y++) {
|
for (var y=0; y<rows; y++) {
|
||||||
html += "<tr>";
|
html += "<tr>";
|
||||||
|
|
||||||
for (var x=0; x<cols; x++) {
|
for (var x=0; x<cols; x++) {
|
||||||
if (!tinymce.isIE)
|
if (!tinymce.isIE || tinymce.isIE11)
|
||||||
html += '<td><br data-mce-bogus="1"/></td>';
|
html += '<td' + cellStyles + '><br data-mce-bogus="1"/></td>';
|
||||||
else
|
else
|
||||||
html += '<td></td>';
|
html += '<td' + cellStyles + '></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += "</tr>";
|
html += "</tr>";
|
||||||
@@ -242,19 +304,19 @@ function insertTable() {
|
|||||||
} else
|
} else
|
||||||
inst.execCommand('mceInsertContent', false, html);
|
inst.execCommand('mceInsertContent', false, html);
|
||||||
|
|
||||||
tinymce.each(dom.select('table[data-mce-new]'), function(node) {
|
tinymce.each(dom.select('table[data-mce-new]'), function(node) {
|
||||||
var tdorth = dom.select('td,th', node);
|
var tdorth = dom.select('td,th', node);
|
||||||
|
|
||||||
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
||||||
if (tinymce.isIE && node.nextSibling == null) {
|
if (tinymce.isIE && !tinymce.isIE11 && node.nextSibling == null) {
|
||||||
if (inst.settings.forced_root_block)
|
if (inst.settings.forced_root_block)
|
||||||
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
|
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
|
||||||
else
|
else
|
||||||
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
|
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// IE9 might fail to do this selection
|
// IE9 might fail to do this selection
|
||||||
inst.selection.setCursorLocation(tdorth[0], 0);
|
inst.selection.setCursorLocation(tdorth[0], 0);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Ignore
|
// Ignore
|
||||||
@@ -269,6 +331,42 @@ function insertTable() {
|
|||||||
tinyMCEPopup.close();
|
tinyMCEPopup.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function styleTDTH (elm, name, value) {
|
||||||
|
if (elm.tagName === "TD" || elm.tagName === "TH") {
|
||||||
|
dom.setStyle(elm, name, value);
|
||||||
|
} else {
|
||||||
|
if (elm.children) {
|
||||||
|
for (var i = 0; i < elm.children.length; i++) {
|
||||||
|
styleTDTH(elm.children[i], name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTDTHOverallStyle (elm, name) {
|
||||||
|
var cells = dom.select("td,th", elm), firstChildStyle;
|
||||||
|
|
||||||
|
function checkChildren(firstChildStyle, elms) {
|
||||||
|
|
||||||
|
for (var i = 0; i < elms.length; i++) {
|
||||||
|
var currentStyle = dom.getStyle(elms[i], name);
|
||||||
|
if (typeof firstChildStyle === "undefined") {
|
||||||
|
firstChildStyle = currentStyle;
|
||||||
|
}
|
||||||
|
if (firstChildStyle != currentStyle) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return firstChildStyle;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
firstChildStyle = checkChildren(firstChildStyle, cells);
|
||||||
|
|
||||||
|
return firstChildStyle;
|
||||||
|
}
|
||||||
|
|
||||||
function makeAttrib(attrib, value) {
|
function makeAttrib(attrib, value) {
|
||||||
var formObj = document.forms[0];
|
var formObj = document.forms[0];
|
||||||
var valueElm = formObj.elements[attrib];
|
var valueElm = formObj.elements[attrib];
|
||||||
@@ -300,9 +398,9 @@ function init() {
|
|||||||
document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
|
document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
|
||||||
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
||||||
|
|
||||||
var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
|
var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', ''), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
|
||||||
var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
|
var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
|
||||||
var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = "";
|
var id = "", summary = "", style = "", dir = "", lang = "", background = "", rules = "", frame = "";
|
||||||
var inst = tinyMCEPopup.editor, dom = inst.dom;
|
var inst = tinyMCEPopup.editor, dom = inst.dom;
|
||||||
var formObj = document.forms[0];
|
var formObj = document.forms[0];
|
||||||
var elm = dom.getParent(inst.selection.getNode(), "table");
|
var elm = dom.getParent(inst.selection.getNode(), "table");
|
||||||
@@ -323,7 +421,7 @@ function init() {
|
|||||||
|
|
||||||
if (elm && action != "insert") {
|
if (elm && action != "insert") {
|
||||||
var rowsAr = elm.rows;
|
var rowsAr = elm.rows;
|
||||||
var cols = 0;
|
cols = 0;
|
||||||
for (var i=0; i<rowsAr.length; i++)
|
for (var i=0; i<rowsAr.length; i++)
|
||||||
if (rowsAr[i].cells.length > cols)
|
if (rowsAr[i].cells.length > cols)
|
||||||
cols = rowsAr[i].cells.length;
|
cols = rowsAr[i].cells.length;
|
||||||
@@ -333,8 +431,8 @@ function init() {
|
|||||||
|
|
||||||
st = dom.parseStyle(dom.getAttrib(elm, "style"));
|
st = dom.parseStyle(dom.getAttrib(elm, "style"));
|
||||||
border = trimSize(getStyle(elm, 'border', 'borderWidth'));
|
border = trimSize(getStyle(elm, 'border', 'borderWidth'));
|
||||||
cellpadding = dom.getAttrib(elm, 'cellpadding', "");
|
cellpadding = dom.getAttrib(elm, 'cellpadding', '') || getTDTHOverallStyle(elm, 'padding');
|
||||||
cellspacing = dom.getAttrib(elm, 'cellspacing', "");
|
cellspacing = dom.getAttrib(elm, 'cellspacing', '') || trimSize(getStyle(elm, 'border-spacing'));
|
||||||
width = trimSize(getStyle(elm, 'width', 'width'));
|
width = trimSize(getStyle(elm, 'width', 'width'));
|
||||||
height = trimSize(getStyle(elm, 'height', 'height'));
|
height = trimSize(getStyle(elm, 'height', 'height'));
|
||||||
bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
|
bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
|
||||||
@@ -429,6 +527,11 @@ function cssSize(value, def) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nonCssSize(value) {
|
||||||
|
var parsedInt = parseInt(value, 10) || "";
|
||||||
|
return parsedInt.toString();
|
||||||
|
}
|
||||||
|
|
||||||
function changedBackgroundImage() {
|
function changedBackgroundImage() {
|
||||||
var formObj = document.forms[0];
|
var formObj = document.forms[0];
|
||||||
var st = dom.parseStyle(formObj.style.value);
|
var st = dom.parseStyle(formObj.style.value);
|
||||||
@@ -443,7 +546,7 @@ function changedBorder() {
|
|||||||
var st = dom.parseStyle(formObj.style.value);
|
var st = dom.parseStyle(formObj.style.value);
|
||||||
|
|
||||||
// Update border width if the element has a color
|
// Update border width if the element has a color
|
||||||
if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != ""))
|
if (formObj.border.value !== "" && (tinyMCEPopup.editor.settings.table_style_by_css || isCssSize(formObj.border.value)))
|
||||||
st['border-width'] = cssSize(formObj.border.value);
|
st['border-width'] = cssSize(formObj.border.value);
|
||||||
else {
|
else {
|
||||||
if (!formObj.border.value) {
|
if (!formObj.border.value) {
|
||||||
@@ -455,19 +558,26 @@ function changedBorder() {
|
|||||||
formObj.style.value = dom.serializeStyle(st);
|
formObj.style.value = dom.serializeStyle(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changedCellSpacing() {
|
||||||
|
var formObj = document.forms[0];
|
||||||
|
var st = dom.parseStyle(formObj.style.value);
|
||||||
|
|
||||||
|
if (formObj.cellspacing.value !== "")
|
||||||
|
st['border-spacing'] = cssSize(formObj.cellspacing.value);
|
||||||
|
else {
|
||||||
|
st['border-spacing'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
formObj.style.value = dom.serializeStyle(st);
|
||||||
|
}
|
||||||
|
|
||||||
function changedColor() {
|
function changedColor() {
|
||||||
var formObj = document.forms[0];
|
var formObj = document.forms[0];
|
||||||
var st = dom.parseStyle(formObj.style.value);
|
var st = dom.parseStyle(formObj.style.value);
|
||||||
|
|
||||||
st['background-color'] = formObj.bgcolor.value;
|
st['background-color'] = formObj.bgcolor.value;
|
||||||
|
|
||||||
if (formObj.bordercolor.value != "") {
|
st['border-color'] = formObj.bordercolor.value;
|
||||||
st['border-color'] = formObj.bordercolor.value;
|
|
||||||
|
|
||||||
// Add border-width if it's missing
|
|
||||||
if (!st['border-width'])
|
|
||||||
st['border-width'] = cssSize(formObj.border.value, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
formObj.style.value = dom.serializeStyle(st);
|
formObj.style.value = dom.serializeStyle(st);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
|
<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
|
||||||
<td class="col2">
|
<td class="col2">
|
||||||
<select id="rowtype" name="rowtype" class="mceFocus">
|
<select id="rowtype" name="rowtype" class="mceFocus" onChange="changedRowType();">
|
||||||
<option value="thead">{#table_dlg.thead}</option>
|
<option value="thead">{#table_dlg.thead}</option>
|
||||||
<option value="tbody">{#table_dlg.tbody}</option>
|
<option value="tbody">{#table_dlg.tbody}</option>
|
||||||
<option value="tfoot">{#table_dlg.tfoot}</option>
|
<option value="tfoot">{#table_dlg.tfoot}</option>
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="id">{#table_dlg.id}</label></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>
|
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -93,25 +93,25 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<select id="dir" name="dir" style="width: 200px">
|
<select id="dir" name="dir" style="width: 200px">
|
||||||
<option value="">{#not_set}</option>
|
<option value="">{#not_set}</option>
|
||||||
<option value="ltr">{#table_dlg.ltr}</option>
|
<option value="ltr">{#table_dlg.ltr}</option>
|
||||||
<option value="rtl">{#table_dlg.rtl}</option>
|
<option value="rtl">{#table_dlg.rtl}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -119,11 +119,11 @@
|
|||||||
<td id="backgroundimagebrowsercontainer"> </td>
|
<td id="backgroundimagebrowsercontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
||||||
<td>
|
<td>
|
||||||
<span role="group" aria-labelledby="bgcolor_label">
|
<span role="group" aria-labelledby="bgcolor_label">
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
|
<td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
|
||||||
<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
|
<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="5" class="size" /></td>
|
||||||
<td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
|
<td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
|
||||||
<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
|
<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="5" onchange="changedCellSpacing();" class="size" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
|
<td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
|
||||||
@@ -62,8 +62,8 @@
|
|||||||
</select></td>
|
</select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1" ><label for="caption">{#table_dlg.caption}</label></td>
|
<td class="column1" ><label for="caption">{#table_dlg.caption}</label></td>
|
||||||
<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
|
<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -75,13 +75,13 @@
|
|||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||||
<td><input id="id" name="id" type="text" value="" class="advfield" /></td>
|
<td><input id="id" name="id" type="text" value="" class="advfield" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="summary">{#table_dlg.summary}</label></td>
|
<td class="column1"><label for="summary">{#table_dlg.summary}</label></td>
|
||||||
<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
|
<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -90,14 +90,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td>
|
<td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td>
|
||||||
<td>
|
<td>
|
||||||
<input id="lang" name="lang" type="text" value="" class="advfield" />
|
<input id="lang" name="lang" type="text" value="" class="advfield" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<table role="presentation" aria-labelledby="backgroundimage_label" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" aria-labelledby="backgroundimage_label" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -105,54 +105,54 @@
|
|||||||
<td id="backgroundimagebrowsercontainer"> </td>
|
<td id="backgroundimagebrowsercontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="tframe">{#table_dlg.frame}</label></td>
|
<td class="column1"><label for="tframe">{#table_dlg.frame}</label></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="tframe" name="tframe" class="advfield">
|
<select id="tframe" name="tframe" class="advfield">
|
||||||
<option value="">{#not_set}</option>
|
<option value="">{#not_set}</option>
|
||||||
<option value="void">{#table_dlg.rules_void}</option>
|
<option value="void">{#table_dlg.rules_void}</option>
|
||||||
<option value="above">{#table_dlg.rules_above}</option>
|
<option value="above">{#table_dlg.rules_above}</option>
|
||||||
<option value="below">{#table_dlg.rules_below}</option>
|
<option value="below">{#table_dlg.rules_below}</option>
|
||||||
<option value="hsides">{#table_dlg.rules_hsides}</option>
|
<option value="hsides">{#table_dlg.rules_hsides}</option>
|
||||||
<option value="lhs">{#table_dlg.rules_lhs}</option>
|
<option value="lhs">{#table_dlg.rules_lhs}</option>
|
||||||
<option value="rhs">{#table_dlg.rules_rhs}</option>
|
<option value="rhs">{#table_dlg.rules_rhs}</option>
|
||||||
<option value="vsides">{#table_dlg.rules_vsides}</option>
|
<option value="vsides">{#table_dlg.rules_vsides}</option>
|
||||||
<option value="box">{#table_dlg.rules_box}</option>
|
<option value="box">{#table_dlg.rules_box}</option>
|
||||||
<option value="border">{#table_dlg.rules_border}</option>
|
<option value="border">{#table_dlg.rules_border}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column1"><label for="rules">{#table_dlg.rules}</label></td>
|
<td class="column1"><label for="rules">{#table_dlg.rules}</label></td>
|
||||||
<td>
|
<td>
|
||||||
<select id="rules" name="rules" class="advfield">
|
<select id="rules" name="rules" class="advfield">
|
||||||
<option value="">{#not_set}</option>
|
<option value="">{#not_set}</option>
|
||||||
<option value="none">{#table_dlg.frame_none}</option>
|
<option value="none">{#table_dlg.frame_none}</option>
|
||||||
<option value="groups">{#table_dlg.frame_groups}</option>
|
<option value="groups">{#table_dlg.frame_groups}</option>
|
||||||
<option value="rows">{#table_dlg.frame_rows}</option>
|
<option value="rows">{#table_dlg.frame_rows}</option>
|
||||||
<option value="cols">{#table_dlg.frame_cols}</option>
|
<option value="cols">{#table_dlg.frame_cols}</option>
|
||||||
<option value="all">{#table_dlg.frame_all}</option>
|
<option value="all">{#table_dlg.frame_all}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>
|
||||||
<select id="dir" name="dir" class="advfield">
|
<select id="dir" name="dir" class="advfield">
|
||||||
<option value="">{#not_set}</option>
|
<option value="">{#not_set}</option>
|
||||||
<option value="ltr">{#table_dlg.ltr}</option>
|
<option value="ltr">{#table_dlg.ltr}</option>
|
||||||
<option value="rtl">{#table_dlg.rtl}</option>
|
<option value="rtl">{#table_dlg.rtl}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr role="group" aria-labelledby="bordercolor_label">
|
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -160,11 +160,11 @@
|
|||||||
<td id="bordercolor_pickcontainer"> </td>
|
<td id="bordercolor_pickcontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr role="group" aria-labelledby="bgcolor_label">
|
<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>
|
<td>
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
<td id="bgcolor_pickcontainer"> </td>
|
<td id="bgcolor_pickcontainer"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
|
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\u00co-\u00ff^\uc397^u00f7\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
var t = this, last = 0, VK = tinymce.VK;
|
var t = this, last = 0, VK = tinymce.VK;
|
||||||
|
|
||||||
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’
|
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\u00co-\u00ff^\uc397^u00f7\'-]+/g); // u2019 == ’ u00c0-u00ff extended latin chars with diacritical marks. exclude uc397 multiplication & u00f7 division
|
||||||
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
|
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
|
||||||
t.update_rate = ed.getParam('wordcount_update_rate', 2000);
|
t.update_rate = ed.getParam('wordcount_update_rate', 2000);
|
||||||
t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);
|
t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -11,6 +11,25 @@
|
|||||||
(function(tinymce) {
|
(function(tinymce) {
|
||||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
|
var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
|
||||||
|
|
||||||
|
var applyDefaultFont = function (body, settings) {
|
||||||
|
var fontSize = settings.theme_advanced_default_font_size;
|
||||||
|
var fontFamily = settings.theme_advanced_default_font_family;
|
||||||
|
|
||||||
|
if (fontSize) {
|
||||||
|
body.style.fontSize = fontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fontFamily) {
|
||||||
|
body.style.fontFamily = fontFamily;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var hasDefaultFontSizeOrFamily = function (settings) {
|
||||||
|
var fontSize = settings.theme_advanced_default_font_size;
|
||||||
|
var fontFamily = settings.theme_advanced_default_font_family;
|
||||||
|
return !!(fontSize || fontFamily);
|
||||||
|
};
|
||||||
|
|
||||||
// Generates a preview for a format
|
// Generates a preview for a format
|
||||||
function getPreviewCss(ed, fmt) {
|
function getPreviewCss(ed, fmt) {
|
||||||
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
||||||
@@ -175,7 +194,7 @@
|
|||||||
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
||||||
theme_advanced_toolbar_align : "left",
|
theme_advanced_toolbar_align : "left",
|
||||||
theme_advanced_statusbar_location : "bottom",
|
theme_advanced_statusbar_location : "bottom",
|
||||||
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
|
theme_advanced_fonts : "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",
|
||||||
theme_advanced_more_colors : 1,
|
theme_advanced_more_colors : 1,
|
||||||
theme_advanced_row_height : 23,
|
theme_advanced_row_height : 23,
|
||||||
theme_advanced_resize_horizontal : 1,
|
theme_advanced_resize_horizontal : 1,
|
||||||
@@ -234,6 +253,8 @@
|
|||||||
t._updateUndoStatus(ed);
|
t._updateUndoStatus(ed);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applyDefaultFont(ed.getBody(), ed.settings);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onSetProgressState.add(function(ed, b, ti) {
|
ed.onSetProgressState.add(function(ed, b, ti) {
|
||||||
@@ -956,7 +977,7 @@
|
|||||||
a = s.theme_advanced_toolbar_align.toLowerCase();
|
a = s.theme_advanced_toolbar_align.toLowerCase();
|
||||||
a = 'mce' + t._ufirst(a);
|
a = 'mce' + t._ufirst(a);
|
||||||
|
|
||||||
n = DOM.add(DOM.add(c, 'tr', {role: 'toolbar'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
|
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
|
||||||
|
|
||||||
// Create toolbar and add the controls
|
// Create toolbar and add the controls
|
||||||
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
|
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
|
||||||
@@ -1079,8 +1100,8 @@
|
|||||||
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
|
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
|
||||||
});
|
});
|
||||||
|
|
||||||
function getParent(name) {
|
var getElement = function (elements, name) {
|
||||||
var i, parents = ob.parents, func = name;
|
var i, elements, func = name;
|
||||||
|
|
||||||
if (typeof(name) == 'string') {
|
if (typeof(name) == 'string') {
|
||||||
func = function(node) {
|
func = function(node) {
|
||||||
@@ -1088,12 +1109,20 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < parents.length; i++) {
|
for (i = 0; i < elements.length; i++) {
|
||||||
if (func(parents[i]))
|
if (func(elements[i]))
|
||||||
return parents[i];
|
return elements[i];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getParent(name) {
|
||||||
|
return getElement(ob.parents, name);
|
||||||
|
};
|
||||||
|
|
||||||
|
function getParentIncBody(name) {
|
||||||
|
return getElement([].concat(ob.parents).concat([ed.getBody()]), name);
|
||||||
|
};
|
||||||
|
|
||||||
cm.setActive('visualaid', ed.hasVisual);
|
cm.setActive('visualaid', ed.hasVisual);
|
||||||
t._updateUndoStatus(ed);
|
t._updateUndoStatus(ed);
|
||||||
cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
|
cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
|
||||||
@@ -1142,13 +1171,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find out current fontSize, fontFamily and fontClass
|
// Find out current fontSize, fontFamily and fontClass
|
||||||
getParent(function(n) {
|
getParentIncBody(function(n) {
|
||||||
|
var matchesSelector;
|
||||||
|
|
||||||
if (n.nodeName === 'SPAN') {
|
if (n.nodeName === 'SPAN') {
|
||||||
if (!cl && n.className)
|
if (!cl && n.className)
|
||||||
cl = n.className;
|
cl = n.className;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ed.dom.is(n, s.theme_advanced_font_selector)) {
|
matchesSelector = ed.dom.is(n, s.theme_advanced_font_selector);
|
||||||
|
if (matchesSelector || hasDefaultFontSizeOrFamily(ed.settings)) {
|
||||||
if (!fz && n.style.fontSize)
|
if (!fz && n.style.fontSize)
|
||||||
fz = n.style.fontSize;
|
fz = n.style.fontSize;
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,6 @@ function resizeInputs() {
|
|||||||
|
|
||||||
if (el) {
|
if (el) {
|
||||||
el.style.width = (vp.w - 20) + 'px';
|
el.style.width = (vp.w - 20) + 'px';
|
||||||
el.style.height = (vp.h - 70) + 'px';
|
el.style.height = (vp.h - 65) + 'px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ font[face=mceinline] {font-family:inherit !important}
|
|||||||
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
|
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
|
||||||
.mceItemVideo {background-image:url(../../img/video.gif)}
|
.mceItemVideo {background-image:url(../../img/video.gif)}
|
||||||
.mceItemAudio {background-image:url(../../img/video.gif)}
|
.mceItemAudio {background-image:url(../../img/video.gif)}
|
||||||
|
.mceItemObject {background-image:url(../../img/video.gif)}
|
||||||
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
|
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
|
||||||
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
||||||
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
|||||||
|
|
||||||
/* Panels */
|
/* Panels */
|
||||||
.panel_wrapper div.panel {display:none;}
|
.panel_wrapper div.panel {display:none;}
|
||||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||||
|
|
||||||
/* Columns */
|
/* Columns */
|
||||||
@@ -116,4 +116,3 @@ h3 {font-size:14px;}
|
|||||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
||||||
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
|||||||
|
|
||||||
/* Panels */
|
/* Panels */
|
||||||
.panel_wrapper div.panel {display:none;}
|
.panel_wrapper div.panel {display:none;}
|
||||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||||
.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
|
.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||||
|
|
||||||
/* Columns */
|
/* Columns */
|
||||||
@@ -104,4 +104,3 @@ h3 {font-size:14px;}
|
|||||||
#colorpicker #namedcolors {width:150px;}
|
#colorpicker #namedcolors {width:150px;}
|
||||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||||
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
||||||
body {background:#FFF;}
|
body {background:#FFF;}
|
||||||
body.mceForceColors {background:#FFF; color:#000;}
|
body.mceForceColors {background:#FFF; color:#000;}
|
||||||
h1 {font-size: 1em}
|
h1 {font-size: 2em}
|
||||||
h2 {font-size: 1em}
|
h2 {font-size: 1.5em}
|
||||||
h3 {font-size: 1em}
|
h3 {font-size: 1.17em}
|
||||||
h4 {font-size: 1em}
|
h4 {font-size: 1em}
|
||||||
h5 {font-size: 3em}
|
h5 {font-size: .83em}
|
||||||
h6 {font-size: 7em}
|
h6 {font-size: .75em}
|
||||||
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
||||||
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
|
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
|
||||||
span.mceItemNbsp {background: #DDD}
|
span.mceItemNbsp {background: #DDD}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
|||||||
|
|
||||||
/* Panels */
|
/* Panels */
|
||||||
.panel_wrapper div.panel {display:none;}
|
.panel_wrapper div.panel {display:none;}
|
||||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||||
|
|
||||||
/* Columns */
|
/* Columns */
|
||||||
@@ -116,4 +116,3 @@ h3 {font-size:14px;}
|
|||||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
||||||
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* Reset */
|
/* Reset */
|
||||||
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
||||||
.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||||
.o2k7Skin table td {vertical-align:top; background-color: white;}
|
.o2k7Skin table td {vertical-align:middle}
|
||||||
|
|
||||||
/* Containers */
|
/* Containers */
|
||||||
.o2k7Skin table {background:transparent}
|
.o2k7Skin table {background:transparent}
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
|
.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
|
||||||
.o2k7Skin table.mceLayout tr.mceLast {height:1px !important}
|
|
||||||
.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}
|
.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}
|
||||||
.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
|
.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
|
||||||
.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
|
.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
|
||||||
@@ -221,8 +220,3 @@
|
|||||||
.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
|
.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
|
||||||
.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
|
.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
|
||||||
.o2k7Skin span.mce_visualblocks {background-position: -40px -40px}
|
.o2k7Skin span.mce_visualblocks {background-position: -40px -40px}
|
||||||
|
|
||||||
|
|
||||||
a.mce_pmSimpleUploader, a.mce_pmVariablePicker, a.mce_pmGrids { border: 1px solid #BBBBBB; border-width: 1px 0 1px 0; background: #EEEEEE !important;}
|
|
||||||
a.mce_pmSimpleUploader:hover, a.mce_pmVariablePicker:hover, a.mce_pmGrids:hover {background: #FFDB6F !important;}
|
|
||||||
a.mce_pmSimpleUploader img, a.mce_pmVariablePicker img, a.mce_pmGrids img {margin: 0.25em 0 0 0.25em !important; width: 14px !important; height: 14px !important;}
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -2,4 +2,4 @@
|
|||||||
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
||||||
// document.domain = 'moxiecode.com';
|
// document.domain = 'moxiecode.com';
|
||||||
|
|
||||||
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(a){var a=(a&&a.target)||window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE&&!tinymce.isIE11){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}else{if(tinymce.isIE11){document.addEventListener("mouseup",tinyMCEPopup._restoreSelection,false)}}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
||||||
38297
gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
38297
gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user