mirror of
https://github.com/e107inc/e107.git
synced 2025-05-01 17:57:56 +02:00
TinyMce upgraded to 3.2.6.
This commit is contained in:
parent
d8f2cc5900
commit
7b0705b2a5
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:12 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-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:20 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-07-01 02:52:09 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:29 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1 +1 @@
|
||||
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},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}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
|
||||
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},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}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
@ -25,6 +25,9 @@
|
||||
init : function(ed, url) {
|
||||
var t = this;
|
||||
|
||||
if (ed.getParam('fullscreen_is_enabled'))
|
||||
return;
|
||||
|
||||
/**
|
||||
* This method gets executed each time the editor needs to resize.
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:48 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-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -123,7 +123,7 @@ function init() {
|
||||
// Parse xml and doctype
|
||||
xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
|
||||
xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
|
||||
docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
|
||||
docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
|
||||
f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
|
||||
|
||||
// Parse title
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:48 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-07-01 02:52:09 e107coders Exp $
|
||||
* $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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31: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.1 2009-07-01 02:52:09 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -98,9 +98,15 @@
|
||||
// Remove container
|
||||
dom.remove(n);
|
||||
|
||||
// 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 === ' ')
|
||||
return;
|
||||
|
||||
// Process contents
|
||||
process({content : n.innerHTML});
|
||||
|
||||
// Block the real paste event
|
||||
return tinymce.dom.Event.cancel(e);
|
||||
} else {
|
||||
or = ed.selection.getRng();
|
||||
@ -114,20 +120,13 @@
|
||||
|
||||
// Wait a while and grab the pasted contents
|
||||
window.setTimeout(function() {
|
||||
var n = dom.get('_mcePaste'), h;
|
||||
var h = '';
|
||||
|
||||
// Webkit clones the _mcePaste div for some odd reason so this will ensure that we get the real new div not the old empty one
|
||||
n.id = '_mceRemoved';
|
||||
dom.remove(n);
|
||||
n = dom.get('_mcePaste') || n;
|
||||
|
||||
// Grab the HTML contents
|
||||
// We need to look for a apple style wrapper on webkit it also adds a div wrapper if you copy/paste the body of the editor
|
||||
// It's amazing how strange the contentEditable mode works in WebKit
|
||||
h = (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML;
|
||||
|
||||
// Remove hidden div and restore selection
|
||||
dom.remove(n);
|
||||
// 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) {
|
||||
h += (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML;
|
||||
dom.remove(n);
|
||||
});
|
||||
|
||||
// Restore the old selection
|
||||
if (or)
|
||||
@ -195,17 +194,17 @@
|
||||
});
|
||||
};
|
||||
|
||||
// Process away some basic content
|
||||
process([
|
||||
/^\s*( )+/g, // nbsp entities at the start of contents
|
||||
/( |<br[^>]*>)+\s*$/g // nbsp entities at the end of contents
|
||||
]);
|
||||
|
||||
// Detect Word content and process it more aggressive
|
||||
if (/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(h) || o.wordContent) {
|
||||
o.wordContent = true; // Mark the pasted contents as word specific content
|
||||
//console.log('Word contents detected.');
|
||||
|
||||
// Process away some basic content
|
||||
process([
|
||||
/^\s*( )+/g, // nbsp entities at the start of contents
|
||||
/( |<br[^>]*>)+\s*$/g // nbsp entities at the end of contents
|
||||
]);
|
||||
|
||||
if (ed.getParam('paste_convert_middot_lists', true)) {
|
||||
process([
|
||||
[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
|
||||
@ -436,9 +435,10 @@
|
||||
// Insert a marker for the caret position
|
||||
this._insert('<span id="_marker"> </span>', 1);
|
||||
marker = dom.get('_marker');
|
||||
parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol');
|
||||
parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td');
|
||||
|
||||
if (parentBlock) {
|
||||
// If it's a parent block but not a table cell
|
||||
if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) {
|
||||
// Split parent block
|
||||
marker = dom.split(parentBlock, marker);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 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-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.3 2009-09-21 16:31:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
@ -55,6 +55,30 @@
|
||||
}
|
||||
|
||||
ed.onInit.add(function() {
|
||||
// Fixes an issue on Gecko where it's impossible to place the caret behind a table
|
||||
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
|
||||
if (!tinymce.isIE && ed.getParam('forced_root_block')) {
|
||||
function fixTableCaretPos() {
|
||||
var last = ed.getBody().lastChild;
|
||||
|
||||
if (last && last.nodeName == 'TABLE')
|
||||
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
|
||||
};
|
||||
|
||||
ed.onKeyUp.add(fixTableCaretPos);
|
||||
ed.onSetContent.add(fixTableCaretPos);
|
||||
ed.onVisualAid.add(fixTableCaretPos);
|
||||
|
||||
ed.onPreProcess.add(function(ed, o) {
|
||||
var last = o.node.lastChild;
|
||||
|
||||
if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
|
||||
ed.dom.remove(last);
|
||||
});
|
||||
|
||||
fixTableCaretPos();
|
||||
}
|
||||
|
||||
if (ed && ed.plugins.contextmenu) {
|
||||
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
|
||||
var sm, se = ed.selection, el = se.getNode() || ed.getBody();
|
||||
|
@ -24,14 +24,14 @@ function insertTable() {
|
||||
border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
|
||||
cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
|
||||
cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
|
||||
align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
|
||||
frame = formObj.elements['tframe'].options[formObj.elements['tframe'].selectedIndex].value;
|
||||
rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
|
||||
align = getSelectValue(formObj, "align");
|
||||
frame = getSelectValue(formObj, "tframe");
|
||||
rules = getSelectValue(formObj, "rules");
|
||||
width = formObj.elements['width'].value;
|
||||
height = formObj.elements['height'].value;
|
||||
bordercolor = formObj.elements['bordercolor'].value;
|
||||
bgcolor = formObj.elements['bgcolor'].value;
|
||||
className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
|
||||
className = getSelectValue(formObj, "class");
|
||||
id = formObj.elements['id'].value;
|
||||
summary = formObj.elements['summary'].value;
|
||||
style = formObj.elements['style'].value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:10 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31: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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
1
e107_plugins/tinymce/plugins/wordcount/editor_plugin.js
Normal file
1
e107_plugins/tinymce/plugins/wordcount/editor_plugin.js
Normal file
@ -0,0 +1 @@
|
||||
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
|
95
e107_plugins/tinymce/plugins/wordcount/editor_plugin_src.js
Normal file
95
e107_plugins/tinymce/plugins/wordcount/editor_plugin_src.js
Normal file
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-09-21 16:31:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.WordCount', {
|
||||
block : 0,
|
||||
id : null,
|
||||
countre : null,
|
||||
cleanre : null,
|
||||
|
||||
init : function(ed, url) {
|
||||
var t = this, last = 0;
|
||||
|
||||
t.countre = ed.getParam('wordcount_countregex', /\S\s+/g);
|
||||
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g);
|
||||
t.id = ed.id + '-word-count';
|
||||
|
||||
ed.onPostRender.add(function(ed, cm) {
|
||||
var row, id;
|
||||
|
||||
// Add it to the specified id or the theme advanced path
|
||||
id = ed.getParam('wordcount_target_id');
|
||||
if (!id) {
|
||||
row = tinymce.DOM.get(ed.id + '_path_row');
|
||||
|
||||
if (row)
|
||||
tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');
|
||||
} else
|
||||
tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');
|
||||
});
|
||||
|
||||
ed.onInit.add(function(ed) {
|
||||
ed.selection.onSetContent.add(function() {
|
||||
t._count(ed);
|
||||
});
|
||||
|
||||
t._count(ed);
|
||||
});
|
||||
|
||||
ed.onSetContent.add(function(ed) {
|
||||
t._count(ed);
|
||||
});
|
||||
|
||||
ed.onKeyUp.add(function(ed, e) {
|
||||
if (e.keyCode == last)
|
||||
return;
|
||||
|
||||
if (13 == e.keyCode || 8 == last || 46 == last)
|
||||
t._count(ed);
|
||||
|
||||
last = e.keyCode;
|
||||
});
|
||||
},
|
||||
|
||||
_count : function(ed) {
|
||||
var t = this, tc = 0;
|
||||
|
||||
// Keep multiple calls from happening at the same time
|
||||
if (t.block)
|
||||
return;
|
||||
|
||||
t.block = 1;
|
||||
|
||||
setTimeout(function() {
|
||||
var tx = ed.getContent({format : 'raw'});
|
||||
|
||||
if (tx) {
|
||||
tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars
|
||||
tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation
|
||||
tx.replace(t.countre, function() {tc++;}); // count the words
|
||||
}
|
||||
|
||||
tinymce.DOM.setHTML(t.id, tc.toString());
|
||||
|
||||
setTimeout(function() {t.block = 0;}, 2000);
|
||||
}, 1);
|
||||
},
|
||||
|
||||
getInfo: function() {
|
||||
return {
|
||||
longname : 'Word Count plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);
|
||||
})();
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js,v 1.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: editor_plugin_src.js,v 1.2 2009-09-21 16:31:49 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: abbr.js,v 1.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: abbr.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: acronym.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: attributes.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: cite.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: del.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: element_common.js,v 1.2 2009-09-21 16:33:20 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.1 2009-07-01 02:52:11 e107coders Exp $
|
||||
* $Id: ins.js,v 1.2 2009-09-21 16:33:20 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode - based on work by Andrew Tetlaw
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -21,7 +21,7 @@
|
||||
<fieldset>
|
||||
<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
|
||||
<div id="picker">
|
||||
<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt=" " />
|
||||
<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
|
||||
|
||||
<div id="light">
|
||||
<!-- Will be filled with divs -->
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editor_template_src.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editor_template_src.js,v 1.3 2009-09-21 16:33:32 e107coders Exp $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
|
@ -63,8 +63,8 @@ var LinkDialog = {
|
||||
ed.dom.setAttribs(e, {
|
||||
href : f.href.value,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
|
||||
'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -72,8 +72,8 @@ var LinkDialog = {
|
||||
ed.dom.setAttribs(e, {
|
||||
href : f.href.value,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
|
||||
'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
});
|
||||
}
|
||||
|
||||
|
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
134
e107_plugins/tinymce/tiny_mce_gzip.js
vendored
Normal file
134
e107_plugins/tinymce/tiny_mce_gzip.js
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
var tinyMCE_GZ = {
|
||||
settings : {
|
||||
themes : '',
|
||||
plugins : '',
|
||||
languages : '',
|
||||
disk_cache : true,
|
||||
page_name : 'tiny_mce_gzip.php',
|
||||
debug : false,
|
||||
suffix : ''
|
||||
},
|
||||
|
||||
init : function(s, cb, sc) {
|
||||
var t = this, n, i, nl = document.getElementsByTagName('script');
|
||||
|
||||
for (n in s)
|
||||
t.settings[n] = s[n];
|
||||
|
||||
s = t.settings;
|
||||
|
||||
for (i=0; i<nl.length; i++) {
|
||||
n = nl[i];
|
||||
|
||||
if (n.src && n.src.indexOf('tiny_mce') != -1)
|
||||
t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
|
||||
}
|
||||
|
||||
if (!t.coreLoaded)
|
||||
t.loadScripts(1, s.themes, s.plugins, s.languages, cb, sc);
|
||||
},
|
||||
|
||||
loadScripts : function(co, th, pl, la, cb, sc) {
|
||||
var t = this, x, w = window, q, c = 0, ti, s = t.settings;
|
||||
|
||||
function get(s) {
|
||||
x = 0;
|
||||
|
||||
try {
|
||||
x = new ActiveXObject(s);
|
||||
} catch (s) {
|
||||
}
|
||||
|
||||
return x;
|
||||
};
|
||||
|
||||
// Build query string
|
||||
q = 'js=true&diskcache=' + (s.disk_cache ? 'true' : 'false') + '&core=' + (co ? 'true' : 'false') + '&suffix=' + escape(s.suffix) + '&themes=' + escape(th) + '&plugins=' + escape(pl) + '&languages=' + escape(la);
|
||||
|
||||
if (co)
|
||||
t.coreLoaded = 1;
|
||||
|
||||
// Send request
|
||||
x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP');
|
||||
x.overrideMimeType && x.overrideMimeType('text/javascript');
|
||||
x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb);
|
||||
// x.setRequestHeader('Content-Type', 'text/javascript');
|
||||
x.send('');
|
||||
|
||||
// Handle asyncronous loading
|
||||
if (cb) {
|
||||
// Wait for response
|
||||
ti = w.setInterval(function() {
|
||||
if (x.readyState == 4 || c++ > 10000) {
|
||||
w.clearInterval(ti);
|
||||
|
||||
if (c < 10000 && x.status == 200) {
|
||||
t.loaded = 1;
|
||||
t.eval(x.responseText);
|
||||
tinymce.dom.Event.domLoaded = true;
|
||||
cb.call(sc || t, x);
|
||||
}
|
||||
|
||||
ti = x = null;
|
||||
}
|
||||
}, 10);
|
||||
} else
|
||||
t.eval(x.responseText);
|
||||
},
|
||||
|
||||
start : function() {
|
||||
var t = this, each = tinymce.each, s = t.settings, ln = s.languages.split(',');
|
||||
|
||||
tinymce.suffix = s.suffix;
|
||||
|
||||
function load(u) {
|
||||
tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(u));
|
||||
};
|
||||
|
||||
// Add core languages
|
||||
each(ln, function(c) {
|
||||
if (c)
|
||||
load('langs/' + c + '.js');
|
||||
});
|
||||
|
||||
// Add themes with languages
|
||||
each(s.themes.split(','), function(n) {
|
||||
if (n) {
|
||||
load('themes/' + n + '/editor_template' + s.suffix + '.js');
|
||||
|
||||
each (ln, function(c) {
|
||||
if (c)
|
||||
load('themes/' + n + '/langs/' + c + '.js');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Add plugins with languages
|
||||
each(s.plugins.split(','), function(n) {
|
||||
if (n) {
|
||||
load('plugins/' + n + '/editor_plugin' + s.suffix + '.js');
|
||||
|
||||
each(ln, function(c) {
|
||||
if (c)
|
||||
load('plugins/' + n + '/langs/' + c + '.js');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
end : function() {
|
||||
},
|
||||
|
||||
eval : function(co) {
|
||||
var w = window;
|
||||
|
||||
// Evaluate script
|
||||
if (!w.execScript) {
|
||||
if (/Gecko/.test(navigator.userAgent))
|
||||
eval(co, w); // Firefox 3.0
|
||||
else
|
||||
eval.call(w, co);
|
||||
} else
|
||||
w.execScript(co); // IE
|
||||
}
|
||||
};
|
2
e107_plugins/tinymce/tiny_mce_popup.js
vendored
2
e107_plugins/tinymce/tiny_mce_popup.js
vendored
File diff suppressed because one or more lines are too long
383
e107_plugins/tinymce/tiny_mce_src.js
vendored
383
e107_plugins/tinymce/tiny_mce_src.js
vendored
@ -1,18 +1,23 @@
|
||||
var tinymce = {
|
||||
majorVersion : '3',
|
||||
minorVersion : '2.5',
|
||||
releaseDate : '2009-06-29',
|
||||
minorVersion : '2.6',
|
||||
releaseDate : '2009-08-19',
|
||||
|
||||
_init : function() {
|
||||
var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
|
||||
|
||||
// Browser checks
|
||||
t.isOpera = w.opera && opera.buildNumber;
|
||||
|
||||
t.isWebKit = /WebKit/.test(ua);
|
||||
|
||||
t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
|
||||
|
||||
t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
|
||||
|
||||
t.isGecko = !t.isWebKit && /Gecko/.test(ua);
|
||||
|
||||
t.isMac = ua.indexOf('Mac') != -1;
|
||||
|
||||
t.isAir = /adobeair/i.test(ua);
|
||||
|
||||
// TinyMCE .NET webcontrol might be setting the values for TinyMCE
|
||||
@ -49,7 +54,9 @@ var tinymce = {
|
||||
t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
|
||||
|
||||
// If path to script is relative and a base href was found add that one infront
|
||||
if (base && t.baseURL.indexOf('://') == -1)
|
||||
// the src property will always be an absolute one on non IE browsers and IE 8
|
||||
// so this logic will basically only be executed on older IE versions
|
||||
if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)
|
||||
t.baseURL = base + t.baseURL;
|
||||
|
||||
return t.baseURL;
|
||||
@ -90,7 +97,6 @@ var tinymce = {
|
||||
return n == t;
|
||||
},
|
||||
|
||||
|
||||
each : function(o, cb, s) {
|
||||
var n, l;
|
||||
|
||||
@ -118,6 +124,7 @@ var tinymce = {
|
||||
return 1;
|
||||
},
|
||||
|
||||
|
||||
map : function(a, f) {
|
||||
var o = [];
|
||||
|
||||
@ -296,7 +303,7 @@ var tinymce = {
|
||||
o = o || window;
|
||||
|
||||
n = n.split('.');
|
||||
for (i=0, l = n.length; i<l; i++) {
|
||||
for (i = 0, l = n.length; i < l; i++) {
|
||||
o = o[n[i]];
|
||||
|
||||
if (!o)
|
||||
@ -490,7 +497,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
s = t.settings = s || {};
|
||||
|
||||
// Strange app protocol or local anchor
|
||||
if (/^(mailto|tel|news|javascript|about):/i.test(u) || /^\s*#/.test(u)) {
|
||||
if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) {
|
||||
t.source = u;
|
||||
return;
|
||||
}
|
||||
@ -704,8 +711,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
|
||||
return t.source;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})();
|
||||
(function() {
|
||||
var each = tinymce.each;
|
||||
@ -775,8 +781,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
||||
|
||||
this.set(n, '', d, p, d);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})();
|
||||
tinymce.create('static tinymce.util.JSON', {
|
||||
serialize : function(o) {
|
||||
@ -863,6 +868,8 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
if (o.content_type)
|
||||
x.setRequestHeader('Content-Type', o.content_type);
|
||||
|
||||
x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
|
||||
x.send(o.data);
|
||||
|
||||
function ready() {
|
||||
@ -884,8 +891,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
|
||||
t = w.setTimeout(ready, 10);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
(function() {
|
||||
var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
|
||||
@ -938,8 +944,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
return new tinymce.util.JSONRequest().send(o);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}());(function(tinymce) {
|
||||
// Shorten names
|
||||
var each = tinymce.each, is = tinymce.is;
|
||||
@ -1110,6 +1115,14 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
return e;
|
||||
},
|
||||
|
||||
getNext : function(node, selector) {
|
||||
return this._findSib(node, selector, 'nextSibling');
|
||||
},
|
||||
|
||||
getPrev : function(node, selector) {
|
||||
return this._findSib(node, selector, 'previousSibling');
|
||||
},
|
||||
|
||||
|
||||
select : function(pa, s) {
|
||||
var t = this;
|
||||
@ -1861,7 +1874,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
// Store away src and href in mce_src and mce_href since browsers mess them up
|
||||
if (s.keep_values) {
|
||||
// Wrap scripts and styles in comments for serialization purposes
|
||||
if (/<script|noscript|style/.test(h)) {
|
||||
if (/<script|noscript|style/i.test(h)) {
|
||||
function trim(s) {
|
||||
// Remove prefix and suffix code for element
|
||||
s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n');
|
||||
@ -1873,14 +1886,13 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
};
|
||||
|
||||
// Wrap the script contents in CDATA and keep them from executing
|
||||
h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g, function(v, attribs, text) {
|
||||
h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) {
|
||||
// Force type attribute
|
||||
if (!attribs)
|
||||
attribs = ' type="text/javascript"';
|
||||
|
||||
// Prefix script type/language attribute values with mce- to prevent it from executing
|
||||
attribs = attribs.replace(/(type|language)=\"?/, '$&mce-');
|
||||
attribs = attribs.replace(/src=\"([^\"]+)\"?/, function(a, url) {
|
||||
// Convert the src attribute of the scripts
|
||||
attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) {
|
||||
if (s.url_converter)
|
||||
url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script'));
|
||||
|
||||
@ -1895,7 +1907,7 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
});
|
||||
|
||||
// Wrap style elements
|
||||
h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g, function(v, attribs, text) {
|
||||
h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {
|
||||
// Wrap text contents
|
||||
if (text)
|
||||
text = '<!--\n' + trim(text) + '\n-->';
|
||||
@ -1974,25 +1986,41 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
setOuterHTML : function(e, h, d) {
|
||||
var t = this;
|
||||
|
||||
return this.run(e, function(e) {
|
||||
function setHTML(e, h, d) {
|
||||
var n, tp;
|
||||
|
||||
tp = d.createElement("body");
|
||||
tp.innerHTML = h;
|
||||
|
||||
n = tp.lastChild;
|
||||
while (n) {
|
||||
t.insertAfter(n.cloneNode(true), e);
|
||||
n = n.previousSibling;
|
||||
}
|
||||
|
||||
t.remove(e);
|
||||
};
|
||||
|
||||
return this.run(e, function(e) {
|
||||
e = t.get(e);
|
||||
d = d || e.ownerDocument || t.doc;
|
||||
|
||||
if (isIE && e.nodeType == 1)
|
||||
e.outerHTML = h;
|
||||
else {
|
||||
tp = d.createElement("body");
|
||||
tp.innerHTML = h;
|
||||
// Only set HTML on elements
|
||||
if (e.nodeType == 1) {
|
||||
d = d || e.ownerDocument || t.doc;
|
||||
|
||||
n = tp.lastChild;
|
||||
while (n) {
|
||||
t.insertAfter(n.cloneNode(true), e);
|
||||
n = n.previousSibling;
|
||||
}
|
||||
|
||||
t.remove(e);
|
||||
if (isIE) {
|
||||
try {
|
||||
// Try outerHTML for IE it sometimes produces an unknown runtime error
|
||||
if (isIE && e.nodeType == 1)
|
||||
e.outerHTML = h;
|
||||
else
|
||||
setHTML(e, h, d);
|
||||
} catch (ex) {
|
||||
// Fix for unknown runtime error
|
||||
setHTML(e, h, d);
|
||||
}
|
||||
} else
|
||||
setHTML(e, h, d);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2350,6 +2378,27 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
},
|
||||
|
||||
|
||||
_findSib : function(node, selector, name) {
|
||||
var t = this, f = selector;
|
||||
|
||||
if (node) {
|
||||
// If expression make a function of it using is
|
||||
if (is(f, 'string')) {
|
||||
f = function(node) {
|
||||
return t.is(node, selector);
|
||||
};
|
||||
}
|
||||
|
||||
// Loop all siblings
|
||||
for (node = node[name]; node; node = node[name]) {
|
||||
if (f(node))
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
_isRes : function(c) {
|
||||
// Is live resizble element
|
||||
return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);
|
||||
@ -2384,10 +2433,8 @@ tinymce.create('static tinymce.util.XHR', {
|
||||
return s;
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Setup page DOM
|
||||
tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
|
||||
})(tinymce);
|
||||
(function(ns) {
|
||||
@ -4597,10 +4644,8 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
this.cancelBubble = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Shorten name and setup global instance
|
||||
Event = tinymce.dom.Event = new tinymce.dom.EventUtils();
|
||||
|
||||
// Dispatch DOM content loaded event for IE and Safari
|
||||
@ -4734,8 +4779,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
function trimNl(s) {
|
||||
@ -5373,8 +5417,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
if (!s)
|
||||
tinymce.removeUnload(t.destroy);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
tinymce.create('tinymce.dom.XMLWriter', {
|
||||
@ -5465,8 +5508,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
tinymce.create('tinymce.dom.StringWriter', {
|
||||
@ -5592,8 +5634,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
// Shorten names
|
||||
@ -5712,13 +5753,17 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
if (s.fix_table_elements) {
|
||||
t.onPreProcess.add(function(se, o) {
|
||||
each(t.dom.select('p table', o.node), function(n) {
|
||||
// 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)
|
||||
n.outerHTML = n.outerHTML;
|
||||
each(t.dom.select('p table', o.node).reverse(), function(n) {
|
||||
var parent = t.dom.getParent(n.parentNode, 'table,p');
|
||||
|
||||
t.dom.split(t.dom.getParent(n, 'p'), n);
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -6046,7 +6091,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
// 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(n);
|
||||
doc.body.appendChild(doc.importNode(n));
|
||||
}
|
||||
|
||||
t.key = '' + (parseInt(t.key) + 1);
|
||||
@ -6134,9 +6179,6 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
// Restore CDATA sections
|
||||
h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');
|
||||
|
||||
// Restore scripts
|
||||
h = h.replace(/(type|language)=\"mce-/g, '$1="');
|
||||
|
||||
// Restore the \u00a0 character if raw mode is enabled
|
||||
if (s.entity_encoding == 'raw')
|
||||
h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>');
|
||||
@ -6492,8 +6534,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var each = tinymce.each, Event = tinymce.dom.Event;
|
||||
@ -6765,8 +6806,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Global script loader
|
||||
tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
|
||||
@ -6870,12 +6910,13 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
destroy : function() {
|
||||
tinymce.dom.Event.clear(this.id);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
|
||||
Container : function(id, s) {
|
||||
this.parent(id, s);
|
||||
|
||||
this.controls = [];
|
||||
|
||||
this.lookup = {};
|
||||
},
|
||||
|
||||
@ -6889,8 +6930,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
||||
get : function(n) {
|
||||
return this.lookup[n];
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
Separator : function(id, s) {
|
||||
@ -6901,8 +6941,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
renderHTML : function() {
|
||||
return tinymce.DOM.createHTML('span', {'class' : this.classPrefix});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
(function(tinymce) {
|
||||
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
|
||||
|
||||
@ -6930,8 +6969,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
if (is(t.selected))
|
||||
t.setSelected(t.selected);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
|
||||
@ -7029,8 +7067,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);(function(tinymce) {
|
||||
var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;
|
||||
|
||||
@ -7357,8 +7394,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
|
||||
DOM.addClass(ro, 'mceLast');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);(function(tinymce) {
|
||||
var DOM = tinymce.DOM;
|
||||
|
||||
@ -7390,8 +7426,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
return s.onclick.call(s.scope, e);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
|
||||
@ -7401,11 +7436,17 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
var t = this;
|
||||
|
||||
t.parent(id, s);
|
||||
|
||||
t.items = [];
|
||||
|
||||
t.onChange = new Dispatcher(t);
|
||||
|
||||
t.onPostRender = new Dispatcher(t);
|
||||
|
||||
t.onAdd = new Dispatcher(t);
|
||||
|
||||
t.onRenderMenu = new tinymce.util.Dispatcher(this);
|
||||
|
||||
t.classPrefix = 'mceListBox';
|
||||
},
|
||||
|
||||
@ -7643,8 +7684,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
Event.clear(this.id + '_text');
|
||||
Event.clear(this.id + '_open');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
|
||||
|
||||
@ -7772,15 +7812,16 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
|
||||
t.onPostRender.dispatch(t, DOM.get(t.id));
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
|
||||
|
||||
tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {
|
||||
MenuButton : function(id, s) {
|
||||
this.parent(id, s);
|
||||
|
||||
this.onRenderMenu = new tinymce.util.Dispatcher(this);
|
||||
|
||||
s.menu_container = s.menu_container || DOM.doc.body;
|
||||
},
|
||||
|
||||
@ -7859,8 +7900,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
|
||||
@ -7925,8 +7965,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
Event.clear(this.id + '_action');
|
||||
Event.clear(this.id + '_open');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
|
||||
@ -7944,6 +7983,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
}, t.settings);
|
||||
|
||||
t.onShowMenu = new tinymce.util.Dispatcher(t);
|
||||
|
||||
t.onHideMenu = new tinymce.util.Dispatcher(t);
|
||||
|
||||
t.value = s.default_color;
|
||||
@ -8091,8 +8131,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
||||
Event.clear(this.id + '_more');
|
||||
DOM.remove(this.id + '_menu');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
renderHTML : function() {
|
||||
@ -8155,8 +8194,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
|
||||
return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
(function(tinymce) {
|
||||
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
|
||||
|
||||
@ -8164,6 +8202,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
items : [],
|
||||
urls : {},
|
||||
lookup : {},
|
||||
|
||||
onAdd : new Dispatcher(this),
|
||||
|
||||
get : function(n) {
|
||||
@ -8203,19 +8242,22 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
t.urls[n] = u.substring(0, u.lastIndexOf('/'));
|
||||
tinymce.ScriptLoader.add(u, cb, s);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Create plugin and theme managers
|
||||
tinymce.PluginManager = new tinymce.AddOnManager();
|
||||
tinymce.ThemeManager = new tinymce.AddOnManager();
|
||||
}(tinymce));(function(tinymce) {
|
||||
}(tinymce));
|
||||
|
||||
(function(tinymce) {
|
||||
// Shorten names
|
||||
var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, explode = tinymce.explode;
|
||||
|
||||
tinymce.create('static tinymce.EditorManager', {
|
||||
editors : {},
|
||||
|
||||
i18n : {},
|
||||
|
||||
activeEditor : null,
|
||||
|
||||
preInit : function() {
|
||||
@ -8280,10 +8322,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
if (s.plugins) {
|
||||
pl = explode(s.plugins);
|
||||
|
||||
// Load compat2x first
|
||||
if (tinymce.inArray(pl, 'compat2x') != -1)
|
||||
PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js');
|
||||
|
||||
// Load rest if plugins
|
||||
each(pl, function(v) {
|
||||
if (v && v.charAt(0) != '-' && !PluginManager.urls[v]) {
|
||||
@ -8578,13 +8616,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
||||
_setActive : function(e) {
|
||||
this.selectedInstance = this.activeEditor = e;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
tinymce.EditorManager.preInit();
|
||||
})(tinymce);
|
||||
|
||||
// Short for editor manager window.tinyMCE is needed when TinyMCE gets loaded though a XHR call
|
||||
var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
(function(tinymce) {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher;
|
||||
@ -8597,53 +8633,90 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
var t = this;
|
||||
|
||||
t.id = t.editorId = id;
|
||||
|
||||
t.execCommands = {};
|
||||
t.queryStateCommands = {};
|
||||
t.queryValueCommands = {};
|
||||
|
||||
t.isNotDirty = false;
|
||||
|
||||
t.plugins = {};
|
||||
|
||||
// Add events to the editor
|
||||
each([
|
||||
'onPreInit',
|
||||
|
||||
'onBeforeRenderUI',
|
||||
|
||||
'onPostRender',
|
||||
|
||||
'onInit',
|
||||
|
||||
'onRemove',
|
||||
|
||||
'onActivate',
|
||||
|
||||
'onDeactivate',
|
||||
|
||||
'onClick',
|
||||
|
||||
'onEvent',
|
||||
|
||||
'onMouseUp',
|
||||
|
||||
'onMouseDown',
|
||||
|
||||
'onDblClick',
|
||||
|
||||
'onKeyDown',
|
||||
|
||||
'onKeyUp',
|
||||
|
||||
'onKeyPress',
|
||||
|
||||
'onContextMenu',
|
||||
|
||||
'onSubmit',
|
||||
|
||||
'onReset',
|
||||
|
||||
'onPaste',
|
||||
|
||||
'onPreProcess',
|
||||
|
||||
'onPostProcess',
|
||||
|
||||
'onBeforeSetContent',
|
||||
|
||||
'onBeforeGetContent',
|
||||
|
||||
'onSetContent',
|
||||
|
||||
'onGetContent',
|
||||
|
||||
'onLoadContent',
|
||||
|
||||
'onSaveContent',
|
||||
|
||||
'onNodeChange',
|
||||
|
||||
'onChange',
|
||||
|
||||
'onBeforeExecCommand',
|
||||
|
||||
'onExecCommand',
|
||||
|
||||
'onUndo',
|
||||
|
||||
'onRedo',
|
||||
|
||||
'onVisualAid',
|
||||
|
||||
'onSetProgressState'
|
||||
], function(e) {
|
||||
t[e] = new Dispatcher(t);
|
||||
});
|
||||
|
||||
// Default editor config
|
||||
t.settings = s = extend({
|
||||
id : id,
|
||||
language : 'en',
|
||||
@ -8690,10 +8763,10 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
removeformat_selector : 'span,b,strong,em,i,font,u,strike'
|
||||
}, s);
|
||||
|
||||
// Setup URIs
|
||||
t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {
|
||||
base_uri : tinyMCE.baseURI
|
||||
});
|
||||
|
||||
t.baseURI = EditorManager.baseURI;
|
||||
|
||||
// Call setup
|
||||
@ -8811,12 +8884,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
});
|
||||
};
|
||||
|
||||
// Load compat2x first
|
||||
if (s.plugins.indexOf('compat2x') != -1) {
|
||||
PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js');
|
||||
sl.loadQueue(loadScripts);
|
||||
} else
|
||||
loadScripts();
|
||||
loadScripts();
|
||||
},
|
||||
|
||||
init : function() {
|
||||
@ -8824,7 +8892,6 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
|
||||
EditorManager.add(t);
|
||||
|
||||
// Create theme
|
||||
if (s.theme) {
|
||||
s.theme = s.theme.replace(/-/, '');
|
||||
o = ThemeManager.get(s.theme);
|
||||
@ -8859,8 +8926,8 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
if (s.popup_css_add)
|
||||
s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);
|
||||
|
||||
// Setup control factory
|
||||
t.controlManager = new tinymce.ControlManager(t);
|
||||
|
||||
t.undoManager = new tinymce.UndoManager(t);
|
||||
|
||||
// Pass through
|
||||
@ -9034,7 +9101,6 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
DOM.show(b);
|
||||
}
|
||||
|
||||
// Setup objects
|
||||
t.dom = new tinymce.DOM.DOMUtils(t.getDoc(), {
|
||||
keep_values : true,
|
||||
url_converter : t.convertURL,
|
||||
@ -9045,26 +9111,13 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
fix_ie_paragraphs : 1
|
||||
});
|
||||
|
||||
t.serializer = new tinymce.dom.Serializer({
|
||||
entity_encoding : s.entity_encoding,
|
||||
entities : s.entities,
|
||||
t.serializer = new tinymce.dom.Serializer(extend(s, {
|
||||
valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
|
||||
extended_valid_elements : s.extended_valid_elements,
|
||||
valid_child_elements : s.valid_child_elements,
|
||||
invalid_elements : s.invalid_elements,
|
||||
fix_table_elements : s.fix_table_elements,
|
||||
fix_list_elements : s.fix_list_elements,
|
||||
fix_content_duplication : s.fix_content_duplication,
|
||||
convert_fonts_to_spans : s.convert_fonts_to_spans,
|
||||
font_size_classes : s.font_size_classes,
|
||||
font_size_style_values : s.font_size_style_values,
|
||||
apply_source_formatting : s.apply_source_formatting,
|
||||
remove_linebreaks : s.remove_linebreaks,
|
||||
element_format : s.element_format,
|
||||
dom : t.dom
|
||||
});
|
||||
}));
|
||||
|
||||
t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
|
||||
|
||||
t.forceBlocks = new tinymce.ForceBlocks(t, {
|
||||
forced_root_block : s.forced_root_block
|
||||
});
|
||||
@ -10468,8 +10521,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit;
|
||||
@ -11523,8 +11575,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
hasRedo : function() {
|
||||
return this.index < this.data.length - 1;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
// Shorten names
|
||||
@ -11537,6 +11588,17 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
each = tinymce.each;
|
||||
extend = tinymce.extend;
|
||||
|
||||
// Checks if the selection/caret is at the end of the specified block element
|
||||
function isAtEnd(rng, par) {
|
||||
var rng2 = par.ownerDocument.createRange();
|
||||
|
||||
rng2.setStart(rng.endContainer, rng.endOffset);
|
||||
rng2.setEndAfter(par);
|
||||
|
||||
// Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element
|
||||
return rng2.cloneContents().textContent.length == 0;
|
||||
};
|
||||
|
||||
function isEmpty(n) {
|
||||
n = n.innerHTML;
|
||||
|
||||
@ -11735,7 +11797,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
nx = nl[i];
|
||||
|
||||
// Is text or non block element
|
||||
if (nx.nodeType == 3 || (!t.dom.isBlock(nx) && nx.nodeType != 8)) {
|
||||
if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) {
|
||||
if (!bl) {
|
||||
// Create new block but ignore whitespace
|
||||
if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {
|
||||
@ -11950,7 +12012,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
aft.removeAttribute('id');
|
||||
|
||||
// Is header and cursor is at the end, then force paragraph under
|
||||
if (/^(H[1-6])$/.test(bn) && sn.nodeValue && so == sn.nodeValue.length)
|
||||
if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb))
|
||||
aft = ed.dom.create(se.element);
|
||||
|
||||
// Find start chop node
|
||||
@ -12095,7 +12157,46 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
},
|
||||
|
||||
backspaceDelete : function(e, bs) {
|
||||
var t = this, ed = t.editor, b = ed.getBody(), n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn;
|
||||
var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn;
|
||||
|
||||
/*
|
||||
var par, rng, nextBlock;
|
||||
|
||||
// Delete key will not merge paragraphs on Gecko so we need to do this manually
|
||||
// Hitting the delete key at the following caret position doesn't merge the elements <p>A|</p><p>B</p>
|
||||
// This logic will merge them into this: <p>A|B</p>
|
||||
if (e.keyCode == 46) {
|
||||
if (r.collapsed) {
|
||||
par = dom.getParent(sc, 'p,h1,h2,h3,h4,h5,h6,div');
|
||||
|
||||
if (par) {
|
||||
rng = dom.createRng();
|
||||
|
||||
rng.setStart(sc, r.startOffset);
|
||||
rng.setEndAfter(par);
|
||||
|
||||
// Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element
|
||||
if (dom.getOuterHTML(rng.cloneContents()).replace(/<[^>]+>/g, '').length == 0) {
|
||||
nextBlock = dom.getNext(par, 'p,h1,h2,h3,h4,h5,h6,div');
|
||||
|
||||
// Copy all children from next sibling block and remove it
|
||||
if (nextBlock) {
|
||||
each(nextBlock.childNodes, function(node) {
|
||||
par.appendChild(node.cloneNode(true));
|
||||
});
|
||||
|
||||
dom.remove(nextBlock);
|
||||
}
|
||||
|
||||
// Block the default even since the Gecko team might eventually fix this
|
||||
// We will remove this logic once they do we can't feature detect this one
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// The caret sometimes gets stuck in Gecko if you delete empty paragraphs
|
||||
// This workaround removes the element by hand and moves the caret to the previous element
|
||||
@ -12510,7 +12611,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
setControlType : function(n, c) {
|
||||
return this._cls[n.toLowerCase()] = c;
|
||||
},
|
||||
|
||||
|
||||
destroy : function() {
|
||||
each(this.controls, function(c) {
|
||||
c.destroy();
|
||||
@ -12518,8 +12619,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
|
||||
this.controls = null;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})(tinymce);
|
||||
(function(tinymce) {
|
||||
var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
|
||||
@ -12630,8 +12730,7 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
_decode : function(s) {
|
||||
return tinymce.DOM.decode(s).replace(/\\n/g, '\n');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}(tinymce));(function(tinymce) {
|
||||
tinymce.CommandManager = function() {
|
||||
var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};
|
||||
@ -12984,7 +13083,13 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
|
||||
if (!doc.queryCommandSupported(cmd))
|
||||
throw 'Error';
|
||||
} catch (ex) {
|
||||
ed.windowManager.alert(ed.getLang('clipboard_no_support'));
|
||||
if (tinymce.isGecko) {
|
||||
ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) {
|
||||
if (s)
|
||||
open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');
|
||||
});
|
||||
} else
|
||||
ed.windowManager.alert(ed.getLang('clipboard_no_support'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: editable_selects.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: editable_selects.js,v 1.3 2009-09-21 16:31:02 e107coders Exp $
|
||||
*
|
||||
* Makes select boxes editable.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: form_utils.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: form_utils.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
*
|
||||
* Various form utilitiy functions.
|
||||
*
|
||||
@ -92,7 +92,7 @@ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
|
||||
function getSelectValue(form_obj, field_name) {
|
||||
var elm = form_obj.elements[field_name];
|
||||
|
||||
if (elm == null || elm.options == null)
|
||||
if (elm == null || elm.options == null || elm.selectedIndex === -1)
|
||||
return "";
|
||||
|
||||
return elm.options[elm.selectedIndex].value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: mctabs.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: mctabs.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
*
|
||||
* Moxiecode DHTML Tabs script.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: validate.js,v 1.2 2009-07-01 02:52:08 e107coders Exp $
|
||||
* $Id: validate.js,v 1.3 2009-09-21 16:31:03 e107coders Exp $
|
||||
*
|
||||
* Various form validation methods.
|
||||
*
|
||||
|
@ -4,8 +4,8 @@
|
||||
| e107 website system - Tiny MCE controller file.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/wysiwyg.php,v $
|
||||
| $Revision: 1.13 $
|
||||
| $Date: 2009-09-01 00:04:40 $
|
||||
| $Revision: 1.14 $
|
||||
| $Date: 2009-09-21 16:31:02 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -14,6 +14,7 @@ function wysiwyg($formids)
|
||||
{
|
||||
|
||||
global $pref,$HANDLERS_DIRECTORY,$PLUGINS_DIRECTORY,$IMAGES_DIRECTORY;
|
||||
|
||||
$lang = e_LANGUAGE;
|
||||
$tinylang = array(
|
||||
"Arabic" => "ar",
|
||||
@ -37,29 +38,11 @@ $tinylang = array(
|
||||
"Swedish" => "sv"
|
||||
);
|
||||
|
||||
if(!$tinylang[$lang]){
|
||||
if(!$tinylang[$lang])
|
||||
{
|
||||
$tinylang[$lang] = "en";
|
||||
}
|
||||
|
||||
$thescript = (strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip")) ? "tiny_mce_gzip.php" : "tiny_mce.js";
|
||||
|
||||
$text = "<script type='text/javascript' src='".e_PLUGIN."tinymce/".$thescript."'></script>\n";
|
||||
|
||||
$text .= "<script type='text/javascript'>\n
|
||||
|
||||
function start_tinyMce() {
|
||||
//<![CDATA[
|
||||
tinyMCE.init({\n";
|
||||
|
||||
$text .= "language : '".$tinylang[$lang]."',\n";
|
||||
$text .= "mode : 'textareas',\n";
|
||||
// $text .= "elements : '".$formids."',\n";
|
||||
$text .= "editor_selector : 'e-wysiwyg',\n";
|
||||
$text .= "editor_deselector : 'e-wysiwyg-off',\n";
|
||||
$text .= "theme : 'advanced'\n";
|
||||
|
||||
// $text .= ",plugins : 'table,contextmenu";
|
||||
|
||||
$admin_only = array("ibrowser","code");
|
||||
|
||||
foreach($pref['tinymce']['plugins'] as $val)
|
||||
@ -79,15 +62,43 @@ foreach($pref['tinymce']['plugins'] as $val)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if(strstr(varset($_SERVER["HTTP_ACCEPT_ENCODING"],""), "gzip") && (ini_get("zlib.output_compression") == false) && file_exists(e_PLUGIN."tinymce/tiny_mce_gzip.php"))
|
||||
{
|
||||
//unset($tinymce_plugins[7]); // 'zoom' causes an error with the gzip version.
|
||||
$text = "<script type='text/javascript' src='".e_PLUGIN_ABS."tinymce/tiny_mce_gzip.js'></script>
|
||||
|
||||
$text .= ",plugins : '".implode(",",$tinymce_plugins)."'\n";
|
||||
// $text .= ($pref['smiley_activate']) ? ",emoticons" : "";
|
||||
// $text .= (ADMIN) ? ",ibrowser" : ",image";
|
||||
<script type='text/javascript'>
|
||||
tinyMCE_GZ.init({
|
||||
plugins : '".implode(",",$tinymce_plugins)."',
|
||||
themes : 'advanced',
|
||||
languages : '".$tinylang[$lang]."',
|
||||
disk_cache : false,
|
||||
debug : false
|
||||
});
|
||||
</script>
|
||||
";
|
||||
}
|
||||
else
|
||||
{*/
|
||||
$text = "<script type='text/javascript' src='".e_PLUGIN_ABS."tinymce/tiny_mce.js'></script>\n";
|
||||
//}
|
||||
|
||||
|
||||
|
||||
// $text .= ",iespell,zoom,media";
|
||||
// $text .= "'\n"; // end of plugins list.
|
||||
$text .= "<script type='text/javascript'>\n
|
||||
|
||||
function start_tinyMce() {
|
||||
//<![CDATA[
|
||||
tinyMCE.init({
|
||||
|
||||
language : '".$tinylang[$lang]."',
|
||||
mode : 'textareas',
|
||||
editor_selector : 'e-wysiwyg',
|
||||
editor_deselector : 'e-wysiwyg-off',
|
||||
theme : 'advanced',
|
||||
plugins : '".implode(",",$tinymce_plugins)."'\n";
|
||||
|
||||
|
||||
/*
|
||||
$text .= ",theme_advanced_buttons1 : 'fontsizeselect,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent, indent,separator, forecolor,cut,copy,paste'";
|
||||
|
Loading…
x
Reference in New Issue
Block a user