home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 July / 07_02.iso / software / mdmx / files / DreamweaverMXInstaller.exe / Disk1 / data1.cab / Configuration_En / Commands / AppletOptions.js < prev    next >
Encoding:
JavaScript  |  2002-05-01  |  1.9 KB  |  84 lines

  1. //
  2. // Copyright 2002 Macromedia, Inc. All rights reserved.
  3. // ----------------------------------------------------
  4. //
  5. // Accessibility.js
  6. //
  7. // This command adds 
  8. // 
  9. //
  10. // Version 1.0
  11. // Added functions...
  12. // ----------------------------------------------------
  13.  
  14.  
  15. var golbalFormItem;
  16. var returnTag='';
  17. var helpDoc = MM.HELP_objAppletAccessOptions;
  18.  
  19. function commandButtons() {
  20.    return new Array(MM.BTN_OK,         "setAppletStr();window.close()",
  21.                     MM.BTN_Cancel,     "window.close()",
  22.                     MM.BTN_Help,       "displayHelp()"    );
  23.  
  24.  
  25. }
  26.  
  27. function isDOMRequired() { 
  28.     // Return false, indicating that this object is available in code view.
  29.     return false;
  30. }
  31.  
  32. function setFormItem(formItem) {
  33.     globalFormItem = formItem;
  34.     returnTag = globalFormItem;
  35. }
  36.  
  37. function setAppletStr()
  38. {
  39.     var rtnStr='';
  40.  
  41.     rtnStr= globalFormItem;
  42.  
  43.  
  44. ////////////////////////////////////////////////////////////////
  45. // Attributes: Compose rtnStr with the attributes that have a value
  46. // Possible attributes are: alt and title
  47.  
  48.  
  49. // if alt attribute has a value, apply it to the initStr
  50.  
  51.     var altValue = document.forms[0].altField.value;
  52.     if (altValue != ""){
  53.         rtnStr = addAttribute("alt", altValue, rtnStr);
  54.     }
  55.  
  56. // if title attribute has a value, apply it to the initStr
  57.  
  58.     var titleValue = document.forms[0].titleField.value;
  59.  
  60.     if (titleValue != ""){ 
  61.         rtnStr= addAttribute("title", titleValue, rtnStr);
  62.     }
  63.  
  64.     returnTag= rtnStr;
  65. }
  66.  
  67. function returnAccessibilityStr () {
  68.  
  69.     return returnTag;
  70. }
  71.  
  72. ///////////////////////////////////////////////////////////////
  73. // other functions
  74. //////////////////////////////////////////////////////////////
  75.  
  76.  
  77. function addAttribute(attName, attVal, initStr){
  78.  
  79.     arrayElem= initStr.split(">");
  80.     rtnStr= arrayElem[0] + " " + attName + "=" + '\"' + attVal + '\"' + ">" + arrayElem[1] + ">";
  81.     
  82.     return rtnStr;
  83. }
  84.