зеркало из https://github.com/mozilla/pjs.git
Make XP filepicker's OK button display Open/Save/Select depending on the mode. r=bryner, a=brendan
This commit is contained in:
Родитель
1b378df792
Коммит
ced5bf8e0f
|
@ -85,6 +85,28 @@ function onLoad() {
|
|||
filterMenuList.appendChild(filterPopup);
|
||||
}
|
||||
|
||||
try {
|
||||
var buttonLabel;
|
||||
switch (filePickerMode) {
|
||||
case nsIFilePicker.modeOpen:
|
||||
buttonLabel = bundle.GetStringFromName("openButtonLabel");
|
||||
break;
|
||||
case nsIFilePicker.modeSave:
|
||||
buttonLabel = bundle.GetStringFromName("saveButtonLabel");
|
||||
break;
|
||||
case nsIFilePicker.modeGetFolder:
|
||||
buttonLabel = bundle.GetStringFromName("selectFolderButtonLabel");
|
||||
break;
|
||||
}
|
||||
|
||||
if (buttonLabel) {
|
||||
var okButton = document.getElementById("ok");
|
||||
okButton.setAttribute("value", buttonLabel);
|
||||
}
|
||||
} catch (exception) {
|
||||
// keep it set to "OK"
|
||||
}
|
||||
|
||||
// setup the dialogOverlay.xul button handlers
|
||||
doSetOKCancel(onOK, onCancel);
|
||||
|
||||
|
@ -249,6 +271,7 @@ function onCancel()
|
|||
{
|
||||
// Close the window.
|
||||
retvals.buttonStatus = nsIFilePicker.returnCancel;
|
||||
retvals.file = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,3 +14,6 @@ xulTitle=XUL Files
|
|||
xulFilter=*.xul
|
||||
|
||||
confirmFileReplacing=already exists. Do you want to replace it?
|
||||
openButtonLabel=Open
|
||||
saveButtonLabel=Save
|
||||
selectFolderButtonLabel=Select
|
||||
|
|
Загрузка…
Ссылка в новой задаче