Update to TinyMCE 3.5.6

pull/14/merge
Aleksander Machniak 12 years ago
parent baecd8becc
commit 750fcf8ece

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Update to TinyMCE 3.5.6
- Correctly escape localized labels in javascript variable (#1488567)
- Update Net_SMTP/Auth_SASL packages to fix Digest-MD5/Cram-MD5 authentication (#1488571)
- Don't add attachments content into reply/forward/draft message body (#1488557)

File diff suppressed because one or more lines are too long

@ -395,12 +395,14 @@ var ImageDialog = {
if (v == '0')
img.style.border = isIE ? '0' : '0 none none';
else {
if (b.length == 3 && b[isIE ? 2 : 1])
bStyle = b[isIE ? 2 : 1];
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
if (b.length == 3 && b[isOldIE ? 2 : 1])
bStyle = b[isOldIE ? 2 : 1];
else if (!bStyle || bStyle == 'none')
bStyle = 'solid';
if (b.length == 3 && b[isIE ? 0 : 2])
bColor = b[isIE ? 0 : 2];
bColor = b[isOldIE ? 0 : 2];
else if (!bColor || bColor == 'none')
bColor = 'black';
img.style.border = v + 'px ' + bStyle + ' ' + bColor;

@ -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}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);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)})();

@ -1,181 +1,184 @@
/**
* editor_plugin_src.js
*
* Copyright 2011, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.AutolinkPlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var t = this;
// Add a key down handler
ed.onKeyDown.addToTop(function(ed, e) {
if (e.keyCode == 13)
return t.handleEnter(ed);
});
// Internet Explorer has built-in automatic linking for most cases
if (tinyMCE.isIE)
return;
ed.onKeyPress.add(function(ed, e) {
if (e.which == 41)
return t.handleEclipse(ed);
});
// Add a key up handler
ed.onKeyUp.add(function(ed, e) {
if (e.keyCode == 32)
return t.handleSpacebar(ed);
});
},
handleEclipse : function(ed) {
this.parseCurrentLine(ed, -1, '(', true);
},
handleSpacebar : function(ed) {
this.parseCurrentLine(ed, 0, '', true);
},
handleEnter : function(ed) {
this.parseCurrentLine(ed, -1, '', false);
},
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
var r, end, start, endContainer, bookmark, text, matches, prev, len;
// We need at least five characters to form a URL,
// hence, at minimum, five characters from the beginning of the line.
r = ed.selection.getRng(true).cloneRange();
if (r.startOffset < 5) {
// During testing, the caret is placed inbetween two text nodes.
// The previous text node contains the URL.
prev = r.endContainer.previousSibling;
if (prev == null) {
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
return;
prev = r.endContainer.firstChild.nextSibling;
}
len = prev.length;
r.setStart(prev, len);
r.setEnd(prev, len);
if (r.endOffset < 5)
return;
end = r.endOffset;
endContainer = prev;
} else {
endContainer = r.endContainer;
// Get a text node
if (endContainer.nodeType != 3 && endContainer.firstChild) {
while (endContainer.nodeType != 3 && endContainer.firstChild)
endContainer = endContainer.firstChild;
r.setStart(endContainer, 0);
r.setEnd(endContainer, endContainer.nodeValue.length);
}
if (r.endOffset == 1)
end = 2;
else
end = r.endOffset - 1 - end_offset;
}
start = end;
do
{
// Move the selection one character backwards.
r.setStart(endContainer, end - 2);
r.setEnd(endContainer, end - 1);
end -= 1;
// Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
r.setStart(endContainer, end);
r.setEnd(endContainer, start);
end += 1;
} else if (r.startOffset == 0) {
r.setStart(endContainer, 0);
r.setEnd(endContainer, start);
}
else {
r.setStart(endContainer, end);
r.setEnd(endContainer, start);
}
// Exclude last . from word like "www.site.com."
var text = r.toString();
if (text.charAt(text.length - 1) == '.') {
r.setEnd(endContainer, start - 1);
}
text = r.toString();
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
if (matches) {
if (matches[1] == 'www.') {
matches[1] = 'http://www.';
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
}
bookmark = ed.selection.getBookmark();
ed.selection.setRng(r);
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
ed.selection.moveToBookmark(bookmark);
ed.nodeChanged();
// TODO: Determine if this is still needed.
if (tinyMCE.isWebKit) {
// move the caret to its original position
ed.selection.collapse(false);
var max = Math.min(endContainer.length, start + 1);
r.setStart(endContainer, max);
r.setEnd(endContainer, max);
ed.selection.setRng(r);
}
}
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
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
};
}
});
// Register plugin
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
})();
/**
* editor_plugin_src.js
*
* Copyright 2011, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.AutolinkPlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var t = this;
// Add a key down handler
ed.onKeyDown.addToTop(function(ed, e) {
if (e.keyCode == 13)
return t.handleEnter(ed);
});
// Internet Explorer has built-in automatic linking for most cases
if (tinyMCE.isIE)
return;
ed.onKeyPress.add(function(ed, e) {
if (e.which == 41)
return t.handleEclipse(ed);
});
// Add a key up handler
ed.onKeyUp.add(function(ed, e) {
if (e.keyCode == 32)
return t.handleSpacebar(ed);
});
},
handleEclipse : function(ed) {
this.parseCurrentLine(ed, -1, '(', true);
},
handleSpacebar : function(ed) {
this.parseCurrentLine(ed, 0, '', true);
},
handleEnter : function(ed) {
this.parseCurrentLine(ed, -1, '', false);
},
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
var r, end, start, endContainer, bookmark, text, matches, prev, len;
// We need at least five characters to form a URL,
// hence, at minimum, five characters from the beginning of the line.
r = ed.selection.getRng(true).cloneRange();
if (r.startOffset < 5) {
// During testing, the caret is placed inbetween two text nodes.
// The previous text node contains the URL.
prev = r.endContainer.previousSibling;
if (prev == null) {
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
return;
prev = r.endContainer.firstChild.nextSibling;
}
len = prev.length;
r.setStart(prev, len);
r.setEnd(prev, len);
if (r.endOffset < 5)
return;
end = r.endOffset;
endContainer = prev;
} else {
endContainer = r.endContainer;
// Get a text node
if (endContainer.nodeType != 3 && endContainer.firstChild) {
while (endContainer.nodeType != 3 && endContainer.firstChild)
endContainer = endContainer.firstChild;
// Move range to text node
if (endContainer.nodeType == 3) {
r.setStart(endContainer, 0);
r.setEnd(endContainer, endContainer.nodeValue.length);
}
}
if (r.endOffset == 1)
end = 2;
else
end = r.endOffset - 1 - end_offset;
}
start = end;
do
{
// Move the selection one character backwards.
r.setStart(endContainer, end - 2);
r.setEnd(endContainer, end - 1);
end -= 1;
// Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
r.setStart(endContainer, end);
r.setEnd(endContainer, start);
end += 1;
} else if (r.startOffset == 0) {
r.setStart(endContainer, 0);
r.setEnd(endContainer, start);
}
else {
r.setStart(endContainer, end);
r.setEnd(endContainer, start);
}
// Exclude last . from word like "www.site.com."
var text = r.toString();
if (text.charAt(text.length - 1) == '.') {
r.setEnd(endContainer, start - 1);
}
text = r.toString();
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
if (matches) {
if (matches[1] == 'www.') {
matches[1] = 'http://www.';
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
}
bookmark = ed.selection.getBookmark();
ed.selection.setRng(r);
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
ed.selection.moveToBookmark(bookmark);
ed.nodeChanged();
// TODO: Determine if this is still needed.
if (tinyMCE.isWebKit) {
// move the caret to its original position
ed.selection.collapse(false);
var max = Math.min(endContainer.length, start + 1);
r.setStart(endContainer, max);
r.setEnd(endContainer, max);
ed.selection.setRng(r);
}
}
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
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
};
}
});
// Register plugin
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
})();

@ -1,119 +1,119 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
/**
* Auto Resize
*
* This plugin automatically resizes the content area to fit its content height.
* It will retain a minimum height, which is the height of the content area when
* it's initialized.
*/
tinymce.create('tinymce.plugins.AutoResizePlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var t = this, oldSize = 0;
if (ed.getParam('fullscreen_is_enabled'))
return;
/**
* This method gets executed each time the editor needs to resize.
*/
function resize() {
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
// Get height differently depending on the browser used
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
// Don't make it smaller than the minimum height
if (myHeight > t.autoresize_min_height)
resizeHeight = myHeight;
// If a maximum height has been defined don't exceed this height
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
resizeHeight = t.autoresize_max_height;
body.style.overflowY = "auto";
de.style.overflowY = "auto"; // Old IE
} else {
body.style.overflowY = "hidden";
de.style.overflowY = "hidden"; // Old IE
body.scrollTop = 0;
}
// Resize content element
if (resizeHeight !== oldSize) {
deltaSize = resizeHeight - oldSize;
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
oldSize = resizeHeight;
// WebKit doesn't decrease the size of the body element until the iframe gets resized
// So we need to continue to resize the iframe down until the size gets fixed
if (tinymce.isWebKit && deltaSize < 0)
resize();
}
};
t.editor = ed;
// Define minimum height
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
// Define maximum height
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
// Add padding at the bottom for better UX
ed.onInit.add(function(ed){
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
});
// Add appropriate listeners for resizing content area
ed.onChange.add(resize);
ed.onSetContent.add(resize);
ed.onPaste.add(resize);
ed.onKeyUp.add(resize);
ed.onPostRender.add(resize);
if (ed.getParam('autoresize_on_init', true)) {
ed.onLoad.add(resize);
ed.onLoadContent.add(resize);
}
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mceAutoResize', resize);
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'Auto Resize',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
})();
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
/**
* Auto Resize
*
* This plugin automatically resizes the content area to fit its content height.
* It will retain a minimum height, which is the height of the content area when
* it's initialized.
*/
tinymce.create('tinymce.plugins.AutoResizePlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var t = this, oldSize = 0;
if (ed.getParam('fullscreen_is_enabled'))
return;
/**
* This method gets executed each time the editor needs to resize.
*/
function resize() {
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
// Get height differently depending on the browser used
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
// Don't make it smaller than the minimum height
if (myHeight > t.autoresize_min_height)
resizeHeight = myHeight;
// If a maximum height has been defined don't exceed this height
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
resizeHeight = t.autoresize_max_height;
body.style.overflowY = "auto";
de.style.overflowY = "auto"; // Old IE
} else {
body.style.overflowY = "hidden";
de.style.overflowY = "hidden"; // Old IE
body.scrollTop = 0;
}
// Resize content element
if (resizeHeight !== oldSize) {
deltaSize = resizeHeight - oldSize;
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
oldSize = resizeHeight;
// WebKit doesn't decrease the size of the body element until the iframe gets resized
// So we need to continue to resize the iframe down until the size gets fixed
if (tinymce.isWebKit && deltaSize < 0)
resize();
}
};
t.editor = ed;
// Define minimum height
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
// Define maximum height
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
// Add padding at the bottom for better UX
ed.onInit.add(function(ed){
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
});
// Add appropriate listeners for resizing content area
ed.onChange.add(resize);
ed.onSetContent.add(resize);
ed.onPaste.add(resize);
ed.onKeyUp.add(resize);
ed.onPostRender.add(resize);
if (ed.getParam('autoresize_on_init', true)) {
ed.onLoad.add(resize);
ed.onLoadContent.add(resize);
}
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mceAutoResize', resize);
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'Auto Resize',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
})();

