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 / ConfirmDS.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  2.5 KB  |  82 lines

  1. // Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2. var PLATFORM = navigator.platform;
  3. var ICON_URL = (PLATFORM == "Win32") ? "../Shared/MM/Images/alertIconWin.gif" : "../Shared/MM/Images/yield28x28.gif";
  4. var FBUTTON = null;
  5.  
  6. function isDOMRequired() {
  7.     // Return false, indicating that this object is available in code view.
  8.     return false;
  9. }
  10.  
  11. function hideDSCheck()
  12.     {
  13.     document.dsCheck.innerHTML = "";
  14.     }
  15.     
  16. function setIcon(newIcon)
  17.     {
  18.     ICON_URL = newIcon;
  19.     }
  20.     
  21. function render() {
  22.    var btnList="", i;
  23.    document.msg.innerHTML = arguments[0]; //Insert the question
  24.    var b1 = document.theForm.button;
  25.    var b2 = document.theForm.button2;
  26.    if (arguments.length == 3){
  27.      b1.value = arguments[1];
  28.      b1.setAttribute("onClick","setResult('" + arguments[1] + "')");
  29.      b2.value = arguments[2];
  30.      b2.setAttribute("onClick","setResult('" + arguments[2] + "')");
  31.      if (arguments[1] == MM.BTN_Yes || arguments[1] == MM.BTN_OK){
  32.        b1.setAttribute("accessKey", "y");
  33.        b2.setAttribute("accessKey", "n");
  34.        b1.focus();
  35.        FBUTTON = b1;
  36.      }else if (arguments[2] == MM.BTN_Yes || arguments[2] == MM.BTN_OK){
  37.        b1.setAttribute("accessKey", "n");
  38.        b2.setAttribute("accessKey", "y");
  39.        b2.focus();
  40.        FBUTTON = b2;
  41.      }else{
  42.        b1.removeAttribute("accessKey");
  43.        b2.removeAttribute("accessKey");
  44.      }
  45.    }
  46.    else if (arguments.length > 1) {
  47.      for (i=1; i<arguments.length; i++){
  48.        btnList += "<input type='button' value='"+arguments[i]+"' onClick='setResult(\""+arguments[i]+"\")'> ";
  49.      }
  50.      document.btns.innerHTML = btnList;
  51.    }
  52. }
  53.  
  54. function render_array(message, buttons) {
  55.    var btnList="", i;
  56.    document.msg.innerHTML = message; //Insert the question
  57.      for (i=0; i<buttons.length; i++)
  58.        btnList += "<input type='button' value='"+buttons[i]+"' onClick='setResult(\""+buttons[i]+"\")'> ";
  59.      
  60.      document.btns.innerHTML = btnList;
  61. }
  62.  
  63. function setResult(result) {    
  64.    if (typeof MMNotes != 'undefined') { // Set values off of MMNotes object if it exists.
  65.      MMNotes.Confirm_RESULT = result;
  66.      if (typeof(document.cbDoNotAsk) != 'undefined')
  67.              MMNotes.Confirm_DONOTSHOW = document.cbDoNotAsk.checked;
  68.      else
  69.              MMNotes.Confirm_DONOTSHOW = false; 
  70.    }
  71.    window.close();
  72. }
  73.  
  74. function initialize()
  75. {
  76.      // Use the right icon for the platform.
  77.      document.confirmIcon.src = ICON_URL;
  78.      if (FBUTTON){
  79.        FBUTTON.focus();
  80.      }
  81. }
  82.