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.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js 2 Nov 2005 09:20:03 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/dialog.js 11 Nov 2005 20:32:40 -0000 1.3 @@ -19,7 +19,7 @@ init = window; // pass this window object by default } Dialog._geckoOpenModal(url, action, init); -}; +} Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); @@ -50,13 +50,13 @@ HTMLArea._addEvent(w, "click", Dialog._parentEvent); HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent); HTMLArea._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); - }; + } capwin(window); // capture other frames, note the exception trapping, this is because // we are not permitted to add events to frames outside of the current @@ -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/htmlarea.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js 2 Nov 2005 09:20:03 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js 11 Nov 2005 20:32:40 -0000 1.3 @@ -27,17 +27,17 @@ -- included in the top 10 lines of the file (see the embedded edit mode) -- -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/htmlarea.js $ - -- $LastChangedDate: 2005-10-26 19:42:49 +1300 (Wed, 26 Oct 2005) $ - -- $LastChangedRevision: 402 $ + -- $LastChangedDate: 2005-11-07 21:36:41 +1300 (Mon, 07 Nov 2005) $ + -- $LastChangedRevision: 421 $ -- $LastChangedBy: gocher $ --------------------------------------------------------------------------*/ HTMLArea.version = { 'Release' : 'Trunk', 'Head' : '$HeadURL: http://svn.xinha.python-hosting.com/trunk/htmlarea.js $'.replace(/^[^:]*: (.*) \$$/, '$1'), - 'Date' : '$LastChangedDate: 2005-10-26 19:42:49 +1300 (Wed, 26 Oct 2005) $'.replace(/^[^:]*: ([0-9-]*) ([0-9:]*) ([+0-9]*) \((.*)\) \$/, '$4 $2 $3'), - 'Revision' : '$LastChangedRevision: 402 $'.replace(/^[^:]*: (.*) \$$/, '$1'), + 'Date' : '$LastChangedDate: 2005-11-07 21:36:41 +1300 (Mon, 07 Nov 2005) $'.replace(/^[^:]*: ([0-9-]*) ([0-9:]*) ([+0-9]*) \((.*)\) \$/, '$4 $2 $3'), + 'Revision' : '$LastChangedRevision: 421 $'.replace(/^[^:]*: (.*) \$$/, '$1'), 'RevisionBy': '$LastChangedBy: gocher $'.replace(/^[^:]*: (.*) \$$/, '$1') }; @@ -152,7 +152,7 @@ } HTMLArea.freeLater(this, '_textArea'); } -}; +} HTMLArea.onload = function(){}; HTMLArea.init = function() { @@ -791,7 +791,7 @@ tb_body.appendChild(tb_row); table.className = 'toolbarRow'; // meh, kinda. - }; // END of function: newLine + } // END of function: newLine // init first line newLine(); @@ -823,7 +823,7 @@ } this[id] = newval; } - }; // END of function: setButtonStatus + } // END of function: setButtonStatus // this function will handle creation of combo boxes. Receives as // parameter the name of a button as defined in the toolBar config. @@ -894,7 +894,7 @@ }); } return el; - }; // END of function: createSelect + } // END of function: createSelect // appends a new button to toolbar function createButton(txt) { @@ -1009,14 +1009,14 @@ img.style.top = '0px'; img.style.left = '0px'; } - } + }; } else if (!el) { el = createSelect(txt); } return el; - }; + } var first = true; for (var i = 0; i < this.config.toolbar.length; ++i) { @@ -1440,13 +1440,13 @@ case 'toolbar': { - width = this._toolBar.offsetWidth; + width = this._toolBar.offsetWidth + 'px'; } break; default : { - width = this.config.width; + width = /[^0-9]/.test(this.config.width) ? this.config.width : this.config.width + 'px'; } break; } @@ -1461,7 +1461,7 @@ default : { - height = this.config.height; + height = /[^0-9]/.test(this.config.height) ? this.config.height : this.config.height + 'px'; } break; } @@ -2239,15 +2239,15 @@ for (; --indent >= 0;) ta.value += " "; ta.value += str + "\n"; - }; + } function _dt(root, level) { var tag = root.tagName.toLowerCase(), i; var ns = HTMLArea.is_ie ? root.scopeName : root.prefix; debug(level, "- " + tag + " [" + ns + "]"); for (i = root.firstChild; i; i = i.nextSibling) if (i.nodeType == 1) _dt(i, level + 2); - }; + } _dt(this._doc.body, 0); document.body.appendChild(ta); }; @@ -2289,7 +2289,7 @@ txt += "Final document length: " + editor._doc.body.innerHTML.length + "\n"; txt += "Clean-up took " + (((new Date()).getTime() - stats.T) / 1000) + " seconds"; alert(txt); - }; + } function clearClass(node) { var newc = node.className.replace(/(^|\s)mso.*?(\s|$)/ig, ' '); if (newc != node.className) { @@ -2299,7 +2299,7 @@ ++stats.mso_class; } } - }; + } function clearStyle(node) { var declarations = node.style.cssText.split(/\s*;\s*/); for (var i = declarations.length; --i >= 0;) @@ -2309,7 +2309,7 @@ declarations.splice(i, 1); } node.style.cssText = declarations.join("; "); - }; + } function stripTag(el) { if (HTMLArea.is_ie) el.outerHTML = HTMLArea.htmlEncode(el.innerText); @@ -2319,14 +2319,14 @@ HTMLArea.removeFromParent(el); } ++stats.mso_xmlel; - }; + } function checkEmpty(el) { if (/^(a|span|b|strong|i|em|font)$/i.test(el.tagName) && !el.firstChild) { HTMLArea.removeFromParent(el); ++stats.empty_tags; } - }; + } function parseTree(root) { var tag = root.tagName.toLowerCase(), i, next; if ((HTMLArea.is_ie && root.scopeName != 'HTML') || (!HTMLArea.is_ie && /:/.test(tag))) { @@ -2342,7 +2342,7 @@ } } return true; - }; + } parseTree(this._doc.body); // showStats(); // this.debugTree(); @@ -2827,7 +2827,7 @@ if (TestRange.inRange(range)) break; if ((parent.nodeType != 1) || (parent.tagName.toLowerCase() == 'body')) break; parent = parent.parentElement; - }; + } return parent; case "None": // It seems that even for selection of type "None", @@ -3369,18 +3369,20 @@ return false; } var img = image; - if (!img) { - var sel = editor._getSelection(); - var range = editor._createRange(sel); - editor._doc.execCommand("insertimage", false, param.f_url); + if (!img) { if (HTMLArea.is_ie) { + var sel = editor._getSelection(); + var range = editor._createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); img = range.parentElement(); // wonder if this works... if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else { - img = range.startContainer.previousSibling; + img = document.createElement('img'); + img.src = param.f_url; + editor.insertNodeAtSelection(img); if (!img.tagName) { // if the cursor is at the beginning of the document img = range.startContainer.firstChild; @@ -3443,8 +3445,8 @@ if (cellwidth) td.style.width = cellwidth + "%"; tr.appendChild(td); - // Mozilla likes to see something inside the cell. - (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br")); + // Browsers like to see something inside the cell ( ). + td.appendChild(doc.createTextNode('\u00a0')); } } if (HTMLArea.is_ie) { @@ -3471,7 +3473,7 @@ case "fontsize": this.execCommand(txt, false, value); break; case "formatblock": // (HTMLArea.is_ie) && (value = "<" + value + ">"); - value = "<" + value + ">" + if(!HTMLArea.is_gecko || value !== 'blockquote') { value = "<" + value + ">";} this.execCommand(txt, false, value); break; default: @@ -4330,12 +4332,12 @@ var newObj = new Object; // check for array objects - if (obj.constructor.toString().indexOf("function Array(") == 1) { + if (obj.constructor.toString().match( /\s*function Array\(/ )) { newObj = obj.constructor(); } // check for function objects (as usual, IE is fucked up) - if (obj.constructor.toString().indexOf("function Function(") == 1) { + if (obj.constructor.toString().match( /\s*function Function\(/ )) { newObj = obj; // just copy reference to it } else for (var n in obj) { var node = obj[n]; @@ -4644,7 +4646,11 @@ return el && el.nodeType == 1 && (HTMLArea._paraContainerTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); }; -HTMLArea._closingTags = " head script style div span tr td tbody table em strong b i strike code cite dfn abbr acronym font a title textarea select form "; +// These are all the tags for which the end tag is not optional or +// forbidden, taken from the list at: +// http://www.w3.org/TR/REC-html40/index/elements.html +HTMLArea._closingTags = " a abbr acronym address applet b bdo big blockquote button caption center cite code del dfn dir div dl em fieldset font form frameset h1 h2 h3 h4 h5 h6 i iframe ins kbd label legend map menu noframes noscript object ol optgroup pre q s samp script select small span strike strong style sub sup table textarea title tt u ul var "; + HTMLArea.needsClosingTag = function(el) { return el && el.nodeType == 1 && (HTMLArea._closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); }; @@ -4879,7 +4885,7 @@ // returns the hex representation of one byte (2 digits) function hex(d) { return (d < 16) ? ("0" + d.toString(16)) : d.toString(16); - }; + } if (typeof v == "number") { // we're talking to IE here @@ -5090,7 +5096,7 @@ alert('An error has occurred: ' + req.statusText); } } - }; + } req.onreadystatechange = callBack; @@ -5129,7 +5135,7 @@ alert('An error has occurred: ' + req.statusText); } } - }; + } req.onreadystatechange = callBack; req.open('GET', url, true); @@ -5578,4 +5584,4 @@ }; HTMLArea.init(); -HTMLArea.addDom0Event(window,'unload',HTMLArea.collectGarbageForIE); +HTMLArea.addDom0Event(window,'unload',HTMLArea.collectGarbageForIE); \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/popupwin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/popupwin.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/popupwin.js 2 Nov 2005 09:20:03 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/popupwin.js 11 Nov 2005 20:32:40 -0000 1.3 @@ -54,9 +54,9 @@ self.element = body; initFunction(self); dlg.focus(); - }; + } init2(); -}; +} PopupWin.prototype.callHandler = function() { var tags = ["input", "textarea", "select"]; @@ -137,4 +137,4 @@ self.window.resizeTo(w + 8, h + 35); } }, 25); -}; +}; \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js 2 Nov 2005 09:20:04 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js 11 Nov 2005 20:32:40 -0000 1.3 @@ -5,17 +5,18 @@ -- from full_example-body.html. -- -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.js $ - -- $LastChangedDate: 2005-09-29 21:03:01 +1200 (Thu, 29 Sep 2005) $ - -- $LastChangedRevision: 359 $ - -- $LastChangedBy: gocher $ + -- $LastChangedDate: 2005-10-30 05:28:08 +1300 (Sun, 30 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.value; - _editor_skin = f.skin.value; + _editor_lang = f.lang[f.lang.selectedIndex].value; + _editor_skin = f.skin[f.skin.selectedIndex].value; + num = parseInt(f.num.value); if(isNaN(num)) { Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js 2 Nov 2005 08:55:58 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js 11 Nov 2005 20:32:40 -0000 1.2 @@ -20,7 +20,7 @@ } }) cfg.addToolbarElement("bgImage", "inserthorizontalrule", 1); -}; +} BackgroundImage._pluginInfo = { name : "BackgroundImage", Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html 2 Nov 2005 08:55:58 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html 11 Nov 2005 20:32:40 -0000 1.2 @@ -10,12 +10,12 @@ __dlg_translate("BackgroundImage"); __dlg_init(); window.resizeTo(300, 195); -}; +} function onCancel() { __dlg_close(null); return false; -}; +} function insertbg(image) { __dlg_close(window.opener._editor_url + "/plugins/BackgroundImage/backgrounds/" + image); @@ -33,10 +33,10 @@
- | - | - | + | + | + | + |