All pastes #827398 Raw Edit

Anonymous

public javascript v1 · immutable
#827398 ·published 2007-12-21 19:09 UTC
rendered paste body
  this.inPlaceEdit_Blur = function(){    var parentTD = this.parentNode;    parentTD.style.background='#33ff00';    var xval = this.value;    var re = new RegExp("(^\[0-9]{1,6}$)");    if((xval == "")){    }    else if(!xval.match(re)){      alert('Value must be numeric.');      return false;    }    parentTD.removeChild(this);    parentTD.innerHTML = xval;//    Event.observe(parentTD, 'dblclick', MonPlanning.inPlaceEdit_DblClick.bind(parentTD));  };  this.inPlaceEdit_DblClick = function(ele){    //Event.stopObserving(ele, 'dblclick', ele.ondblclickListener);//    ele.removeEventListener('dblclick',MonPlanning.inPlaceEdit_DblClick,false);    ele.style.background='#ff3366';    var Inp = document.createElement('input');    Inp.style.width = '100%';    Inp.style.border = '1px';    Inp.style.overflow = 'hidden';    Inp.style.padding = '0px';    Inp.style.margin = '0px';    Inp.style.fontSize = '10px';    Inp.style.fontWeight = 'bold';    Inp.value = (ele.innerHTML);    ele.innerHTML = '';    ele.appendChild(Inp);    Inp.focus();    Event.observe(Inp, 'blur', MonPlanning.inPlaceEdit_Blur.bind(Inp));  };