From 4e273dd5062c54d34c7de3de6890584ce142dd8f Mon Sep 17 00:00:00 2001
From: Nathan Gass
Date: Tue, 13 Dec 2011 13:36:48 +0000
Subject: factor out D() from ED() consistent with php

---
 itjs/it.js | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

(limited to 'itjs')

diff --git a/itjs/it.js b/itjs/it.js
index a48d829..54fa5c7 100644
--- a/itjs/it.js
+++ b/itjs/it.js
@@ -11,16 +11,11 @@ function CED(txt)
 }
 
 /**
- * Add debugging output to element 'jsdebug'
+ * Return string with dump of all arguments
  */
-function ED()
+function D()
 {
-	var element;
 	var text = "";
-
-	if (!(element = document.getElementById('jsdebug')))
-		return; // var element = it_create_element(document.body, 'div', {id:'jsdebug', style:{position:'absolute', left:'100px', top:'10px', opacity:'0.8'}})
-
 	for (var i = 0; i < arguments.length; i++)
 	{
 		var variable = arguments[i];
@@ -48,8 +43,20 @@ function ED()
 
 		text += "\n";
 	}
+	return text;
+}
+
+/**
+ * Add debugging output to element 'jsdebug'
+ */
+function ED()
+{
+	var element;
+
+	if (!(element = document.getElementById('jsdebug')))
+		return; // var element = it_create_element(document.body, 'div', {id:'jsdebug', style:{position:'absolute', left:'100px', top:'10px', opacity:'0.8'}})
 
-	element.innerHTML += '<pre style="background-color:#FEE; margin:0">'  + text + '<' + '/pre>';
+	element.innerHTML += '<pre style="background-color:#FEE; margin:0">'  + D.apply(this, arguments) + '<' + '/pre>';
 }
 
 /**
-- 
cgit v1.2.3