summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-03-04 00:35:37 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-03-04 00:35:37 +0100
commitc411826fe5e7662fb0f6dc5fbcb074c68b467ea4 (patch)
treeda23da095fcc3e034d09ab978337265c26e043ff /core/js
parentf06858689f9709d3859f814ca57dfa54b9ed0865 (diff)
downloadnextcloud-server-c411826fe5e7662fb0f6dc5fbcb074c68b467ea4.tar.gz
nextcloud-server-c411826fe5e7662fb0f6dc5fbcb074c68b467ea4.zip
moving gallery op to one file, migrate gallery dialogs to oc dialogs
Diffstat (limited to 'core/js')
-rw-r--r--core/js/oc-dialogs.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index de67c342a71..9ce2bae1642 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -52,7 +52,7 @@ OCdialogs = {
*/
confirm:function(text, title, callback) {
var content = '<p><span class="ui-icon ui-icon-notice"></span>'+text+'</p>';
- OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.YES_NO_BUTTON, callback);
+ OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.YES_NO_BUTTONS, callback);
},
/**
* prompt for user input
@@ -60,8 +60,8 @@ OCdialogs = {
* @param title dialog title
* @param callback which will be triggered when user press OK (input text will be passed to callback)
*/
- prompt:function(text, title, callback) {
- var content = '<p><span class="ui-icon ui-icon-pencil"></span>'+text+':<br/><input type="text" id="oc-dialog-prompt-input" style="width:90%"></p>';
+ prompt:function(text, title, default_value, callback) {
+ var content = '<p><span class="ui-icon ui-icon-pencil"></span>'+text+':<br/><input type="text" id="oc-dialog-prompt-input" value="'+default_value+'" style="width:90%"></p>';
OCdialogs.message(content, title, OCdialogs.PROMPT_DIALOG, OCdialogs.OK_CANCEL_BUTTONS, callback);
},
/**
@@ -131,15 +131,19 @@ OCdialogs = {
}
return $(element).val();
},
- prompt_ok_handler: function(callback, c_id){callback(true, $(c_id + " input#oc-dialog-prompt-input").val()); $(c_id).dialog('close');},
+ prompt_ok_handler: function(callback, c_id) { $(c_id).dialog('close'); if (callback != undefined) callback($(c_id + " input#oc-dialog-prompt-input").val()); },
form_ok_handler: function(callback, c_id) {
- var r = [];
- var c = 0;
- $(c_id + ' input').each(function(i, elem) {
- r[c] = {name: $(elem).attr('name'), value: OCdialogs.determineValue(elem)};
- c++;
- });
- $(c_id).dialog('close');
- callback(r);
+ if (callback != undefined) {
+ var r = [];
+ var c = 0;
+ $(c_id + ' input').each(function(i, elem) {
+ r[c] = {name: $(elem).attr('name'), value: OCdialogs.determineValue(elem)};
+ c++;
+ });
+ $(c_id).dialog('close');
+ callback(r);
+ } else {
+ $(c_id).dialog('close');
+ }
}
};