Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js 12 Nov 2005 12:37:08 -0000 1.3.2.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js 1 Jan 2006 23:28:20 -0000 1.3.2.2 @@ -73,4 +73,4 @@ Dialog._modal = null; }; Dialog._modal.focus(); -}; +}; \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html 2 Nov 2005 09:20:04 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html 1 Jan 2006 23:28:21 -0000 1.2.2.1 @@ -15,15 +15,56 @@ 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 @@ 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 - +
Settings
Editor width:
@@ -154,10 +222,10 @@

Size includes bars
- +

Status Bar
- +

Mozilla Parameter Handler:

Strip base href
- +

Strip self named anchors
- +

only 7bit printables in URLs
- +

7bit Clean
- +

kill Word on paste
- +

flow toolbars
- +

+

show loading
+ +


-
CharacterMap mode :
- -
+

-
+
ListType mode :
-
-

- +

+ +

+
+
CharCounter (showChar) :

+
CharCounter (showWord) :

+
CharCounter (showHtml) :
+
+

+

- \ No newline at end of file + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html 2 Nov 2005 09:20:04 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html 1 Jan 2006 23:28:21 -0000 1.2.2.1 @@ -20,19 +20,16 @@ 'Line: ' + sLine + '\n'; return false; } - window.onerror = showError; - document.onerror = showError; - - var f = window.parent.menu.document.forms[0]; + var f = top.frames["menu"].document.forms["fsettings"]; // 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\/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 + _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 @@ -45,7 +42,10 @@ 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"]; // 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 = [ ]; @@ -86,23 +86,32 @@ } // Create a default configuration to be used by all the editors. + settings = top.frames["menu"].settings; 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; + 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);"; } @@ -147,7 +156,7 @@ // Path for InsertPicture plugin InsertPicture.PicturePath = '/schmal/pictures/'; } - + if(typeof Filter != 'undefined') { xinha_config.Filters = ["Word", "Paragraph"]; } @@ -172,29 +181,27 @@ HTMLArea.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 = HTMLArea.collectGarbageForIE; -
-
- - + +
+ +
- Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php 2 Nov 2005 09:20:04 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php 1 Jan 2006 23:28:21 -0000 1.2.2.1 @@ -1,7 +1,7 @@ +?> @@ -25,7 +25,30 @@ label { display:block;} -
+

Xinha Example

Settings @@ -233,28 +244,13 @@ $d = @dir($LocalSkinPath); while (false !== ($entry = $d->read())) //not a dot file or directory { if(substr($entry,0,1) != '.') - { echo ''; + { echo ''."\n"; } } $d->close(); ?> - - - - - - - - - - - - - - -
@@ -265,15 +261,15 @@ $d = @dir($LocalPluginPath); while (false !== ($entry = $d->read())) //not a dot file or directory { if(substr($entry,0,1) != '.') - { echo ''; + { echo ''."\n"; } } $d->close(); ?>
- + - +