upgrade to tinymce 2.1.1.1

This commit is contained in:
JT Smith 2007-07-07 21:26:06 +00:00
parent f36ba1b268
commit e75b689857
847 changed files with 34500 additions and 7692 deletions

View file

@ -0,0 +1,117 @@
body {
overflow: hidden;
}
h1 {
font-size: 14px;
margin: 0 0 10px 0;
}
h2 {
font-size: 12px;
margin: 3px 0 3px 0;
}
h3 {
font-size: 11px;
margin: 3px 0 3px 0;
}
#log {
font-family: Verdana;
border: 1px solid gray;
width: 100%; height: 240px;
overflow: scroll;
white-space: nowrap;
}
#log span {
display: block;
}
#log span.msg {
float: left;
}
#log span.time {
float: left;
}
#log br {
clear: both;
}
#logfilter {
width: 350px;
}
#logenabled {
border: 0;
}
#settings_panel span, #info_panel span, #content_panel span, #command_states_panel span, #undo_redo_panel span {
display: block;
margin: 5px 0 5px 0;
}
div.data {
width: 100%; height: 240px;
overflow: scroll;
border: 1px solid gray;
}
#misc_panel div.data {
height: 270px;
}
.data input {
width: 265px;
border: 0;
}
.data h2 {
margin-left: 5px;
}
.data h3 {
margin-left: 7px;
}
.data div {
margin-left: 7px;
}
.data table {
margin: 0 0 15px 15px;
}
.data p {
margin: 0; padding: 0;
margin-top: 5px;
margin-left: 5px;
}
table, td {
border: 1px solid gray;
border-collapse: collapse;
}
#flip {
position: absolute;
left: 295; top: 384px;
}
.bspec {
color: gray;
}
.dep {
color: #880000;
}
.col1 {
width: 265px;
}
div.undodata {
}

View file

@ -0,0 +1,15 @@
#devkit {
position: absolute;
top: -385px; right: 0;
width: 640px; height: 390px;
border: 1px solid black;
z-index: 10000;
}
.devkitup {
top: -385px !important;
}
.devkitdown {
top: 0 !important;
}

View file

