1
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
14
# The Original Code is Mozilla.org Code.
16
# The Initial Developer of the Original Code is.
17
# Portions created by the Initial Developer are Copyright (C) 2001
18
# the Initial Developer. All Rights Reserved.
21
# Blake Ross <blakeross@telocity.com>
23
# Alternatively, the contents of this file may be used under the terms of
24
# either the GNU General Public License Version 2 or later (the "GPL"), or
25
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26
# in which case the provisions of the GPL or the LGPL are applicable instead
27
# of those above. If you wish to allow use of your version of this file only
28
# under the terms of either the GPL or the LGPL, and not to allow others to
29
# use your version of this file under the terms of the MPL, indicate your
30
# decision by deleting the provisions above and replace them with the notice
31
# and other provisions required by the GPL or the LGPL. If you do not delete
32
# the provisions above, a recipient may use your version of this file under
33
# the terms of any one of the MPL, the GPL or the LGPL.
35
# ***** END LICENSE BLOCK *****
39
const NC_NS = "http://home.netscape.com/NC-rdf#";
40
const rdfSvcContractID = "@mozilla.org/rdf/rdf-service;1";
41
const rdfSvcIID = Components.interfaces.nsIRDFService;
42
var rdfService = Components.classes[rdfSvcContractID].getService(rdfSvcIID);
44
const dlmgrContractID = "@mozilla.org/download-manager;1";
45
const dlmgrIID = Components.interfaces.nsIDownloadManager;
46
var downloadMgr = Components.classes[dlmgrContractID].getService(dlmgrIID);
47
var ds = downloadMgr.datasource;
49
const dateTimeContractID = "@mozilla.org/intl/scriptabledateformat;1";
50
const dateTimeIID = Components.interfaces.nsIScriptableDateFormat;
51
var dateTimeService = Components.classes[dateTimeContractID].getService(dateTimeIID);
53
var resource = rdfService.GetUnicodeResource(window.arguments[0]);
54
var dateStartedRes = rdfService.GetResource(NC_NS + "DateStarted");
55
var dateEndedRes = rdfService.GetResource(NC_NS + "DateEnded");
56
var sourceRes = rdfService.GetResource(NC_NS + "URL");
58
var dateStartedField = document.getElementById("dateStarted");
59
var dateEndedField = document.getElementById("dateEnded");
60
var pathField = document.getElementById("path");
61
var sourceField = document.getElementById("source");
64
var dateStarted = ds.GetTarget(resource, dateStartedRes, true).QueryInterface(Components.interfaces.nsIRDFDate).Value;
65
dateStarted = new Date(dateStarted/1000);
66
dateStarted = dateTimeService.FormatDateTime("", dateTimeService.dateFormatShort, dateTimeService.timeFormatSeconds, dateStarted.getFullYear(), dateStarted.getMonth()+1, dateStarted.getDate(), dateStarted.getHours(), dateStarted.getMinutes(), dateStarted.getSeconds());
67
dateStartedField.setAttribute("value", dateStarted);
73
var dateEnded = ds.GetTarget(resource, dateEndedRes, true).QueryInterface(Components.interfaces.nsIRDFDate).Value;
74
dateEnded = new Date(dateEnded/1000);
75
dateEnded = dateTimeService.FormatDateTime("", dateTimeService.dateFormatShort, dateTimeService.timeFormatSeconds, dateEnded.getFullYear(), dateEnded.getMonth()+1, dateEnded.getDate(), dateEnded.getHours(), dateEnded.getMinutes(), dateEnded.getSeconds());
76
dateEndedField.setAttribute("value", dateEnded);
81
var source = ds.GetTarget(resource, sourceRes, true).QueryInterface(Components.interfaces.nsIRDFResource).Value;
83
pathField.value = window.arguments[0];
84
sourceField.value = source;
86
var dl = window.opener.gDownloadManager.getDownload(window.arguments[0]);
88
document.getElementById("dateEndedRow").hidden = true;
89
document.getElementById("dateEndedSeparator").hidden = true;
92
document.documentElement.getButton("accept").label = document.documentElement.getAttribute("acceptbuttontext");
94
document.documentElement.getButton("accept").focus();
b'\\ No newline at end of file'