Diff for /zogiLib/js/dllib.js between versions 1.5 and 1.6

version 1.5, 2004/11/03 15:24:46 version 1.6, 2005/11/08 10:13:31
Line 186  function bestPicSize(elem, inset) { Line 186  function bestPicSize(elem, inset) {
     return ws;      return ws;
 }  }
   
   function setDLParam(e, s) {
       // sets parameter based on HTML event
       var nam;
       var val;
       if (s.type && (s.type == "select-one")) {
           nam = s.name;
           val = s.options[s.selectedIndex].value;
       } else if (s.name && s.value) {
           nam = s.name;
           val = s.value;
       }
       if (nam && val) {
           setParameter(nam, val);
           display();
       } else {
           alert("unable to process event!");
       }
       return true;
   }
   
   
 /* **********************************************  /* **********************************************
  *     digilib specific routines   *     digilib specific routines
Line 462  function moveCenter() { Line 482  function moveCenter() {
 }  }
   
 function moveBy(movx, movy) {  function moveBy(movx, movy) {
     // move visible area by movx and movy (in units of dw, dh)      // move visible area by movx and movy (in units of ww, wh)
     if ((dlArea.width == 1.0)&&(dlArea.height == 1.0)) {      if ((dlArea.width == 1.0)&&(dlArea.height == 1.0)) {
     // nothing to do      // nothing to do
     return;      return;
Line 477  function moveBy(movx, movy) { Line 497  function moveBy(movx, movy) {
     display();      display();
 }  }
   
       
   
   
 function getRef() {  function getRef() {
     // returns a reference to the current digilib set      // returns a reference to the current digilib set
     if (! baseUrl) {      if (! baseUrl) {
Line 500  function getRefWin(type, msg) { Line 517  function getRefWin(type, msg) {
     }      }
     prompt(msg, getRef());      prompt(msg, getRef());
 }  }
   
   function getQuality() {
       // returns the current q setting
       for (var i = 0; i < 3; i++) {
           if (hasFlag("q"+i)) {
               return i;
           }
       }
       return 1
   }
   
   function setQuality(qual) {
       // set the image quality
       for (var i = 0; i < 3; i++) {
           removeFlag("q"+i);
           if (i == qual) {
               addFlag("q"+i);
           }
       }
       setParameter("mo", getAllFlags());
       display();
   }    
   
   function setQualityWin(msg) {
       // dialog for setting quality
       if (! msg) {
           msg = "Quality (0..2)";
       }
       var q = getQuality();
       var newq = window.prompt(msg, q);
       if (newq) {
           setQuality(newq);
       }
   }
   
   function mirror(dir) {
       // mirror the image horizontally or vertically
       if (dir == "h") {
           toggleFlag("hmir");
       } else {
           toggleFlag("vmir");
       }
       setParameter("mo", getAllFlags());
       display();
   }
   
   function gotoPage(gopage) {
       // goto given page nr (+/- relative)
       setParameter("pn", gopage);
       var pn = parseInt(getParameter("pn"));
       if (pn < 1) {
           pn = 1;
           setParameter("pn", pn);
       }
       // TODO: check for last page
       display(1);
   }
   
   function gotoPageWin() {
       // dialog to ask for new page nr
       var pn = getParameter('pn');
       var gopage = window.prompt("Go to page", pn);
       if (gopage) {
           gotoPage(gopage);
       }
   }
   
   function setParamWin(param, text) {
       // dialog to ask for new parameter value
       var val = getParameter(param);
       var newval = window.prompt(text, val);
       if (newval) {
           setParameter(param, newval);
           display();
       }
   }
   
   function showOptions(show) {
       // show or hide option div
       var elem = getElement("dloptions");
       showElement(elem, show);
   }
   

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>