2004-04-18 18:21:17 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-03-22 03:59:29 +03:00
|
|
|
*
|
2004-04-18 18:21:17 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2001-03-22 03:59:29 +03:00
|
|
|
*
|
2001-09-20 04:02:59 +04:00
|
|
|
* The Original Code is Mozilla Communicator client code, released
|
|
|
|
* March 31, 1998.
|
2001-03-22 03:59:29 +03:00
|
|
|
*
|
2004-04-18 18:21:17 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998-2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-03-22 03:59:29 +03:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
2001-09-20 04:02:59 +04:00
|
|
|
* Dan Haddix
|
2004-04-18 18:21:17 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-10-27 01:27:05 +04:00
|
|
|
|
|
|
|
// dialog initialization code
|
|
|
|
function Startup()
|
|
|
|
{
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.urlInput = document.getElementById("urlInput");
|
|
|
|
gDialog.targetInput = document.getElementById("targetInput");
|
|
|
|
gDialog.altInput = document.getElementById("altInput");
|
|
|
|
gDialog.commonInput = document.getElementById("commonInput");
|
1999-10-27 01:27:05 +04:00
|
|
|
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.hsHref = window.arguments[0].getAttribute("hsHref");
|
|
|
|
if (gDialog.hsHref != '')
|
|
|
|
gDialog.urlInput.value = gDialog.hsHref;
|
1999-10-27 01:27:05 +04:00
|
|
|
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.hsAlt = window.arguments[0].getAttribute("hsAlt");
|
|
|
|
if (gDialog.hsAlt != '')
|
|
|
|
gDialog.altInput.value = gDialog.hsAlt;
|
1999-10-27 01:27:05 +04:00
|
|
|
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.hsTarget = window.arguments[0].getAttribute("hsTarget");
|
|
|
|
if (gDialog.hsTarget != ''){
|
|
|
|
gDialog.targetInput.value = gDialog.hsTarget;
|
|
|
|
len = gDialog.commonInput.length;
|
2000-03-21 15:52:05 +03:00
|
|
|
for (i=0; i<len; i++){
|
2001-10-11 00:07:06 +04:00
|
|
|
if (gDialog.hsTarget == gDialog.commonInput.options[i].value)
|
|
|
|
gDialog.commonInput.options[i].selected = "true";
|
2000-03-21 15:52:05 +03:00
|
|
|
}
|
|
|
|
}
|
1999-10-27 01:27:05 +04:00
|
|
|
|
2001-10-11 00:07:06 +04:00
|
|
|
SetTextboxFocus(gDialog.urlInput);
|
Fixed lots of nsbeta3+ bugs: 45756, 47654, 41810,47503,48990, 48995,40204, 42740, 46953, 47646, 47696, 48693, 45899. r=sfraser,jfrancis
2000-08-23 04:29:24 +04:00
|
|
|
|
|
|
|
SetWindowLocation();
|
1999-10-27 01:27:05 +04:00
|
|
|
}
|
|
|
|
|
2001-12-07 07:38:52 +03:00
|
|
|
function onAccept()
|
1999-10-27 01:27:05 +04:00
|
|
|
{
|
|
|
|
dump(window.arguments[0].id+"\n");
|
2001-10-11 00:07:06 +04:00
|
|
|
window.arguments[0].setAttribute("hsHref", gDialog.urlInput.value);
|
|
|
|
window.arguments[0].setAttribute("hsAlt", gDialog.altInput.value);
|
|
|
|
window.arguments[0].setAttribute("hsTarget", gDialog.targetInput.value);
|
Fixed lots of nsbeta3+ bugs: 45756, 47654, 41810,47503,48990, 48995,40204, 42740, 46953, 47646, 47696, 48693, 45899. r=sfraser,jfrancis
2000-08-23 04:29:24 +04:00
|
|
|
|
|
|
|
SaveWindowLocation();
|
|
|
|
|
1999-10-27 01:27:05 +04:00
|
|
|
window.close();
|
2000-03-21 15:52:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function changeTarget() {
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.targetInput.value=gDialog.commonInput.value;
|
2000-03-21 15:52:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function chooseFile()
|
|
|
|
{
|
|
|
|
// Get a local file, converted into URL format
|
|
|
|
|
2001-05-03 04:29:22 +04:00
|
|
|
fileName = GetLocalFileURL("html");
|
2000-03-21 15:52:05 +03:00
|
|
|
if (fileName && fileName != "") {
|
2001-10-11 00:07:06 +04:00
|
|
|
gDialog.urlInput.value = fileName;
|
2000-03-21 15:52:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Put focus into the input field
|
2001-10-11 00:07:06 +04:00
|
|
|
SetTextboxFocus(gDialog.urlInput);
|
2001-03-22 03:15:47 +03:00
|
|
|
}
|