home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet Web Designer 86 / PIWD86.iso / pc / contents / dreamweaver / software / dwmx2004.exe / Disk1 / data1.cab / Configuration_En / Commands / GoToLine.js < prev    next >
Encoding:
Text File  |  2003-09-05  |  578 b   |  27 lines

  1. function commandButtons(){
  2.   return new Array(MM.BTN_OK,     "goToLine()",
  3.                    MM.BTN_Cancel, "window.close()");
  4. }
  5.  
  6. function canAcceptCommand(){
  7.   var retVal = false;
  8.   if (dw.getFocus(true) == 'textView'){
  9.     retVal = true;
  10.   }
  11.   return retVal;
  12. }
  13.  
  14. function goToLine(){
  15.   var dom = dw.getDocumentDOM();
  16.   var lineNum = parseInt(document.forms[0].lineNum.value);
  17.   if (typeof lineNum == 'number' && lineNum > 0){
  18.     dom.source.setCurrentLine(lineNum);
  19.   }
  20.   window.close();
  21. }
  22.  
  23. function initUI(){
  24.   document.forms[0].lineNum.focus();
  25. }
  26.  
  27.