summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-03-25 14:02:02 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-03-25 14:02:02 +0200
commit19c101a660e311437bd471f0c87f0a9413351f7f (patch)
tree09be642404b56a14e2f7e4e09e426ea9e88c9a68 /core
parent37963fee28824165d50e8a12c754fb9ee26d89d8 (diff)
parent34c08b3165ff7ee024006b4c425130fde057863c (diff)
downloadnextcloud-server-19c101a660e311437bd471f0c87f0a9413351f7f.tar.gz
nextcloud-server-19c101a660e311437bd471f0c87f0a9413351f7f.zip
fix merge conflicts
Diffstat (limited to 'core')
-rw-r--r--core/js/oc-dialogs.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 9ce2bae1642..c11ac13332b 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -2,7 +2,7 @@
* ownCloud
*
* @author Bartek Przybylski
- * @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+ * @copyright 2012 Bartek Przybylski bartek@alefzero.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -66,7 +66,7 @@ OCdialogs = {
},
/**
* prompt user for input with custom form
- * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type'},...]
+ * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type', value: 'dafault value'},...]
* @param fields to display
* @param title dialog title
* @param callback which will be triggered when user press OK (user answers will be passed to callback in following format: [{name:'return name', value: 'user value'},...])
@@ -76,8 +76,15 @@ OCdialogs = {
for (var a in fields) {
content += '<tr><td>'+fields[a].text+'</td><td>';
var type=fields[a].type;
- if (type == 'text' || type == 'checkbox' || type == 'password')
- content += '<input type="'+type+'" name="'+fields[a].name+'">';
+ if (type == 'text' || type == 'checkbox' || type == 'password') {
+ content += '<input type="'+type+'" name="'+fields[a].name+'"';
+ if (type == 'checkbox') {
+ if (fields[a].value != undefined && fields[a].value == true) {
+ content += ' checked="checked">';
+ } else content += '>';
+ } else if (type == 'text' || type == 'password' && fields[a].value)
+ content += ' value="'+fields[a].value+'">';
+ }
content += "</td></tr>"
}
content += "</table>";
@@ -112,7 +119,8 @@ OCdialogs = {
b[0] = {text: t('dialogs', 'Ok'), click: f};
break;
}
- $(c_id).dialog({width: 4*$(document).width()/9, height: $(d).height() + 150, modal: false, buttons: b});
+ var possible_height = ($('tr', d).size()+1)*30;
+ $(c_id).dialog({width: 4*$(document).width()/9, height: possible_height + 120, modal: false, buttons: b});
OCdialogs.dialogs_counter++;
},
// dialogs buttons types
@@ -127,7 +135,7 @@ OCdialogs = {
dialogs_counter: 0,
determineValue: function(element) {
switch ($(element).attr('type')) {
- case 'checkbox': return $(element).attr('checked') != undefined;
+ case 'checkbox': return element.checked;
}
return $(element).val();
},