зеркало из https://github.com/mozilla/pjs.git
b=210948 Some file dialogs have harcoded filter description
patch from Vincent B�ron r=kaie sr=brendan
This commit is contained in:
Родитель
f82f7c9d38
Коммит
2dc27003e2
|
@ -1,39 +0,0 @@
|
||||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
|
||||||
var gFileBox;
|
|
||||||
var gData;
|
|
||||||
|
|
||||||
function Init() {
|
|
||||||
doSetOKCancel(onOK);
|
|
||||||
|
|
||||||
gFileBox = document.getElementById("czFileBox");
|
|
||||||
|
|
||||||
if ("arguments" in window && window.arguments[0]) {
|
|
||||||
gData = window.arguments[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
gFileBox.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onChooseFile() {
|
|
||||||
try {
|
|
||||||
var flClass = Components.classes["@mozilla.org/filepicker;1"];
|
|
||||||
var fp = flClass.createInstance(nsIFilePicker);
|
|
||||||
fp.init(window, "Choose a JavaScript script", nsIFilePicker.modeOpen);
|
|
||||||
|
|
||||||
fp.appendFilter("JavaScript script (*.js)", "*.js");
|
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
|
||||||
|
|
||||||
if (fp.show() == nsIFilePicker.returnOK && fp.fileURL.spec
|
|
||||||
&& fp.fileURL.spec.length > 0)
|
|
||||||
gFileBox.value = fp.fileURL.spec;
|
|
||||||
}
|
|
||||||
catch(ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onOK() {
|
|
||||||
gData.url = gFileBox.value;
|
|
||||||
gData.ok = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -254,7 +254,8 @@ function backupCerts()
|
||||||
fp.init(window,
|
fp.init(window,
|
||||||
bundle.GetStringFromName("chooseP12BackupFileDialog"),
|
bundle.GetStringFromName("chooseP12BackupFileDialog"),
|
||||||
nsIFilePicker.modeSave);
|
nsIFilePicker.modeSave);
|
||||||
fp.appendFilter("PKCS12 Files", "*.p12");
|
fp.appendFilter(bundle.GetStringFromName("file_browse_PKCS12_spec"),
|
||||||
|
"*.p12");
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
fp.appendFilters(nsIFilePicker.filterAll);
|
||||||
var rv = fp.show();
|
var rv = fp.show();
|
||||||
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
|
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
|
||||||
|
@ -301,7 +302,8 @@ function restoreCerts()
|
||||||
fp.init(window,
|
fp.init(window,
|
||||||
bundle.GetStringFromName("chooseP12RestoreFileDialog"),
|
bundle.GetStringFromName("chooseP12RestoreFileDialog"),
|
||||||
nsIFilePicker.modeOpen);
|
nsIFilePicker.modeOpen);
|
||||||
fp.appendFilter("PKCS12 Files", "*.p12; *.pfx");
|
fp.appendFilter(bundle.GetStringFromName("file_browse_PKCS12_spec"),
|
||||||
|
"*.p12; *.pfx");
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
fp.appendFilters(nsIFilePicker.filterAll);
|
||||||
if (fp.show() == nsIFilePicker.returnOK) {
|
if (fp.show() == nsIFilePicker.returnOK) {
|
||||||
certdb.importPKCS12File(null, fp.file);
|
certdb.importPKCS12File(null, fp.file);
|
||||||
|
@ -420,7 +422,8 @@ function addCACerts()
|
||||||
fp.init(window,
|
fp.init(window,
|
||||||
bundle.GetStringFromName("importCACertsPrompt"),
|
bundle.GetStringFromName("importCACertsPrompt"),
|
||||||
nsIFilePicker.modeOpen);
|
nsIFilePicker.modeOpen);
|
||||||
fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der");
|
fp.appendFilter(bundle.GetStringFromName("file_browse_Certificate_spec"),
|
||||||
|
"*.crt; *.cert; *.cer; *.pem; *.der");
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
fp.appendFilters(nsIFilePicker.filterAll);
|
||||||
if (fp.show() == nsIFilePicker.returnOK) {
|
if (fp.show() == nsIFilePicker.returnOK) {
|
||||||
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.CA_CERT);
|
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.CA_CERT);
|
||||||
|
@ -436,7 +439,8 @@ function addEmailCert()
|
||||||
fp.init(window,
|
fp.init(window,
|
||||||
bundle.GetStringFromName("importEmailCertPrompt"),
|
bundle.GetStringFromName("importEmailCertPrompt"),
|
||||||
nsIFilePicker.modeOpen);
|
nsIFilePicker.modeOpen);
|
||||||
fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der");
|
fp.appendFilter(bundle.GetStringFromName("file_browse_Certificate_spec"),
|
||||||
|
"*.crt; *.cert; *.cer; *.pem; *.der");
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
fp.appendFilters(nsIFilePicker.filterAll);
|
||||||
if (fp.show() == nsIFilePicker.returnOK) {
|
if (fp.show() == nsIFilePicker.returnOK) {
|
||||||
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.EMAIL_CERT);
|
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.EMAIL_CERT);
|
||||||
|
@ -456,7 +460,8 @@ function addWebSiteCert()
|
||||||
fp.init(window,
|
fp.init(window,
|
||||||
bundle.GetStringFromName("importWebSiteCertPrompt"),
|
bundle.GetStringFromName("importWebSiteCertPrompt"),
|
||||||
nsIFilePicker.modeOpen);
|
nsIFilePicker.modeOpen);
|
||||||
fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der");
|
fp.appendFilter(bundle.GetStringFromName("file_browse_Certificate_spec"),
|
||||||
|
"*.crt; *.cert; *.cer; *.pem; *.der");
|
||||||
fp.appendFilters(nsIFilePicker.filterAll);
|
fp.appendFilters(nsIFilePicker.filterAll);
|
||||||
if (fp.show() == nsIFilePicker.returnOK) {
|
if (fp.show() == nsIFilePicker.returnOK) {
|
||||||
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.SERVER_CERT);
|
certdb.importCertsFromFile(null, fp.file, nsIX509Cert.SERVER_CERT);
|
||||||
|
|
|
@ -62,6 +62,7 @@ deleteEmailCertTitle=Delete E-Mail Certificates
|
||||||
#PKCS#12 file dialogs
|
#PKCS#12 file dialogs
|
||||||
chooseP12RestoreFileDialog=File Name to Restore
|
chooseP12RestoreFileDialog=File Name to Restore
|
||||||
chooseP12BackupFileDialog=File Name to Backup
|
chooseP12BackupFileDialog=File Name to Backup
|
||||||
|
file_browse_PKCS12_spec=PKCS12 Files
|
||||||
|
|
||||||
#Mismatch Domain Dialg
|
#Mismatch Domain Dialg
|
||||||
mismatchDomainMsg1=You have attempted to establish a connection with "%S". However, the security certificate presented belongs to "%S". It is possible, though unlikely, that someone may be trying to intercept your communication with this web site.
|
mismatchDomainMsg1=You have attempted to establish a connection with "%S". However, the security certificate presented belongs to "%S". It is possible, though unlikely, that someone may be trying to intercept your communication with this web site.
|
||||||
|
@ -173,3 +174,4 @@ crlAutoupdateFailed=Failed
|
||||||
importEmailCertPrompt=Select File containing somebody's Email certificate to import
|
importEmailCertPrompt=Select File containing somebody's Email certificate to import
|
||||||
importCACertsPrompt=Select File containing CA certificate(s) to import
|
importCACertsPrompt=Select File containing CA certificate(s) to import
|
||||||
importWebSiteCertPrompt=Select File containing Web Site certificate to import
|
importWebSiteCertPrompt=Select File containing Web Site certificate to import
|
||||||
|
file_browse_Certificate_spec=Certificate Files
|
||||||
|
|
Загрузка…
Ссылка в новой задаче