@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();

@ -15,30 +15,33 @@
t.editor = ed;
ed.addCommand('mceDirectionLTR', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "ltr")
ed.dom.setAttrib(e, "dir", "ltr");
else
ed.dom.setAttrib(e, "dir", "");
function setDir(dir) {
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
if (blocks.length) {
curDir = dom.getAttrib(blocks[0], "dir");
tinymce.each(blocks, function(block) {
// Add dir to block if the parent block doesn't already have that dir
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
if (curDir != dir) {
dom.setAttrib(block, "dir", dir);
} else {
dom.setAttrib(block, "dir", null);
}
}
});
ed.nodeChanged();
}
}
ed.nodeChanged();
ed.addCommand('mceDirectionLTR', function() {
setDir("ltr");
});
ed.addCommand('mceDirectionRTL', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "rtl")
ed.dom.setAttrib(e, "dir", "rtl");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
setDir("rtl");
});
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});

@ -1,50 +1,50 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'Example Dependency plugin',
author : 'Some author',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
version : "1.0"
};
}
});
/**
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
* with an object which has the url to the plugin and the shortname.
*/
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
})();
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'Example Dependency plugin',
author : 'Some author',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
version : "1.0"
};
}
});
/**
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
* with an object which has the url to the plugin and the shortname.
*/
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
})();

@ -1 +1 @@
tinyMCE.addI18n('he.fullpage_dlg',{title:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05de\u05e1\u05de\u05da","meta_tab":"\u05db\u05dc\u05dc\u05d9","appearance_tab":"\u05de\u05e8\u05d0\u05d4","advanced_tab":"\u05de\u05ea\u05e7\u05d3\u05dd","meta_props":"\u05ea\u05d2\u05d9 \u05de\u05d8\u05d4",langprops:"\u05e9\u05e4\u05d4 \u05d5\u05e7\u05d9\u05d3\u05d5\u05d3","meta_title":"\u05db\u05d5\u05ea\u05e8\u05ea","meta_keywords":"\u05de\u05d9\u05dc\u05d5\u05ea \u05de\u05e4\u05ea\u05d7","meta_description":"\u05ea\u05d9\u05d0\u05d5\u05e8","meta_robots":"\u05e8\u05d5\u05d1\u05d5\u05d8\u05d9\u05dd",doctypes:"Doctype",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc","xml_pi":"XML declaration",encoding:"\u05e7\u05d9\u05d3\u05d5\u05d3 \u05ea\u05d5\u05d5\u05d9\u05dd","appearance_bgprops":"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05e8\u05e7\u05e2","appearance_marginprops":"Body margins","appearance_linkprops":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","appearance_textprops":"Text properties",bgcolor:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",bgimage:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2","left_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e9\u05de\u05d0\u05dc\u05d9\u05d9\u05dd","right_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05d9\u05de\u05e0\u05d9\u05d9\u05dd","top_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e2\u05dc\u05d9\u05d5\u05e0\u05d9\u05dd","bottom_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05ea\u05d7\u05ea\u05d9\u05d9\u05dd","text_color":"\u05e6\u05d1\u05e2 \u05d8\u05e7\u05e1\u05d8","font_size":"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df","font_face":"\u05e1\u05d5\u05d2 \u05d2\u05d5\u05e4\u05df","link_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8","hover_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05de\u05e2\u05d1\u05e8 \u05e2\u05db\u05d1\u05e8","visited_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e9\u05e0\u05e6\u05e4\u05d4","active_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e4\u05e2\u05d9\u05dc",textcolor:"\u05e6\u05d1\u05e2",fontsize:"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df",fontface:"\u05d2\u05d5\u05e4\u05df","meta_index_follow":"Index and follow the links","meta_index_nofollow":"Index and don\'t follow the links","meta_noindex_follow":"Do not index but follow the links","meta_noindex_nofollow":"Do not index and don\\\'t follow the links","appearance_style":"Stylesheet and style properties",stylesheet:"\u05e1\u05d2\u05e0\u05d5\u05df \u05e2\u05d9\u05e6\u05d5\u05d1",style:"\u05e2\u05d9\u05e6\u05d5\u05d1",author:"\u05db\u05d5\u05ea\u05d1",copyright:"\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05d9\u05d5\u05e6\u05e8\u05d9\u05dd",add:"Add new element",remove:"Remove selected element",moveup:"Move selected element up",movedown:"Move selected element down","head_elements":"Head elements",info:"\u05de\u05d9\u05d3\u05e2","add_title":"Title element","add_meta":"Meta element","add_script":"Script element","add_style":"Style element","add_link":"Link element","add_base":"Base element","add_comment":"Comment node","title_element":"Title element","script_element":"Script element","style_element":"Style element","base_element":"Base element","link_element":"Link element","meta_element":"Meta element","comment_element":"\u05ea\u05d2\u05d5\u05d1\u05d4",src:"\u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05e7\u05d5\u05e8",language:"\u05e9\u05e4\u05d4",href:"Href",target:"\u05d9\u05e2\u05d3",type:"\u05e1\u05d5\u05d2",charset:"\u05e7\u05d9\u05d3\u05d5\u05d3",defer:"Defer",media:"\u05de\u05d3\u05d9\u05d4",properties:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd",name:"\u05e9\u05dd",value:"\u05e2\u05e8\u05da",content:"\u05ea\u05d5\u05db\u05df",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"\u05db\u05dc\u05dc\u05d9","advanced_props":"\u05de\u05ea\u05e7\u05d3\u05dd"});
tinyMCE.addI18n('he.fullpage_dlg',{title:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05de\u05e1\u05de\u05da","meta_tab":"\u05db\u05dc\u05dc\u05d9","appearance_tab":"\u05de\u05e8\u05d0\u05d4","advanced_tab":"\u05de\u05ea\u05e7\u05d3\u05dd","meta_props":"\u05ea\u05d2\u05d9 \u05de\u05d8\u05d4",langprops:"\u05e9\u05e4\u05d4 \u05d5\u05e7\u05d9\u05d3\u05d5\u05d3","meta_title":"\u05db\u05d5\u05ea\u05e8\u05ea","meta_keywords":"\u05de\u05d9\u05dc\u05d5\u05ea \u05de\u05e4\u05ea\u05d7","meta_description":"\u05ea\u05d9\u05d0\u05d5\u05e8","meta_robots":"\u05e8\u05d5\u05d1\u05d5\u05d8\u05d9\u05dd",doctypes:"Doctype",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc","xml_pi":"XML declaration",encoding:"\u05e7\u05d9\u05d3\u05d5\u05d3 \u05ea\u05d5\u05d5\u05d9\u05dd","appearance_bgprops":"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05e8\u05e7\u05e2","appearance_marginprops":"Body margins","appearance_linkprops":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","appearance_textprops":"Text properties",bgcolor:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",bgimage:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2","left_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e9\u05de\u05d0\u05dc\u05d9\u05d9\u05dd","right_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05d9\u05de\u05e0\u05d9\u05d9\u05dd","top_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e2\u05dc\u05d9\u05d5\u05e0\u05d9\u05dd","bottom_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05ea\u05d7\u05ea\u05d9\u05d9\u05dd","text_color":"\u05e6\u05d1\u05e2 \u05d8\u05e7\u05e1\u05d8","font_size":"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df","font_face":"\u05e1\u05d5\u05d2 \u05d2\u05d5\u05e4\u05df","link_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8","hover_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05de\u05e2\u05d1\u05e8 \u05e2\u05db\u05d1\u05e8","visited_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e9\u05e0\u05e6\u05e4\u05d4","active_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e4\u05e2\u05d9\u05dc",textcolor:"\u05e6\u05d1\u05e2",fontsize:"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df",fontface:"\u05d2\u05d5\u05e4\u05df","meta_index_follow":"Index and follow the links","meta_index_nofollow":"Index and don\'t follow the links","meta_noindex_follow":"Do not index but follow the links","meta_noindex_nofollow":"Do not index and don\\\'t follow the links","appearance_style":"Stylesheet and style properties",stylesheet:"\u05e1\u05d2\u05e0\u05d5\u05df \u05e2\u05d9\u05e6\u05d5\u05d1",style:"\u05e2\u05d9\u05e6\u05d5\u05d1",author:"\u05db\u05d5\u05ea\u05d1",copyright:"\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05d9\u05d5\u05e6\u05e8\u05d9\u05dd",add:"\u05d4\u05d5\u05e1\u05e3 \u05d0\u05dc\u05de\u05e0\u05d8 \u05d7\u05d3\u05e9",remove:"Remove selected element",moveup:"Move selected element up",movedown:"Move selected element down","head_elements":"Head elements",info:"\u05de\u05d9\u05d3\u05e2","add_title":"Title element","add_meta":"Meta element","add_script":"Script element","add_style":"Style element","add_link":"Link element","add_base":"Base element","add_comment":"Comment node","title_element":"Title element","script_element":"Script element","style_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05e2\u05d9\u05e6\u05d5\u05d1","base_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05d1\u05e1\u05d9\u05e1","link_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05e7\u05d9\u05e9\u05d5\u05e8","meta_element":"Meta element","comment_element":"\u05ea\u05d2\u05d5\u05d1\u05d4",src:"\u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05e7\u05d5\u05e8",language:"\u05e9\u05e4\u05d4",href:"HREF",target:"\u05d9\u05e2\u05d3",type:"\u05e1\u05d5\u05d2",charset:"\u05e7\u05d9\u05d3\u05d5\u05d3",defer:"Defer",media:"\u05de\u05d3\u05d9\u05d4",properties:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd",name:"\u05e9\u05dd",value:"\u05e2\u05e8\u05da",content:"\u05ea\u05d5\u05db\u05df",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"\u05db\u05dc\u05dc\u05d9","advanced_props":"\u05de\u05ea\u05e7\u05d3\u05dd"});

@ -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().firstChild);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 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)})();

