rem: FillNamedAnchorList(); dump("11\n"); 
add: FillListboxes(); 
context: function Startup(){  if (!InitEditorShell())    return;  doSetOKCancel(onOK, null);    // Message was wrapped in a <label> or <div>, so actual text is a child text node  linkCaption      = (document.getElementById("linkTextCaption")).firstChild;  linkMessage      = (document.getElementById("linkTextMessage")).firstChild;  linkTextInput    = document.getElementById("linkTextInput");  hrefInput        = document.getElementById("hrefInput");  NamedAnchorList = document.getElementById("NamedAnchorList");  // Get a single selected anchor element  anchorElement = editorShell.GetSelectedElement(tagName);  var selection = editorShell.editorSelection;  if (selection) {    dump("There is a selection: collapsed = "+selection.isCollapsed+"\n");  } else {    dump("Failed to get selection\n");  }  if (anchorElement) {    // We found an element and don't need to insert one    dump("found anchor element\n");    insertNew = false;    // We get the anchor if any of the selection (or just caret)    //  is enclosed by the link. Select the entire link    //  so we can show the selection text    editorShell.SelectElement(anchorElement);    selection = editorShell.editorSelection;  } else {    // See if we have a selected image instead of text    imageElement = editorShell.GetSelectedElement("img");    if (imageElement) {      // See if the image is a child of a link      dump("Image element found - check if its a link...\n");      dump("Image Parent="+parent);      parent = imageElement.parentNode;        dump("Parent="+parent+" nodeName="+parent.nodeName+"\n");      if (parent) {        anchorElement = parent;        insertNew = false;        linkCaption.data = GetString("LinkImage");        // Link source string is the source URL of image        // TODO: THIS STILL DOESN'T HANDLE MULTIPLE SELECTED IMAGES!        linkMessage.data = imageElement.getAttribute("src");;      }    } else {      // We don't have an element selected,       //  so create one with default attributes      dump("Element not selected - calling createElementWithDefaults\n");      anchorElement = editorShell.CreateElementWithDefaults(tagName);dump("1\n");      // We will insert a new link at caret location if there's no selection      // TODO: This isn't entirely correct. If selection doesn't have any text      //   or an image, then shouldn't we clear the selection and insert new text?      insertNew = selection.isCollapsed;dump("2\n");      dump("insertNew is " + insertNew + "\n");      linkCaption.data = GetString("EnterLinkText");dump("3\n");      linkMessage.data = "";dump("4\n");    }  }  if(!anchorElement)  {    dump("Failed to get selected element or create a new one!\n");    window.close();  } else if (!insertNew && !imageElement) {    // Replace the link message with the link source string    selectedText = GetSelectionAsText();dump("5\n");    if (selectedText.length > 0) {      // Use just the first 50 characters and add "..."      selectedText = TruncateStringAtWordEnd(selectedText, 50, true);dump("6\n");    } else {      dump("Selected text for link source not found. Non-text elements selected?\n");    }    linkMessage.data = selectedText;dump("7\n");    // The label above the selected text:    linkCaption.data = GetString("LinkText");  }dump("8\n");  if (!selection.isCollapsed)  {    // HREF is a weird case: If selection extends beyond    //   the link, user probably wants to extend link to     //   entire selection.    // TODO: If there was already a link,     //   we need to know if selection extends beyond existing    //   link text before we should do this    insertLinkAroundSelection = true;    dump("insertLinkAroundSelection is TRUE\n");  }dump("9\n");  // Make a copy to use for AdvancedEdit and onSaveDefault  globalElement = anchorElement.cloneNode(false);dump("10\n");  // Get the list of existing named anchors and headings  FillNamedAnchorList();dump("11\n");  // Set data for the dialog controls  InitDialog();  // Set initial focus  if (insertNew) {    dump("Setting focus to linkTextInput\n");    // We will be using the HREF inputbox, so text message    linkTextInput.focus();  } else {    dump("Setting focus to linkTextInput\n");    hrefInput.focus();    // We will not insert a new link at caret, so remove link text input field    parentNode = linkTextInput.parentNode;    if (parentNode) {      dump("Removing link text input field.\n");      parentNode.removeChild(linkTextInput);      linkTextInput = null;    }  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ec2d4cca1705dd2e02e2804b508e10521106a0df/EdLinkProps.js/clean/editor/ui/dialogs/content/EdLinkProps.js