Update of /cvsroot/mxbb/mx_kb/kb/includes/js In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2123 Added Files: .htaccess common.js debug.js form.js index.htm init_view.js management.js.php request.js.php Log Message: added --- NEW FILE: form.js --- // Forms, some help functions. // Author: Cezary Tomczak [www.gosu.pl] // submit button must have name "submit" to get this working window.onload = function() { document.forms[0].onsubmit = function() { if (!document.forms[0].submit.disabled) { document.forms[0].submit.disabled = true; return true; } return false; }; }; function isNumber(s) { if (s.length && s.charAt(0) == "-") { return isNumber(s.substr(1)); } if (!(/^[\d.]+$/.test(s))) { return false; } if (s.indexOf(".") != -1 && (s.indexOf(".") != s.lastIndexOf("."))) { return false; } if (s.charAt(0) == ".") { return false; } if (s.length >= 2 && s.charAt(0) == "0" && s.charAt(1) != ".") { return false; } return !isNaN(s); } --- NEW FILE: init_view.js --- function treeGetId() { if (tree.active) { return tree.active.substr("tree-".length); } return ""; } /** RSH must be initialized after the page is finished loading. */ window.onload = initialize; // This updates docs whenever a node is clicked OR updateUI() is called tree.textClickListener.add(function() { if (tree.getActiveNode().isDocument()) { documentView(); dhtmlHistory.add( treeGetId(), el(tree.active+"-text").innerHTML ); queryPath = tree.getActiveNode().id; tree.queryPath = queryPath.replace('tree-', ""); tree.active = queryPath; tree.loadState(); tree.updateHtml(); document.title = el(tree.active+"-text").innerHTML; } else { el('tabs-data').innerHTML = ""; } }); // Activate first doc in the clicked folder tree.textClickListener.add(function() { if (!tree.getActiveNode().isDocument()) { generateParentTOC('view'); dhtmlHistory.add( treeGetId(), el(tree.active+"-text").innerHTML ); //queryPath = tree.getActiveNode().id; //tree.queryPath = queryPath.replace('tree-', ""); //tree.active = queryPath; //tree.loadState(); //tree.updateHtml(); //if (tree.getActiveNode().childNodes) { //for (var i = 0; i < tree.getActiveNode().childNodes.length; i++) { //if (tree.getActiveNode().childNodes[i].isDocument()) { //queryPath = tree.getActiveNode().childNodes[i].id; //tree.queryPath = queryPath.replace('tree-', ""); //tree.active = queryPath; //tree.loadState(); //tree.updateHtml(); //break; //} //} //} } }); function initialize() { // initialize RSH dhtmlHistory.initialize(); // add ourselves as a listener for history change events dhtmlHistory.addListener(handleHistoryChange); if (dhtmlHistory.isFirstLoad()) { // determine our current location so we can initialize ourselves at startup var initialLocation = dhtmlHistory.getCurrentLocation(); // The App has received a standard GET url if (articlePath != '') { initialLocation = articlePath; } // if no location specified, use the default else if ((initialLocation == '' || initialLocation == null) && tree.allNodes[0]) { if (tree.allNodes[0].childNodes) { // First set default, then loop to find real document queryPath = tree.allNodes[0].id; for (var i = 0; i < tree.allNodes[0].childNodes.length; i++) { if (tree.allNodes[0].childNodes[i].isDocument()) { queryPath = tree.allNodes[0].childNodes[i].id; break; } } } else { queryPath = tree.allNodes[0].id; } initialLocation = queryPath.replace('tree-', ""); } // now initialize our starting UI if (tree.allNodes[0]) { updateUI(initialLocation, null); } } } /** A function that is called whenever the user presses the back or forward buttons. This function will be passed the newLocation, as well as any history data we associated with the location. */ function handleHistoryChange(newLocation, historyData) { // use the history data to update our UI updateUI(newLocation, historyData); } /** A simple method that updates our user interface using the new location. */ function updateUI(newLocation, historyData) { //alert('updateUI'); tree.queryPath = newLocation; tree.setActive(); tree.loadState(); tree.updateHtml(); } --- NEW FILE: management.js.php --- <?php //require '../../../config.php'; //$CONFIG['encoding'] is replaced by iso-8859-1 ?> // +--------------------------------------------------------------------+ // | DO NOT REMOVE THIS | // +--------------------------------------------------------------------+ // | management.js | // | Some functions, stuff for documents & folders management. | // +--------------------------------------------------------------------+ // | Author: Cezary Tomczak [www.gosu.pl] | // | Project: SimpleDoc | // | URL: http://gosu.pl/php/simpledoc.html | // | License: GPL | // +--------------------------------------------------------------------+ function Fader(id) { this.start = function() { this.timerId = setInterval(change, 80); }; this.stop = function() { clearInterval(this.timerId); this.opacity = 80; this.direction = 0; document.getElementById(this.id).style.opacity = 1; document.getElementById(this.id).style.MozOpacity = 1; document.getElementById(this.id).style.filter = 80; }; function change() { self.opacity += (self.direction ? 10 : -10); document.getElementById(self.id).style.opacity = self.opacity/100; document.getElementById(self.id).style.MozOpacity = self.opacity/100; document.getElementById(self.id).style.filter = "alpha(opacity="+self.opacity+")"; if (self.opacity == 20) { self.direction = 1; } if (self.opacity == 80) { self.direction = 0; } } var self = this; this.id = id; this.timerId = null; this.opacity = 80; this.direction = 0; } //var tabsLoading = new Fader("tabs-loading"); //var tabsSaving = new Fader("tabs-saving"); //var AjaxRequest = new AjaxRequest(); //function tabsLoadingOn() { document.getElementById("tabs-loading").style.display = "block"; tabsLoading.start(); } function tabsLoadingOn() { } //function tabsLoadingOff() { document.getElementById("tabs-loading").style.display = "none"; tabsLoading.stop(); } function tabsLoadingOff() { } //function tabsSavingOn() { document.getElementById("tabs-saving").style.display = "block"; tabsSaving.start(); } function tabsSavingOn() { } //function tabsSavingOff() { document.getElementById("tabs-saving").style.display = "none"; tabsSaving.stop(); } function tabsSavingOff() { } function documentInfo() { if (!tree.active || !tree.getActiveNode().isDocument()) { alert("You have to select a document in the Tree View to perform this action."); return; } checkContentSaved(); AjaxRequest.get( { 'url':'modules/mx_simpledoc/simpledoc/modules/simpledoc__tab-document-info.php' ,'parameters':{ 'id':escape(treeGetId()), 'block_id':mxBlock.block_id, 'page_id':mxBlock.page_id } ,'onLoading':function() { clearTabs(); tabsLoadingOn(); } ,'onComplete':function() { tabsLoadingOff(); } ,'onSuccess':function(req){ el('tabs-data').innerHTML = req.responseText; updateTabs('tab1'); dhtmlHistory.add( treeGetId(), el(tree.active+"-text").innerHTML );} ,'onError':function(req){ el('tabs-data').innerHTML = 'Error!\nStatusText='+req.statusText+'\nContents='+req.responseText;} ,'timeout':5000 ,'onTimeout':function(){ clearTabs(); tabsLoadingOff(); el('tabs-data').innerHTML = 'Timed out. Try again!'; } } ); } function editContent() { if (!tree.active || !tree.getActiveNode().isDocument()) { alert("You have to select a document in the Tree View to perform this action."); return; } checkContentSaved(); AjaxRequest.get( { 'url':'modules/mx_simpledoc/simpledoc/modules/simpledoc__tab-edit-content.php' ,'parameters':{ 'id':escape(treeGetId()), 'block_id':mxBlock.block_id, 'page_id':mxBlock.page_id } ,'onLoading':function() { clearTabs(); tabsLoadingOn(); } ,'onComplete':function() { tabsLoadingOff(); } ,'onSuccess':function(req){ el('tabs-data').innerHTML = req.responseText; initSimpleEditor(); el('body-tmp').value = el('body').value; updateTabs('tab2'); dhtmlHistory.add( treeGetId(), el(tree.active+"-text").innerHTML );} ,'onError':function(req){ el('tabs-data').innerHTML = 'Error!\nStatusText='+req.statusText+'\nContents='+req.responseText;} ,'timeout':5000 ,'onTimeout':function(){ clearTabs(); tabsLoadingOff(); el('tabs-data').innerHTML = 'Timed out. Try again!'; } } ); } var ste = null; function initSimpleEditor(){ ste = new SimpleTextEditor("body", "ste"); ste.path = "modules/mx_simpledoc/simpledoc/shared/SimpleTextEditor/"; ste.charset = "iso-8859-1"; ste.init(); ste.frame.document.onkeydown = keyPress; // aaa!! next IE bug, editor images not loading :\ if (document.all) { setTimeout(loadEditorImages, 50); } } function documentPreview() { if (!tree.active || !tree.getActiveNode().isDocument()) { alert("You have to select a document in the Tree View to perform this action."); return; } AjaxRequest.get( { 'url':'modules/mx_simpledoc/simpledoc/modules/simpledoc__tab-view-content.php' ,'parameters':{ 'id':escape(treeGetId()), 'block_id':mxBlock.block_id, 'page_id':mxBlock.page_id } ,'onLoading':function() { clearTabs(); tabsLoadingOn(); } ,'onComplete':function() { tabsLoadingOff(); } ,'onSuccess':function(req){ el('tabs-data').innerHTML = addTocDiv(stripBodyHtml(req.responseText)); generateTOC('index'); updateTabs('tab3'); } ,'onError':function(req){ el('tabs-data').innerHTML = 'Error!\nStatusText='+req.statusText+'\nContents='+req.responseText;} ,'timeout':5000 ,'onTimeout':function(){ clearTabs(); tabsLoadingOff(); el('tabs-data').innerHTML = 'Timed out. Try again!'; } } ); } function documentView() { if (!tree.active || !tree.getActiveNode().isDocument()) { alert("You have to select a document in the Tree View to perform this action."); return; } AjaxRequest.get( { 'url':'modules/mx_kb/kb/modules/tabs/kb__tab-view.php' ,'parameters':{ 'mode':'article', 'k': escape(treeGetId().substr(treeGetId().lastIndexOf("/")+1)), 'id': escape(treeGetId()), 'block_id':mxBlock.block_id, 'page_id':mxBlock.page_id } ,'onLoading':function() { clearTabs(); tabsLoadingOn(); } ,'onComplete':function() { tabsLoadingOff(); } ,'onSuccess':function(req){ el('tabs-data').innerHTML = stripBodyHtml(req.responseText); generateParentTOC('view'); generateTOC('view');} ,'onError':function(req){ el('tabs-data').innerHTML = 'Error!\nStatusText='+req.statusText+'\nContents='+req.responseText; } ,'timeout':5000 ,'onTimeout':function(){ clearTabs(); tabsLoadingOff(); el('tabs-data').innerHTML = 'Timed out. Try again!'; } } ); } function saveContent(theform) { tabsSavingOn(); el('save-document').disabled = true; //el('tabs-data').style.visibility = "hidden"; var status = AjaxRequest.submit( theform ,{ 'onSuccess':function(req){ } } ); el('save-document').disabled = false; el('body-tmp').value = el('body').value; tabsSavingOff(); //var data = {"body": el('body').value} //var save = httpSave("modules/mx_simpledoc/simpledoc/modules/simpledoc__tab-save-content.php?id="+escape(treeGetId())+'&block_id='+mxBlock.block_id+'&page_id='+mxBlock.page_id, data); if ((typeof status == "boolean" && !status) || typeof status == "string") { alert("Unknown error, cannot save document."); } else { el("saved").innerHTML = "Saved successfuly on "+(new Date()+"<br>(this message will disappear in 3 seconds)"); if (savedTimerID) clearTimeout(savedTimerID); savedTimerID = setTimeout(function(){ el("saved").innerHTML = ""; }, 3000); } return status; } // The top right toc // this snippet doesn't work if there is a folder named "html" // Only used when the doc is generated as part of the app - inline (scripts are stripped in plain code) function generateTOC(mode) { var contents = ""; var link = escape(treeGetId()); contents = '<div><a target="_blank" href="index.php?page='+mxBlock.page_id+'&mode='+mode+'#'+link+'">Permanent Link to this page</a></div>'; var all = document.getElementById("tabs-data").childNodes; var contents2 = ""; var text = ""; var found = false; var h3 = false; contents2 += '<b>Contents</b><ul>'; for (var i = 0; i < all.length; ++i) { if (all[i].nodeName == "H2" || all[i].nodeName == "H3") { if (all[i].nodeName == "H2") { if (h3) contents2 += '</ul>'; h3 = false; } if (all[i].nodeName == "H3") { if (!h3) contents2 += '<ul>'; h3 = true; } found = true; text = all[i].innerHTML.replace(/<[^>]+>/g,""); all[i].innerHTML = '<a name="'+text+'">'+text+'</a>'; contents2 += '<li><a href="index.php?page='+mxBlock.page_id+'&mode='+mode+'#'+text+'">'+text+'</a></li>'; } } contents2 += '</ul>'; if (found) { if (contents) contents += '<br>'; contents += contents2; } if (contents) { document.getElementById("contents").className = "contents"; document.getElementById("contents").innerHTML = contents; } //alert(document.getElementById("tabs-data").innerHTML); } // ?? // this snippet doesn't work if there is a folder named "html" // Only used when the doc is generated as part of the app - inline (scripts are stripped in plain code) function generateParentTOC(mode) { var contents = ""; var loc = ""; var contents2 = ""; var title = "<h1>Section Contents</h1>"; var s = ''; if(!document.getElementById("sectioncontents")) { //document.getElementById("tabs-data").innerHTML = addTocDiv(''); document.getElementById("tabs-data").innerHTML = addTocDiv(document.getElementById("tabs-data").innerHTML); } var node = tree.getActiveNode(); while (node && node.parentNode) { loc = (!node.isDocument() ? ' » ' + '<a href="javascript:void(0)"><span '+(node.childNodes.length ? 'ondblclick="tree.nodeClick(\''+node.id+'\'); node.blur();"' : "")+' onclick="tree.textClick(\''+node.id+'\')">'+node.text+'</span></a>' : '') + loc; node = node.parentNode; } loc = '<a href="index.php?page='+mxBlock.page_id+'&mode='+mode+'">Table of Contents</a> ' + loc; node = tree.getActiveNode(); if (node.childNodes) { for (var i = 0; i < node.childNodes.length; i++) { contents2 += node.childNodes[i].toToc(); } } contents2 = contents2 != '' ? title + contents2 : ''; contents = loc + ' <hr align="left"> ' + contents2; if (contents) { document.getElementById("sectioncontents").className = "sectioncontents"; document.getElementById("sectioncontents").innerHTML = contents; } } function stripBodyHtml(html) { // Remove HTML comments //html = html.replace(/<!--[\w\s\d@{}:.;,'"%!#_=&|?~()[*+\/\-\]]*-->/gi, "" ); // Remove all HTML tags //html = html.replace(/<\/?\s*HTML[^>]*>/gi, "" ); // Remove all BODY tags //html = html.replace(/<\/?\s*BODY[^>]*>/gi, "" ); // Remove all META tags //html = html.replace(/<\/?\s*META[^>]*>/gi, "" ); // Remove all TITLE tags & content //html = html.replace(/<\s*TITLE[^>]*>([^<]*)<\/\s*TITLE\s*>/i, "" ); // Remove all HEAD tags & content //html = html.replace(/<\s*HEAD[^>]*>([^<]*)<\/\s*HEAD\s*>/i, "" ); // Remove all SCRIPT tags //html = html.replace(/<\s*SCRIPT[^>]*>([^<]*)<\/\s*SCRIPT\s*>/i, "" ); // Remove all SPAN tags //html = html.replace(/<\/?\s*SPAN[^>]*>/gi, "" ); // Remove all STYLE tags //html = html.replace(/<\s*STYLE[^>]*>([^<]*)<\/\s*STYLE\s*>/i, "" ); // Remove Class attributes //html = html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "") ; // Remove Style attributes //html = html.replace(/<\s*(\w[^>]*) style="([^"]*)"([^>]*)/gi, "") ; //html = html.replace(/<\s*br[^>]*>/gi,""); html = html.trim(); return html; } function addTocDiv(html) { html = '<div id="contents"></div>' + '<div id="sectioncontents"></div>' + html; return html; } function loadEditorImages() { var a = el('tabs-data').getElementsByTagName("img"); for (var i = 0; i < a.length; ++i) { if (!a[i].complete && a[i].outerHTML) { a[i].outerHTML = a[i].outerHTML; } } } var savedTimerID = null; function isContentSaved() { if (ste && el("body") && el("save-document")) { ste.submit(); if (el("body").value != el("body-tmp").value) { return false; } } return true; } function checkContentSaved() { if (!isContentSaved()) { if (confirm("Content has not been saved since last change.\nSave it ?")) { saveContent(); } } } function clearTabs() { if(el('tab1')) {el('tab1').className = "tab";} if(el('tab2')) {el('tab2').className = "tab right";} if(el('tabs-data')) {el('tabs-data').innerHTML = "";} } function updateTabs(active){ el('tab1').className = "tab"+((active=='tab1')?"-active":""); el('tab2').className = "tab"+((active=='tab2')?"-active":"")+" right"; el('tab3').className = "tab"+((active=='tab3')?"-active":"")+" view"; } function keyPress(e) { if (!e) { if (!this.parentWindow) return; e = this.parentWindow.event; } if (e.ctrlKey && e.keyCode == 83) { if (el("body") && el("save-document")) { el("save-document").click(); } } if (e.altKey && e.keyCode == 49) documentInfo(); if (e.altKey && e.keyCode == 50) editContent(); } document.onkeydown = keyPress; --- NEW FILE: .htaccess --- allow from all --- NEW FILE: request.js.php --- <?php //require '../../../config.php'; //$CONFIG['encoding'] is replaced by iso-8859-1 ?> // +--------------------------------------------------------------------+ // | DO NOT REMOVE THIS | // +--------------------------------------------------------------------+ // | request.js | // | Functions for getting and saving data using XMLHttpRequest object. | // +--------------------------------------------------------------------+ // | Author: Cezary Tomczak [www.gosu.pl] | // | Project: SimpleDoc | // | URL: http://gosu.pl/php/simpledoc.html | // | License: GPL | // +--------------------------------------------------------------------+ /* Note (httpLoad): seems like IE always caches retrieved data until you close the browser, so when you call a few times the same url, it always returns the same, even if the content in the given url changed. There are 2 solutions: add to url some random query string or in the url script send NOCACHE headers. */ // returns: false|string(responseText) function httpLoad(url) { var req; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.open("GET", url, false); req.setRequestHeader('Accept-Charset','iso-8859-1'); req.send(null); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.open("GET", url, false); req.setRequestHeader('Accept-Charset','iso-8859-1'); req.send(); } else { alert("Could not create ActiveXObject (XMLHttpRequest)"); return false; } } else { alert("Your browser does not support XMLHttpRequest object"); return false; } if (req.status != 200) { alert("There was a problem while retrieving the data:\n" + req.statusText); req.abort(); return false; } return req.responseText; } // returns: true|false|string(responseText) function httpSave(url, data) { var req; var p; var content = ""; if (data) { for (var p in data) { if (content) { content += "&"; } content += (p + "=" + escape(data[p])); } } if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.open("POST", url, false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1"); req.send(content); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.open("POST", url, false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1"); req.send(content); } else { alert("Could not create ActiveXObject (XMLHttpRequest)"); return false; } } else { alert("Your browser does not support XMLHttpRequest object"); return false; } if (req.status != 200) { alert("There was a problem while sending the data:\n" + req.statusText); req.abort(); return false; } if (req.responseText.length) { alert(req.responseText); return false; } return true; } --- NEW FILE: common.js --- // +--------------------------------------------------------------------+ // | DO NOT REMOVE THIS | // +--------------------------------------------------------------------+ // | common.js | // | Some common help functions used all over the project. | // +--------------------------------------------------------------------+ // | Author: Cezary Tomczak [www.gosu.pl] | // | Project: SimpleDoc | // | URL: http://gosu.pl/php/simpledoc.html | // | License: GPL | // +--------------------------------------------------------------------+ function element(id) { return document.getElementById(id); } function elem(id) { return document.getElementById(id); } function el(id) { return document.getElementById(id); } /* Check whether array contains given string */ Array.prototype.contains = function(s) { for (var i = 0; i < this.length; i++) { if (this[i] === s) { return true; } } return false; }; /* Finds the index of the first occurence of item in the array, or -1 if not found */ Array.prototype.indexOf = function(item) { for (var i = 0; i < this.length; i++) { if (this[i] === item) { return i; } } return -1; }; /* Get the last element from the array */ Array.prototype.getLast = function() { return this[this.length-1]; }; /* Remove element with given index (mutates) */ Array.prototype.removeByIndex = function(index) { this.splice(index, 1); }; /* Remove elements with such value (mutates) */ Array.prototype.removeByValue = function(value) { var i, indexes = []; for (i = 0; i < this.length; i++) { if (this[i] === value) { indexes.push(i); } } for (i = indexes.length - 1; i >= 0; i--) { this.splice(indexes[i], 1); } }; /* Push an element at specified index */ Array.prototype.pushAtIndex = function(el, index) { this.splice(index, 0, el); }; /* Strip whitespace from the beginning and end of a string */ String.prototype.trim = function() { return this.replace(/^\s*|\s*$/g, ""); }; /* Count the number of substring occurrences */ String.prototype.substrCount = function(s) { return this.split(s).length - 1; }; // Getting, Setting and Deleteing cookies. // Author: Cezary Tomczak [www.gosu.pl] // Note: name cannot contain 2 chars: =; function Cookie() { this.get = function(name) { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; ++i) { var a = cookies[i].split("="); if (a.length == 2) { a[0] = a[0].trim(); a[1] = a[1].trim(); if (a[0] == name) { return unescape(a[1]); } } } return ""; }; this.set = function(name, value, seconds, path) { var cookie = (name + "=" + escape(value)); if (seconds) { var date = new Date(new Date().getTime()+seconds*1000); cookie += ("; expires="+date.toGMTString()); } cookie += (path ? "; path="+path : ""); document.cookie = cookie; }; this.del = function(name, path) { var cookie = (name + "="); cookie += (path ? "; path="+path : ""); cookie += "; expires=Thu, 01-Jan-70 00:00:01 GMT"; document.cookie = cookie; }; } var COOKIE_MONTH = 3600*24*30; var COOKIE_YEAR = 3600*24*30*12; function getCookie(name) { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; ++i) { var a = cookies[i].split("="); if (a.length == 2) { a[0] = a[0].trim(); a[1] = a[1].trim(); if (a[0] == name) { return unescape(a[1]); } } } return ""; } function setCookie(name, value, seconds, path) { var cookie = (name + "=" + escape(value)); if (seconds) { var date = new Date(new Date().getTime()+seconds*1000); cookie += ("; expires="+date.toGMTString()); } cookie += (path ? "; path="+path : ""); document.cookie = cookie; } function delCookie(name, path) { var cookie = (name + "="); cookie += (path ? "; path="+path : ""); cookie += "; expires=Thu, 01-Jan-70 00:00:01 GMT"; document.cookie = cookie; } function addEvent(obj, event, func) { if (obj.addEventListener) { obj.addEventListener(event, func, false); } else if (obj.attachEvent) { obj.attachEvent("on"+event, func); } } --- NEW FILE: debug.js --- var debugWindow = null; function debug(s, name) { if (!debugWindow) { debugWindow = window.open("", "debugWindow", "width=400,height=500,scrollbars=yes,resizable=yes"); debugWindow.document.write("<pre>"); } if (name) { debugWindow.document.write('<div style="font: 12px sans-serif; font-weight: bold;">'+name+'</div>'); } debugWindow.document.write(s + "\n"); } function debugObject(obj, name) { var s = ''; for (var i in obj) { if (obj[i] && (typeof obj[i] == "object" || typeof obj[i] == "function") && obj[i].toString) { s += "Object." + i + "=" + obj[i].toString().replace(/\n/g, "") + "\n"; } else { s += "Object." + i + "=" + obj[i] + "\n"; } } debug(s, name); } function debugArray(arr, name) { var s = ''; for (var i = 0; i < arr.length; ++i) { s += "Array[" + i + "]=" + arr[i] + "\n"; } debug(s, name); } --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |