Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1425 → Rev 1426

/mozilla/nomodal/trunk/src/components/Prompt.js
19,6 → 19,10
.getService(Components.interfaces.nsIStringBundleService);
this.commonBundle = stringBundleService.createBundle("chrome://global/locale/commonDialogs.properties");
this.promptBundle = stringBundleService.createBundle("chrome://global/locale/prompts.properties");
 
this.origin = Components.classesByID["{a2112d6a-0e28-421f-b46a-25c0b308cbd0}"]
.getService(Components.interfaces.nsIPromptService);
this.origin.QueryInterface(Components.interfaces.nsIPromptService2);
}
NoModal_Prompt.prototype = {
classDescription: "NoModal_Prompt",
190,6 → 194,10
// interface nsIPromptService
alert: function(aParent, aDialogTitle, aText)
{
if(!this.isEnabled(aParent, 'alert')) {
return this.origin.alert(aParent, aDialogTitle, aText);
}
 
this.alertCheck(aParent, aDialogTitle, aText, null, null);
},
 
197,6 → 205,10
// interface nsIPromptService
alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'alertCheck')) {
return this.origin.alertCheck(aParent, aDialogTitle, aText, aCheckMsg, aCheckState);
}
 
var params = {
dialogTitleKey: "Alert",
dialogTitle: aDialogTitle,
228,6 → 240,10
// interface nsIPromptService
confirm: function(aParent, aDialogTitle, aText)
{
if(!this.isEnabled(aParent, 'confirm')) {
return this.origin.confirm(aParent, aDialogTitle, aText);
}
 
var params = {
dialogTitleKey: "Confirm",
dialogTitle: aDialogTitle,
251,6 → 267,10
// interface nsIPromptService
confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'confirmCheck')) {
return this.origin.confirmCheck(aParent, aDialogTitle, aText, aCheckMsg, aCheckState);
}
 
var params = {
dialogTitleKey: "ConfirmCheck",
dialogTitle: aDialogTitle,
285,6 → 305,11
confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title,
aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'confirmEx')) {
return this.origin.confirmEx(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title,
aButton2Title, aCheckMsg, aCheckState);
}
 
var params = {
dialogTitleKey: "Confirm",
dialogTitle: aDialogTitle,
360,6 → 385,10
// interface nsIPromptService
prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'prompt')) {
return this.origin.prompt(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState);
}
 
var params = {
dialogTitleKey: "Prompt",
dialogTitle: aDialogTitle,
396,6 → 425,11
// interface nsIPromptService
promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'promptUsernameAndPassword')) {
return this.origin.promptUsernameAndPassword(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg,
aCheckState);
}
 
var params = {
dialogTitleKey: "PromptUsernameAndPassword2",
dialogTitle: aDialogTitle,
434,6 → 468,10
// interface nsIPromptService
promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState)
{
if(!this.isEnabled(aParent, 'promptPassword')) {
return this.origin.promptPassword(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState);
}
 
var params = {
dialogTitleKey: "PromptPassword2",
dialogTitle: aDialogTitle,
471,6 → 509,10
// interface nsIPromptService
select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection)
{
if(!this.isEnabled(aParent, 'select')) {
return this.origin.select(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection);
}
 
// note: the selectDialog.xul uses another params numbering
if(!aDialogTitle) {
aDialogTitle = this.commonBundle.GetStringFromName("Select");
503,6 → 545,10
// interface nsIPromptService2
promptAuth: function(aParent, aChannel, level, authInfo, checkboxLabel, checkValue)
{
if(!this.isEnabled(aParent, 'promptAuth')) {
return this.origin.promptAuth(aParent, aChannel, level, authInfo, checkboxLabel, checkValue);
}
 
return this.promptPasswordAdapter(aParent, aChannel, level, authInfo, checkboxLabel, checkValue);
},
 
510,6 → 556,11
// interface nsIPromptService2
asyncPromptAuth: function(aParent, aChannel, aCallback, aContext, level, authInfo, checkboxLabel, checkValue)
{
if(!this.isEnabled(aParent, 'asyncPromptAuth')) {
return this.origin.asyncPromptAuth(aParent, aChannel, aCallback, aContext, level, authInfo, checkboxLabel,
checkValue);
}
 
return null; // NS_ERROR_NOT_IMPLEMENTED
},