@ -65,7 +65,7 @@
// Fixes an IE bug where the scrollbars doesn't reappear
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
s.fullscreen_html_overflow = 'auto';
s.fullscreen_html_overflow = 'auto';
if (s.fullscreen_overflow == '0px')
s.fullscreen_overflow = '';
@ -85,7 +85,7 @@
posCss = 'fixed;top:0';
n = DOM.add(DOM.doc.body, 'div', {
id : 'mce_fullscreen_container',
id : 'mce_fullscreen_container',
style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
DOM.add(n, 'div', {id : 'mce_fullscreen'});
@ -127,7 +127,7 @@
var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
// Get outer/inner size to get a delta size that can be used to calc the new iframe size
outerSize = fed.dom.getSize(fed.getContainer().firstChild);
outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
@ -156,4 +156,4 @@
// Register plugin
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
})();
})();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -382,7 +382,7 @@
data = JSON.parse(data);
typeItem = this.getType(node.attr('class'));
style = node.attr('data-mce-style')
style = node.attr('data-mce-style');
if (!style) {
style = node.attr('style');

@ -78,7 +78,7 @@
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
if (html == "")
@ -326,6 +326,39 @@
setVal('src', src);
setVal('media_type', data.type);
}
// Vimeo
if (src.match(/vimeo.com\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// stream.cz
if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// Google maps
if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";
setVal('src', src);
setVal('media_type', data.type);
}
if (data.type == 'video') {
if (!data.video.sources)

File diff suppressed because one or more lines are too long

@ -14,10 +14,7 @@
var VK = tinymce.VK;
function handleContentEditableSelection(ed) {
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret';
// Setup invisible character use zero width space on Gecko since it doesn't change the height of the container
invisibleChar = tinymce.isGecko ? '\u200B' : '\uFEFF';
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
// Returns the content editable state of a node "true/false" or null
function getContentEditable(node) {

@ -1 +1 @@
tinyMCE.addI18n('es.style_dlg',{"text_lineheight":"Ancho de la fila","text_variant":"Variante","text_style":"Estilo","text_weight":"Peso","text_size":"Tama\u00f1o","text_font":"Fuente","text_props":"Texto","positioning_tab":"Posici\u00f3n","list_tab":"Lista","border_tab":"Borde","box_tab":"Caja","block_tab":"Bloque","background_tab":"Fondo","text_tab":"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidad","positioning_type":"Tipo",position:"Posici\u00f3n","bullet_image":"Imagen de la vi\u00f1eta","list_type":"Tipo",color:"Color",height:"Alto",width:"Ancho",style:"Estilo",margin:"Margen",left:"Izquierda",bottom:"Debajo",right:"Derecha",top:"Arriba",same:"Lo mismo en todos",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Alto","box_width":"Ancho","block_display":"Display","block_whitespace":"Espacio en blanco","block_text_indent":"Sangr\u00eda","block_text_align":"Alineaci\u00f3n del texto","block_vertical_alignment":"Alineaci\u00f3n vertical","block_letterspacing":"Espacio entre letra","block_wordspacing":"Espacio entre palabra","background_vpos":"Posici\u00f3n vertical","background_hpos":"Posici\u00f3n horizontal","background_attachment":"Adjunto","background_repeat":"Repetici\u00f3n","background_image":"Imagen de fondo","background_color":"Color de fondo","text_none":"Ninguno","text_blink":"Parpadeo","text_case":"Min\u00fas./May\u00fas.","text_striketrough":"Tachado","text_underline":"Subrayado","text_overline":"Subrayado superior","text_decoration":"Decorativos","text_color":"Color",text:"Texto",background:"Fondo",block:"Bloque",box:"Caja",border:"Borde",list:"Lista"});
tinyMCE.addI18n('es.style_dlg',{"text_lineheight":"Ancho de la fila","text_variant":"Variante","text_style":"Estilo","text_weight":"Peso","text_size":"Tama\u00f1o","text_font":"Fuente","text_props":"Texto","positioning_tab":"Posicionamiento","list_tab":"Lista","border_tab":"Borde","box_tab":"Caja","block_tab":"Bloque","background_tab":"Fondo","text_tab":"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidad","positioning_type":"Tipo",position:"Posici\u00f3n","bullet_image":"Imagen de la vi\u00f1eta","list_type":"Tipo",color:"Color",height:"Alto",width:"Ancho",style:"Estilo",margin:"Margen",left:"Izquierda",bottom:"Inferior",right:"Derecha",top:"Superior",same:"Lo mismo en todos",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Alto","box_width":"Ancho","block_display":"Display","block_whitespace":"Espacio en blanco","block_text_indent":"Sangr\u00eda","block_text_align":"Alineaci\u00f3n del texto","block_vertical_alignment":"Alineaci\u00f3n vertical","block_letterspacing":"Espacio entre letra","block_wordspacing":"Espacio entre palabra","background_vpos":"Posici\u00f3n vertical","background_hpos":"Posici\u00f3n horizontal","background_attachment":"Adjunto","background_repeat":"Repetici\u00f3n","background_image":"Imagen de fondo","background_color":"Color de fondo","text_none":"Ninguno","text_blink":"Parpadeo","text_case":"Min\u00fas./May\u00fas.","text_striketrough":"Tachado","text_underline":"Subrayado","text_overline":"Subrayado superior","text_decoration":"Decorativos","text_color":"Color",text:"Texto",background:"Fondo",block:"Bloque",box:"Caja",border:"Borde",list:"Lista"});

File diff suppressed because it is too large Load Diff

@ -1,19 +1,19 @@
Edit CSS Style plug-in notes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike WYSIWYG editor functionality that operates only on the selected text,
typically by inserting new HTML elements with the specified styles.
This plug-in operates on the HTML blocks surrounding the selected text.
No new HTML elements are created.
This plug-in only operates on the surrounding blocks and not the nearest
parent node. This means that if a block encapsulates a node,
e.g <p><span>text</span></p>, then only the styles in the block are
recognized, not those in the span.
When selecting text that includes multiple blocks at the same level (peers),
this plug-in accumulates the specified styles in all of the surrounding blocks
and populates the dialogue checkboxes accordingly. There is no differentiation
between styles set in all the blocks versus styles set in some of the blocks.
When the [Update] or [Apply] buttons are pressed, the styles selected in the
checkboxes are applied to all blocks that surround the selected text.
Edit CSS Style plug-in notes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike WYSIWYG editor functionality that operates only on the selected text,
typically by inserting new HTML elements with the specified styles.
This plug-in operates on the HTML blocks surrounding the selected text.
No new HTML elements are created.
This plug-in only operates on the surrounding blocks and not the nearest
parent node. This means that if a block encapsulates a node,
e.g <p><span>text</span></p>, then only the styles in the block are
recognized, not those in the span.
When selecting text that includes multiple blocks at the same level (peers),
this plug-in accumulates the specified styles in all of the surrounding blocks
and populates the dialogue checkboxes accordingly. There is no differentiation
between styles set in all the blocks versus styles set in some of the blocks.
When the [Update] or [Apply] buttons are pressed, the styles selected in the
checkboxes are applied to all blocks that surround the selected text.

@ -1,122 +1,122 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
tinymce.create('tinymce.plugins.TabFocusPlugin', {
init : function(ed, url) {
function tabCancel(ed, e) {
if (e.keyCode === 9)
return Event.cancel(e);
}
function tabHandler(ed, e) {
var x, i, f, el, v;
function find(d) {
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
function canSelectRecursive(e) {
return e.nodeName==="BODY" || (e.type != 'hidden' &&
!(e.style.display == "none") &&
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
}
function canSelectInOldIe(el) {
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
}
function isOldIe() {
return tinymce.isIE6 || tinymce.isIE7;
}
function canSelect(el) {
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
}
each(el, function(e, i) {
if (e.id == ed.id) {
x = i;
return false;
}
});
if (d > 0) {
for (i = x + 1; i < el.length; i++) {
if (canSelect(el[i]))
return el[i];
}
} else {
for (i = x - 1; i >= 0; i--) {
if (canSelect(el[i]))
return el[i];
}
}
return null;
}
if (e.keyCode === 9) {
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
if (v.length == 1) {
v[1] = v[0];
v[0] = ':prev';
}
// Find element to focus
if (e.shiftKey) {
if (v[0] == ':prev')
el = find(-1);
else
el = DOM.get(v[0]);
} else {
if (v[1] == ':next')
el = find(1);
else
el = DOM.get(v[1]);
}
if (el) {
if (el.id && (ed = tinymce.get(el.id || el.name)))
ed.focus();
else
window.setTimeout(function() {
if (!tinymce.isWebKit)
window.focus();
el.focus();
}, 10);
return Event.cancel(e);
}
}
}
ed.onKeyUp.add(tabCancel);
if (tinymce.isGecko) {
ed.onKeyPress.add(tabHandler);
ed.onKeyDown.add(tabCancel);
} else
ed.onKeyDown.add(tabHandler);
},
getInfo : function() {
return {
longname : 'Tabfocus',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
})();
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
tinymce.create('tinymce.plugins.TabFocusPlugin', {
init : function(ed, url) {
function tabCancel(ed, e) {
if (e.keyCode === 9)
return Event.cancel(e);
}
function tabHandler(ed, e) {
var x, i, f, el, v;
function find(d) {
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
function canSelectRecursive(e) {
return e.nodeName==="BODY" || (e.type != 'hidden' &&
!(e.style.display == "none") &&
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
}
function canSelectInOldIe(el) {
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
}
function isOldIe() {
return tinymce.isIE6 || tinymce.isIE7;
}
function canSelect(el) {
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
}
each(el, function(e, i) {
if (e.id == ed.id) {
x = i;
return false;
}
});
if (d > 0) {
for (i = x + 1; i < el.length; i++) {
if (canSelect(el[i]))
return el[i];
}
} else {
for (i = x - 1; i >= 0; i--) {
if (canSelect(el[i]))
return el[i];
}
}
return null;
}
if (e.keyCode === 9) {
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
if (v.length == 1) {
v[1] = v[0];
v[0] = ':prev';
}
// Find element to focus
if (e.shiftKey) {
if (v[0] == ':prev')
el = find(-1);
else
el = DOM.get(v[0]);
} else {
if (v[1] == ':next')
el = find(1);
else
el = DOM.get(v[1]);
}
if (el) {
if (el.id && (ed = tinymce.get(el.id || el.name)))
ed.focus();
else
window.setTimeout(function() {
if (!tinymce.isWebKit)
window.focus();
el.focus();
}, 10);
return Event.cancel(e);
}
}
}
ed.onKeyUp.add(tabCancel);
if (tinymce.isGecko) {
ed.onKeyPress.add(tabHandler);
ed.onKeyDown.add(tabCancel);
} else
ed.onKeyDown.add(tabHandler);
},
getInfo : function() {
return {
longname : 'Tabfocus',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -13,7 +13,7 @@
// Generates a preview for a format
function getPreviewCss(ed, fmt) {
var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
previewStyles = ed.settings.preview_styles;
@ -831,6 +831,7 @@
var f = Event.add(ed.id + '_external_close', 'click', function() {
DOM.hide(ed.id + '_external');
Event.remove(ed.id + '_external_close', 'click', f);
return false;
});
DOM.show(e);
@ -1038,6 +1039,8 @@
width = startWidth + (e.screenX - startX);
height = startHeight + (e.screenY - startY);
t.resizeTo(width, height, true);
ed.nodeChanged();
};
e.preventDefault();
@ -1286,7 +1289,7 @@
ti += 'id: ' + v + ' ';
if (v = n.className) {
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '');
if (v) {
ti += 'class: ' + v + ' ';

@ -1,345 +1,345 @@
tinyMCEPopup.requireLangPack();
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
var colors = [
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
];
var named = {
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
};
var namedLookup = {};
function init() {
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
tinyMCEPopup.resizeToInnerSize();
generatePicker();
generateWebColors();
generateNamedColors();
if (inputColor) {
changeFinalColor(inputColor);
col = convertHexToRGB(inputColor);
if (col)
updateLight(col.r, col.g, col.b);
}
for (key in named) {
value = named[key];
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
}
}
function toHexColor(color) {
var matches, red, green, blue, toInt = parseInt;
function hex(value) {
value = parseInt(value).toString(16);
return value.length > 1 ? value : '0' + value; // Padd with leading zero
};
color = tinymce.trim(color);
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
color = namedLookup[color] || color;
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
if (matches) {
red = toInt(matches[1]);
green = toInt(matches[2]);
blue = toInt(matches[3]);
} else {
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
if (matches) {
red = toInt(matches[1], 16);
green = toInt(matches[2], 16);
blue = toInt(matches[3], 16);
} else {
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
if (matches) {
red = toInt(matches[1] + matches[1], 16);
green = toInt(matches[2] + matches[2], 16);
blue = toInt(matches[3] + matches[3], 16);
} else {
return '';
}
}
}
return '#' + hex(red) + hex(green) + hex(blue);
}
function insertAction() {
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
var hexColor = toHexColor(color);
if (hexColor === '') {
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
tinyMCEPopup.alert(text + ': ' + color);
}
else {
tinyMCEPopup.restoreSelection();
if (f)
f(hexColor);
tinyMCEPopup.close();
}
}
function showColor(color, name) {
if (name)
document.getElementById("colorname").innerHTML = name;
document.getElementById("preview").style.backgroundColor = color;
document.getElementById("color").value = color.toUpperCase();
}
function convertRGBToHex(col) {
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
if (!col)
return col;
var rgb = col.replace(re, "$1,$2,$3").split(',');
if (rgb.length == 3) {
r = parseInt(rgb[0]).toString(16);
g = parseInt(rgb[1]).toString(16);
b = parseInt(rgb[2]).toString(16);
r = r.length == 1 ? '0' + r : r;
g = g.length == 1 ? '0' + g : g;
b = b.length == 1 ? '0' + b : b;
return "#" + r + g + b;
}
return col;
}
function convertHexToRGB(col) {
if (col.indexOf('#') != -1) {
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
r = parseInt(col.substring(0, 2), 16);
g = parseInt(col.substring(2, 4), 16);
b = parseInt(col.substring(4, 6), 16);
return {r : r, g : g, b : b};
}
return null;
}
function generatePicker() {
var el = document.getElementById('light'), h = '', i;
for (i = 0; i < detail; i++){
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
+ ' onmousedown="isMouseDown = true; return false;"'
+ ' onmouseup="isMouseDown = false;"'
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+ ' onmouseover="isMouseOver = true;"'
+ ' onmouseout="isMouseOver = false;"'
+ '></div>';
}
el.innerHTML = h;
}
function generateWebColors() {
var el = document.getElementById('webcolors'), h = '', i;
if (el.className == 'generated')
return;
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
+ '<tr>';
for (i=0; i<colors.length; i++) {
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
if (tinyMCEPopup.editor.forcedHighContrastMode) {
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
}
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
h += '</a></td>';
if ((i+1) % 18 == 0)
h += '</tr><tr>';
}
h += '</table></div>';
el.innerHTML = h;
el.className = 'generated';
paintCanvas(el);
enableKeyboardNavigation(el.firstChild);
}
function paintCanvas(el) {
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
var context;
if (canvas.getContext && (context = canvas.getContext("2d"))) {
context.fillStyle = canvas.getAttribute('data-color');
context.fillRect(0, 0, 10, 10);
}
});
}
function generateNamedColors() {
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
if (el.className == 'generated')
return;
for (n in named) {
v = named[n];
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
if (tinyMCEPopup.editor.forcedHighContrastMode) {
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
}
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
h += '</a>';
i++;
}
el.innerHTML = h;
el.className = 'generated';
paintCanvas(el);
enableKeyboardNavigation(el);
}
function enableKeyboardNavigation(el) {
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
root: el,
items: tinyMCEPopup.dom.select('a', el)
}, tinyMCEPopup.dom);
}
function dechex(n) {
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
}
function computeColor(e) {
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
partWidth = document.getElementById('colors').width / 6;
partDetail = detail / 2;
imHeight = document.getElementById('colors').height;
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
coef = (imHeight - y) / imHeight;
r = 128 + (r - 128) * coef;
g = 128 + (g - 128) * coef;
b = 128 + (b - 128) * coef;
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
updateLight(r, g, b);
}
function updateLight(r, g, b) {
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
for (i=0; i<detail; i++) {
if ((i>=0) && (i<partDetail)) {
finalCoef = i / partDetail;
finalR = dechex(255 - (255 - r) * finalCoef);
finalG = dechex(255 - (255 - g) * finalCoef);
finalB = dechex(255 - (255 - b) * finalCoef);
} else {
finalCoef = 2 - i / partDetail;
finalR = dechex(r * finalCoef);
finalG = dechex(g * finalCoef);
finalB = dechex(b * finalCoef);
}
color = finalR + finalG + finalB;
setCol('gs' + i, '#'+color);
}
}
function changeFinalColor(color) {
if (color.indexOf('#') == -1)
color = convertRGBToHex(color);
setCol('preview', color);
document.getElementById('color').value = color;
}
function setCol(e, c) {
try {
document.getElementById(e).style.backgroundColor = c;
} catch (ex) {
// Ignore IE warning
}
}
tinyMCEPopup.onInit.add(init);
tinyMCEPopup.requireLangPack();
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
var colors = [
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
];
var named = {
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
};
var namedLookup = {};
function init() {
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
tinyMCEPopup.resizeToInnerSize();
generatePicker();
generateWebColors();
generateNamedColors();
if (inputColor) {
changeFinalColor(inputColor);
col = convertHexToRGB(inputColor);
if (col)
updateLight(col.r, col.g, col.b);
}
for (key in named) {
value = named[key];
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
}
}
function toHexColor(color) {
var matches, red, green, blue, toInt = parseInt;
function hex(value) {
value = parseInt(value).toString(16);
return value.length > 1 ? value : '0' + value; // Padd with leading zero
};
color = tinymce.trim(color);
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
color = namedLookup[color] || color;
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
if (matches) {
red = toInt(matches[1]);
green = toInt(matches[2]);
blue = toInt(matches[3]);
} else {
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
if (matches) {
red = toInt(matches[1], 16);
green = toInt(matches[2], 16);
blue = toInt(matches[3], 16);
} else {
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
if (matches) {
red = toInt(matches[1] + matches[1], 16);
green = toInt(matches[2] + matches[2], 16);
blue = toInt(matches[3] + matches[3], 16);
} else {
return '';
}
}
}
return '#' + hex(red) + hex(green) + hex(blue);
}
function insertAction() {
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
var hexColor = toHexColor(color);
if (hexColor === '') {
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
tinyMCEPopup.alert(text + ': ' + color);
}
else {
tinyMCEPopup.restoreSelection();
if (f)
f(hexColor);
tinyMCEPopup.close();
}
}
function showColor(color, name) {
if (name)
document.getElementById("colorname").innerHTML = name;
document.getElementById("preview").style.backgroundColor = color;
document.getElementById("color").value = color.toUpperCase();
}
function convertRGBToHex(col) {
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
if (!col)
return col;
var rgb = col.replace(re, "$1,$2,$3").split(',');
if (rgb.length == 3) {
r = parseInt(rgb[0]).toString(16);
g = parseInt(rgb[1]).toString(16);
b = parseInt(rgb[2]).toString(16);
r = r.length == 1 ? '0' + r : r;
g = g.length == 1 ? '0' + g : g;
b = b.length == 1 ? '0' + b : b;
return "#" + r + g + b;
}
return col;
}
function convertHexToRGB(col) {
if (col.indexOf('#') != -1) {
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
r = parseInt(col.substring(0, 2), 16);
g = parseInt(col.substring(2, 4), 16);
b = parseInt(col.substring(4, 6), 16);
return {r : r, g : g, b : b};
}
return null;
}
function generatePicker() {
var el = document.getElementById('light'), h = '', i;
for (i = 0; i < detail; i++){
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
+ ' onmousedown="isMouseDown = true; return false;"'
+ ' onmouseup="isMouseDown = false;"'
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+ ' onmouseover="isMouseOver = true;"'
+ ' onmouseout="isMouseOver = false;"'
+ '></div>';
}
el.innerHTML = h;
}
function generateWebColors() {
var el = document.getElementById('webcolors'), h = '', i;
if (el.className == 'generated')
return;
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
+ '<tr>';
for (i=0; i<colors.length; i++) {
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
if (tinyMCEPopup.editor.forcedHighContrastMode) {
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
}
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
h += '</a></td>';
if ((i+1) % 18 == 0)
h += '</tr><tr>';
}
h += '</table></div>';
el.innerHTML = h;
el.className = 'generated';
paintCanvas(el);
enableKeyboardNavigation(el.firstChild);
}
function paintCanvas(el) {
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
var context;
if (canvas.getContext && (context = canvas.getContext("2d"))) {
context.fillStyle = canvas.getAttribute('data-color');
context.fillRect(0, 0, 10, 10);
}
});
}
function generateNamedColors() {
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
if (el.className == 'generated')
return;
for (n in named) {
v = named[n];
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
if (tinyMCEPopup.editor.forcedHighContrastMode) {
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
}
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
h += '</a>';
i++;
}
el.innerHTML = h;
el.className = 'generated';
paintCanvas(el);
enableKeyboardNavigation(el);
}
function enableKeyboardNavigation(el) {
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
root: el,
items: tinyMCEPopup.dom.select('a', el)
}, tinyMCEPopup.dom);
}
function dechex(n) {
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
}
function computeColor(e) {
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
partWidth = document.getElementById('colors').width / 6;
partDetail = detail / 2;
imHeight = document.getElementById('colors').height;
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
coef = (imHeight - y) / imHeight;
r = 128 + (r - 128) * coef;
g = 128 + (g - 128) * coef;
b = 128 + (b - 128) * coef;
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
updateLight(r, g, b);
}
function updateLight(r, g, b) {
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
for (i=0; i<detail; i++) {
if ((i>=0) && (i<partDetail)) {
finalCoef = i / partDetail;
finalR = dechex(255 - (255 - r) * finalCoef);
finalG = dechex(255 - (255 - g) * finalCoef);
finalB = dechex(255 - (255 - b) * finalCoef);
} else {
finalCoef = 2 - i / partDetail;
finalR = dechex(r * finalCoef);
finalG = dechex(g * finalCoef);
finalB = dechex(b * finalCoef);
}
color = finalR + finalG + finalB;
setCol('gs' + i, '#'+color);
}
}
function changeFinalColor(color) {
if (color.indexOf('#') == -1)
color = convertRGBToHex(color);
setCol('preview', color);
document.getElementById('color').value = color;
}
function setCol(e, c) {
try {
document.getElementById(e).style.backgroundColor = c;
} catch (ex) {
// Ignore IE warning
}
}
tinyMCEPopup.onInit.add(init);

@ -1 +1 @@
tinyMCE.addI18n('he.advanced_dlg',{"link_list":"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","link_is_external":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_is_email":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_titlefield":"\u05db\u05d5\u05ea\u05e8\u05ea","link_target_blank":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9","link_target_same":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d0\u05d5\u05ea\u05d5 \u05d7\u05dc\u05d5\u05df","link_target":"\u05d9\u05e2\u05d3","link_url":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8","link_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8","image_align_right":"\u05d9\u05de\u05d9\u05df","image_align_left":"\u05e9\u05de\u05d0\u05dc","image_align_textbottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_texttop":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_bottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df","image_align_middle":"\u05d0\u05de\u05e6\u05e2","image_align_top":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df","image_align_baseline":"\u05e7\u05d5 \u05d4\u05d4\u05ea\u05d7\u05dc\u05d4","image_align":"\u05d9\u05d9\u05e9\u05d5\u05e8","image_hspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9","image_vspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9","image_dimensions":"\u05d2\u05d5\u05d3\u05dc","image_alt":"\u05ea\u05d9\u05d0\u05d5\u05e8","image_list":"\u05e8\u05e9\u05d9\u05de\u05d4","image_border":"\u05d2\u05d1\u05d5\u05dc","image_src":"\u05db\u05ea\u05d5\u05d1\u05ea:","image_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4","charmap_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e1\u05d9\u05de\u05df","colorpicker_name":"\u05e9\u05dd:","colorpicker_color":"\u05e6\u05d1\u05e2:","colorpicker_named_title":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_named_tab":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_palette_title":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_palette_tab":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_title":"\u05d1\u05d5\u05e8\u05e8 \u05d4\u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_tab":"\u05d1\u05d5\u05e8\u05e8","colorpicker_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2","code_wordwrap":"\u05d2\u05dc\u05d9\u05e9\u05ea \u05d8\u05e7\u05e1\u05d8","code_title":"\u05e2\u05d5\u05e8\u05da \u05d4-HTML","anchor_name":"\u05e9\u05dd \u05d4\u05e1\u05d9\u05de\u05e0\u05d9\u05d4","anchor_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4","about_loaded":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea","about_version":"\u05d2\u05d9\u05e8\u05e1\u05d4","about_author":"\u05d9\u05d5\u05e6\u05e8","about_plugin":"\u05ea\u05d5\u05e1\u05e4\u05ea","about_plugins":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea","about_license":"\u05e8\u05e9\u05d9\u05d5\u05df","about_help":"\u05e2\u05d6\u05e8\u05d4","about_general":"\u05d0\u05d5\u05d3\u05d5\u05ea","about_title":"\u05d0\u05d5\u05d3\u05d5\u05ea TinyMCE","charmap_usage":"\u05d4\u05e9\u05ea\u05de\u05e9/\u05d9 \u05d1\u05d7\u05d9\u05e6\u05d9\u05dd \u05dc\u05e0\u05d9\u05d5\u05d5\u05d8 \u05d9\u05de\u05d9\u05e0\u05d4 \u05d5\u05e9\u05de\u05d0\u05dc\u05d4","anchor_invalid":"\u05e0\u05d0 \u05dc\u05e6\u05d9\u05d9\u05df \u05e9\u05dd \u05d7\u05d5\u05e7\u05d9","accessibility_help":"\u05e2\u05d6\u05e8\u05d4 \u05d1\u05e0\u05d2\u05d9\u05e9\u05d5\u05ea","accessibility_usage_title":"\u05e9\u05d9\u05de\u05d5\u05e9 \u05db\u05dc\u05dc\u05d9"});
tinyMCE.addI18n('he.advanced_dlg',{"link_list":"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","link_is_external":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_is_email":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_titlefield":"\u05db\u05d5\u05ea\u05e8\u05ea","link_target_blank":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9","link_target_same":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d0\u05d5\u05ea\u05d5 \u05d7\u05dc\u05d5\u05df","link_target":"\u05d9\u05e2\u05d3","link_url":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8","link_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8","image_align_right":"\u05d9\u05de\u05d9\u05df","image_align_left":"\u05e9\u05de\u05d0\u05dc","image_align_textbottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_texttop":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_bottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df","image_align_middle":"\u05d0\u05de\u05e6\u05e2","image_align_top":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df","image_align_baseline":"\u05e7\u05d5 \u05d4\u05d4\u05ea\u05d7\u05dc\u05d4","image_align":"\u05d9\u05d9\u05e9\u05d5\u05e8","image_hspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9","image_vspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9","image_dimensions":"\u05d2\u05d5\u05d3\u05dc","image_alt":"\u05ea\u05d9\u05d0\u05d5\u05e8","image_list":"\u05e8\u05e9\u05d9\u05de\u05d4","image_border":"\u05d2\u05d1\u05d5\u05dc","image_src":"\u05db\u05ea\u05d5\u05d1\u05ea:","image_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4","charmap_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e1\u05d9\u05de\u05df","colorpicker_name":"\u05e9\u05dd:","colorpicker_color":"\u05e6\u05d1\u05e2:","colorpicker_named_title":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_named_tab":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_palette_title":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_palette_tab":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_title":"\u05d1\u05d5\u05e8\u05e8 \u05d4\u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_tab":"\u05d1\u05d5\u05e8\u05e8","colorpicker_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2","code_wordwrap":"\u05d2\u05dc\u05d9\u05e9\u05ea \u05d8\u05e7\u05e1\u05d8","code_title":"\u05e2\u05d5\u05e8\u05da \u05d4-HTML","anchor_name":"\u05e9\u05dd \u05d4\u05e1\u05d9\u05de\u05e0\u05d9\u05d4","anchor_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4","about_loaded":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea","about_version":"\u05d2\u05d9\u05e8\u05e1\u05d4","about_author":"\u05d9\u05d5\u05e6\u05e8","about_plugin":"\u05ea\u05d5\u05e1\u05e4\u05ea","about_plugins":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea","about_license":"\u05e8\u05e9\u05d9\u05d5\u05df","about_help":"\u05e2\u05d6\u05e8\u05d4","about_general":"\u05d0\u05d5\u05d3\u05d5\u05ea","about_title":"\u05d0\u05d5\u05d3\u05d5\u05ea TinyMCE","charmap_usage":"\u05d4\u05e9\u05ea\u05de\u05e9/\u05d9 \u05d1\u05d7\u05d9\u05e6\u05d9\u05dd \u05dc\u05e0\u05d9\u05d5\u05d5\u05d8 \u05d9\u05de\u05d9\u05e0\u05d4 \u05d5\u05e9\u05de\u05d0\u05dc\u05d4","anchor_invalid":"\u05e0\u05d0 \u05dc\u05e6\u05d9\u05d9\u05df \u05e9\u05dd \u05d7\u05d5\u05e7\u05d9","accessibility_help":"\u05e2\u05d6\u05e8\u05d4 \u05d1\u05e0\u05d2\u05d9\u05e9\u05d5\u05ea","accessibility_usage_title":"\u05e9\u05d9\u05de\u05d5\u05e9 \u05db\u05dc\u05dc\u05d9","invalid_color_value":"\u05e2\u05e8\u05da \u05d4\u05e6\u05d1\u05e2 \u05dc\u05d0 \u05ea\u05e7\u05d9\u05df"});

@ -1 +1 @@
tinyMCE.addI18n('nb.advanced_dlg',{"link_list":"Lenkeliste","link_is_external":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern nettadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde http://-prefikset?","link_is_email":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en e-postadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde mailto:-prefikset?","link_titlefield":"Tittel","link_target_blank":"\u00c5pne i nytt vindu","link_target_same":"\u00c5pne i dette vinduet","link_target":"M\u00e5lside","link_url":"Lenkens URL","link_title":"Sett inn /endre lenke","image_align_right":"H\u00f8yre","image_align_left":"Venstre","image_align_textbottom":"Tekstbunn","image_align_texttop":"Teksttopp","image_align_bottom":"Bunn","image_align_middle":"Midtstilt","image_align_top":"Topp","image_align_baseline":"Bunnlinje","image_align":"Justering","image_hspace":"Horisontal avstand","image_vspace":"Vertikal avstand","image_dimensions":"Dimensjoner","image_alt":"Bildebeskrivelse","image_list":"Bildeliste","image_border":"Ramme","image_src":"Bildets URL","image_title":"Sett inn / endre bilde","charmap_title":"Velg spesialtegn","colorpicker_name":"Navn:","colorpicker_color":"Farge:","colorpicker_named_title":"Fargenavn","colorpicker_named_tab":"Navnevalg","colorpicker_palette_title":"Palettfarger","colorpicker_palette_tab":"Palett","colorpicker_picker_title":"Fargevalg","colorpicker_picker_tab":"Velg farge","colorpicker_title":"Velg en farge","code_wordwrap":"Tekstbryting","code_title":"HTML-editor","anchor_name":"Ankernavn","anchor_title":"Sett inn / endre anker","about_loaded":"Lastede programtillegg","about_version":"Versjon","about_author":"Utvikler","about_plugin":"Programtillegg","about_plugins":"Programtillegg","about_license":"Lisens","about_help":"Hjelp","about_general":"Om","about_title":"Om TinyMCE","charmap_usage":"Bruk venstre og h\u00f8yre piltast for \u00e5 navigere.","anchor_invalid":"Du m\u00e5 angi et gyldig ankernavn.","accessibility_help":"Tilhjengelighetshjelp","accessibility_usage_title":"Generell bruk"});
tinyMCE.addI18n('nb.advanced_dlg',{"link_list":"Lenkeliste","link_is_external":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern nettadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde http://-prefikset?","link_is_email":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en e-postadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde mailto:-prefikset?","link_titlefield":"Tittel","link_target_blank":"\u00c5pne i nytt vindu","link_target_same":"\u00c5pne i dette vinduet","link_target":"M\u00e5lside","link_url":"Lenkens URL","link_title":"Sett inn /endre lenke","image_align_right":"H\u00f8yre","image_align_left":"Venstre","image_align_textbottom":"Tekstbunn","image_align_texttop":"Teksttopp","image_align_bottom":"Bunn","image_align_middle":"Midtstilt","image_align_top":"Topp","image_align_baseline":"Bunnlinje","image_align":"Justering","image_hspace":"Horisontal avstand","image_vspace":"Vertikal avstand","image_dimensions":"Dimensjoner","image_alt":"Bildebeskrivelse","image_list":"Bildeliste","image_border":"Ramme","image_src":"Bildets URL","image_title":"Sett inn / endre bilde","charmap_title":"Velg spesialtegn","colorpicker_name":"Navn:","colorpicker_color":"Farge:","colorpicker_named_title":"Fargenavn","colorpicker_named_tab":"Navnevalg","colorpicker_palette_title":"Palettfarger","colorpicker_palette_tab":"Palett","colorpicker_picker_title":"Fargevalg","colorpicker_picker_tab":"Velg farge","colorpicker_title":"Velg en farge","code_wordwrap":"Tekstbryting","code_title":"HTML-editor","anchor_name":"Ankernavn","anchor_title":"Sett inn / endre anker","about_loaded":"Lastede programtillegg","about_version":"Versjon","about_author":"Utvikler","about_plugin":"Programtillegg","about_plugins":"Programtillegg","about_license":"Lisens","about_help":"Hjelp","about_general":"Om","about_title":"Om TinyMCE","charmap_usage":"Bruk venstre og h\u00f8yre piltast for \u00e5 navigere.","anchor_invalid":"Du m\u00e5 angi et gyldig ankernavn.","accessibility_help":"Tilhjengelighetshjelp","accessibility_usage_title":"Generell bruk","invalid_color_value":"Ugyldig fargeverdi"});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -6,9 +6,9 @@
var tinymce = {
majorVersion : '3',
minorVersion : '5.4.1',
minorVersion : '5.6',
releaseDate : '2012-06-24',
releaseDate : '2012-07-26',
_init : function() {
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
@ -1086,7 +1086,8 @@ tinymce.create('static tinymce.util.XHR', {
},
metaKeyPressed: function(e) {
return tinymce.isMac ? e.metaKey : e.ctrlKey;
// Check if ctrl or meta key is pressed also check if alt is false for Polish users
return tinymce.isMac ? e.metaKey : e.ctrlKey && !e.altKey;
}
};
})(tinymce);
@ -1180,7 +1181,7 @@ tinymce.util.Quirks = function(editor) {
var allRng = dom.createRng();
allRng.selectNode(editor.getBody());
var allSelection = serializeRng(allRng);//console.log(selection, "----", allSelection);
var allSelection = serializeRng(allRng);
return selection === allSelection;
}
@ -1313,7 +1314,7 @@ tinymce.util.Quirks = function(editor) {
}
function isSelectionAcrossElements() {
return !selection.isCollapsed() && selection.getStart() != selection.getEnd();
return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
}
function blockEvent(editor, e) {
@ -1632,77 +1633,237 @@ tinymce.util.Quirks = function(editor) {
};
function fakeImageResize() {
var mouseDownImg, startX, startY, startW, startH;
var selectedElmX, selectedElmY, selectedElm, selectedElmGhost, selectedHandle, startX, startY, startW, startH, ratio,
resizeHandles, width, height, rootDocument = document, editableDoc = editor.getDoc();
if (!settings.object_resizing || settings.webkit_fake_resize === false) {
return;
}
editor.contentStyles.push('.mceResizeImages img {cursor: se-resize !important}');
// Try disabling object resizing if WebKit implements resizing in the future
setEditorCommandState("enableObjectResizing", false);
// Details about each resize handle how to scale etc
resizeHandles = {
// Name: x multiplier, y multiplier, delta size x, delta size y
n: [.5, 0, 0, -1],
e: [1, .5, 1, 0],
s: [.5, 1, 0, 1],
w: [0, .5, -1, 0],
nw: [0, 0, -1, -1],
ne: [1, 0, 1, -1],
se: [1, 1, 1, 1],
sw : [0, 1, -1, 1]
};
function resizeImage(e) {
var deltaX, deltaY, ratio, width, height;
function resizeElement(e) {
var deltaX, deltaY;
if (mouseDownImg) {
deltaX = e.screenX - startX;
deltaY = e.screenY - startY;
ratio = Math.max((startW + deltaX) / startW, (startH + deltaY) / startH);
// Calc new width/height
deltaX = e.screenX - startX;
deltaY = e.screenY - startY;
// Only update styles if the user draged one pixel or more
if (Math.abs(deltaX) > 1 || Math.abs(deltaY) > 1) {
// Constrain proportions
width = Math.round(startW * ratio);
height = Math.round(startH * ratio);
// Calc new size
width = deltaX * selectedHandle[2] + startW;
height = deltaY * selectedHandle[3] + startH;
// Resize by using style or attribute
if (mouseDownImg.style.width) {
dom.setStyle(mouseDownImg, 'width', width);
} else {
dom.setAttrib(mouseDownImg, 'width', width);
}
// Never scale down lower than 5 pixels
width = width < 5 ? 5 : width;
height = height < 5 ? 5 : height;
// Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image
if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) {
width = Math.round(height / ratio);
height = Math.round(width * ratio);
}
// Update ghost size
dom.setStyles(selectedElmGhost, {
width: width,
height: height
});
// Update ghost X position if needed
if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
}
// Update ghost Y position if needed
if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
}
}
function endResize() {
function setSizeProp(name, value) {
if (value) {
// Resize by using style or attribute
if (mouseDownImg.style.height) {
dom.setStyle(mouseDownImg, 'height', height);
if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
dom.setStyle(selectedElm, name, value);
} else {
dom.setAttrib(mouseDownImg, 'height', height);
dom.setAttrib(selectedElm, name, value);
}
}
}
if (!dom.hasClass(editor.getBody(), 'mceResizeImages')) {
dom.addClass(editor.getBody(), 'mceResizeImages');
}
// Set width/height properties
setSizeProp('width', width);
setSizeProp('height', height);
dom.unbind(editableDoc, 'mousemove', resizeElement);
dom.unbind(editableDoc, 'mouseup', endResize);
if (rootDocument != editableDoc) {
dom.unbind(rootDocument, 'mousemove', resizeElement);
dom.unbind(rootDocument, 'mouseup', endResize);
}
// Remove ghost and update resize handle positions
dom.remove(selectedElmGhost);
showResizeRect(selectedElm);
}
function showResizeRect(targetElm) {
var position, targetWidth, targetHeight;
hideResizeRect();
// Get position and size of target
position = dom.getPos(targetElm);
selectedElmX = position.x;
selectedElmY = position.y;
targetWidth = targetElm.offsetWidth;
targetHeight = targetElm.offsetHeight;
// Reset width/height if user selects a new image/table
if (selectedElm != targetElm) {
selectedElm = targetElm;
width = height = 0;
}
tinymce.each(resizeHandles, function(handle, name) {
var handleElm;
// Get existing or render resize handle
handleElm = dom.get('mceResizeHandle' + name);
if (!handleElm) {
handleElm = dom.add(editableDoc.documentElement, 'div', {
id: 'mceResizeHandle' + name,
'class': 'mceResizeHandle',
style: 'cursor:' + name + '-resize; margin:0; padding:0'
});
dom.bind(handleElm, 'mousedown', function(e) {
e.preventDefault();
endResize();
startX = e.screenX;
startY = e.screenY;
startW = selectedElm.clientWidth;
startH = selectedElm.clientHeight;
ratio = startH / startW;
selectedHandle = handle;
selectedElmGhost = selectedElm.cloneNode(true);
dom.addClass(selectedElmGhost, 'mceClonedResizable');
dom.setStyles(selectedElmGhost, {
left: selectedElmX,
top: selectedElmY,
margin: 0
});
editableDoc.documentElement.appendChild(selectedElmGhost);
dom.bind(editableDoc, 'mousemove', resizeElement);
dom.bind(editableDoc, 'mouseup', endResize);
if (rootDocument != editableDoc) {
dom.bind(rootDocument, 'mousemove', resizeElement);
dom.bind(rootDocument, 'mouseup', endResize);
}
});
} else {
dom.show(handleElm);
}
// Position element
dom.setStyles(handleElm, {
left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
});
});
// Only add resize rectangle on WebKit and only on images
if (!tinymce.isOpera && selectedElm.nodeName == "IMG") {
selectedElm.setAttribute('data-mce-selected', '1');
}
};
}
editor.onMouseDown.add(function(editor, e) {
var target = e.target;
if (target.nodeName == "IMG") {
mouseDownImg = target;
startX = e.screenX;
startY = e.screenY;
startW = mouseDownImg.clientWidth;
startH = mouseDownImg.clientHeight;
dom.bind(editor.getDoc(), 'mousemove', resizeImage);
e.preventDefault();
function hideResizeRect() {
if (selectedElm) {
selectedElm.removeAttribute('data-mce-selected');
}
});
// Unbind events on node change and restore resize cursor
editor.onNodeChange.add(function() {
if (mouseDownImg) {
mouseDownImg = null;
dom.unbind(editor.getDoc(), 'mousemove', resizeImage);
for (var name in resizeHandles) {
dom.hide('mceResizeHandle' + name);
}
}
// Add CSS for resize handles, cloned element and selected
editor.contentStyles.push(
'.mceResizeHandle {' +
'position: absolute;' +
'border: 1px solid black;' +
'background: #FFF;' +
'width: 5px;' +
'height: 5px;' +
'z-index: 10000' +
'}' +
'.mceResizeHandle:hover {' +
'background: #000' +
'}' +
'img[data-mce-selected] {' +
'outline: 1px solid black' +
'}' +
'img.mceClonedResizable, table.mceClonedResizable {' +
'position: absolute;' +
'outline: 1px dashed black;' +
'opacity: .5;' +
'z-index: 10000' +
'}'
);
function updateResizeRect() {
var controlElm = dom.getParent(selection.getNode(), 'table,img');
// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
tinymce.each(dom.select('img[data-mce-selected]'), function(img) {
img.removeAttribute('data-mce-selected');
});
if (selection.getNode().nodeName == "IMG") {
dom.addClass(editor.getBody(), 'mceResizeImages');
if (controlElm) {
showResizeRect(controlElm);
} else {
dom.removeClass(editor.getBody(), 'mceResizeImages');
hideResizeRect();
}
}
// Show/hide resize rect when image is selected
editor.onNodeChange.add(updateResizeRect);
// Fixes WebKit quirk where it returns IMG on getNode if caret is after last image in container
dom.bind(editableDoc, 'selectionchange', updateResizeRect);
// Remove the internal attribute when serializing the DOM
editor.serializer.addAttributeFilter('data-mce-selected', function(nodes, name) {
var i = nodes.length;
while (i--) {
nodes[i].attr(name, null);
}
});
};
}
// All browsers
disableBackspaceIntoATable();
@ -1745,6 +1906,11 @@ tinymce.util.Quirks = function(editor) {
addBrAfterLastLinks();
removeGhostSelection();
}
// Opera
if (tinymce.isOpera) {
fakeImageResize();
}
};
(function(tinymce) {
var namedEntities, baseEntities, reverseEntities,
@ -5599,7 +5765,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
styleElm.id = 'mceDefaultStyles';
styleElm.type = 'text/css';
head = doc.getElementsByTagName('head')[0]
head = doc.getElementsByTagName('head')[0];
if (head.firstChild) {
head.insertBefore(styleElm, head.firstChild);
} else {
@ -7349,7 +7515,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
};
this.addRange = function(rng) {
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, doc = selection.dom.doc, body = doc.body;
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
function setEndPoint(start) {
var container, offset, marker, tmpRng, nodes;
@ -7435,10 +7602,17 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
if (startOffset == endOffset - 1) {
try {
ctrlElm = startContainer.childNodes[startOffset];
ctrlRng = body.createControlRange();
ctrlRng.addElement(startContainer.childNodes[startOffset]);
ctrlRng.addElement(ctrlElm);
ctrlRng.select();
return;
// Check if the range produced is on the correct element and is a control range
// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
nativeRng = selection.getRng();
if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
return;
}
} catch (ex) {
// Ignore
}
@ -10379,7 +10553,7 @@ window.tinymce.dom.Sizzle = Sizzle;
// Replace all BOM characters for now until we can find a better solution
if (!args.cleanup)
args.content = args.content.replace(/\uFEFF|\u200B/g, '');
args.content = args.content.replace(/\uFEFF/g, '');
// Post process
if (!args.no_events)
@ -13361,6 +13535,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
});
}
// Load specified content CSS last
if (s.content_style) {
t.contentStyles.push(s.content_style);
}
// Content editable mode ends here
if (s.content_editable) {
e = n = o = null; // Fix IE leak
@ -14135,7 +14314,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
getContent : function(args) {
var self = this, content;
var self = this, content, body = self.getBody();
// Setup args object
args = args || {};
@ -14149,11 +14328,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Get raw contents or by default the cleaned contents
if (args.format == 'raw')
content = self.getBody().innerHTML;
content = body.innerHTML;
else if (args.format == 'text')
content = body.innerText || body.textContent;
else
content = self.serializer.serialize(self.getBody(), args);
content = self.serializer.serialize(body, args);
args.content = tinymce.trim(content);
// Trim whitespace in beginning/end of HTML
if (args.format != 'text') {
args.content = tinymce.trim(content);
} else {
args.content = content;
}
// Do post processing
if (!args.no_events)
@ -14969,7 +15155,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Insert bookmark node and get the parent
selection.setContent(bookmarkHtml);
parentNode = editor.selection.getNode();
parentNode = selection.getNode();
rootNode = editor.getBody();
// Opera will return the document node when selection is in root
@ -15136,10 +15322,15 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
selectAll : function() {
var root = dom.getRoot(), rng = dom.createRng();
rng.setStart(root, 0);
rng.setEnd(root, root.childNodes.length);
// Old IE does a better job with selectall than new versions
if (selection.getRng().setStart) {
rng.setStart(root, 0);
rng.setEnd(root, root.childNodes.length);
editor.selection.setRng(rng);
selection.setRng(rng);
} else {
execNativeCommand('SelectAll');
}
}
});
@ -15178,7 +15369,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
'InsertUnorderedList,InsertOrderedList' : function(command) {
return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');
var list = dom.getParent(selection.getNode(), 'ul,ol');
return list &&
(command === 'insertunorderedlist' && list.tagName === 'UL'
|| command === 'insertorderedlist' && list.tagName === 'OL');
}
}, 'state');
@ -15479,6 +15673,14 @@ tinymce.ForceBlocks = function(editor) {
node = rootNode.firstChild;
while (node) {
if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {
// Remove empty text nodes
if (node.nodeType === 3 && node.nodeValue.length == 0) {
tempNode = node;
node = node.nextSibling;
dom.remove(tempNode);
continue;
}
if (!rootBlockNode) {
rootBlockNode = dom.create(settings.forced_root_block);
node.parentNode.insertBefore(rootBlockNode, node);
@ -16049,7 +16251,7 @@ tinymce.ForceBlocks = function(editor) {
isBlock = dom.isBlock,
forcedRootBlock = ed.settings.forced_root_block,
nodeIndex = dom.nodeIndex,
INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF',
INVISIBLE_CHAR = '\uFEFF',
MCE_ATTR_RE = /^(src|href|style)$/,
FALSE = false,
TRUE = true,
@ -16964,7 +17166,7 @@ tinymce.ForceBlocks = function(editor) {
return FALSE;
};
function formatChanged(formats, callback) {
function formatChanged(formats, callback, similar) {
var currentFormats;
// Setup format node change logic
@ -16978,7 +17180,7 @@ tinymce.ForceBlocks = function(editor) {
// Check for new formats
each(formatChangeData, function(callbacks, format) {
each(parents, function(node) {
if (matchNode(node, format, {}, true)) {
if (matchNode(node, format, {}, callbacks.similar)) {
if (!currentFormats[format]) {
// Execute callbacks
each(callbacks, function(callback) {
@ -17011,6 +17213,7 @@ tinymce.ForceBlocks = function(editor) {
each(formats.split(','), function(format) {
if (!formatChangeData[format]) {
formatChangeData[format] = [];
formatChangeData[format].similar = similar;
}
formatChangeData[format].push(callback);
@ -18106,7 +18309,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager, nonEmptyElementsMap = editor.schema.getNonEmptyElements();
function handleEnterKey(evt) {
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode,
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
// Returns true if the block can be split into two blocks or not
@ -18151,6 +18354,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
node = firstChilds[i];
if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
dom.remove(node);
} else {
// Remove <a> </a> see #5381
if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
dom.remove(node);
}
}
}
};
@ -18429,7 +18637,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
// Insert extra BR element at the end block elements
if (!tinymce.isIE && !hasRightSideBr()) {
brElm = dom.create('br')
brElm = dom.create('br');
rng.insertNode(brElm);
rng.setStartAfter(brElm);
rng.setEndAfter(brElm);
@ -18514,9 +18722,10 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Setup range items and newBlockName
container = rng.startContainer;
offset = rng.startOffset;
newBlockName = settings.forced_root_block;
newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
documentMode = dom.doc.documentMode;
shiftKey = evt.shiftKey;
// Resolve node index
if (container.nodeType == 1 && container.hasChildNodes()) {
@ -18541,7 +18750,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// If editable root isn't block nor the root of the editor
if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
if (!newBlockName || evt.shiftKey) {
if (!newBlockName || shiftKey) {
insertBr();
}
@ -18551,7 +18760,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Wrap the current node and it's sibling in a default block if it's needed.
// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
// This won't happen if root blocks are disabled or the shiftKey is pressed
if ((newBlockName && !evt.shiftKey) || (!newBlockName && evt.shiftKey)) {
if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
}
@ -18563,26 +18772,34 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
// Handle enter inside an empty list item
if (parentBlockName == 'LI' && dom.isEmpty(parentBlock)) {
// Let the list plugin or browser handle nested lists for now
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
return false;
// Handle enter in LI
if (parentBlockName == 'LI') {
if (!newBlockName && shiftKey) {
insertBr();
return;
}
handleEmptyListItem();
return;
// Handle enter inside an empty list item
if (dom.isEmpty(parentBlock)) {
// Let the list plugin or browser handle nested lists for now
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
return false;
}
handleEmptyListItem();
return;
}
}
// Don't split PRE tags but insert a BR instead easier when writing code samples etc
if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
if (!evt.shiftKey) {
if (!shiftKey) {
insertBr();
return;
}
} else {
// If no root block is configured then insert a BR by default or if the shiftKey is pressed
if ((!newBlockName && !evt.shiftKey && parentBlockName != 'LI') || (newBlockName && evt.shiftKey)) {
if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
insertBr();
return;
}

Loading…
Cancel
Save