@ -0,0 +1,140 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_devkit_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/devkit.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/diff.js"></script>
<link href="css/devkit.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body id="devkit" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<form action="#">
<h1>{$lang_devkit_title}</h1>
<div class="tabs">
<ul>
<li id="log_tab" class="current"><span><a href="javascript:mcTabs.displayTab('log_tab','log_panel');" onmousedown="return false;">{$lang_devkit_log_tab}</a></span></li>
<li id="info_tab"><span><a href="javascript:mcTabs.displayTab('info_tab','info_panel');" onmousedown="return false;">{$lang_devkit_info_tab}</a></span></li>
<li id="settings_tab"><span><a href="javascript:mcTabs.displayTab('settings_tab','settings_panel');" onmousedown="return false;">{$lang_devkit_settings_tab}</a></span></li>
<li id="content_tab"><span><a href="javascript:mcTabs.displayTab('content_tab','content_panel');" onmousedown="return false;">{$lang_devkit_content_tab}</a></span></li>
<!-- <li id="command_states_tab"><span><a href="javascript:mcTabs.displayTab('command_states_tab','command_states_panel');" onmousedown="return false;">{$lang_devkit_command_states_tab}</a></span></li> -->
<li id="undo_redo_tab"><span><a href="javascript:mcTabs.displayTab('undo_redo_tab','undo_redo_panel');" onmousedown="return false;">{$lang_devkit_undo_redo_tab}</a></span></li>
<li id="misc_tab"><span><a href="javascript:mcTabs.displayTab('misc_tab','misc_panel');" onmousedown="return false;">{$lang_devkit_misc_tab}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="log_panel" class="panel current">
<fieldset>
<legend>{$lang_devkit_log_tab}</legend>
<div style="float: left">
<label>{$lang_devkit_filter} </label><input type="text" id="logfilter" name="logfilter" value="" onchange="changeFilter(this.value);" />
</div>
<div style="float: left">
<input type="checkbox" id="logenabled" name="logenabled" value="true" checked="checked" onclick="toggleLog(this.checked);" />
</div>
<div style="float: right">
<a href="javascript:clearLog();">[{$lang_devkit_clear_log}]</a>
</div>
<br style="clear: both" />
<div id="log">
</div>
<input type="checkbox" id="debug_events" name="debug_events" class="checkbox" onclick="toggleDebugEvents(this.checked);" /><label for="debug_events" onclick="toggleDebugEvents(this.form.debug_events.checked);">{$lang_devkit_debug_events}</label>
</fieldset>
</div>
<div id="info_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_info_tab}</legend>
<span><a href="javascript:renderInfo();">[{$lang_devkit_refresh}]</a></span>
<div id="info" class="data">
<p>{$lang_devkit_info_help}</p>
</div>
</fieldset>
</div>
<div id="settings_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_settings_tab}</legend>
<span><a href="javascript:renderSettings();">[{$lang_devkit_refresh}]</a></span>
<div id="settings" class="data">
<p>{$lang_devkit_settings_help}</p>
</div>
</fieldset>
</div>
<div id="content_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_content_tab}</legend>
<span><a href="javascript:renderContent();">[{$lang_devkit_refresh}]</a></span>
<div id="content" class="data">
<p>{$lang_devkit_content_help}</p>
</div>
</fieldset>
</div>
<div id="command_states_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_command_states_tab}</legend>
<span><a href="javascript:renderCommandStates();">[{$lang_devkit_refresh}]</a></span>
<div id="command_states" class="data">
<p>{$lang_devkit_command_states_help}</p>
</div>
</fieldset>
</div>
<div id="undo_redo_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_undo_redo_tab}</legend>
<span><a href="javascript:renderUndoRedo();">[{$lang_devkit_refresh}]</a></span>
<div id="undo_redo" class="data">
<p>{$lang_devkit_undo_redo_help}</p>
</div>
<input type="checkbox" id="undo_diff" name="undo_diff" class="checkbox" /><label for="undo_diff">{$lang_devkit_undo_diff}</label>
</fieldset>
</div>
<div id="misc_panel" class="panel">
<fieldset>
<legend>{$lang_devkit_misc_tab}</legend>
<div class="data">
<p>{$lang_devkit_misc_help}</p>
<hr />
<p>Selection: <a href="#" onmousedown="return storeSelection();">[Store selection]</a> <a href="#" onmousedown="return restoreSelection();">[Restore selection]</a></p>
<hr />
<div><strong>Insert custom HTML content</strong></div>
<div><textarea id="htmlcont" name="htmlcont" style="width: 90%" rows="5"></textarea></div>
<div><a href="#" onclick="return tinyMCE.execCommand('mceInsertContent',false,document.getElementById('htmlcont').value);">[Insert content]</a></div>
<hr />
<div><strong>Eval JS:</strong></div>
<div><textarea id="jscont" name="jscont" style="width: 90%" rows="5">tinyMCE.execCommand('Bold',false,null);</textarea></div>
<div><a href="#" onclick="return parent.window.eval(document.getElementById('jscont').value);">[Evaluate]</a></div>
</div>
</fieldset>
</div>
</div>
</form>
<div id="flip"><a href="javascript:toggleFlip();" onmousedown="return false;"><img id="flipbtn" src="images/flip_down.gif" border="0" /></a></div>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,325 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
*/
tinyMCE.importPluginLanguagePack('devkit');
var TinyMCE_DevKitPlugin = {
_logFilter : '\\[(importCSS|execCommand|execInstanceCommand|debug)\\]',
_logPadding : '',
_startTime : null,
_benchMark : false,
_winLoaded : false,
_isDebugEvents : false,
getInfo : function() {
return {
longname : 'Development Kit',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/devkit',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
initInstance : function(inst) {
this._setup();
},
_setup : function() {
if (this._loaded)
return;
this._loaded = true;
// Register a document reference for more easy access in the FF DOM inspector
document.___TinyMCE = tinyMCE;
// Setup devkit by settings
this._logFilter = tinyMCE.getParam('devkit_log_filter', this._logFilter);
this._benchMark = tinyMCE.getParam('devkit_bench_mark', false);
var ifr = document.createElement('iframe');
ifr.setAttribute("id", "devkit");
ifr.setAttribute("frameBorder", "0");
ifr.setAttribute("src", tinyMCE.baseURL + '/plugins/devkit/devkit.htm');
document.body.appendChild(ifr);
// Workaround for strange IE reload bug
//if (tinyMCE.isRealIE)
// document.getElementById('devkit').outerHTML = document.getElementById('devkit').outerHTML;
tinyMCE.importCSS(document, tinyMCE.baseURL + '/plugins/devkit/css/devkit_ui.css');
},
_start : function() {
this._logPadding += '\u00a0';
return new Date().getTime();
},
_end : function(st) {
if (this._logPadding.length > 0)
this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
if (this._benchMark)
this._log("benchmark", "Execution time: " + (new Date().getTime() - st));
},
_log : function(t) {
var m, a, i, e = document.getElementById('devkit'), now = new Date().getTime();
if (!this._startTime)
this._startTime = now;
m = (this._logPadding.length > 1 ? this._logPadding : '') + '[' + (now - this._startTime) + '] [' + t + '] ';
a = this._log.arguments;
for (i=1; i<a.length; i++) {
if (typeof(a[i]) == 'undefined')
continue;
if (i > 1)
m += ', ';
m += a[i];
}
if (!new RegExp(this._logFilter, 'gi').test(m)) {
if (this._logPadding.length > 0)
this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
return;
}
if (!this._winLoaded)
tinyMCE.log[tinyMCE.log.length] = m;
else
e.contentWindow.debug(m);
},
_debugEvents : function(s) {
var i, ld, inst, n, ev = ['CheckboxStateChange','DOMAttrModified','DOMMenuItemActive',
'DOMMenuItemInactive','DOMMouseScroll','DOMNodeInserted','DOMNodeRemoved',
'RadioStateChange','blur','broadcast','change','click','close','command',
'commandupdate','contextmenu','dblclick','dragdrop','dragenter','dragexit',
'draggesture','dragover','focus','input','keydown','keypress','keyup','load',
'mousedown','mouseout','mouseover','mouseup','overflow','overflowchanged','popuphidden',
'popuphiding','popupshowing','popupshown','select','syncfrompreference','synctopreference',
'underflow','unload','abort','activate','afterprint','afterupdate','beforeactivate',
'beforecopy','beforecut','beforedeactivate','beforeeditfocus','beforepaste','beforeprint',
'beforeunload','beforeupdate','bounce','cellchange','controlselect','copy','cut',
'dataavailable','datasetchanged','datasetcomplete','deactivate','dragend','dragleave',
'dragstart','drop','error','errorupdate','filterchange','finish','focusin','focusout',
'help','layoutcomplete','losecapture','mouseenter','mouseleave','mousewheel',
'move','moveend','movestart','paste','propertychange','readystatechange','reset','resize',
'resizeend','resizestart','rowenter','rowexit','rowsdelete','rowsinserted','scroll',
'selectionchange','selectstart','start','stop','submit'];
// mousemove
if (TinyMCE_DevKitPlugin._isDebugEvents == s)
return;
TinyMCE_DevKitPlugin._isDebugEvents = s;
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst) || inst.getDoc() == ld)
continue;
ld = inst.getDoc();
for (i=0; i<ev.length; i++) {
if (s)
tinyMCE.addEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
else
tinyMCE.removeEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
}
}
},
_debugEvent : function(e) {
var t;
e = e ? e : tinyMCE.selectedInstance.getWin().event;
t = e.srcElement ? e.srcElement : e.target;
tinyMCE.debug(e.type, t ? t.nodeName : '');
},
_serialize : function(o) {
var i, v, s = TinyMCE_DevKitPlugin._serialize;
if (o == null)
return 'null';
switch (typeof o) {
case 'string':
v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
return '"' + o.replace(new RegExp('([\u0080-\uFFFF\\x00-\\x1f\\"])', 'g'), function(a, b) {
i = v.indexOf(b);
if (i+1)
return '\\' + v.charAt(i + 1);
a = b.charCodeAt().toString(16);
return '\\u' + '0000'.substring(a.length) + a;
}) + '"';
case 'object':
if (o instanceof Array) {
for (i=0, v = '['; i<o.length; i++)
v += (i > 0 ? ',' : '') + s(o[i]);
return v + ']';
}
v = '{';
for (i in o)
v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
return v + '}';
}
return '' + o;
}
};
// Patch and piggy back functions
tinyMCE.__debug = tinyMCE.debug;
tinyMCE.debug = function() {
var a, i, m = '', now = new Date().getTime(), start = TinyMCE_DevKitPlugin._startTime;
if (!start)
TinyMCE_DevKitPlugin._startTime = start = now;
a = this.debug.arguments;
for (i=0; i<a.length; i++) {
if (typeof(a[i]) == 'undefined')
continue;
if (i > 0)
m += ', ';
m += a[i];
}
TinyMCE_DevKitPlugin._log('debug', m);
};
tinyMCE.dump = function(o) {
tinyMCE.debug(TinyMCE_DevKitPlugin._serialize(o));
};
tinyMCE.sleep = function(t) {
var s = new Date().getTime(), b;
while (new Date().getTime() - s < t) b=1;
};
tinyMCE.__execCommand = tinyMCE.execCommand;
tinyMCE.execCommand = function(command, user_interface, value) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('execCommand', command, user_interface, value);
r = tinyMCE.__execCommand(command, user_interface, value);
dk._end(st);
return r;
};
tinyMCE.__execInstanceCommand = tinyMCE.execInstanceCommand;
tinyMCE.execInstanceCommand = function(editor_id, command, user_interface, value, focus) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('execInstanceCommand', editor_id, command, user_interface, value);
r = tinyMCE.__execInstanceCommand(editor_id, command, user_interface, value);
dk._end(st);
return r;
};
TinyMCE_Engine.prototype.__handleEvent = TinyMCE_Engine.prototype.handleEvent;
TinyMCE_Engine.prototype.handleEvent = function(e) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('handleEvent', e.type);
r = tinyMCE.__handleEvent(e);
dk._end(st);
return r;
};
tinyMCE.__importCSS = tinyMCE.importCSS;
tinyMCE.importCSS = function(doc, css) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('importCSS', doc, css);
r = tinyMCE.__importCSS(doc, css);
dk._end(st);
return r;
};
tinyMCE.__triggerNodeChange = tinyMCE.triggerNodeChange;
tinyMCE.triggerNodeChange = function(focus, setup_content) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('triggerNodeChange', focus, setup_content);
r = tinyMCE.__triggerNodeChange(focus, setup_content);
dk._end(st);
return r;
};
tinyMCE.__dispatchCallback = tinyMCE.dispatchCallback;
tinyMCE.dispatchCallback = function(i, p, n) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('dispatchCallback', i, p, n);
r = tinyMCE.__dispatchCallback(i, p, n);
dk._end(st);
return r;
};
tinyMCE.__executeCallback = tinyMCE.executeCallback;
tinyMCE.executeCallback = function(i, p, n) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('executeCallback', i, p, n);
r = tinyMCE.__executeCallback(i, p, n);
dk._end(st);
return r;
};
tinyMCE.__execCommandCallback = tinyMCE.execCommandCallback;
tinyMCE.execCommandCallback = function(i, p, n) {
var r, st, dk = TinyMCE_DevKitPlugin;
st = dk._start();
dk._log('execCommandCallback', i, p, n);
r = tinyMCE.__execCommandCallback(i, p, n);
dk._end(st);
return r;
};
tinyMCE.addPlugin("devkit", TinyMCE_DevKitPlugin);

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

