Do noy allow empty urls to be submitted in "add to your owncloud"

Fixes #19382
This commit is contained in:
Roeland Jago Douma 2015-09-28 20:44:33 +02:00
parent 6d743ffac6
commit 08fd4b38f8
2 changed files with 9 additions and 1 deletions

View File

@ -228,6 +228,14 @@ OCA.Sharing.PublicApp = {
OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, name, isProtected);
});
$('#remote_address').on("change keyup paste", function() {
if ($(this).val() === '') {
$('#save-button-confirm').prop('disabled', true);
} else {
$('#save-button-confirm').prop('disabled', false);
}
});
$('#save #save-button').click(function () {
$(this).hide();
$('.save-form').css('display', 'inline');

View File

@ -76,7 +76,7 @@ $thumbSize = 1024;
<button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
<form class="save-form hidden" action="#">
<input type="text" id="remote_address" placeholder="example.com/owncloud"/>
<button id="save-button-confirm" class="icon-confirm svg"></button>
<button id="save-button-confirm" class="icon-confirm svg" disabled></button>
</form>
</span>
<?php } ?>