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 / InsertEnt.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  1.6 KB  |  62 lines

  1. // Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. //---------------   GLOBAL VARIABLES   ---------------
  4.  
  5. var helpDoc = MM.HELP_objInsertEntity;
  6.  
  7. //---------------     API FUNCTIONS    ---------------
  8.  
  9. function isDOMRequired() { 
  10.     // Return false, indicating that this object is available in code view.
  11.     return false;
  12. }
  13.  
  14. function commandButtons(){
  15.     return new Array(MM.BTN_OK,        'insertChars()',
  16.                    MM.BTN_Cancel,    'cleanupUI()',
  17.                    MM.BTN_Help,        'displayHelp()');
  18. }
  19.  
  20.  
  21. function canAcceptCommand() {
  22.   return true;
  23. }
  24.  
  25.  
  26. //---------------    LOCAL FUNCTIONS   ---------------
  27.  
  28. // function: initUI
  29. // description: initialize UI and other associated preferences
  30. function initUI() {  
  31. }
  32.  
  33. // function: cleanupUI
  34. // description: 
  35. function cleanupUI() {
  36.   // Exit
  37.   document.entityForm.Insert.childNodes[1].value = '';
  38.   window.close();
  39. }
  40.  
  41. // function: insertChars
  42. // description: Insert selected character and cleanupUI
  43. function insertChars(curChar) {
  44. // As an Object this command uses the return value in Object tag to insert characters.
  45.   window.close();
  46. }
  47.  
  48. // function: objectTag
  49. // description: Return inserted value for an Object
  50. function objectTag() {
  51.   // Return the html tag that should be inserted
  52.   return document.entityForm.Insert.childNodes[1].value;
  53. }
  54.  
  55. //--- Interface Support Functions
  56.  
  57. // Handles selection and display of choosen character in the form field.
  58. function setChar(curChar) {
  59.   // Add the character to the insertion field.
  60.   document.entityForm.Insert.childNodes[1].value = '&' + curChar + ';';
  61. }
  62.