View file

@ -0,0 +1,331 @@
var devkit = parent.tinyMCE.plugins['devkit'], logEnabled = true, flip = false, book = null;
function init() {
var log, i, f = document.forms[0];
devkit._winLoaded = true;
log = tinyMCE.log;
for (i=0; i<log.length; i++)
debug(log[i]);
f.logfilter.value = devkit._logFilter;
}
function changeFilter(f) {
devkit._logFilter = f;
}
function toggleLog(s) {
logEnabled = s;
}
function toggleFlip() {
document.getElementById('flipbtn').src = flip ? 'images/flip_down.gif' : 'images/flip_up.gif';
if (flip)
parent.document.getElementById('devkit').className = 'devkitup';
else
parent.document.getElementById('devkit').className = 'devkitdown';
flip = !flip;
}
function debug(s) {
var d, l, n;
if (!logEnabled || !new RegExp(devkit._logFilter, 'gi').test(s))
return;
d = document;
l = d.getElementById('log');
n = d.createElement('span');
n.innerHTML = tinyMCE.xmlEncode(s);
l.appendChild(n);
l.scrollTop = l.scrollHeight;
}
function renderInfo() {
var se = document.getElementById('info'), n, sn, inst, h = '', sel, rng, instCount = 0, rc;
h += '<h2>Browser info:</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
h += addRenderInfo('navigator.userAgent', navigator.userAgent);
h += addRenderInfo('navigator.appName', navigator.appName);
h += addRenderInfo('navigator.platform', navigator.platform);
h += addRenderInfo('navigator.language', navigator.language, 'bspec');
h += addRenderInfo('navigator.browserLanguage', navigator.browserLanguage, 'bspec');
h += addRenderInfo('navigator.systemLanguage', navigator.systemLanguage, 'bspec');
h += addRenderInfo('navigator.userLanguage', navigator.userLanguage, 'bspec');
h += addRenderInfo('opera.buildNumber("inconspicuous")', typeof(opera) != 'undefined' && opera.buildNumber ? opera.buildNumber('inconspicuous') : null, 'bspec');
h += addRenderInfo('window.innerWidth', parent.window.innerWidth, 'bspec');
h += addRenderInfo('window.innerHeight', parent.window.innerHeight, 'bspec');
h += addRenderInfo('document.body.offsetWidth', parent.document.body.offsetWidth);
h += addRenderInfo('document.body.offsetHeight', parent.document.body.offsetHeight);
h += addRenderInfo('screen.width', screen.width);
h += addRenderInfo('screen.height', screen.height);
h += addRenderInfo('screen.availWidth', screen.availWidth);
h += addRenderInfo('screen.availHeight', screen.availHeight);
h += addRenderInfo('screen.colorDepth', screen.colorDepth);
h += addRenderInfo('screen.pixelDepth', screen.pixelDepth, 'bspec');
h += addRenderInfo('document.contentType', document.contentType, 'bspec');
h += '</table>';
h += '<h2>TinyMCE_Engine info:</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
h += addRenderInfo('baseURL', tinyMCE.baseURL);
h += addRenderInfo('selectedInstance.editorId', tinyMCE.selectedInstance ? tinyMCE.selectedInstance.editorId : null);
h += addRenderInfo('selectedElement.nodeName', tinyMCE.selectedElement ? tinyMCE.selectedElement.nodeName : null, 'dep');
h += addRenderInfo('loadedFiles',tinyMCE.loadedFiles.join(','));
h += addRenderInfo('isMSIE', tinyMCE.isMSIE);
h += addRenderInfo('isMSIE5', tinyMCE.isMSIE5);
h += addRenderInfo('isMSIE5_0', tinyMCE.isMSIE5_0);
h += addRenderInfo('isMSIE7', tinyMCE.isMSIE7);
h += addRenderInfo('isGecko', tinyMCE.isGecko);
h += addRenderInfo('isSafari', tinyMCE.isSafari);
h += addRenderInfo('isOpera', tinyMCE.isOpera);
h += addRenderInfo('isMac', tinyMCE.isMac);
h += addRenderInfo('isNS7', tinyMCE.isNS7);
h += addRenderInfo('isNS71', tinyMCE.isNS71);
h += addRenderInfo('idCounter', tinyMCE.idCounter);
h += addRenderInfo('currentConfig', tinyMCE.currentConfig);
h += addRenderInfo('majorVersion', tinyMCE.majorVersion);
h += addRenderInfo('minorVersion', tinyMCE.minorVersion);
h += addRenderInfo('releaseDate', tinyMCE.releaseDate);
h += addRenderInfo('documentBasePath', tinyMCE.documentBasePath);
h += addRenderInfo('documentURL', tinyMCE.documentURL);
h += '</table>';
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
sel = inst.selection.getSel();
rng = inst.selection.getRng();
h += '<h2>TinyMCE_Control(' + (instCount++) + ') id: ' + inst.editorId + '</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
h += addRenderInfo('editorId', inst.editorId);
h += addRenderInfo('visualAid', inst.visualAid);
h += addRenderInfo('foreColor', inst.foreColor);
h += addRenderInfo('backColor', inst.backColor);
h += addRenderInfo('formTargetElementId', inst.formTargetElementId);
h += addRenderInfo('formElement', inst.formElement ? inst.formElement.nodeName : null);
h += addRenderInfo('oldTargetElement', inst.oldTargetElement ? inst.oldTargetElement.nodeName : null);
h += addRenderInfo('linkElement', inst.linkElement ? inst.linkElement.nodeName : null, 'dep');
h += addRenderInfo('imgElement', inst.imgElement ? inst.imgElement.nodeName : null, 'dep');
h += addRenderInfo('selectedNode', inst.selectedNode ? inst.selectedNode.nodeName : null, 'dep');
h += addRenderInfo('targetElement', inst.targetElement ? inst.targetElement.nodeName : null);
h += addRenderInfo('getBody().nodeName', inst.getBody() ? inst.getBody().nodeName : null);
h += addRenderInfo('getBody().getAttribute("id")', inst.getBody() ? inst.getBody().getAttribute("id") : null);
h += addRenderInfo('getDoc().location', inst.getDoc() ? inst.getDoc().location : null);
h += addRenderInfo('startContent', inst.startContent);
h += addRenderInfo('isHidden()', inst.isHidden());
h += addRenderInfo('isDirty()', inst.isDirty());
h += addRenderInfo('undoRedo.undoLevels.length', inst.undoRedo.undoLevels.length);
h += addRenderInfo('undoRedo.undoIndex', inst.undoRedo.undoIndex);
h += addRenderInfo('selection.getSelectedHTML()', inst.selection.getSelectedHTML());
h += addRenderInfo('selection.isCollapsed()', inst.selection.isCollapsed() || 'false');
h += addRenderInfo('selection.getSelectedText()', inst.selection.getSelectedText());
h += addRenderInfo('selection.getFocusElement().nodeName', inst.selection.getFocusElement().nodeName);
h += addRenderInfo('selection.getFocusElement().outerHTML', tinyMCE.getOuterHTML(inst.selection.getFocusElement()));
if ((tinyMCE.isGecko || tinyMCE.isOpera) && sel && rng) {
h += addRenderInfo('selection.getSel().anchorNode.nodeName', sel.anchorNode ? sel.anchorNode.nodeName : null, 'bspec');
h += addRenderInfo('selection.getSel().anchorOffset', sel.anchorOffset, 'bspec');
h += addRenderInfo('selection.getSel().focusNode.nodeName', sel.focusNode ? sel.focusNode.nodeName : null, 'bspec');
h += addRenderInfo('selection.getSel().focusOffset', sel.focusOffset, 'bspec');
h += addRenderInfo('selection.getRng().startContainer.nodeName', rng.startContainer ? rng.startContainer.nodeName : null, 'bspec');
h += addRenderInfo('selection.getRng().startOffset', rng.startOffset, 'bspec');
h += addRenderInfo('selection.getRng().endContainer.nodeName', rng.endContainer ? rng.endContainer.nodeName : null, 'bspec');
h += addRenderInfo('selection.getRng().endOffset', rng.endOffset, 'bspec');
}
if (typeof(rng.item) != 'undefined' || typeof(rng.htmlText) != 'undefined') {
if (!rng.item) {
h += addRenderInfo('selection.getSel().type', sel.type, 'bspec');
h += addRenderInfo('selection.getRng().htmlText', rng.htmlText, 'bspec');
h += addRenderInfo('selection.getRng().text', rng.text, 'bspec');
} else
h += addRenderInfo('selection.getRng().item(0).nodeName', rng.item(0).nodeName, 'bspec');
}
h += '</table>';
}
h += '<p>Fields marked in <strong class="bspec">gray</strong> is not cross browser and should be used with care.</p>';
h += '<p>Fields marked <strong class="dep">red</strong> are marked deprecated and will be removed in the future.</p><br />';
se.innerHTML = h;
}
function addRenderInfo(n, v, c) {
return '<tr><td' + (c ? ' class="' + c + '"' : '')+ '>' + n + '</td><td><input type="text" value="' + tinyMCE.xmlEncode(v != null ? ('' + v).replace(/[\r\n]/g, '') : 'null') + '" /></td></tr>';
}
function renderSettings() {
var se = document.getElementById('settings'), n, sn, inst, h = '', v;
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
for (sn in inst.settings) {
v = inst.settings[sn];
h += '<tr><td class="col1">' + tinyMCE.xmlEncode(sn) + '</td><td><input type="text" value="' + tinyMCE.xmlEncode(v) + '" /></td></tr>';
}
h += '</table>';
}
se.innerHTML = h;
}
function renderContent() {
var se = document.getElementById('content'), n, inst, h = '';
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
h += '<h3>Start content - inst.startContent:</h3>';
h += '<div>' + tinyMCE.xmlEncode(inst.startContent) + '</div>';
h += '<h3>Raw content - inst.getBody().innerHTML or inst.getHTML(true):</h3>';
h += '<div>' + tinyMCE.xmlEncode(inst.getHTML(true)) + '</div>';
h += '<h3>Cleaned content - inst.getHTML():</h3>';
h += '<div>' + tinyMCE.xmlEncode(inst.getHTML()) + '</div>';
if (inst.serializedHTML) {
h += '<h3>Serialized HTML content - inst.serializedHTML:</h3>';
h += '<div>' + tinyMCE.xmlEncode(inst.serializedHTML) + '</div>';
}
}
se.innerHTML = h;
}
function renderCommandStates() {
var se = document.getElementById('command_states'), n, inst, h = '', v, ex;
var cmds = new Array('2D-Position','AbsolutePosition','BackColor','BlockDirLTR','BlockDirRTL','Bold','BrowseMode','Copy','CreateBookmark','CreateLink','Cut','Delete','DirLTR','DirRTL','EditMode','enableInlineTableEditing','enableObjectResizing','FontName','FontSize','ForeColor','FormatBlock','Indent','InsertButton','InsertFieldset','InsertHorizontalRule','InsertIFrame','InsertImage','InsertInputButton','InsertInputCheckbox','InsertInputFileUpload','InsertInputHidden','InsertInputImage','InsertInputPassword','InsertInputRadio','InsertInputReset','InsertInputSubmit','InsertInputText','InsertMarquee','InsertOrderedList','InsertParagraph','InsertSelectDropdown','InsertSelectListbox','InsertTextArea','InsertUnorderedList','Italic','JustifyCenter','JustifyFull','JustifyLeft','JustifyNone','JustifyRight','LiveResize','MultipleSelection','Open','Outdent','OverWrite','Paste','PlayImage','Redo','Refresh','RemoveFormat','SaveAs','SelectAll','SizeToControl','SizeToControlHeight','SizeToControlWidth','Stop','StopImage','StrikeThrough','styleWithCSS','Subscript','Superscript','UnBookmark','Underline','Undo','Unlink','Unselect'), i;
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
for (i=0; i<cmds.length; i++) {
v = null;
try {
v = tinyMCE.isGecko || inst.getDoc().queryCommandSupported(cmds[i]);
v = v ? inst.queryCommandState(cmds[i]) : 'Not supported';
} catch (ex) {
v = 'Not supported';
}
h += '<tr><td><input type="text" value="' + tinyMCE.xmlEncode(cmds[i]) + '" /></td><td><input type="text" value="' + tinyMCE.xmlEncode(v) + '" /></td></tr>';
}
h += '</table>';
}
se.innerHTML = h;
}
function renderUndoRedo() {
var se = document.getElementById('undo_redo'), inst, n, h = '', i, le, id, d, ur;
var f = document.forms[0];
if (tinyMCE.undoLevels) {
le = tinyMCE.undoLevels;
h += '<h2>Global undo/redo</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
h += '<tr><td>undoLevels.length</td><td>' + le.length + '</td></tr>';
h += '<tr><td>undoIndex</td><td>' + tinyMCE.undoIndex + '</td></tr>';
h += '</table>';
for (i=0; i<le.length; i++)
h += '<h3>Level: ' + i + ', Instance: ' + (le[i] ? le[i].editorId : 'null') + '</h3>';
}
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
ur = inst.undoRedo;
le = ur.undoLevels;
h += '<hr /><h2>Instance id: ' + inst.editorId + '</h2>';
h += '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
h += '<tr><td>undoLevels.length</td><td>' + le.length + '</td></tr>';
h += '<tr><td>undoIndex</td><td>' + ur.undoIndex + '</td></tr>';
h += '<tr><td>typingUndoIndex</td><td>' + ur.typingUndoIndex + '</td></tr>';
h += '<tr><td>undoRedo</td><td>' + ur.undoRedo + '</td></tr>';
h += '</table>';
for (i=0; i<le.length; i++) {
h += '<h3>Level: ' + i + (!le[i].bookmark ? "" : " [bookmark]") + '</h3>';
h += '<div class="undodata">' + tinyMCE.xmlEncode(le[i].content) + '</div>';
if (i > 0 && f.undo_diff.checked) {
d = diff_main(i > 0 ? le[i-1].content.replace(/[\r\n]+/g, '') : null, le[i].content.replace(/[\r\n]+/g, ''), false);
diff_cleanup_semantic(d);
h += '<h3>Diff ' + (i-1) + ',' + i + '</h3><div class="undodata">' + diff_prettyhtml(d) + '</div>';
}
}
}
se.innerHTML = h;
}
function clearLog() {
document.getElementById('log').innerHTML = '';
devkit._startTime = null;
}
function cancelAction() {
parent.document.getElementById('devkit').style.display = 'none';
}
function toggleDebugEvents(s) {
devkit._debugEvents(s);
}
function storeSelection() {
book = tinyMCE.selectedInstance.selection.getBookmark();
return false;
}
function restoreSelection() {
tinyMCE.selectedInstance.selection.moveToBookmark(book);
return false;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
// UK lang variables
tinyMCE.addToLang('devkit',{
title : 'TinyMCE Development Kit',
info_tab : 'Info',
settings_tab : 'Settings',
log_tab : 'Log',
content_tab : 'Content',
command_states_tab : 'Commands',
undo_redo_tab : 'Undo/Redo',
misc_tab : 'Misc',
filter : 'Filter:',
clear_log : 'Clear log',
refresh : 'Refresh',
info_help : 'Press Refresh to view info.',
settings_help : 'Press Refresh to display the settings array for each TinyMCE_Control instance.',
content_help : 'Press Refresh to display the raw and cleaned HTML content for each TinyMCE_Control instance.',
command_states_help : 'Press Refresh to display the current command states from inst.queryCommandState. This list will also mark unsupported commands.',
undo_redo_help : 'Press Refresh to display the global and instance undo/redo levels.',
misc_help : 'Here are various tools for debugging and development purposes.',
debug_events : 'Debug events',
undo_diff : 'Diff undo levels'
});