Upgrade to Xinha 0.931. Xinha has been optimized for size and dozens of issues have been closed

out since the last upgrade . Add Firefox and Xinha buttons to main page to show our support.
This commit is contained in:
Chris Morgan
2007-05-31 22:43:05 +00:00
committed by WineHQ
parent ff46a4485d
commit 2d4b27530d
354 changed files with 19793 additions and 21419 deletions

View File

@@ -4,14 +4,14 @@
<!-- ---------------------------------------------------------------------
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/ext_example-body.html $
-- $LastChangedDate: 2005-07-27 16:43:19 +0200 (Mi, 27 Jul 2005) $
-- $LastChangedRevision: 287 $
-- $LastChangedDate: 2007-01-22 16:06:18 +0100 (Mo, 22 Jan 2007) $
-- $LastChangedRevision: 686 $
-- $LastChangedBy: gocher $
------------------------------------------------------------------------ -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Example of Xinha</title>
<link rel="stylesheet" href="full_example.css" />
<link rel="stylesheet" type="text/css" href="full_example.css" />
<script type="text/javascript">
function showError( sMsg, sUrl, sLine){
@@ -20,10 +20,6 @@
'Line: ' + sLine + '\n';
return false;
}
window.onerror = showError;
document.onerror = showError;
var f = window.parent.menu.document.forms[0];
// You must set _editor_url to the URL (including trailing slash) where
// where xinha is installed, it's highly recommended to use an absolute URL
// eg: _editor_url = "/path/to/xinha/";
@@ -31,21 +27,25 @@
// eg: _editor_url = "../";
// in this example we do a little regular expression to find the absolute path.
_editor_url = document.location.href.replace(/examples\/ext_example-body\.html.*/, '')
_editor_lang = f.lang.value; // And the language we need to use in the editor.
_editor_skin = f.skin.value; // the skin we use in the editor
//moved _editor_lang & _editor_skin to init function because of error thrown when frame document not ready
</script>
<!-- Load up the actual editor core -->
<script type="text/javascript" src="../htmlarea.js"></script>
<script type="text/javascript" src="../XinhaCore.js"></script>
<script type="text/javascript">
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
xinha_init = xinha_init ? xinha_init : function() {
var f = window.parent.menu.document.forms[0];
window.onerror = showError;
document.onerror = showError;
var f = top.frames["menu"].document.forms["fsettings"];
_editor_lang = f.lang[f.lang.selectedIndex].value; // the language we need to use in the editor.
_editor_skin = f.skin[f.skin.selectedIndex].value; // the skin we use in the editor
// What are the plugins you will be using in the editors on this page.
// List all the plugins you will need, even if not all the editors will use all the plugins.
xinha_plugins = [ ];
@@ -54,7 +54,7 @@
}
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
// What are the names of the textareas you will be turning into editors?
var num = 1;
@@ -70,7 +70,7 @@
for(var x = 0; x < num; x++) {
var ta = 'myTextarea' + x;
xinha_editors.push(ta);
var div = document.createElement('div');
div.className = 'area_holder';
@@ -86,22 +86,31 @@
}
// Create a default configuration to be used by all the editors.
xinha_config = new HTMLArea.Config();
if (f.width) xinha_config.width = f.width.value;
if (f.height) xinha_config.height = f.height.value;
if (f.sizeIncludesBars) xinha_config.sizeIncludesBars = f.sizeIncludesBars.value;
if (f.statusBar) xinha_config.statusBar = f.statusBar.value;
if (f.mozParaHandler) xinha_config.mozParaHandler = f.mozParaHandler.value;
if (f.undoSteps) xinha_config.undoSteps = f.undoSteps.value;
if (f.baseHref) xinha_config.baseHref = f.baseHref.value;
if (f.stripBaseHref) xinha_config.stripBaseHref = f.stripBaseHref.value;
if (f.stripSelfNamedAnchors) xinha_config.stripSelfNamedAnchors = f.stripSelfNamedAnchors.value;
if (f.only7BitPrintablesInURLs) xinha_config.only7BitPrintablesInURLs = f.only7BitPrintablesInURLs.value;
if (f.sevenBitClean) xinha_config.sevenBitClean = f.sevenBitClean.value;
if (f.killWordOnPaste) xinha_config.killWordOnPaste = f.killWordOnPaste.value;
if (f.flowToolbars) xinha_config.flowToolbars = f.flowToolbars.value;
if ((typeof CharacterMap != 'undefined') && (f.CharacterMapMode)) xinha_config.CharacterMap.mode = f.CharacterMapMode.value;
if ((typeof ListType != 'undefined') && (f.ListTypeMode)) xinha_config.ListType.mode = f.ListTypeMode.value;
settings = top.frames["menu"].settings;
xinha_config = new Xinha.Config();
xinha_config.width = settings.width;
xinha_config.height = settings.height;
xinha_config.sizeIncludesBars = settings.sizeIncludesBars;
xinha_config.statusBar = settings.statusBar;
xinha_config.mozParaHandler = settings.mozParaHandler;
xinha_config.undoSteps = settings.undoSteps;
xinha_config.baseHref = settings.baseHref;
xinha_config.stripBaseHref = settings.stripBaseHref;
xinha_config.stripSelfNamedAnchors = settings.stripSelfNamedAnchors;
xinha_config.only7BitPrintablesInURLs = settings.only7BitPrintablesInURLs;
xinha_config.sevenBitClean = settings.sevenBitClean;
xinha_config.killWordOnPaste = settings.killWordOnPaste;
xinha_config.flowToolbars = settings.flowToolbars;
xinha_config.showLoading = settings.showLoading;
if (typeof CharCounter != 'undefined') {
xinha_config.CharCounter.showChar = settings.showChar;
xinha_config.CharCounter.showWord = settings.showWord;
xinha_config.CharCounter.showHtml = settings.showHtml;
}
if (typeof CharacterMap != 'undefined') xinha_config.CharacterMap.mode = settings.CharacterMapMode;
if (typeof ListType != 'undefined') xinha_config.ListType.mode = settings.ListTypeMode;
if(typeof CSS != 'undefined') {
xinha_config.pageStyle = "@import url(custom.css);";
@@ -143,58 +152,51 @@
}
}
if(typeof InsertPicture != 'undefined') {
// Path for InsertPicture plugin
InsertPicture.PicturePath = '/schmal/pictures/';
}
if(typeof Filter != 'undefined') {
xinha_config.Filters = ["Word", "Paragraph"];
}
// First create editors for the textareas.
// You can do this in two ways, either
// xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
// xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
// if you want all the editor objects to use the same set of plugins, OR;
// xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
// xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
// xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
// xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
// xinha_editors['myTextarea0'].registerPlugins(['Stylist','FullScreen']);
// xinha_editors['myTextarea1'].registerPlugins(['CSS','SuperClean']);
// if you want to use a different set of plugins for one or more of the editors.
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
// If you want to change the configuration variables of any of the editors,
// If you want to change the configuration variables of any of the editors,
// this is the place to do that, for example you might want to
// change the width and height of one of the editors, like this...
// xinha_editors.myTextArea.config.width = '640px';
// xinha_editors.myTextArea.config.height = '480px';
// xinha_editors['myTextarea0'].config.width = '640px';
// xinha_editors['myTextarea0'].config.height = '480px';
// Finally we "start" the editors, this turns the textareas into Xinha editors.
HTMLArea.startEditors(xinha_editors);
Xinha.startEditors(xinha_editors);
}
// javascript submit handler
// this shows how to create a javascript submit button that works with the htmleditor.
submitHandler = function(formname) {
var form = document.getElementById(formname);
// in order for the submit to work both of these methods have to be called.
form.onsubmit();
window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value;
form.submit();
return true;
}
window.onload = xinha_init;
// window.onunload = Xinha.collectGarbageForIE;
</script>
</head>
<body>
<form id="to_submit" method="post" action="ext_example-dest.php">
<div id="editors_here"></div>
<button type="submit">Submit</button>
<textarea id="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;"> -->
<form id="to_submit" name="to_submit" method="post" action="ext_example-dest.php">
<div id="editors_here" name="editors_here"></div>
<button type="button" onclick="submitHandler('to_submit');">Submit</button>
<textarea id="errors" name="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;" -->
</form>
<script type="text/javascript">
var _oldSubmitHandler = null;
if (document.forms[0].onsubmit != null) {
_oldSubmitHandler = document.forms[0].onsubmit;
}
function frame_onSubmit(){
document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value.replace(/^[\r\n]+|\s+$/, '')
window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value;
if (_oldSubmitHandler != null) {
_oldSubmitHandler();
}
}
document.forms[0].onsubmit = frame_onSubmit;
</script>
</body>
</html>