diff options
Diffstat (limited to 'Duplicati/Server/webroot/ngax/scripts/services/DialogService.js')
-rw-r--r-- | Duplicati/Server/webroot/ngax/scripts/services/DialogService.js | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/services/DialogService.js b/Duplicati/Server/webroot/ngax/scripts/services/DialogService.js index 7be415ce1..d5ab6e5d6 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/DialogService.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/DialogService.js @@ -1,4 +1,4 @@ -backupApp.service('DialogService', function() { +backupApp.service('DialogService', function(gettextCatalog) { var state = this.state = { CurrentItem: null, Queue: [] @@ -21,11 +21,11 @@ backupApp.service('DialogService', function() { this.enqueueDialog = function(config) { - if (config == null || config.message == null) + if (config == null || (config.message == null && config.htmltemplate == null && config.enableTextarea == null)) return; - config.title = config.title || 'Information'; - config.buttons = config.buttons || ['OK']; + config.title = config.title || gettextCatalog.getString('Information'); + config.buttons = config.buttons || [gettextCatalog.getString('OK')]; state.Queue.push(config); if (state.CurrentItem == null) @@ -47,7 +47,7 @@ backupApp.service('DialogService', function() { return this.enqueueDialog({ 'message': message, 'callback': callback, - 'buttons': ['Cancel', 'OK'] + 'buttons': [gettextCatalog.getString('Cancel'), gettextCatalog.getString('OK')] }); }; @@ -55,7 +55,7 @@ backupApp.service('DialogService', function() { return this.enqueueDialog({ 'message': message, 'callback': callback, - 'buttons': ['OK'] + 'buttons': [gettextCatalog.getString('OK')] }); }; @@ -69,6 +69,30 @@ backupApp.service('DialogService', function() { }); }; + this.htmlDialog = function(title, htmltemplate, buttons, callback, onshow) { + return this.enqueueDialog({ + 'htmltemplate': htmltemplate, + 'title': title, + 'callback': callback, + 'buttons': buttons, + 'onshow': onshow + }); + }; + + this.textareaDialog = function(title, message, placeholder, textarea, buttons, buttonTemplate, callback, onshow) { + return this.enqueueDialog({ + 'enableTextarea': true, + 'title': title, + 'message': message, + 'placeholder': placeholder, + 'textarea': textarea, + 'callback': callback, + 'buttons': buttons, + 'buttonTemplate': buttonTemplate, + 'onshow': onshow + }); + }; + this.dismissCurrent = function() { if (state.CurrentItem != null) { if (state.CurrentItem.ondismiss) |