Fix external storage UI for new storage namespaces
This commit is contained in:
parent
f2d0eeae83
commit
e666ce3622
|
@ -1,6 +1,6 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#externalStorage tbody tr.OC_Filestorage_Dropbox').each(function() {
|
$('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Dropbox').each(function() {
|
||||||
var configured = $(this).find('[data-parameter="configured"]');
|
var configured = $(this).find('[data-parameter="configured"]');
|
||||||
if ($(configured).val() == 'true') {
|
if ($(configured).val() == 'true') {
|
||||||
$(this).find('.configuration input').attr('disabled', 'disabled');
|
$(this).find('.configuration input').attr('disabled', 'disabled');
|
||||||
|
@ -38,7 +38,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$('#externalStorage tbody tr input').live('keyup', function() {
|
$('#externalStorage tbody tr input').live('keyup', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
if ($(tr).hasClass('OC_Filestorage_Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') {
|
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') {
|
||||||
var config = $(tr).find('.configuration');
|
var config = $(tr).find('.configuration');
|
||||||
if ($(tr).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '') {
|
if ($(tr).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '') {
|
||||||
if ($(tr).find('.dropbox').length == 0) {
|
if ($(tr).find('.dropbox').length == 0) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#externalStorage tbody tr.OC_Filestorage_Google').each(function() {
|
$('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google').each(function() {
|
||||||
var configured = $(this).find('[data-parameter="configured"]');
|
var configured = $(this).find('[data-parameter="configured"]');
|
||||||
if ($(configured).val() == 'true') {
|
if ($(configured).val() == 'true') {
|
||||||
$(this).find('.configuration')
|
$(this).find('.configuration')
|
||||||
|
@ -34,7 +34,8 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#externalStorage tbody tr').live('change', function() {
|
$('#externalStorage tbody tr').live('change', function() {
|
||||||
if ($(this).hasClass('OC_Filestorage_Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
|
console.log('hello');
|
||||||
|
if ($(this).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
|
||||||
if ($(this).find('.mountPoint input').val() != '') {
|
if ($(this).find('.mountPoint input').val() != '') {
|
||||||
if ($(this).find('.google').length == 0) {
|
if ($(this).find('.google').length == 0) {
|
||||||
$(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>');
|
$(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>');
|
||||||
|
@ -45,7 +46,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$('#externalStorage tbody tr .mountPoint input').live('keyup', function() {
|
$('#externalStorage tbody tr .mountPoint input').live('keyup', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
if ($(tr).hasClass('OC_Filestorage_Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) {
|
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) {
|
||||||
if ($(this).val() != '') {
|
if ($(this).val() != '') {
|
||||||
$(tr).find('.google').show();
|
$(tr).find('.google').show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -100,7 +100,7 @@ $(document).ready(function() {
|
||||||
td.append('<input type="text" data-parameter="'+parameter+'" placeholder="'+placeholder+'" />');
|
td.append('<input type="text" data-parameter="'+parameter+'" placeholder="'+placeholder+'" />');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (parameters['custom'] && $('#externalStorage tbody tr.'+backendClass).length == 1) {
|
if (parameters['custom'] && $('#externalStorage tbody tr.'+backendClass.replace(/\\/g, '\\\\')).length == 1) {
|
||||||
OC.addScript('files_external', parameters['custom']);
|
OC.addScript('files_external', parameters['custom']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue