home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / code / contr / setup.exe / Disk1 / data1.cab / Configuration_En / Commands / InsertEnt.js < prev    next >
Encoding:
JavaScript  |  2003-07-18  |  1.8 KB  |  69 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.     return new Array( "PutButtonsOnBottom", 
  21.                       "OkButton", MM.BTN_OK, "insertChars()",
  22.                       "CancelButton", MM.BTN_Cancel, "cleanupUI()",
  23.                       "PutButtonOnLeft", MM.BTN_Help,    "displayHelp()");
  24.  
  25. }
  26.  
  27.  
  28. function canAcceptCommand() {
  29.   return true;
  30. }
  31.  
  32.  
  33. //---------------    LOCAL FUNCTIONS   ---------------
  34.  
  35. // function: initUI
  36. // description: initialize UI and other associated preferences
  37. function initUI() {  
  38. }
  39.  
  40. // function: cleanupUI
  41. // description: 
  42. function cleanupUI() {
  43.   // Exit
  44.   document.entityForm.Insert.childNodes[1].value = '';
  45.   window.close();
  46. }
  47.  
  48. // function: insertChars
  49. // description: Insert selected character and cleanupUI
  50. function insertChars(curChar) {
  51. // As an Object this command uses the return value in Object tag to insert characters.
  52.   window.close();
  53. }
  54.  
  55. // function: objectTag
  56. // description: Return inserted value for an Object
  57. function objectTag() {
  58.   // Return the html tag that should be inserted
  59.   return document.entityForm.Insert.childNodes[1].value;
  60. }
  61.  
  62. //--- Interface Support Functions
  63.  
  64. // Handles selection and display of choosen character in the form field.
  65. function setChar(curChar) {
  66.   // Add the character to the insertion field.
  67.   document.entityForm.Insert.childNodes[1].value = '&' + curChar + ';';
  68. }
  69.