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:
@@ -15,14 +15,55 @@ function getAbsolutePos(el) {
|
||||
return r;
|
||||
};
|
||||
|
||||
function comboSelectValue(c, val) {
|
||||
var ops = c.getElementsByTagName("option");
|
||||
for (var i = ops.length; --i >= 0;) {
|
||||
var op = ops[i];
|
||||
op.selected = (op.value == val);
|
||||
}
|
||||
c.value = val;
|
||||
};
|
||||
function getSelectedValue(el) {
|
||||
if(!el)
|
||||
return "";
|
||||
return el[el.selectedIndex].value;
|
||||
}
|
||||
|
||||
function setSelectedValue(el, val) {
|
||||
if(!el)
|
||||
return "";
|
||||
var ops = el.getElementsByTagName("option");
|
||||
for (var i = ops.length; --i >= 0;) {
|
||||
var op = ops[i];
|
||||
op.selected = (op.value == val);
|
||||
}
|
||||
el.value = val;
|
||||
}
|
||||
|
||||
function getCheckedValue(el) {
|
||||
if(!el)
|
||||
return "";
|
||||
var radioLength = el.length;
|
||||
if(radioLength == undefined)
|
||||
if(el.checked)
|
||||
return el.value;
|
||||
else
|
||||
return "false";
|
||||
for(var i = 0; i < radioLength; i++) {
|
||||
if(el[i].checked) {
|
||||
return el[i].value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function setCheckedValue(el, val) {
|
||||
if(!el)
|
||||
return;
|
||||
var radioLength = el.length;
|
||||
if(radioLength == undefined) {
|
||||
el.checked = (el.value == val.toString());
|
||||
return;
|
||||
}
|
||||
for(var i = 0; i < radioLength; i++) {
|
||||
el[i].checked = false;
|
||||
if(el[i].value == val.toString()) {
|
||||
el[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function __dlg_onclose() {
|
||||
opener.Dialog._return(null);
|
||||
@@ -84,50 +125,77 @@ function __dlg_init(bottom) {
|
||||
document.body.onkeypress = __dlg_close_on_esc;
|
||||
};
|
||||
|
||||
function placeFocus() {
|
||||
var bFound = false;
|
||||
// for each form
|
||||
for (f=0; f < document.forms.length; f++) {
|
||||
// for each element in each form
|
||||
for(i=0; i < document.forms[f].length; i++) {
|
||||
// if it's not a hidden element
|
||||
if (document.forms[f][i].type != "hidden") {
|
||||
// and it's not disabled
|
||||
if (document.forms[f][i].disabled != true) {
|
||||
// set the focus to it
|
||||
document.forms[f][i].focus();
|
||||
var bFound = true;
|
||||
}
|
||||
}
|
||||
// if found in this element, stop looking
|
||||
if (bFound == true)
|
||||
break;
|
||||
}
|
||||
// if found in this form, stop looking
|
||||
if (bFound == true)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function Init() {
|
||||
__dlg_init();
|
||||
var param = window.dialogArguments;
|
||||
if (param) {
|
||||
document.getElementById("width").value = param["width"];
|
||||
document.getElementById("height").value = param["height"];
|
||||
document.getElementById("sizeIncludesBars").checked = (param["sizeIncludesBars"] == 'true');
|
||||
document.getElementById("statusBar").checked = (param["statusBar"] == 'true');
|
||||
document.getElementById("mozParaHandler").value = param["mozParaHandler"];
|
||||
document.getElementById("undoSteps").value = param["undoSteps"];
|
||||
document.getElementById("baseHref").value = param["baseHref"];
|
||||
document.getElementById("stripBaseHref").checked = (param["stripBaseHref"] == 'true');
|
||||
document.getElementById("stripSelfNamedAnchors").checked = (param["stripSelfNamedAnchors"] == 'true');
|
||||
document.getElementById("only7BitPrintablesInURLs").checked = (param["only7BitPrintablesInURLs"] == 'true');
|
||||
document.getElementById("sevenBitClean").checked = (param["sevenBitClean"] == 'true');
|
||||
document.getElementById("killWordOnPaste").checked = (param["killWordOnPaste"] == 'true');
|
||||
document.getElementById("flowToolbars").checked = (param["flowToolbars"] == 'true');
|
||||
document.getElementById("CharacterMapMode").value = param["CharacterMapMode"];
|
||||
document.getElementById("ListTypeMode").value = param["ListTypeMode"];
|
||||
|
||||
if(param) {
|
||||
var el;
|
||||
for (var field in param) {
|
||||
//alert(field + '="' + param[field] + '"');
|
||||
el = document.getElementById(field);
|
||||
if (el.tagName.toLowerCase()=="input"){
|
||||
if ((el.type.toLowerCase()=="radio") || (el.type.toLowerCase()=="checkbox")){
|
||||
setCheckedValue(el, param[field]);
|
||||
} else {
|
||||
el.value = param[field];
|
||||
}
|
||||
} else if (el.tagName.toLowerCase()=="select"){
|
||||
setSelectedValue(el, param[field]);
|
||||
} else if (el.tagName.toLowerCase()=="textarea"){
|
||||
el.value = param[field];
|
||||
}
|
||||
}
|
||||
}
|
||||
document.getElementById("width").focus();
|
||||
window.resizeTo(420, 500);
|
||||
placeFocus();
|
||||
};
|
||||
|
||||
// pass data back to the calling window
|
||||
function onOK() {
|
||||
// pass data back to the calling window
|
||||
var param = { width: document.getElementById("width").value,
|
||||
height: document.getElementById("height").value,
|
||||
sizeIncludesBars: (document.getElementById("sizeIncludesBars").checked?true:""),
|
||||
statusBar: (document.getElementById("statusBar").checked?true:""),
|
||||
mozParaHandler: document.getElementById("mozParaHandler").value,
|
||||
undoSteps: document.getElementById("undoSteps").value,
|
||||
baseHref: document.getElementById("baseHref").value,
|
||||
stripBaseHref: (document.getElementById("stripBaseHref").checked?true:""),
|
||||
stripSelfNamedAnchors: (document.getElementById("stripSelfNamedAnchors").checked?true:""),
|
||||
only7BitPrintablesInURLs: (document.getElementById("only7BitPrintablesInURLs").checked?true:""),
|
||||
sevenBitClean: (document.getElementById("sevenBitClean").checked?true:""),
|
||||
killWordOnPaste: (document.getElementById("killWordOnPaste").checked?true:""),
|
||||
flowToolbars: (document.getElementById("flowToolbars").checked?true:""),
|
||||
CharacterMapMode: document.getElementById("CharacterMapMode").value,
|
||||
ListTypeOptions: document.getElementById("ListTypeMode").value
|
||||
};
|
||||
__dlg_close(param);
|
||||
var param = new Object();
|
||||
var el = document.getElementsByTagName('input');
|
||||
for (var i=0; i<el.length;i++){
|
||||
if ((el[i].type.toLowerCase()=="radio") || (el[i].type.toLowerCase()=="checkbox")){
|
||||
if (getCheckedValue(el[i])!=''){
|
||||
param[el[i].id] = getCheckedValue(el[i]);
|
||||
}
|
||||
} else {
|
||||
param[el[i].id] = el[i].value;
|
||||
}
|
||||
}
|
||||
el = document.getElementsByTagName('select');
|
||||
for (var i=0; i<el.length;i++){
|
||||
param[el[i].id] = getSelectedValue(el[i]);
|
||||
}
|
||||
el = document.getElementsByTagName('textarea');
|
||||
for (var i=0; i<el.length;i++){
|
||||
param[el[i].id] = el[i].value;
|
||||
}
|
||||
__dlg_close(param);
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -144,7 +212,7 @@ function onCancel() {
|
||||
|
||||
</head>
|
||||
|
||||
<body class="dialog" onload="Init()">
|
||||
<body class="dialog" onload="Init(); window.resizeTo(360, 590);">
|
||||
<div class="title">Settings</div>
|
||||
<form action="" method="get">
|
||||
<div class="fr">Editor width:</div>
|
||||
@@ -154,10 +222,10 @@ function onCancel() {
|
||||
<input type="text" name="height" id="height" title="" />
|
||||
<p />
|
||||
<div class="fr">Size includes bars</div>
|
||||
<input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" />
|
||||
<input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" value="true" />
|
||||
<p />
|
||||
<div class="fr">Status Bar</div>
|
||||
<input type="checkbox" name="statusBar" id="statusBar" />
|
||||
<input type="checkbox" name="statusBar" id="statusBar" value="true" />
|
||||
<p />
|
||||
<div class="fr">Mozilla Parameter Handler:</div>
|
||||
<select name="mozParaHandler" id="mozParaHandler">
|
||||
@@ -173,48 +241,59 @@ function onCancel() {
|
||||
<input type="text" name="baseHref" id="baseHref" title="" />
|
||||
<p />
|
||||
<div class="fr">Strip base href</div>
|
||||
<input type="checkbox" name="stripBaseHref" id="stripBaseHref" />
|
||||
<input type="checkbox" name="stripBaseHref" id="stripBaseHref" value="true" />
|
||||
<p />
|
||||
<div class="fr">Strip self named anchors</div>
|
||||
<input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" />
|
||||
<input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" value="true" />
|
||||
<p />
|
||||
<div class="fr">only 7bit printables in URLs</div>
|
||||
<input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" />
|
||||
<input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" value="true" />
|
||||
<p />
|
||||
<div class="fr">7bit Clean</div>
|
||||
<input type="checkbox" name="sevenBitClean" id="sevenBitClean" />
|
||||
<input type="checkbox" name="sevenBitClean" id="sevenBitClean" value="true" />
|
||||
<p />
|
||||
<div class="fr">kill Word on paste</div>
|
||||
<input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" />
|
||||
<input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" value="true" />
|
||||
<p />
|
||||
<div class="fr">flow toolbars</div>
|
||||
<input type="checkbox" name="flowToolbars" id="flowToolbars" />
|
||||
<input type="checkbox" name="flowToolbars" id="flowToolbars" value="true" />
|
||||
<p />
|
||||
<div class="fr">show loading</div>
|
||||
<input type="checkbox" name="showLoading" id="showLoading" value="true" />
|
||||
<p />
|
||||
|
||||
<div id="CharacterMapOptions" class="options">
|
||||
<hr size="0.5">
|
||||
<div class="fr">CharacterMap mode :</div>
|
||||
<select id="CharacterMapMode" name="CharacterMapMode">
|
||||
<div class="fr">CharacterMap mode :</div>
|
||||
<select id="CharacterMapMode" name="CharacterMapMode">
|
||||
<option value="popup">popup</option>
|
||||
<option value="panel">panel</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p />
|
||||
|
||||
<div id="ListTypeOptions" class="options">
|
||||
<hr size="0.5">
|
||||
<hr size="0.5">
|
||||
<div class="fr">ListType mode :</div>
|
||||
<select id="ListTypeMode" name="ListTypeMode">
|
||||
<select id="ListTypeMode" name="ListTypeMode">
|
||||
<option value="toolbar">toolbar</option>
|
||||
<option value="panel">panel</option>
|
||||
</select>
|
||||
</div>
|
||||
<p />
|
||||
|
||||
<p />
|
||||
|
||||
<div id="CharCounterOptions" class="options">
|
||||
<hr size="0.5">
|
||||
<div class="fr">CharCounter (showChar) :</div><input type="checkbox" name="showChar" id="showChar" value="true" /><br />
|
||||
<div class="fr">CharCounter (showWord) :</div><input type="checkbox" name="showWord" id="showWord" value="true" /><br />
|
||||
<div class="fr">CharCounter (showHtml) :</div><input type="checkbox" name="showHtml" id="showHtml" value="true" />
|
||||
</div>
|
||||
<p />
|
||||
|
||||
<div id="buttons">
|
||||
<button type="submit" name="ok" onclick="return onOK();">OK</button>
|
||||
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
22
xinha/examples/Newbie.html
Normal file
22
xinha/examples/Newbie.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Xinha Newbie Guide</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<script type="text/javascript">
|
||||
_editor_url = "../" // (preferably absolute) URL (including trailing slash) where Xinha is installed
|
||||
_editor_lang = "en"; // And the language we need to use in the editor.
|
||||
_editor_skin = "silva"; // If you want use skin, add the name here
|
||||
</script>
|
||||
<script type="text/javascript" src="../XinhaCore.js"></script>
|
||||
<script type="text/javascript" src="XinhaConfig.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form action="">
|
||||
<textarea id="myTextArea" name="myTextArea" rows="10" cols="50" style="width: 100%"></textarea>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
17
xinha/examples/XinhaConfig.js
Normal file
17
xinha/examples/XinhaConfig.js
Normal file
@@ -0,0 +1,17 @@
|
||||
xinha_editors=null;
|
||||
xinha_init=null;
|
||||
xinha_config=null;
|
||||
xinha_plugins=null;
|
||||
xinha_init=xinha_init?xinha_init:function(){
|
||||
xinha_editors=xinha_editors?xinha_editors:["myTextArea","anotherOne"];
|
||||
xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","ListType","Stylist","Linker","SuperClean","TableOperations"];
|
||||
if(!Xinha.loadPlugins(xinha_plugins,xinha_init)){
|
||||
return;
|
||||
}
|
||||
xinha_config=xinha_config?xinha_config():new Xinha.Config();
|
||||
xinha_config.pageStyleSheets=[_editor_url+"examples/full_example.css"];
|
||||
xinha_editors=Xinha.makeEditors(xinha_editors,xinha_config,xinha_plugins);
|
||||
Xinha.startEditors(xinha_editors);
|
||||
};
|
||||
Xinha._addEvent(window,"load",xinha_init);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
-- @TODO Make this CSS more useful.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/custom.css $
|
||||
-- $LastChangedDate: 2005-02-18 23:10:03 -0500 (Fri, 18 Feb 2005) $
|
||||
-- $LastChangedRevision: 14 $
|
||||
-- $LastChangedBy: gogo $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; }
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
-- @TODO Make this CSS more useful.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/dynamic.css $
|
||||
-- $LastChangedDate: 2005-02-18 23:10:03 -0500 (Fri, 18 Feb 2005) $
|
||||
-- $LastChangedRevision: 14 $
|
||||
-- $LastChangedBy: gogo $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
p {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?PHP
|
||||
$LocalPluginPath = dirname(dirname(__FILE__)).'\plugins';
|
||||
$LocalSkinPath = dirname(dirname(__File__)).'\skins';
|
||||
?>
|
||||
$LocalPluginPath = dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'plugins';
|
||||
$LocalSkinPath = dirname(dirname(__File__)).DIRECTORY_SEPARATOR.'skins';
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
-- frame to provide a menu for generating example editors using
|
||||
-- full_example-body.html, and full_example.js.
|
||||
--
|
||||
-- $HeadURL$
|
||||
-- $LastChangedDate$
|
||||
-- $LastChangedRevision$
|
||||
-- $LastChangedBy$
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/ext_example-menu.php $
|
||||
-- $LastChangedDate: 2007-02-07 20:12:42 +0100 (Mi, 07 Feb 2007) $
|
||||
-- $LastChangedRevision: 715 $
|
||||
-- $LastChangedBy: htanaka $
|
||||
--------------------------------------------------------------------------->
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
@@ -25,7 +25,30 @@
|
||||
label { display:block;}
|
||||
</style>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
var settings = null;
|
||||
settings = {
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
sizeIncludesBars: true,
|
||||
statusBar: true,
|
||||
mozParaHandler: "best",
|
||||
undoSteps: 20,
|
||||
baseHref: null,
|
||||
stripBaseHref: true,
|
||||
stripSelfNamedAnchors: true,
|
||||
only7BitPrintablesInURLs: true,
|
||||
sevenBitClean: false,
|
||||
killWordOnPaste: true,
|
||||
flowToolbars: true,
|
||||
CharacterMapMode: "popup",
|
||||
ListTypeMode: "toolbar",
|
||||
showLoading: false,
|
||||
showChar: true,
|
||||
showWord: true,
|
||||
showHtml: true
|
||||
};
|
||||
|
||||
|
||||
function getCookieVal (offset) {
|
||||
var endstr = document.cookie.indexOf (";", offset);
|
||||
if (endstr == -1)
|
||||
@@ -43,7 +66,7 @@
|
||||
if (document.cookie.substring(i, j) == arg)
|
||||
return getCookieVal (j);
|
||||
i = document.cookie.indexOf(" ", i) + 1;
|
||||
if (i == 0) break;
|
||||
if (i == 0) break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -71,11 +94,11 @@
|
||||
sHeight = sHeight - 245;
|
||||
} else {
|
||||
sHeight = 30
|
||||
}
|
||||
}
|
||||
var div = document.getElementById("div_plugins");
|
||||
div.style.height = sHeight + "px";
|
||||
}
|
||||
|
||||
|
||||
function Dialog(url, action, init) {
|
||||
if (typeof init == "undefined") {
|
||||
init = window; // pass this window object by default
|
||||
@@ -117,15 +140,15 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
|
||||
// capture some window's events
|
||||
function capwin(w) {
|
||||
// HTMLArea._addEvent(w, "click", Dialog._parentEvent);
|
||||
// HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
|
||||
// HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
|
||||
// Xinha._addEvent(w, "click", Dialog._parentEvent);
|
||||
// Xinha._addEvent(w, "mousedown", Dialog._parentEvent);
|
||||
// Xinha._addEvent(w, "focus", Dialog._parentEvent);
|
||||
};
|
||||
// release the captured events
|
||||
function relwin(w) {
|
||||
// HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
|
||||
// HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
|
||||
// HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
|
||||
// Xinha._removeEvent(w, "click", Dialog._parentEvent);
|
||||
// Xinha._removeEvent(w, "mousedown", Dialog._parentEvent);
|
||||
// Xinha._removeEvent(w, "focus", Dialog._parentEvent);
|
||||
};
|
||||
capwin(window);
|
||||
// capture other frames
|
||||
@@ -143,41 +166,29 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
};
|
||||
|
||||
function fExtended () {
|
||||
var outparam = { width: document.getElementById("width").value,
|
||||
height: document.getElementById("height").value,
|
||||
sizeIncludesBars: document.getElementById("sizeIncludesBars").value,
|
||||
statusBar: document.getElementById("statusBar").value,
|
||||
mozParaHandler: document.getElementById("mozParaHandler").value,
|
||||
undoSteps: document.getElementById("undoSteps").value,
|
||||
baseHref: document.getElementById("baseHref").value,
|
||||
stripBaseHref: document.getElementById("stripBaseHref").value,
|
||||
stripSelfNamedAnchors: document.getElementById("stripSelfNamedAnchors").value,
|
||||
only7BitPrintablesInURLs: document.getElementById("only7BitPrintablesInURLs").value,
|
||||
sevenBitClean: document.getElementById("sevenBitClean").value,
|
||||
killWordOnPaste: document.getElementById("killWordOnPaste").value,
|
||||
flowToolbars: document.getElementById("flowToolbars").value,
|
||||
CharacterMapMode: document.getElementById("CharacterMapMode").value,
|
||||
ListTypeMode: document.getElementById("ListTypeMode").value
|
||||
};
|
||||
Dialog("Extended.html", function(param) {
|
||||
Dialog("Extended.html", function(param) {
|
||||
if(param) {
|
||||
document.getElementById("width").value = param["width"];
|
||||
document.getElementById("height").value = param["height"];
|
||||
document.getElementById("sizeIncludesBars").value = param["sizeIncludesBars"];
|
||||
document.getElementById("statusBar").value = param["statusBar"];
|
||||
document.getElementById("mozParaHandler").value = param["mozParaHandler"];
|
||||
document.getElementById("undoSteps").value = param["undoSteps"];
|
||||
document.getElementById("baseHref").value = param["baseHref"];
|
||||
document.getElementById("stripBaseHref").value = param["stripBaseHref"];
|
||||
document.getElementById("stripSelfNamedAnchors").value = param["stripSelfNamedAnchors"];
|
||||
document.getElementById("only7BitPrintablesInURLs").value = param["only7BitPrintablesInURLs"];
|
||||
document.getElementById("sevenBitClean").value = param["sevenBitClean"];
|
||||
document.getElementById("killWordOnPaste").value = param["killWordOnPaste"];
|
||||
document.getElementById("flowToolbars").value = param["flowToolbars"];
|
||||
document.getElementById("CharacterMapMode").value = param["CharacterMapMode"];
|
||||
document.getElementById("ListTypeMode").value = param["ListTypeMode"];
|
||||
}
|
||||
}, outparam );
|
||||
settings.width = param["width"];
|
||||
settings.height = param["height"];
|
||||
settings.sizeIncludesBars = (param["sizeIncludesBars"]=="true");
|
||||
settings.statusBar = (param["statusBar"]=="true");
|
||||
settings.mozParaHandler = param["mozParaHandler"];
|
||||
settings.undoSteps = param["undoSteps"];
|
||||
settings.baseHref = param["baseHref"];
|
||||
settings.stripBaseHref = (param["stripBaseHref"]=="true");
|
||||
settings.stripSelfNamedAnchors = (param["stripSelfNamedAnchors"]=="true");
|
||||
settings.only7BitPrintablesInURLs = (param["only7BitPrintablesInURLs"]=="true");
|
||||
settings.sevenBitClean = (param["sevenBitClean"]=="true");
|
||||
settings.killWordOnPaste = (param["killWordOnPaste"]=="true");
|
||||
settings.flowToolbars = (param["flowToolbars"]=="true");
|
||||
settings.CharacterMapMode = param["CharacterMapMode"];
|
||||
settings.ListTypeMode = param["ListTypeMode"];
|
||||
settings.showLoading = (param["showLoading"]=="true");
|
||||
settings.showChar = (param["showChar"]=="true");
|
||||
settings.showWord = (param["showWord"]=="true");
|
||||
settings.showHtml = (param["showHtml"]=="true");
|
||||
}
|
||||
}, settings );
|
||||
}
|
||||
|
||||
function init(){
|
||||
@@ -197,17 +208,17 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
document.getElementById(co_values[0]).value = co_values[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_onResize();
|
||||
};
|
||||
|
||||
|
||||
window.onresize = _onResize;
|
||||
window.onload = init;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="ext_example-body.html" target="body">
|
||||
<form action="ext_example-body.html" target="body" name="fsettings" id="fsettings">
|
||||
<h1>Xinha Example</h1>
|
||||
<fieldset>
|
||||
<legend>Settings</legend>
|
||||
@@ -223,6 +234,7 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
<option value="it">Italian</option>
|
||||
<option value="no">Norwegian</option>
|
||||
<option value="pl">Polish</option>
|
||||
<option value="ja">Japanese</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
@@ -233,28 +245,13 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
$d = @dir($LocalSkinPath);
|
||||
while (false !== ($entry = $d->read())) //not a dot file or directory
|
||||
{ if(substr($entry,0,1) != '.')
|
||||
{ echo '<option value="' . $entry . '"> ' . $entry . '</option>';
|
||||
{ echo '<option value="' . $entry . '"> ' . $entry . '</option>'."\n";
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<input type="hidden" id="width" name="width" value="auto" />
|
||||
<input type="hidden" id="height" name="height" value="auto" />
|
||||
<input type="hidden" id="sizeIncludesBars" name="sizeIncludeBars" value="true" />
|
||||
<input type="hidden" id="statusBar" name="statusBar" value="true" />
|
||||
<input type="hidden" id="mozParaHandler" name="mozParaHandler" value="best" />
|
||||
<input type="hidden" id="undoSteps" name="undoSteps" value="20" />
|
||||
<input type="hidden" id="baseHref" name="baseHref" value="null" />
|
||||
<input type="hidden" id="stripBaseHref" name="stripBaseHref" value="true" />
|
||||
<input type="hidden" id="stripSelfNamedAnchors" name="stripSelfNamedAnchors" value="true" />
|
||||
<input type="hidden" id="only7BitPrintablesInURLs" name="only7BitPrintablesInURLs" value="true" />
|
||||
<input type="hidden" id="sevenBitClean" name="sevenBitClean" value="false" />
|
||||
<input type="hidden" id="killWordOnPaste" name="killWordOnPaste" value="true" />
|
||||
<input type="hidden" id="flowToolbars" name="flowToolbars" value="true" />
|
||||
<input type="hidden" id="CharacterMapMode" name="CharacterMapMode" value="popup" />
|
||||
<input type="hidden" id="ListTypeMode" name="ListTypeMode" value="toolbar" />
|
||||
<center><input type="button" value="extended Settings" onClick="fExtended();" /></center>
|
||||
|
||||
</fieldset>
|
||||
@@ -263,17 +260,25 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
<div id="div_plugins" style="width:100%; overflow:auto">
|
||||
<?php
|
||||
$d = @dir($LocalPluginPath);
|
||||
$dir_array = array();
|
||||
while (false !== ($entry = $d->read())) //not a dot file or directory
|
||||
{ if(substr($entry,0,1) != '.')
|
||||
{ echo '<label><input type="checkbox" name="plugins" value="' . $entry . '"> ' . $entry . '</label>';
|
||||
{
|
||||
$dir_array[] = $entry;
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
sort($dir_array);
|
||||
foreach ($dir_array as $entry)
|
||||
{
|
||||
echo '<label><input type="checkbox" name="plugins" id="plugins" value="' . $entry . '"> ' . $entry . '</label>'."\n";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<center><button type="submit">reload editor</button></center>
|
||||
|
||||
|
||||
<textarea id="myTextarea0" style="display:none">
|
||||
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
|
||||
@@ -292,7 +297,7 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
<li> Nunc sit amet metus in tortor semper mattis. </li>
|
||||
</ul>
|
||||
</textarea>
|
||||
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
top.frames["body"].location.href = document.location.href.replace(/ext_example-menu\.php.*/, 'ext_example-body.html')
|
||||
@@ -308,7 +313,7 @@ Dialog._geckoOpenModal = function(url, action, init) {
|
||||
'num=' + document.getElementById('num').value + '###';
|
||||
var s_value='';
|
||||
for(var x = 0; x < document.forms[0].plugins.length; x++) {
|
||||
if(document.forms[0].plugins[x].checked)
|
||||
if(document.forms[0].plugins[x].checked)
|
||||
s_value += document.forms[0].plugins[x].value + '/';
|
||||
}
|
||||
if(s_value!='') {
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
|
||||
-- Xinha example frameset.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.html $
|
||||
-- $LastChangedDate: 2005-06-02 11:14:41 +0200 (Thu, 02 Jun 2005) $
|
||||
-- $LastChangedRevision: 212 $
|
||||
-- $LastChangedBy: gocher $
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/ext_example.html $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------->
|
||||
|
||||
<frameset cols="240,*">
|
||||
<frame src="ext_example-menu.php" name="menu">
|
||||
<frame src="about:blank" name="body">
|
||||
<frame src="ext_example-menu.php" name="menu" id="menu">
|
||||
<frame src="about:blank" name="body" id="body">
|
||||
</frameset>
|
||||
</html>
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
|
||||
-- Xinha example usage. This file shows how a developer might make use of
|
||||
-- Xinha, it forms the primary example file for the entire Xinha project.
|
||||
-- This file can be copied and used as a template for development by the
|
||||
-- end developer who should simply removed the area indicated at the bottom
|
||||
-- of the file to remove the auto-example-generating code and allow for the
|
||||
-- use of the file as a boilerplate.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example-body.html $
|
||||
-- $LastChangedDate: 2005-07-27 10:43:19 -0400 (Wed, 27 Jul 2005) $
|
||||
-- $LastChangedRevision: 287 $
|
||||
-- $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" />
|
||||
|
||||
<script type="text/javascript">
|
||||
// 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/";
|
||||
// You may try a relative URL if you wish]
|
||||
// eg: _editor_url = "../";
|
||||
// in this example we do a little regular expression to find the absolute path.
|
||||
_editor_url = document.location.href.replace(/examples\/full_example-body\.html.*/, '')
|
||||
_editor_lang = "en"; // And the language we need to use in the editor.
|
||||
</script>
|
||||
|
||||
<!-- Load up the actual editor core -->
|
||||
<script type="text/javascript" src="../htmlarea.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
xinha_editors = null;
|
||||
xinha_init = null;
|
||||
xinha_config = null;
|
||||
xinha_plugins = null;
|
||||
|
||||
// This contains the names of textareas we will make into Xinha editors
|
||||
xinha_init = xinha_init ? xinha_init : function()
|
||||
{
|
||||
/** STEP 1 ***************************************************************
|
||||
* First, 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 = xinha_plugins ? xinha_plugins :
|
||||
[
|
||||
'CharacterMap',
|
||||
'ContextMenu',
|
||||
'FullScreen',
|
||||
'ListType',
|
||||
'SpellChecker',
|
||||
'Stylist',
|
||||
'SuperClean',
|
||||
'TableOperations'
|
||||
];
|
||||
|
||||
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
|
||||
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
|
||||
|
||||
/** STEP 2 ***************************************************************
|
||||
* Now, what are the names of the textareas you will be turning into
|
||||
* editors?
|
||||
************************************************************************/
|
||||
|
||||
xinha_editors = xinha_editors ? xinha_editors :
|
||||
[
|
||||
'myTextArea',
|
||||
'anotherOne'
|
||||
];
|
||||
|
||||
/** STEP 3 ***************************************************************
|
||||
* We create a default configuration to be used by all the editors.
|
||||
* If you wish to configure some of the editors differently this will be
|
||||
* done in step 5.
|
||||
*
|
||||
* If you want to modify the default config you might do something like this.
|
||||
*
|
||||
* xinha_config = new HTMLArea.Config();
|
||||
* xinha_config.width = '640px';
|
||||
* xinha_config.height = '420px';
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
|
||||
|
||||
/** STEP 4 ***************************************************************
|
||||
* We first create editors for the textareas.
|
||||
*
|
||||
* You can do this in two ways, either
|
||||
*
|
||||
* xinha_editors = HTMLArea.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']);
|
||||
*
|
||||
* 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);
|
||||
|
||||
/** STEP 5 ***************************************************************
|
||||
* 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';
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/** STEP 6 ***************************************************************
|
||||
* Finally we "start" the editors, this turns the textareas into
|
||||
* Xinha editors.
|
||||
************************************************************************/
|
||||
|
||||
HTMLArea.startEditors(xinha_editors);
|
||||
}
|
||||
|
||||
window.onload = xinha_init;
|
||||
</script>
|
||||
<!--link type="text/css" rel="alternate stylesheet" title="blue-look" href="../skins/blue-look/skin.css" />
|
||||
<link type="text/css" rel="alternate stylesheet" title="green-look" href="../skins/green-look/skin.css" />
|
||||
<link type="text/css" rel="alternate stylesheet" title="xp-blue" href="../skins/xp-blue/skin.css" />
|
||||
<link type="text/css" rel="alternate stylesheet" title="xp-green" href="../skins/xp-green/skin.css" />
|
||||
<link type="text/css" rel="alternate stylesheet" title="inditreuse" href="../skins/inditreuse/skin.css" />
|
||||
<link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="../skins/blue-metallic/skin.css" /-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<form id="editors_here">
|
||||
<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%"></textarea>
|
||||
<textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%"></textarea>
|
||||
</form>
|
||||
|
||||
|
||||
<!-- *************************************************************************
|
||||
- !! IMPORTANT !!
|
||||
- The html and javascript below is the code used to create the example page.
|
||||
- It renders a lot of the above unused because it pre-fills xinha_editors,
|
||||
- xinha_config and xinha_plugins for you, and creates new textareas in place
|
||||
- of the ones above. The items above are not used while the example is being
|
||||
- used!
|
||||
-
|
||||
- If you are going to take the code in this file to form the basis of your
|
||||
- own, then leave out this marked area.
|
||||
- ********************************************************************* -->
|
||||
|
||||
<div id="lipsum" style="display:none">
|
||||
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
|
||||
velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
|
||||
ante elementum turpis. Aliquam nisl. Nulla posuere neque non
|
||||
tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
|
||||
parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
|
||||
Curabitur pharetra bibendum lectus.</p>
|
||||
|
||||
<ul>
|
||||
<li> Phasellus et massa sed diam viverra semper. </li>
|
||||
<li> Mauris tincidunt felis in odio. </li>
|
||||
<li> Nulla placerat nunc ut pede. </li>
|
||||
<li> Vivamus ultrices mi sit amet urna. </li>
|
||||
<li> Quisque sed augue quis nunc laoreet volutpat.</li>
|
||||
<li> Nunc sit amet metus in tortor semper mattis. </li>
|
||||
</ul>
|
||||
</div>
|
||||
<script src="full_example.js"></script>
|
||||
|
||||
<!-- ********************************************************************* -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,213 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
:noTabs=true:tabSize=2:indentSize=2:
|
||||
Xinha example menu. This file is used by full_example.html within a
|
||||
frame to provide a menu for generating example editors using
|
||||
full_example-body.html, and full_example.js.
|
||||
-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Example of Xinha</title>
|
||||
<link rel="stylesheet" href="full_example.css" type="text/css">
|
||||
<style type="text/css">
|
||||
form, p {margin:0; padding:0;}
|
||||
label {display:block;}
|
||||
#numeditor {width:25px;}
|
||||
.options {display:none;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function checkPluginsOptions()
|
||||
{
|
||||
var plugins = document.forms[0].elements['plugins'];
|
||||
for(var x = 0; x < plugins.length; x++)
|
||||
if (document.getElementById(plugins[x].value + 'Options'))
|
||||
document.getElementById(plugins[x].value + 'Options').style.display = (plugins[x].checked)? 'block':'none';
|
||||
}
|
||||
function toggleOnChange(elt) {
|
||||
document.getElementById(elt.value + 'Options').style.display = (elt.checked)? 'block':'none';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="checkPluginsOptions();">
|
||||
<form action="full_example-body.html" target="body">
|
||||
<p>
|
||||
Select from the options below and <input type="submit" value="click to show Example">
|
||||
</p>
|
||||
<fieldset>
|
||||
<legend>Settings</legend>
|
||||
<label>
|
||||
Number of Editors: <input type="text" name="num" value="1" id="numeditor" maxlength="2">
|
||||
</label>
|
||||
<label>
|
||||
Language:
|
||||
<select name="lang">
|
||||
<option value="en">English</option>
|
||||
<option value="de">German</option>
|
||||
<option value="fr">French</option>
|
||||
<option value="it">Italian</option>
|
||||
<option value="no">Norwegian</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Skin:
|
||||
<select name="skin">
|
||||
<option value="blue-look">blue-look</option>
|
||||
<option value="green-look">green-look</option>
|
||||
<option value="xp-blue">xp-blue</option>
|
||||
<option value="xp-green">xp-green</option>
|
||||
<option value="inditreuse">inditreuse</option>
|
||||
<option value="blue-metallic">blue-metallic</option>
|
||||
<option value="titan">titan</option>
|
||||
</select>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Plugins</legend>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Abbreviation"> Abbreviation
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="BackgroundImage"> BackgroundImage
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="CharacterMap" checked="checked" onchange="toggleOnChange(this);"> CharacterMap
|
||||
</label>
|
||||
<div id="CharacterMapOptions" class="options">
|
||||
mode : <select name="CharacterMapMode">
|
||||
<option value="popup">popup</option>
|
||||
<option value="panel">panel</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="CharCounter"> CharCounter
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="ClientsideSpellcheck" checked="checked"> ClientsideSpellcheck
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="ContextMenu" checked="checked"> ContextMenu
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="CSS" > CSS
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="DoubleClick"> DoubleClick
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="DynamicCSS" > DynamicCSS
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="EditTag"> EditTag
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="EnterParagraphs"> EnterParagraphs
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Equation"> Equation
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="FindReplace" checked="checked"> FindReplace
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="FormOperations"> FormOperations
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Forms"> Forms
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="FullPage" > FullPage
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="FullScreen" checked="checked"> FullScreen
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="GetHtml" checked="checked"> GetHtml
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="HorizontalRule"> HorizontalRule
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertAnchor" checked="checked"> InsertAnchor
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertMarquee"> InsertMarquee
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertPagebreak"> InsertPagebreak
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertSmiley"> InsertSmiley
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertWords"> InsertWords
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="LangMarks"> LangMarks
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="ListType" checked="checked" onchange="toggleOnChange(this);"> ListType
|
||||
</label>
|
||||
<div id="ListTypeOptions" class="options">
|
||||
mode : <select name="ListTypeMode">
|
||||
<option value="toolbar">toolbar</option>
|
||||
<option value="panel">panel</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="NoteServer"> NoteServer
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="PasteText" checked="checked"> PasteText
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="QuickTag"> QuickTag
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Stylist" checked="checked"> Stylist
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="TableOperations" checked="checked"> TableOperations
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Template"> Template
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="UnFormat"> UnFormat
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>PHP Plugins</legend>
|
||||
<p>
|
||||
<small>These plugins require PHP in order to run.</small>
|
||||
</p>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="HtmlTidy"> HtmlTidy
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="ImageManager"> ImageManager
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="InsertPicture"> InsertPicture
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="Linker"> Linker
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="SpellChecker"> SpellChecker
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="plugins" value="SuperClean"> SuperClean
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
top.frames["body"].location.href = document.location.href.replace(/full_example-menu\.html.*/, 'full_example-body.html')
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,9 +2,9 @@
|
||||
-- Xinha example CSS file. This is ripped from Trac ;)
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.css $
|
||||
-- $LastChangedDate: 2005-02-18 23:10:03 -0500 (Fri, 18 Feb 2005) $
|
||||
-- $LastChangedRevision: 14 $
|
||||
-- $LastChangedBy: gogo $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
body {
|
||||
@@ -44,4 +44,5 @@
|
||||
.area_holder
|
||||
{
|
||||
margin:10px;
|
||||
}
|
||||
}
|
||||
label {font-size: 11px;}
|
||||
@@ -1,16 +0,0 @@
|
||||
<html>
|
||||
|
||||
<!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
|
||||
-- Xinha example frameset.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.html $
|
||||
-- $LastChangedDate: 2005-09-07 09:12:14 -0400 (Wed, 07 Sep 2005) $
|
||||
-- $LastChangedRevision: 312 $
|
||||
-- $LastChangedBy: gocher $
|
||||
--------------------------------------------------------------------------->
|
||||
|
||||
<frameset cols="220,*">
|
||||
<frame src="full_example-menu.html" name="menu">
|
||||
<frame src="about:blank" name="body">
|
||||
</frameset>
|
||||
</html>
|
||||
@@ -1,155 +1,97 @@
|
||||
|
||||
/*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
|
||||
-- Xinha example logic. This javascript is used to auto-generate examples
|
||||
-- as controlled by the options set in full_example-menu.html. it's called
|
||||
-- from full_example-body.html.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.js $
|
||||
-- $LastChangedDate: 2005-10-29 12:28:08 -0400 (Sat, 29 Oct 2005) $
|
||||
-- $LastChangedRevision: 416 $
|
||||
-- $LastChangedBy: gogo $
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
var num = 1;
|
||||
if(window.parent && window.parent != window)
|
||||
{
|
||||
var f = window.parent.menu.document.forms[0];
|
||||
_editor_lang = f.lang[f.lang.selectedIndex].value;
|
||||
_editor_skin = f.skin[f.skin.selectedIndex].value;
|
||||
|
||||
num = parseInt(f.num.value);
|
||||
if(isNaN(num))
|
||||
{
|
||||
num = 1;
|
||||
f.num.value = 1;
|
||||
}
|
||||
xinha_plugins = [ ];
|
||||
for(var x = 0; x < f.plugins.length; x++)
|
||||
{
|
||||
if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value);
|
||||
}
|
||||
}
|
||||
|
||||
xinha_editors = [ ]
|
||||
for(var x = 0; x < num; x++)
|
||||
{
|
||||
var ta = 'myTextarea' + x;
|
||||
xinha_editors.push(ta);
|
||||
}
|
||||
|
||||
xinha_config = function()
|
||||
{
|
||||
var config = new HTMLArea.Config();
|
||||
|
||||
if(typeof CSS != 'undefined')
|
||||
{
|
||||
config.pageStyle = "@import url(custom.css);";
|
||||
}
|
||||
|
||||
if(typeof Stylist != 'undefined')
|
||||
{
|
||||
// We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
|
||||
// otherwise it won't work!
|
||||
config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css'));
|
||||
|
||||
// Or we can load styles directly
|
||||
config.stylistLoadStyles('p.red_text { color:red }');
|
||||
|
||||
// If you want to provide "friendly" names you can do so like
|
||||
// (you can do this for stylistLoadStylesheet as well)
|
||||
config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'});
|
||||
}
|
||||
|
||||
if(typeof DynamicCSS != 'undefined')
|
||||
{
|
||||
config.pageStyle = "@import url(dynamic.css);";
|
||||
}
|
||||
|
||||
if(typeof InsertWords != 'undefined')
|
||||
{
|
||||
// Register the keyword/replacement list
|
||||
var keywrds1 = new Object();
|
||||
var keywrds2 = new Object();
|
||||
|
||||
keywrds1['-- Dropdown Label --'] = '';
|
||||
keywrds1['onekey'] = 'onevalue';
|
||||
keywrds1['twokey'] = 'twovalue';
|
||||
keywrds1['threekey'] = 'threevalue';
|
||||
|
||||
keywrds2['-- Insert Keyword --'] = '';
|
||||
keywrds2['Username'] = '%user%';
|
||||
keywrds2['Last login date'] = '%last_login%';
|
||||
config.InsertWords = {
|
||||
combos : [ { options: keywrds1, context: "body" },
|
||||
{ options: keywrds2, context: "li" } ]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (typeof ListType != 'undefined')
|
||||
{
|
||||
if(window.parent && window.parent != window)
|
||||
{
|
||||
var f = window.parent.menu.document.forms[0];
|
||||
config.ListType.mode = f.elements['ListTypeMode'].options[f.elements['ListTypeMode'].selectedIndex].value;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof CharacterMap != 'undefined')
|
||||
{
|
||||
if(window.parent && window.parent != window)
|
||||
{
|
||||
var f = window.parent.menu.document.forms[0];
|
||||
config.CharacterMap.mode = f.elements['CharacterMapMode'].options[f.elements['CharacterMapMode'].selectedIndex].value;
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof Filter != 'undefined') {
|
||||
xinha_config.Filters = ["Word", "Paragraph"]
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
var f = document.forms[0];
|
||||
f.innerHTML = '';
|
||||
|
||||
var lipsum = document.getElementById('lipsum').innerHTML;
|
||||
|
||||
for(var x = 0; x < num; x++)
|
||||
{
|
||||
var ta = 'myTextarea' + x;
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.className = 'area_holder';
|
||||
|
||||
var txta = document.createElement('textarea');
|
||||
txta.id = ta;
|
||||
txta.name = ta;
|
||||
txta.value = lipsum;
|
||||
txta.style.width="100%";
|
||||
txta.style.height="420px";
|
||||
|
||||
div.appendChild(txta);
|
||||
f.appendChild(div);
|
||||
}
|
||||
|
||||
//check submitted values
|
||||
var submit = document.createElement('input');
|
||||
submit.type = "submit";
|
||||
submit.id = "submit";
|
||||
submit.value = "submit";
|
||||
f.appendChild(submit);
|
||||
|
||||
var _oldSubmitHandler = null;
|
||||
if (document.forms[0].onsubmit != null) {
|
||||
_oldSubmitHandler = document.forms[0].onsubmit;
|
||||
}
|
||||
function frame_onSubmit(){
|
||||
alert(document.getElementById("myTextarea0").value);
|
||||
if (_oldSubmitHandler != null) {
|
||||
_oldSubmitHandler();
|
||||
}
|
||||
}
|
||||
document.forms[0].onsubmit = frame_onSubmit;
|
||||
var num=1;
|
||||
if(window.parent&&window.parent!=window){
|
||||
var f=window.parent.menu.document.forms[0];
|
||||
_editor_lang=f.lang[f.lang.selectedIndex].value;
|
||||
_editor_skin=f.skin[f.skin.selectedIndex].value;
|
||||
num=parseInt(f.num.value);
|
||||
if(isNaN(num)){
|
||||
num=1;
|
||||
f.num.value=1;
|
||||
}
|
||||
xinha_plugins=[];
|
||||
for(var x=0;x<f.plugins.length;x++){
|
||||
if(f.plugins[x].checked){
|
||||
xinha_plugins.push(f.plugins[x].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
xinha_editors=[];
|
||||
for(var x=0;x<num;x++){
|
||||
var ta="myTextarea"+x;
|
||||
xinha_editors.push(ta);
|
||||
}
|
||||
xinha_config=function(){
|
||||
var _1=new HTMLArea.Config();
|
||||
if(typeof CSS!="undefined"){
|
||||
_1.pageStyle="@import url(custom.css);";
|
||||
}
|
||||
if(typeof Stylist!="undefined"){
|
||||
_1.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/,"stylist.css"));
|
||||
_1.stylistLoadStyles("p.red_text { color:red }");
|
||||
_1.stylistLoadStyles("p.pink_text { color:pink }",{"p.pink_text":"Pretty Pink"});
|
||||
}
|
||||
if(typeof DynamicCSS!="undefined"){
|
||||
_1.pageStyle="@import url(dynamic.css);";
|
||||
}
|
||||
if(typeof InsertWords!="undefined"){
|
||||
var _2=new Object();
|
||||
var _3=new Object();
|
||||
_2["-- Dropdown Label --"]="";
|
||||
_2["onekey"]="onevalue";
|
||||
_2["twokey"]="twovalue";
|
||||
_2["threekey"]="threevalue";
|
||||
_3["-- Insert Keyword --"]="";
|
||||
_3["Username"]="%user%";
|
||||
_3["Last login date"]="%last_login%";
|
||||
_1.InsertWords={combos:[{options:_2,context:"body"},{options:_3,context:"li"}]};
|
||||
}
|
||||
if(typeof ListType!="undefined"){
|
||||
if(window.parent&&window.parent!=window){
|
||||
var f=window.parent.menu.document.forms[0];
|
||||
_1.ListType.mode=f.elements["ListTypeMode"].options[f.elements["ListTypeMode"].selectedIndex].value;
|
||||
}
|
||||
}
|
||||
if(typeof CharacterMap!="undefined"){
|
||||
if(window.parent&&window.parent!=window){
|
||||
var f=window.parent.menu.document.forms[0];
|
||||
_1.CharacterMap.mode=f.elements["CharacterMapMode"].options[f.elements["CharacterMapMode"].selectedIndex].value;
|
||||
}
|
||||
}
|
||||
if(typeof Filter!="undefined"){
|
||||
xinha_config.Filters=["Word","Paragraph"];
|
||||
}
|
||||
return _1;
|
||||
};
|
||||
var f=document.forms[0];
|
||||
f.innerHTML="";
|
||||
var lipsum=document.getElementById("lipsum").innerHTML;
|
||||
for(var x=0;x<num;x++){
|
||||
var ta="myTextarea"+x;
|
||||
var div=document.createElement("div");
|
||||
div.className="area_holder";
|
||||
var txta=document.createElement("textarea");
|
||||
txta.id=ta;
|
||||
txta.name=ta;
|
||||
txta.value=lipsum;
|
||||
txta.style.width="100%";
|
||||
txta.style.height="420px";
|
||||
div.appendChild(txta);
|
||||
f.appendChild(div);
|
||||
}
|
||||
var submit=document.createElement("input");
|
||||
submit.type="submit";
|
||||
submit.id="submit";
|
||||
submit.value="submit";
|
||||
f.appendChild(submit);
|
||||
var _oldSubmitHandler=null;
|
||||
if(document.forms[0].onsubmit!=null){
|
||||
_oldSubmitHandler=document.forms[0].onsubmit;
|
||||
}
|
||||
function frame_onSubmit(){
|
||||
alert(document.getElementById("myTextarea0").value);
|
||||
if(_oldSubmitHandler!=null){
|
||||
_oldSubmitHandler();
|
||||
}
|
||||
}
|
||||
document.forms[0].onsubmit=frame_onSubmit;
|
||||
|
||||
|
||||
138
xinha/examples/simple_example.html
Normal file
138
xinha/examples/simple_example.html
Normal file
@@ -0,0 +1,138 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Simple example of Xinha</title>
|
||||
<script type="text/javascript">
|
||||
/************************************************************************
|
||||
* Please refer to http://xinha.python-hosting.com/wiki/NewbieGuide
|
||||
************************************************************************
|
||||
* 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/";
|
||||
* You may try a relative URL if you wish]
|
||||
* eg: _editor_url = "../";
|
||||
* in this example we do a little regular expression to find the absolute path.
|
||||
************************************************************************/
|
||||
var _editor_url = document.location.href.replace(/examples\/simple_example\.html.*/, '')
|
||||
// And the language we need to use in the editor.
|
||||
var _editor_lang = "en";
|
||||
</script>
|
||||
<!-- Load up the actual editor core -->
|
||||
<script type="text/javascript" src="../XinhaCore.js"></script>
|
||||
<script type="text/javascript">
|
||||
/************************************************************************
|
||||
* 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.
|
||||
************************************************************************
|
||||
* Please refer to http://xinha.python-hosting.com/wiki/Plugins for the
|
||||
* list of availables plugins
|
||||
************************************************************************/
|
||||
var xinha_plugins =
|
||||
[
|
||||
'CharacterMap',
|
||||
'ContextMenu',
|
||||
'FullScreen',
|
||||
'ListType',
|
||||
'SpellChecker',
|
||||
'Stylist',
|
||||
'SuperClean',
|
||||
'TableOperations'
|
||||
];
|
||||
/************************************************************************
|
||||
* Names of the textareas you will be turning into editors
|
||||
************************************************************************/
|
||||
var xinha_editors =
|
||||
[
|
||||
'myTextArea',
|
||||
'anotherOne'
|
||||
];
|
||||
/************************************************************************
|
||||
* Initialisation function
|
||||
************************************************************************/
|
||||
function xinha_init()
|
||||
{
|
||||
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
|
||||
if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
|
||||
/*************************************************************************
|
||||
* We create a default configuration to be used by all the editors.
|
||||
* If you wish to configure some of the editors differently this will be
|
||||
* done later after editors are initiated.
|
||||
************************************************************************
|
||||
* Please refer to http://xinha.python-hosting.com/wiki/Documentation/Customise
|
||||
* for the configuration parameters
|
||||
************************************************************************/
|
||||
var xinha_config = new Xinha.Config();
|
||||
/************************************************************************
|
||||
* We first create editors for the textareas.
|
||||
* You can do this in two ways, either
|
||||
*
|
||||
* 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 = Xinha.makeEditors(xinha_editors, xinha_config);
|
||||
* xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
|
||||
* xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
|
||||
*
|
||||
* if you want to use a different set of plugins for one or more of the
|
||||
* editors.
|
||||
************************************************************************/
|
||||
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
|
||||
/************************************************************************
|
||||
* 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';
|
||||
/************************************************************************
|
||||
* Or remove the statusbar on the other one, like this...
|
||||
* For every possible configuration, please refer to
|
||||
* http://xinha.python-hosting.com/wiki/Documentation/ConfigVariablesList
|
||||
************************************************************************/
|
||||
xinha_editors.anotherOne.config.statusBar = false;
|
||||
/************************************************************************
|
||||
* Finally we "start" the editors, this turns the textareas into
|
||||
* Xinha editors.
|
||||
************************************************************************/
|
||||
Xinha.startEditors(xinha_editors);
|
||||
}
|
||||
window.onload = xinha_init;
|
||||
</script>
|
||||
<link type="text/css" rel="stylesheet" title="blue-look" href="../skins/blue-look/skin.css">
|
||||
<link type="text/css" rel="alternate stylesheet" title="green-look" href="../skins/green-look/skin.css">
|
||||
<link type="text/css" rel="alternate stylesheet" title="xp-blue" href="../skins/xp-blue/skin.css">
|
||||
<link type="text/css" rel="alternate stylesheet" title="xp-green" href="../skins/xp-green/skin.css">
|
||||
<link type="text/css" rel="alternate stylesheet" title="inditreuse" href="../skins/inditreuse/skin.css">
|
||||
<link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="../skins/blue-metallic/skin.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<form onsubmit="alert(this.myTextArea.value); alert(this.anotherOne.value); return false;">
|
||||
<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%">
|
||||
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
|
||||
velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
|
||||
ante elementum turpis. Aliquam nisl. Nulla posuere neque non
|
||||
tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
|
||||
parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
|
||||
Curabitur pharetra bibendum lectus.</p>
|
||||
</textarea>
|
||||
<textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%">
|
||||
<ul>
|
||||
<li> Phasellus et massa sed diam viverra semper. </li>
|
||||
<li> Mauris tincidunt felis in odio. </li>
|
||||
<li> Nulla placerat nunc ut pede. </li>
|
||||
<li> Vivamus ultrices mi sit amet urna. </li>
|
||||
<li> Quisque sed augue quis nunc laoreet volutpat.</li>
|
||||
<li> Nunc sit amet metus in tortor semper mattis. </li>
|
||||
</ul>
|
||||
</textarea>
|
||||
<input type="submit">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,9 +3,9 @@
|
||||
-- when the Stylist plugin is included in an auto-generated example.
|
||||
--
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/stylist.css $
|
||||
-- $LastChangedDate: 2005-07-19 02:23:58 -0400 (Tue, 19 Jul 2005) $
|
||||
-- $LastChangedRevision: 277 $
|
||||
-- $LastChangedBy: gogo $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
.bluetext
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
-- of the file to remove the auto-example-generating code and allow for the
|
||||
-- use of the file as a boilerplate.
|
||||
--
|
||||
-- $HeadURL: svn://gogo@xinha.gogo.co.nz/repository/trunk/examples/full_example-body.html $
|
||||
-- $LastChangedDate: 2005-03-05 21:42:32 +1300 (Sat, 05 Mar 2005) $
|
||||
-- $LastChangedRevision: 35 $
|
||||
-- $LastChangedBy: gogo $
|
||||
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/testbed.html $
|
||||
-- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $
|
||||
-- $LastChangedRevision: 677 $
|
||||
-- $LastChangedBy: ray $
|
||||
--------------------------------------------------------------------------->
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
@@ -54,10 +54,10 @@
|
||||
|
||||
xinha_plugins = xinha_plugins ? xinha_plugins :
|
||||
[
|
||||
|
||||
'CharacterMap', 'SpellChecker', 'Linker'
|
||||
];
|
||||
// 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;
|
||||
|
||||
/** STEP 2 ***************************************************************
|
||||
* Now, what are the names of the textareas you will be turning into
|
||||
@@ -76,13 +76,15 @@
|
||||
*
|
||||
* If you want to modify the default config you might do something like this.
|
||||
*
|
||||
* xinha_config = new HTMLArea.Config();
|
||||
* xinha_config = new Xinha.Config();
|
||||
* xinha_config.width = 640;
|
||||
* xinha_config.height = 420;
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
|
||||
xinha_config = xinha_config ? xinha_config : new Xinha.Config();
|
||||
xinha_config.fullPage = true;
|
||||
xinha_config.CharacterMap.mode = 'panel';
|
||||
/*
|
||||
// We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
|
||||
// otherwise it won't work!
|
||||
@@ -100,11 +102,11 @@
|
||||
*
|
||||
* 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 = Xinha.makeEditors(xinha_editors, xinha_config);
|
||||
* xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
|
||||
* xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
|
||||
*
|
||||
@@ -112,7 +114,7 @@
|
||||
* editors.
|
||||
************************************************************************/
|
||||
|
||||
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
|
||||
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
|
||||
|
||||
/** STEP 4 ***************************************************************
|
||||
* If you want to change the configuration variables of any of the
|
||||
@@ -130,12 +132,12 @@
|
||||
* Xinha editors.
|
||||
************************************************************************/
|
||||
|
||||
HTMLArea.startEditors(xinha_editors);
|
||||
Xinha.startEditors(xinha_editors);
|
||||
window.onload = null;
|
||||
}
|
||||
|
||||
window.onload = xinha_init;
|
||||
// window.onunload = HTMLArea.collectGarbageForIE;
|
||||
// window.onunload = Xinha.collectGarbageForIE;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -143,6 +145,19 @@
|
||||
|
||||
<form action="javascript:var x = document.getElementById('editors_here');alert(x.myTextArea.value);" id="editors_here" onsubmit="alert(this.myTextArea.value);">
|
||||
<textarea id="myTextArea" name="myTextArea" style="width:100%;height:320px;">
|
||||
<html>
|
||||
<head>
|
||||
<title>Hello</title>
|
||||
<style type="text/css">
|
||||
li { color:red; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img src="http://xinha.python-hosting.com/trac/logo.jpg" usemap="#m1">
|
||||
<map name="m1">
|
||||
<area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com">
|
||||
</map>
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
|
||||
@@ -161,6 +176,8 @@
|
||||
<li> Quisque sed augue quis nunc laoreet volutpat.</li>
|
||||
<li> Nunc sit amet metus in tortor semper mattis. </li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
</textarea>
|
||||
|
||||
<input type="submit" /> <input type="reset" />
|
||||
|
||||
Reference in New Issue
Block a user