You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/10/19 21:30:44 UTC
svn commit: r465897 -
/incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
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, '&').replace(/</g, '<').replace(/>/g, '>');
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,