incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r465897 - /incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
Date Thu, 19 Oct 2006 21:30:44 GMT
Author: mturyn
Date: Thu Oct 19 14:30:43 2006
New Revision: 465897

URL: http://svn.apache.org/viewvc?view=rev&rev=465897
Log:
Added a way to clear the log pane (double-click), and now it now highlights last entry for
better visual focus.

Modified:
    incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js

Modified: incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js?view=diff&rev=465897&r1=465896&r2=465897
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js Thu Oct 19 14:30:43
2006
@@ -33,19 +33,29 @@
 	    l.style.backgroundColor = '#f0f0f0';
 	    l.style.border = '1px solid gray';
 	    l.style.fontSize = '10px';
+//	    l.style.fontWeight = 'bold';	    
 	    l.style.padding = '5px';
 	    document.body.appendChild(l);
 	    this._logDiv = l;
+		dojo.event.connect(this._logDiv, "ondblclick",this,"clearLog");	  	    
+	    this._logDiv.innerHTML="[Double-click to clear.]<br/><br/>" ; 
 	}
 	
 	text = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g,
'&gt;');
 	text = text.replace(/\n/g,'<br>');
-	this._logDiv.innerHTML = this._logDiv.innerHTML + "<br><br>" + text;
+	this._logDiv.innerHTML = this._logDiv.innerHTML.replace(/<[/]*b>/g,"")
+		 + "<br/><br/><b>" + text+"</b>";
 	if (this._logDiv.innerHTML.length>5000){
       	this._logDiv.innerHTML = this._logDiv.innerHTML.substring(this._logDiv.innerHTML.length-5000);
 	}
 	this._logDiv.scrollTop = this._logDiv.scrollHeight;
 	
+}
+
+AttributeTester.prototype.clearLog = function(){
+	if (this._logDiv){
+		this._logDiv.innerHTML = "" ;	
+	}
 }
 
 //IMPORTANT this works if you remove the same thing twice,



Mime
View raw message