mirror of
https://github.com/e107inc/e107.git
synced 2025-01-18 05:09:05 +01:00
TinyMce 3.2.7 upgrade
This commit is contained in:
parent
917ffedade
commit
90fa862473
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:12 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:17:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:20 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:17:59 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:29 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:08 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,27 +1,27 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
* 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;
|
||||
|
||||
@ -93,11 +93,11 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
* 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',
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-09-28 07:18:42 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.4 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.4 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:48 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.4 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -61,7 +61,7 @@
|
||||
if (ed.settings.content_css !== false)
|
||||
ed.dom.loadCSS(url + "/css/content.css");
|
||||
|
||||
if (ed.theme.onResolveName) {
|
||||
if (ed.theme && ed.theme.onResolveName) {
|
||||
ed.theme.onResolveName.add(function(th, o) {
|
||||
if (o.name == 'img') {
|
||||
each(lo, function(v, k) {
|
||||
@ -341,7 +341,7 @@
|
||||
_createImg : function(cl, n) {
|
||||
var im, dom = this.editor.dom, pa = {}, ti = '', args;
|
||||
|
||||
args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality'];
|
||||
args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data'];
|
||||
|
||||
// Create image
|
||||
im = dom.create('img', {
|
||||
@ -372,6 +372,12 @@
|
||||
delete pa.movie;
|
||||
}
|
||||
|
||||
// No src try data
|
||||
if (!pa.src) {
|
||||
pa.src = pa.data;
|
||||
delete pa.data;
|
||||
}
|
||||
|
||||
// Merge with embed args
|
||||
n = dom.select('.mceItemEmbed', n)[0];
|
||||
if (n) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:24 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -71,7 +71,7 @@
|
||||
return;
|
||||
|
||||
// Create container to paste into
|
||||
n = dom.add(body, 'div', {id : '_mcePaste'}, ' ');
|
||||
n = dom.add(body, 'div', {id : '_mcePaste'}, '\uFEFF');
|
||||
|
||||
// If contentEditable mode we need to find out the position of the closest element
|
||||
if (body != ed.getDoc().body)
|
||||
@ -100,8 +100,11 @@
|
||||
|
||||
// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
|
||||
// to IE security settings so we pass the junk though better than nothing right
|
||||
if (n.innerHTML === ' ')
|
||||
if (n.innerHTML === '\uFEFF') {
|
||||
ed.execCommand('mcePasteWord');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// Process contents
|
||||
process({content : n.innerHTML});
|
||||
@ -120,11 +123,15 @@
|
||||
|
||||
// Wait a while and grab the pasted contents
|
||||
window.setTimeout(function() {
|
||||
var h = '';
|
||||
var h = '', nl = dom.select('div[id=_mcePaste]');
|
||||
|
||||
// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
|
||||
each(dom.select('div[id=_mcePaste]').reverse(), function(n) {
|
||||
each(nl, function(n) {
|
||||
h += (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML;
|
||||
});
|
||||
|
||||
// Remove the nodes
|
||||
each(nl, function(n) {
|
||||
dom.remove(n);
|
||||
});
|
||||
|
||||
@ -235,19 +242,31 @@
|
||||
|
||||
// Allow for class names to be retained if desired; either all, or just the ones from Word
|
||||
// Note that the paste_strip_class_attributes: 'none, verify_css_classes: true is also a good variation.
|
||||
stripClass = ed.getParam('paste_strip_class_attributes', 'all');
|
||||
stripClass = ed.getParam('paste_strip_class_attributes');
|
||||
if (stripClass != 'none') {
|
||||
if (stripClass == 'all') {
|
||||
process([
|
||||
/ class=\"([^\"]*)\"/gi, // class attributes with quotes
|
||||
/ class=(\w+)/gi // class attributes without quotes (IE)
|
||||
]);
|
||||
} else { // Only strip the 'mso*' classes
|
||||
process([
|
||||
/ class=\"(mso[^\"]*)\"/gi, // class attributes with quotes
|
||||
/ class=(mso\w+)/gi // class attributes without quotes (IE)
|
||||
]);
|
||||
}
|
||||
// Cleans everything but mceItem... classes
|
||||
function cleanClasses(str, cls) {
|
||||
var i, out = '';
|
||||
|
||||
// Remove all classes
|
||||
if (stripClass == 'all')
|
||||
return '';
|
||||
|
||||
cls = tinymce.explode(cls, ' ');
|
||||
|
||||
for (i = cls.length - 1; i >= 0; i--) {
|
||||
// Remove Mso classes
|
||||
if (!/^(Mso)/i.test(cls[i]))
|
||||
out += (!out ? '' : ' ') + cls[i];
|
||||
}
|
||||
|
||||
return ' class="' + out + '"';
|
||||
};
|
||||
|
||||
process([
|
||||
[/ class=\"([^\"]*)\"/gi, cleanClasses], // class attributes with quotes
|
||||
[/ class=(\w+)/gi, cleanClasses] // class attributes without quotes (IE)
|
||||
]);
|
||||
}
|
||||
|
||||
// Remove spans option
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.4 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -8,6 +8,20 @@
|
||||
(function() {
|
||||
var each = tinymce.each;
|
||||
|
||||
// Checks if the selection/caret is at the start of the specified block element
|
||||
function isAtStart(rng, par) {
|
||||
var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
|
||||
|
||||
rng2.setStartBefore(par);
|
||||
rng2.setEnd(rng.endContainer, rng.endOffset);
|
||||
|
||||
elm = doc.createElement('body');
|
||||
elm.appendChild(rng2.cloneContents());
|
||||
|
||||
// Check for text characters of other elements that should be treated as content
|
||||
return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
|
||||
};
|
||||
|
||||
tinymce.create('tinymce.plugins.TablePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this;
|
||||
@ -65,6 +79,34 @@
|
||||
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
|
||||
};
|
||||
|
||||
// Fixes an bug where it's impossible to place the caret before a table in Gecko
|
||||
// this fix solves it by detecting when the caret is at the beginning of such a table
|
||||
// and then manually moves the caret infront of the table
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyDown.add(function(ed, e) {
|
||||
var rng, table, dom = ed.dom;
|
||||
|
||||
// On gecko it's not possible to place the caret before a table
|
||||
if (e.keyCode == 37 || e.keyCode == 38) {
|
||||
rng = ed.selection.getRng();
|
||||
table = dom.getParent(rng.startContainer, 'table');
|
||||
|
||||
if (table && ed.getBody().firstChild == table) {
|
||||
if (isAtStart(rng, table)) {
|
||||
rng = dom.createRng();
|
||||
|
||||
rng.setStartBefore(table);
|
||||
rng.setEndBefore(table);
|
||||
|
||||
ed.selection.setRng(rng);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ed.onKeyUp.add(fixTableCaretPos);
|
||||
ed.onSetContent.add(fixTableCaretPos);
|
||||
ed.onVisualAid.add(fixTableCaretPos);
|
||||
|
@ -1 +1 @@
|
||||
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+tinyMCE.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+tinyMCE.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+tinyMCE.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+tinyMCE.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
|
||||
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -141,10 +141,10 @@
|
||||
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
||||
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
||||
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
||||
fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);
|
||||
fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);
|
||||
fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);
|
||||
fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);
|
||||
fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]);
|
||||
fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]);
|
||||
fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]);
|
||||
fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]);
|
||||
fmt = fmt.replace("%%", "%");
|
||||
|
||||
return fmt;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-10-02 18:18:25 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: abbr.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: abbr.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: acronym.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: acronym.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: attributes.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: attributes.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: cite.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: cite.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: del.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: del.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: element_common.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: element_common.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: ins.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
* $Id: ins.js,v 1.3 2009-10-02 18:19:50 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_template_src.js,v 1.3 2009-09-21 16:33:32 e107coders Exp $
|
||||
* $Id: editor_template_src.js,v 1.4 2009-10-02 18:20:03 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_template_src.js,v 1.1 2009-09-28 07:18:42 e107coders Exp $
|
||||
* $Id: editor_template_src.js,v 1.2 2009-10-02 18:20:04 e107coders Exp $
|
||||
*
|
||||
* This file is meant to showcase how to create a simple theme. The advanced
|
||||
* theme is more suitable for production use.
|
||||
|
2
e107_plugins/tinymce/tiny_mce.js
vendored
2
e107_plugins/tinymce/tiny_mce.js
vendored
File diff suppressed because one or more lines are too long
220
e107_plugins/tinymce/tiny_mce_src.js
vendored
220
e107_plugins/tinymce/tiny_mce_src.js
vendored
@ -1,7 +1,7 @@
|
||||
var tinymce = {
|
||||
majorVersion : '3',
|
||||
minorVersion : '2.6',
|
||||
releaseDate : '2009-08-19',
|
||||
minorVersion : '2.7',
|
||||
releaseDate : '2009-09-22',
|
||||
|
||||
_init : function() {
|
||||
var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
|
||||
@ -585,7 +585,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
toAbsolute : function(u, nh) {
|
||||
var u = new tinymce.util.URI(u, {base_uri : this});
|
||||
|
||||
return u.getURI(this.host == u.host ? nh : 0);
|
||||
return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);
|
||||
},
|
||||
|
||||
toRelPath : function(base, path) {
|
||||
@ -631,7 +631,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
},
|
||||
|
||||
toAbsPath : function(base, path) {
|
||||
var i, nb = 0, o = [], tr;
|
||||
var i, nb = 0, o = [], tr, outPath;
|
||||
|
||||
// Split paths
|
||||
tr = /\/$/.test(path) ? '/' : '';
|
||||
@ -671,9 +671,19 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
|
||||
// If /a/b/c or /
|
||||
if (i <= 0)
|
||||
return '/' + o.reverse().join('/') + tr;
|
||||
outPath = o.reverse().join('/');
|
||||
else
|
||||
outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
|
||||
|
||||
return '/' + base.slice(0, i).join('/') + '/' + o.reverse().join('/') + tr;
|
||||
// Add front / if it's needed
|
||||
if (outPath.indexOf('/') !== 0)
|
||||
outPath = '/' + outPath;
|
||||
|
||||
// Add traling / if it's needed
|
||||
if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)
|
||||
outPath += tr;
|
||||
|
||||
return outPath;
|
||||
},
|
||||
|
||||
getURI : function(nh) {
|
||||
@ -1406,6 +1416,18 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (!v)
|
||||
v = e.getAttribute(n, 2);
|
||||
|
||||
// Check boolean attribs
|
||||
if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {
|
||||
if (e[t.props[n]] === true && v === '')
|
||||
return n;
|
||||
|
||||
return v ? n : '';
|
||||
}
|
||||
|
||||
// Inner input elements will override attributes on form elements
|
||||
if (e.nodeName === "FORM" && e.getAttributeNode(n))
|
||||
return e.getAttributeNode(n).nodeValue;
|
||||
|
||||
if (n === 'style') {
|
||||
v = v || e.style.cssText;
|
||||
|
||||
@ -1803,7 +1825,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (x) {
|
||||
// So if we replace the p elements with divs and mark them and then replace them back to paragraphs
|
||||
// after we use innerHTML we can fix the DOM tree
|
||||
h = h.replace(/<p ([^>]+)>|<p>/g, '<div $1 mce_tmp="1">');
|
||||
h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 mce_tmp="1">');
|
||||
h = h.replace(/<\/p>/g, '</div>');
|
||||
|
||||
// Set the new HTML with DIVs
|
||||
@ -1854,7 +1876,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
},
|
||||
|
||||
processHTML : function(h) {
|
||||
var t = this, s = t.settings;
|
||||
var t = this, s = t.settings, codeBlocks = [];
|
||||
|
||||
if (!s.process_html)
|
||||
return h;
|
||||
@ -1900,8 +1922,10 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
});
|
||||
|
||||
// Wrap text contents
|
||||
if (tinymce.trim(text))
|
||||
text = '<!--\n' + trim(text) + '\n// -->';
|
||||
if (tinymce.trim(text)) {
|
||||
codeBlocks.push(trim(text));
|
||||
text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->';
|
||||
}
|
||||
|
||||
return '<mce:script' + attribs + '>' + text + '</mce:script>';
|
||||
});
|
||||
@ -1909,8 +1933,10 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
// Wrap style elements
|
||||
h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {
|
||||
// Wrap text contents
|
||||
if (text)
|
||||
text = '<!--\n' + trim(text) + '\n-->';
|
||||
if (text) {
|
||||
codeBlocks.push(trim(text));
|
||||
text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->';
|
||||
}
|
||||
|
||||
return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' mce_bogus="1">' + text + '</style>';
|
||||
});
|
||||
@ -1923,6 +1949,24 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
|
||||
h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');
|
||||
|
||||
// Remove false bool attributes and force attributes into xhtml style attr="attr"
|
||||
h = h.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi, function(val) {
|
||||
function handle(val, name, value) {
|
||||
// Remove false/0 attribs
|
||||
if (value === 'false' || value === '0')
|
||||
return '';
|
||||
|
||||
return ' ' + name + '="' + name + '"';
|
||||
};
|
||||
|
||||
val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi, handle); // W3C
|
||||
val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi, handle); // W3C
|
||||
val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi, handle); // IE
|
||||
val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi, ' $1="$1"$2'); // Force attr="attr"
|
||||
|
||||
return val;
|
||||
});
|
||||
|
||||
// Process all tags with src, href or style
|
||||
h = h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi, function(a, n) {
|
||||
function handle(m, b, c) {
|
||||
@ -1937,17 +1981,8 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (t._isRes(c))
|
||||
return m;
|
||||
|
||||
if (s.hex_colors) {
|
||||
u = u.replace(/rgb\([^\)]+\)/g, function(v) {
|
||||
return t.toHex(v);
|
||||
});
|
||||
}
|
||||
|
||||
if (s.url_converter) {
|
||||
u = u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g, function(x, c) {
|
||||
return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)) + ')';
|
||||
});
|
||||
}
|
||||
// Parse and serialize the style to convert for example uppercase styles like "BORDER: 1px"
|
||||
u = t.encode(t.serializeStyle(t.parseStyle(u)));
|
||||
} else if (b != 'coords' && b != 'shape') {
|
||||
if (s.url_converter)
|
||||
u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n));
|
||||
@ -1961,6 +1996,11 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
|
||||
return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi, handle); // IE
|
||||
});
|
||||
|
||||
// Restore script blocks
|
||||
h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) {
|
||||
return codeBlocks[idx];
|
||||
});
|
||||
}
|
||||
|
||||
return h;
|
||||
@ -2094,7 +2134,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
|
||||
n = n.nodeName || n;
|
||||
|
||||
return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);
|
||||
return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);
|
||||
},
|
||||
|
||||
replace : function(n, o, k) {
|
||||
@ -2265,9 +2305,13 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (n.nodeName == 'OBJECT')
|
||||
return n.attributes;
|
||||
|
||||
// IE doesn't keep the selected attribute if you clone option elements
|
||||
if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))
|
||||
o.push({specified : 1, nodeName : 'selected'});
|
||||
|
||||
// It's crazy that this is faster in IE but it's because it returns all attributes all the time
|
||||
n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi, function(a, b) {
|
||||
o.push({specified : 1, nodeName : b});
|
||||
n.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi, '').replace(/[\w:]+/gi, function(a) {
|
||||
o.push({specified : 1, nodeName : a});
|
||||
});
|
||||
|
||||
return o;
|
||||
@ -2321,16 +2365,29 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
return n.replace(/[ \t\r\n]+| | /g, '') == '';
|
||||
};
|
||||
|
||||
// Added until Gecko can create real HTML documents using implementation.createHTMLDocument
|
||||
// this is to future proof it if Gecko decides to implement the error checking for range methods.
|
||||
function nodeIndex(n) {
|
||||
var i = 0;
|
||||
|
||||
while (n.previousSibling) {
|
||||
i++;
|
||||
n = n.previousSibling;
|
||||
}
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
if (pe && e) {
|
||||
// Get before chunk
|
||||
r.setStartBefore(pe);
|
||||
r.setEndBefore(e);
|
||||
r.setStart(pe.parentNode, nodeIndex(pe));
|
||||
r.setEnd(e.parentNode, nodeIndex(e));
|
||||
bef = r.extractContents();
|
||||
|
||||
// Get after chunk
|
||||
r = t.createRng();
|
||||
r.setStartAfter(e);
|
||||
r.setEndAfter(pe);
|
||||
r.setStart(e.parentNode, nodeIndex(e) + 1);
|
||||
r.setEnd(pe.parentNode, nodeIndex(pe) + 1);
|
||||
aft = r.extractContents();
|
||||
|
||||
// Insert chunks and remove parent
|
||||
@ -3343,6 +3400,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (sc == ec && sc.nodeType == 3) {
|
||||
startPos = getCharPos(sc, so);
|
||||
|
||||
ieRng = body.createTextRange();
|
||||
ieRng.move('character', startPos);
|
||||
ieRng.moveEnd('character', eo - so);
|
||||
ieRng.select();
|
||||
@ -5119,6 +5177,8 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
// Handle explorer
|
||||
if (isIE) {
|
||||
t.tridentSel.destroy();
|
||||
|
||||
// Handle simple
|
||||
if (r = b.rng) {
|
||||
try {
|
||||
@ -5669,7 +5729,6 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
closed : /^(br|hr|input|meta|img|link|param|area)$/,
|
||||
entity_encoding : 'named',
|
||||
entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',
|
||||
bool_attrs : /(checked|disabled|readonly|selected|nowrap)/,
|
||||
valid_elements : '*[*]',
|
||||
extended_valid_elements : 0,
|
||||
valid_child_elements : 0,
|
||||
@ -5753,18 +5812,21 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
if (s.fix_table_elements) {
|
||||
t.onPreProcess.add(function(se, o) {
|
||||
each(t.dom.select('p table', o.node).reverse(), function(n) {
|
||||
var parent = t.dom.getParent(n.parentNode, 'table,p');
|
||||
// Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build
|
||||
// so Opera users with an older version will have to live with less compaible output not much we can do here
|
||||
if (!tinymce.isOpera || opera.buildNumber() >= 1767) {
|
||||
each(t.dom.select('p table', o.node).reverse(), function(n) {
|
||||
var parent = t.dom.getParent(n.parentNode, 'table,p');
|
||||
|
||||
if (parent.nodeName != 'TABLE') {
|
||||
// IE has a odd bug where tables inside paragraphs sometimes gets wrapped in a BODY and documentFragement element
|
||||
// This hack seems to resolve that issue. This will normally not happed since your contents should be valid in the first place
|
||||
if (isIE)
|
||||
t.dom.setOuterHTML(n, n.outerHTML);
|
||||
|
||||
t.dom.split(parent, n);
|
||||
}
|
||||
});
|
||||
if (parent.nodeName != 'TABLE') {
|
||||
try {
|
||||
t.dom.split(parent, n);
|
||||
} catch (ex) {
|
||||
// IE can sometimes fire an unknown runtime error so we just ignore it
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -6080,18 +6142,56 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
},
|
||||
|
||||
serialize : function(n, o) {
|
||||
var h, t = this, doc;
|
||||
var h, t = this, doc, oldDoc, impl, selected;
|
||||
|
||||
t._setup();
|
||||
o = o || {};
|
||||
o.format = o.format || 'html';
|
||||
n = n.cloneNode(true);
|
||||
t.processObj = o;
|
||||
|
||||
// Nodes needs to be attached to something in WebKit due to a bug https://bugs.webkit.org/show_bug.cgi?id=25571
|
||||
if (tinymce.isWebKit) {
|
||||
doc = n.ownerDocument.implementation.createHTMLDocument("");
|
||||
doc.body.appendChild(doc.importNode(n));
|
||||
// IE looses the selected attribute on option elements so we need to store it
|
||||
// See: http://support.microsoft.com/kb/829907
|
||||
if (isIE) {
|
||||
selected = [];
|
||||
each(n.getElementsByTagName('option'), function(n) {
|
||||
var v = t.dom.getAttrib(n, 'selected');
|
||||
|
||||
selected.push(v ? v : null);
|
||||
});
|
||||
}
|
||||
|
||||
n = n.cloneNode(true);
|
||||
|
||||
// IE looses the selected attribute on option elements so we need to restore it
|
||||
if (isIE) {
|
||||
each(n.getElementsByTagName('option'), function(n, i) {
|
||||
t.dom.setAttrib(n, 'selected', selected[i]);
|
||||
});
|
||||
}
|
||||
|
||||
// Nodes needs to be attached to something in WebKit/Opera
|
||||
// Older builds of Opera crashes if you attach the node to an document created dynamically
|
||||
// and since we can't feature detect a crash we need to sniff the acutal build number
|
||||
// This fix will make DOM ranges and make Sizzle happy!
|
||||
impl = n.ownerDocument.implementation;
|
||||
if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) {
|
||||
// Create an empty HTML document
|
||||
doc = impl.createHTMLDocument("");
|
||||
|
||||
// Add the element or it's children if it's a body element to the new document
|
||||
each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) {
|
||||
doc.body.appendChild(doc.importNode(node, true));
|
||||
});
|
||||
|
||||
// Grab first child or body element for serialization
|
||||
if (n.nodeName != 'BODY')
|
||||
n = doc.body.firstChild;
|
||||
else
|
||||
n = doc.body;
|
||||
|
||||
// set the new document in DOMUtils so createElement etc works
|
||||
oldDoc = t.dom.doc;
|
||||
t.dom.doc = doc;
|
||||
}
|
||||
|
||||
t.key = '' + (parseInt(t.key) + 1);
|
||||
@ -6109,6 +6209,10 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
// Post process
|
||||
o.content = t.writer.getContent();
|
||||
|
||||
// Restore the old document if it was changed
|
||||
if (oldDoc)
|
||||
t.dom.doc = oldDoc;
|
||||
|
||||
if (!o.no_events)
|
||||
t.onPostProcess.dispatch(t, o);
|
||||
|
||||
@ -6482,16 +6586,6 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
v = this.dom.getAttrib(n, na);
|
||||
|
||||
// Bool attr
|
||||
if (this.settings.bool_attrs.test(na) && v) {
|
||||
v = ('' + v).toLowerCase();
|
||||
|
||||
if (v === 'false' || v === '0')
|
||||
return null;
|
||||
|
||||
v = na;
|
||||
}
|
||||
|
||||
switch (na) {
|
||||
case 'rowspan':
|
||||
case 'colspan':
|
||||
@ -8751,7 +8845,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
apply_source_formatting : 1,
|
||||
directionality : 'ltr',
|
||||
forced_root_block : 'p',
|
||||
valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',
|
||||
valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',
|
||||
hidden_input : 1,
|
||||
padd_empty_editor : 1,
|
||||
render_ui : 1,
|
||||
@ -9101,7 +9195,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
DOM.show(b);
|
||||
}
|
||||
|
||||
t.dom = new tinymce.DOM.DOMUtils(t.getDoc(), {
|
||||
t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {
|
||||
keep_values : true,
|
||||
url_converter : t.convertURL,
|
||||
url_converter_scope : t,
|
||||
@ -11837,9 +11931,11 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
}
|
||||
}
|
||||
|
||||
// Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE
|
||||
// See: http://support.microsoft.com/kb/829907
|
||||
bl = ed.dom.create(ed.settings.forced_root_block);
|
||||
bl.appendChild(nx.cloneNode(1));
|
||||
nx.parentNode.replaceChild(bl, nx);
|
||||
bl.appendChild(nx);
|
||||
}
|
||||
} else {
|
||||
if (bl.hasChildNodes())
|
||||
@ -13080,7 +13176,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
doc.execCommand(cmd, false, null);
|
||||
|
||||
// On WebKit the command will just be ignored if it's not enabled
|
||||
if (!doc.queryCommandSupported(cmd))
|
||||
if (!doc.queryCommandEnabled(cmd))
|
||||
throw 'Error';
|
||||
} catch (ex) {
|
||||
if (tinymce.isGecko) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editable_selects.js,v 1.3 2009-09-21 16:31:02 e107coders Exp $
|
||||
* $Id: editable_selects.js,v 1.4 2009-10-02 18:17:40 e107coders Exp $
|
||||
*
|
||||
* Makes select boxes editable.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: form_utils.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
* $Id: form_utils.js,v 1.4 2009-10-02 18:17:40 e107coders Exp $
|
||||
*
|
||||
* Various form utilitiy functions.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: mctabs.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
* $Id: mctabs.js,v 1.4 2009-10-02 18:17:40 e107coders Exp $
|
||||
*
|
||||
* Moxiecode DHTML Tabs script.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: validate.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
* $Id: validate.js,v 1.4 2009-10-02 18:17:40 e107coders Exp $
|
||||
*
|
||||
* Various form validation methods.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user