Fixed things in alert-messages

Two parameters for OC.dialogs.alert, otherwise one will be "undefined".

Also fixed missing translation.
This commit is contained in:
root 2013-04-05 01:56:32 +02:00
parent e824c6cffa
commit 74b02db337
4 changed files with 17 additions and 17 deletions

View File

@ -615,7 +615,7 @@ $(document).ready(function() {
tr.find('td.filename').attr('style','background-image:url('+path+')'); tr.find('td.filename').attr('style','background-image:url('+path+')');
}); });
} else { } else {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files', 'Error'));
} }
} }
); );
@ -631,7 +631,7 @@ $(document).ready(function() {
var tr=$('tr').filterAttr('data-file',name); var tr=$('tr').filterAttr('data-file',name);
tr.attr('data-id', result.data.id); tr.attr('data-id', result.data.id);
} else { } else {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files', 'Error'));
} }
} }
); );
@ -920,7 +920,7 @@ var folderDropOptions={
$('#notification').fadeIn(); $('#notification').fadeIn();
} }
} else { } else {
OC.dialogs.alert(t('Error moving file')); OC.dialogs.alert(t('Error moving file'), t('files', 'Error'));
} }
}); });
}); });
@ -958,7 +958,7 @@ var crumbDropOptions={
$('#notification').fadeIn(); $('#notification').fadeIn();
} }
} else { } else {
OC.dialogs.alert(t('Error moving file')); OC.dialogs.alert(t('Error moving file'), t('files', 'Error'));
} }
}); });
}); });

View File

@ -16,7 +16,7 @@ $(document).ready(function() {
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} }
if (result.status != 'success') { if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error'));
} }
}); });
@ -43,7 +43,7 @@ $(document).ready(function() {
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} }
if (result.status != 'success') { if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error'));
} }
}); });
@ -111,7 +111,7 @@ $(document).ready(function() {
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} }
if (result.status != 'success') { if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error'));
} }
}); });
}); });
@ -136,7 +136,7 @@ $(document).ready(function() {
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} }
if (result.status != 'success') { if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, t('files_trashbin', 'Error'));
} }
}); });
}); });

View File

@ -11,7 +11,7 @@ var OCCategories= {
try { try {
var jsondata = jQuery.parseJSON(response); var jsondata = jQuery.parseJSON(response);
if(response.status == 'error') { if(response.status == 'error') {
OC.dialogs.alert(response.data.message, 'Error'); OC.dialogs.alert(response.data.message, t('core', 'Error'));
return; return;
} }
} catch(e) { } catch(e) {
@ -77,7 +77,7 @@ var OCCategories= {
if(jsondata.status == 'success') { if(jsondata.status == 'success') {
OCCategories._update(jsondata.data.categories); OCCategories._update(jsondata.data.categories);
} else { } else {
OC.dialogs.alert(jsondata.data.message, 'Error'); OC.dialogs.alert(jsondata.data.message, t('core', 'Error'));
} }
}, },
favorites:function(type, cb) { favorites:function(type, cb) {
@ -107,7 +107,7 @@ var OCCategories= {
cb(jsondata); cb(jsondata);
} else { } else {
if(jsondata.status !== 'success') { if(jsondata.status !== 'success') {
OC.dialogs.alert(jsondata.data.message, 'Error'); OC.dialogs.alert(jsondata.data.message, t('core', 'Error'));
} }
} }
}); });
@ -169,7 +169,7 @@ var OCCategories= {
if(jsondata.status === 'success') { if(jsondata.status === 'success') {
OCCategories._update(jsondata.data.categories); OCCategories._update(jsondata.data.categories);
} else { } else {
OC.dialogs.alert(jsondata.data.message, 'Error'); OC.dialogs.alert(jsondata.data.message, t('core', 'Error'));
} }
} }
}); });
@ -186,7 +186,7 @@ var OCCategories= {
if(jsondata.status === 'success') { if(jsondata.status === 'success') {
OCCategories._update(jsondata.data.categories); OCCategories._update(jsondata.data.categories);
} else { } else {
OC.dialogs.alert(jsondata.data.message, 'Error'); OC.dialogs.alert(jsondata.data.message, t('core', 'Error'));
} }
} }
}).error(function(xhr){ }).error(function(xhr){
@ -196,7 +196,7 @@ var OCCategories= {
if(typeof cb == 'function') { if(typeof cb == 'function') {
cb({status:'error', data:{message:errormessage}}); cb({status:'error', data:{message:errormessage}});
} else { } else {
OC.dialogs.alert(errormessage); OC.dialogs.alert(errormessage, t('core', 'Error'));
} }
} }
}); });

View File

@ -56,7 +56,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
if(active) { if(active) {
$.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) {
if(!result || result.status!='success') { if(!result || result.status!='success') {
OC.dialogs.alert('Error while disabling app','Error'); OC.dialogs.alert('Error while disabling app', t('settings', 'Error'));
} }
else { else {
element.data('active',false); element.data('active',false);
@ -68,7 +68,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
} else { } else {
$.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) { $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) {
if(!result || result.status!='success') { if(!result || result.status!='success') {
OC.dialogs.alert('Error while enabling app','Error'); OC.dialogs.alert('Error while enabling app', t('settings', 'Error'));
} }
else { else {
OC.Settings.Apps.addNavigation(appid); OC.Settings.Apps.addNavigation(appid);
@ -77,7 +77,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
} }
},'json') },'json')
.fail(function() { .fail(function() {
OC.dialogs.alert('Error while enabling app','Error'); OC.dialogs.alert('Error while enabling app', t('settings', 'Error'));
element.data('active',false); element.data('active',false);
OC.Settings.Apps.removeNavigation(appid); OC.Settings.Apps.removeNavigation(appid);
element.val(t('settings','Enable')); element.val(t('settings','Enable'));