2 lines
662 B
JavaScript
2 lines
662 B
JavaScript
(function(){var b,g=YAHOO.util.Event;YAHOO.namespace("YAHOO.WebGUI");YAHOO.WebGUI.CodeArea=function(a){this.el=a};b=YAHOO.WebGUI.CodeArea.prototype;b.draw=function(){var a=this.el;if(typeof a==="string")a=this.el=document.getElementById(a);a.style.fontFamily="monospace"};b.render=function(){this.draw();this.bind()};b.bind=function(){(new YAHOO.util.KeyListener(this.el,{keys:9},{fn:this.onTab,scope:this,correctScope:true})).enable()};b.onTab=function(a,c){a=this.el;c=c[1];var f=a.selectionStart,d=
|
|
a.selectionEnd,h=a.scrollTop,e=a.value;d=e.slice(0,f)+"\t"+e.slice(d,e.length);a.value=d;a.selectionStart=a.selectionEnd=f+1;a.scrollTop=h;g.stopEvent(c)}})();
|