add:  gOriginalSrc = dialog.srcInput.value;  
context: function Startup(){  //XXX Very weird! When calling this with an existing image,  //    we get called twice. That causes dialog layout  //    to explode to fullscreen!  if (StartupCalled)  {    dump("*** CALLING IMAGE DIALOG Startup() AGAIN! ***\n");    return;  }  StartupCalled = true;  if (!InitEditorShell())    return;  doSetOKCancel(onOK, onCancel);  // Create dialog object to store controls for easy access  dialog = new Object;  dialog.srcInput          = document.getElementById( "srcInput" );  dialog.altTextInput      = document.getElementById( "altTextInput" );  dialog.MoreFewerButton   = document.getElementById( "MoreFewerButton" );  dialog.AdvancedEditButton = document.getElementById( "AdvancedEditButton" );  dialog.AdvancedEditButton2 = document.getElementById( "AdvancedEditButton2" );  dialog.MoreSection       = document.getElementById( "MoreSection" );  dialog.customSizeRadio   = document.getElementById( "customSizeRadio" );  dialog.actualSizeRadio = document.getElementById( "actualSizeRadio" );  dialog.constrainCheckbox = document.getElementById( "constrainCheckbox" );  dialog.widthInput        = document.getElementById( "widthInput" );  dialog.heightInput       = document.getElementById( "heightInput" );  dialog.widthUnitsMenulist   = document.getElementById( "widthUnitsMenulist" );  dialog.heightUnitsMenulist  = document.getElementById( "heightUnitsMenulist" );  dialog.imagelrInput      = document.getElementById( "imageleftrightInput" );  dialog.imagetbInput      = document.getElementById( "imagetopbottomInput" );  dialog.border            = document.getElementById( "border" );  dialog.alignTypeSelect   = document.getElementById( "alignTypeSelect" );  dialog.alignImage        = document.getElementById( "alignImage" );  dialog.alignText         = document.getElementById( "alignText" );  dialog.editImageMap      = document.getElementById( "editImageMap" );  dialog.removeImageMap    = document.getElementById( "removeImageMap" );  dialog.ImageHolder       = document.getElementById( "preview-image-holder" );  dialog.PreviewImage      = document.getElementById( "preview-image" );  dialog.PreviewBox        = document.getElementById( "preview-image-box" );  dialog.PreviewWidth      = document.getElementById( "PreviewWidth" );  dialog.PreviewHeight     = document.getElementById( "PreviewHeight" );  dialog.PreviewSize       = document.getElementById( "PreviewSize" );  // Get a single selected image element  var tagName = "img"  imageElement = editorShell.GetSelectedElement(tagName);  if (imageElement)  {    // We found an element and don't need to insert one    insertNew = false;    actualWidth  = imageElement.naturalWidth;    actualHeight = imageElement.naturalHeight;  }  else  {    insertNew = true;    // We don't have an element selected,    //  so create one with default attributes    imageElement = editorShell.CreateElementWithDefaults(tagName);    if( !imageElement )    {      dump("Failed to get selected element or create a new one!\n");      window.close();      return;    }  }  // Make a copy to use for AdvancedEdit  globalElement = imageElement.cloneNode(false);  // Get image map for image  var usemap = globalElement.getAttribute("usemap");  if (usemap)  {    var mapname = usemap.substring(1, usemap.length);    var mapCollection = editorShell.editorDocument.getElementsByName(mapname);    if (mapCollection[0] != null)    {      imageMap = mapCollection[0];      globalMap = imageMap;      canRemoveImageMap = true;      insertNewIMap = false;    }    else    {      insertNewIMap = true;      globalMap = null;    }  }  else  {    insertNewIMap = true;    globalMap = null;  }  InitDialog();  // By default turn constrain on, but both width and height must be in pixels  dialog.constrainCheckbox.checked =    dialog.widthUnitsMenulist.selectedIndex == 0 &&    dialog.heightUnitsMenulist.selectedIndex == 0;  // Set SeeMore bool to the OPPOSITE of the current state,  //   which is automatically saved by using the 'persist="more"'  //   attribute on the MoreFewerButton button  //   onMoreFewer will toggle the state and redraw the dialog  SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1");  // Initialize widgets with image attributes in the case where the entire dialog isn't visible  onMoreFewer();  // this call will initialize all widgets if entire dialog is visible  SetTextboxFocus(dialog.srcInput);  SetWindowLocation();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/492a58807eb0b22f626c1b330360545f64d5e70f/EdImageProps.js/buggy/editor/ui/dialogs/content/EdImageProps.js