!import
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 *
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
8 *
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
13 *
14 * The Original Code is Mozilla Communicator client code, released
15 * March 31, 1998.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Dan Haddix
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39 // dialog initialization code
Startup
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
40 function Startup()
41 {
42 gDialog.urlInput = document.getElementById("urlInput");
43 gDialog.targetInput = document.getElementById("targetInput");
44 gDialog.altInput = document.getElementById("altInput");
45 gDialog.commonInput = document.getElementById("commonInput");
46
47 gDialog.hsHref = window.arguments[0].getAttribute("hsHref");
48 if (gDialog.hsHref != '')
49 gDialog.urlInput.value = gDialog.hsHref;
50
51 gDialog.hsAlt = window.arguments[0].getAttribute("hsAlt");
52 if (gDialog.hsAlt != '')
53 gDialog.altInput.value = gDialog.hsAlt;
54
55 gDialog.hsTarget = window.arguments[0].getAttribute("hsTarget");
56 if (gDialog.hsTarget != ''){
57 gDialog.targetInput.value = gDialog.hsTarget;
58 len = gDialog.commonInput.length;
59 for (i=0; i<len; i++){
60 if (gDialog.hsTarget == gDialog.commonInput.options[i].value)
61 gDialog.commonInput.options[i].selected = "true";
62 }
63 }
64
65 SetTextboxFocus(gDialog.urlInput);
66
67 SetWindowLocation();
68 }
69
onAccept
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
70 function onAccept()
71 {
72 dump(window.arguments[0].id+"\n");
73 window.arguments[0].setAttribute("hsHref", gDialog.urlInput.value);
74 window.arguments[0].setAttribute("hsAlt", gDialog.altInput.value);
75 window.arguments[0].setAttribute("hsTarget", gDialog.targetInput.value);
76
77 SaveWindowLocation();
78
79 window.close();
80 }
81
changeTarget
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
82 function changeTarget() {
83 gDialog.targetInput.value=gDialog.commonInput.value;
84 }
85
chooseFile
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
86 function chooseFile()
87 {
88 // Get a local file, converted into URL format
89
90 fileName = GetLocalFileURL("html");
91 if (fileName && fileName != "") {
92 gDialog.urlInput.value = fileName;
93 }
94
95 // Put focus into the input field
96 SetTextboxFocus(gDialog.urlInput);
97 }