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 / FrameOptions.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  2.4 KB  |  95 lines

  1. //
  2. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  3. // ----------------------------------------------------
  4. //
  5. // FrameOptions.js
  6. //
  7. // This command returns a frame title to mm_frameset.js
  8. // when preferences are set for prompting for accessibility 
  9. // frame options. The title is added to the <frame> tag as
  10. // an attribute.
  11. //
  12. // Version 1.0
  13. // 
  14. // ----------------------------------------------------
  15.  
  16.  
  17. var frameNameList=  new Array();
  18. var frameTitleList= new Array();
  19. var globalFormDom= '';
  20. var helpDoc = MM.HELP_objFrameAccessOptions;
  21.  
  22. function commandButtons() {
  23.    return new Array(MM.BTN_OK,         "setAccessibilityStr();window.close()",
  24.                     MM.BTN_Cancel,     "window.close()",
  25.                     MM.BTN_Help,       "displayHelp()"    );
  26.  
  27.  
  28. }
  29.  
  30.  
  31. function isDOMRequired() { 
  32.     // Return false, indicating that this object is available in code view.
  33.     return false;
  34. }
  35.  
  36. function setFormItem(formDom) {
  37.     globalFormDom = formDom;
  38.  
  39. }
  40.  
  41. function setAccessibilityStr()
  42. {
  43.     arrayFrames= globalFormDom.getElementsByTagName('FRAME');
  44.     numFrames= arrayFrames.length; 
  45.  
  46.     for (i=0; i < numFrames; i++){
  47.         if (frameTitleList[i] != '') {arrayFrames[i].setAttribute('title', frameTitleList[i]);}
  48.     }
  49.  
  50. }
  51.  
  52.  
  53.  
  54. ///////////////////////////////////////////////////////////////
  55. // functions
  56. //////////////////////////////////////////////////////////////
  57.  
  58. function initializeUI(){
  59.  
  60.    var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/FrameOptions.htm";
  61.    var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
  62.  
  63.     arrayFrames= globalFormDom.getElementsByTagName('FRAME');
  64.     numFrames= arrayFrames.length; 
  65.  
  66.     for (i=0; i < numFrames; i++){
  67.         
  68.         frameName = arrayFrames[i].getAttribute('name');
  69.         FRAME_LIST.add(frameName);
  70.         frameNameList[i]= frameName;
  71.  
  72.         if (arrayFrames[i].getAttribute('title') == null) 
  73.          {frameTitleList[i]= frameName;}
  74.         else {frameTitleList[i]= arrayFrames[i].getAttribute('title');}
  75.                 
  76.     }
  77.  
  78.     FRAME_LIST.setIndex(i-1);
  79.     document.theForm.frameTitle.value= frameTitleList[i-1];
  80. }
  81.  
  82.  
  83. function updateUI() {
  84.  
  85.     currIndex=FRAME_LIST.getIndex();
  86.     document.theForm.frameTitle.value= frameTitleList[currIndex];
  87. }
  88.  
  89. function updateTitle() {
  90.  
  91.     var currFrameTitle= document.theForm.frameTitle.value;
  92.     var currIndex= FRAME_LIST.getIndex();
  93.     frameTitleList[currIndex]= currFrameTitle;
  94. }
  95.