home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-macos9-1.3.1.sea.bin / Mozilla1.3.1 / Chrome / comm.jar / content / editor / EdImageMapHotSpot.js < prev    next >
Text File  |  2003-06-08  |  2KB  |  83 lines

  1. /*
  2.  * The contents of this file are subject to the Netscape Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/NPL/
  6.  *
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  *
  12.  * The Original Code is Mozilla Communicator client code, released
  13.  * March 31, 1998.
  14.  *
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corporation. Portions created by Netscape are
  17.  * Copyright (C) 1998-2000 Netscape Communications Corporation. All
  18.  * Rights Reserved.
  19.  *
  20.  * Contributor(s):
  21.  *   Dan Haddix
  22.  */
  23.  
  24. // dialog initialization code
  25. function Startup()
  26. {
  27.   gDialog.urlInput = document.getElementById("urlInput");
  28.   gDialog.targetInput = document.getElementById("targetInput");
  29.   gDialog.altInput = document.getElementById("altInput");
  30.   gDialog.commonInput = document.getElementById("commonInput");
  31.  
  32.   gDialog.hsHref = window.arguments[0].getAttribute("hsHref");
  33.   if (gDialog.hsHref != '')
  34.     gDialog.urlInput.value = gDialog.hsHref;
  35.  
  36.   gDialog.hsAlt = window.arguments[0].getAttribute("hsAlt");
  37.   if (gDialog.hsAlt != '')
  38.     gDialog.altInput.value = gDialog.hsAlt;
  39.  
  40.   gDialog.hsTarget = window.arguments[0].getAttribute("hsTarget");
  41.   if (gDialog.hsTarget != ''){
  42.     gDialog.targetInput.value = gDialog.hsTarget;
  43.     len = gDialog.commonInput.length;
  44.     for (i=0; i<len; i++){
  45.       if (gDialog.hsTarget == gDialog.commonInput.options[i].value)
  46.         gDialog.commonInput.options[i].selected = "true";
  47.     }
  48.   }
  49.  
  50.   SetTextboxFocus(gDialog.urlInput);
  51.  
  52.   SetWindowLocation();
  53. }
  54.  
  55. function onAccept()
  56. {
  57.   dump(window.arguments[0].id+"\n");
  58.   window.arguments[0].setAttribute("hsHref", gDialog.urlInput.value);
  59.   window.arguments[0].setAttribute("hsAlt", gDialog.altInput.value);
  60.   window.arguments[0].setAttribute("hsTarget", gDialog.targetInput.value);
  61.  
  62.   SaveWindowLocation();
  63.  
  64.   window.close();
  65. }
  66.  
  67. function changeTarget() {
  68.   gDialog.targetInput.value=gDialog.commonInput.value;
  69. }
  70.  
  71. function chooseFile()
  72. {
  73.   // Get a local file, converted into URL format
  74.  
  75.   fileName = GetLocalFileURL("html");
  76.   if (fileName && fileName != "") {
  77.     gDialog.urlInput.value = fileName;
  78.   }
  79.  
  80.   // Put focus into the input field
  81.   SetTextboxFocus(gDialog.urlInput);
  82. }
  83.