diff --git a/apps/files_sharing/js/external.js b/apps/files_sharing/js/external.js index 969a2b184d..e743d2e2d3 100644 --- a/apps/files_sharing/js/external.js +++ b/apps/files_sharing/js/external.js @@ -42,13 +42,40 @@ } }; if (!passwordProtected) { - OC.dialogs.confirm(t('files_sharing', 'Add {name} from {owner}@{remote}', {name: name, owner: owner, remote: remoteClean}) - , t('files_sharing','Add Share'), callback, true); + OC.dialogs.confirm( + t( + 'files_sharing', + 'Do you want to add the remote share {name} from {owner}@{remote}?', + {name: name, owner: owner, remote: remoteClean} + ), + t('files_sharing','Remote share'), + callback, + true + ).then(this._adjustDialog); } else { - OC.dialogs.prompt(t('files_sharing', 'Add {name} from {owner}@{remote}', {name: name, owner: owner, remote: remoteClean}) - , t('files_sharing','Add Share'), callback, true, t('files_sharing','Password'), true); + OC.dialogs.prompt( + t( + 'files_sharing', + 'Do you want to add the remote share {name} from {owner}@{remote}?', + {name: name, owner: owner, remote: remoteClean} + ), + t('files_sharing','Remote share'), + callback, + true, + t('files_sharing','Remote share password'), + true + ).then(this._adjustDialog); } }; + + OCA.Sharing._adjustDialog = function() { + var $dialog = $('.oc-dialog:visible'); + var $buttons = $dialog.find('button'); + // hack the buttons + $dialog.find('.ui-icon').remove(); + $buttons.eq(0).text(t('core', 'Cancel')); + $buttons.eq(1).text(t('core', 'Add remote share')); + }; })(); $(document).ready(function () { diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index a1221137bc..93930bf435 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -31,6 +31,17 @@ margin-top: 10px; width: 100%; } +/* align primary button to right, other buttons to left */ +.oc-dialog-buttonrow.twobuttons button:nth-child(1) { + float: left; +} +.oc-dialog-buttonrow.twobuttons button:nth-child(2) { + float: right; +} + +.oc-dialog-buttonrow.onebutton button { + float: right; +} .oc-dialog-close { position:absolute; diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index af32591ce5..e48e3e8df6 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -111,6 +111,13 @@ var $buttonrow = $('
'); this.$buttonrow = $buttonrow.appendTo(this.$dialog); } + if (value.length === 1) { + this.$buttonrow.addClass('onebutton'); + } else if (value.length === 2) { + this.$buttonrow.addClass('twobuttons'); + } else if (value.length === 3) { + this.$buttonrow.addClass('threebuttons'); + } $.each(value, function(idx, val) { var $button = $('