diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 43b698df68..074d3656f9 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -23,6 +23,11 @@
* this class to ease the usage of jquery dialogs
*/
var OCdialogs = {
+ // dialog button types
+ YES_NO_BUTTONS: 70,
+ OK_BUTTONS: 71,
+ // used to name each dialog
+ dialogs_counter: 0,
/**
* displays alert dialog
* @param text content of dialog
@@ -31,7 +36,7 @@ var OCdialogs = {
* @param modal make the dialog modal
*/
alert:function(text, title, callback, modal) {
- OCdialogs.message(text, title, 'alert', OCdialogs.OK_BUTTON, callback, modal);
+ this.message(text, title, 'alert', OCdialogs.OK_BUTTON, callback, modal);
},
/**
* displays info dialog
@@ -41,7 +46,7 @@ var OCdialogs = {
* @param modal make the dialog modal
*/
info:function(text, title, callback, modal) {
- OCdialogs.message(text, title, 'info', OCdialogs.OK_BUTTON, callback, modal);
+ this.message(text, title, 'info', OCdialogs.OK_BUTTON, callback, modal);
},
/**
* displays confirmation dialog
@@ -51,81 +56,7 @@ var OCdialogs = {
* @param modal make the dialog modal
*/
confirm:function(text, title, callback, modal) {
- OCdialogs.message(text, title, 'notice', OCdialogs.YES_NO_BUTTONS, callback, modal);
- },
- /**
- * prompt for user input
- * @param text content of dialog
- * @param title dialog title
- * @param callback which will be triggered when user presses OK (input text will be passed to callback)
- * @param modal make the dialog modal
- */
- prompt:function(text, title, default_value, callback, modal) {
- var input = '';
- var content = '
' + escapeHTML(text) + ': ' + input + '
';
- OCdialogs.message(content, title, 'prompt', OCdialogs.OK_BUTTON, callback, modal);
- },
- /**
- * prompt user for input with custom form
- * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type', value: 'default value'},...]
- * example:
- * var fields=[{text:'Test', name:'test', type:'select', options:[{text:'hello1',value:1},{text:'hello2',value:2}] }];
- * @param fields to display
- * @param title dialog title
- * @param callback which will be triggered when user presses OK (user answers will be passed to callback in following format: [{name:'return name', value: 'user value'},...])
- * @param modal make the dialog modal
- */
- form:function(fields, title, callback, modal) {
- var content = '