diff options
26 files changed, 349 insertions, 594 deletions
diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php index c5f8d9f5536..39d10490c44 100644 --- a/apps/encryption/templates/settings-admin.php +++ b/apps/encryption/templates/settings-admin.php @@ -2,7 +2,6 @@ /** @var array $_ */ /** @var \OCP\IL10N $l */ script('encryption', 'settings-admin'); -script('core', 'multiselect'); style('encryption', 'settings-admin'); ?> <form id="ocDefaultEncryptionModule" class="sub-section"> diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php index 05a720687aa..41dacc534e6 100644 --- a/apps/encryption/templates/settings-personal.php +++ b/apps/encryption/templates/settings-personal.php @@ -2,7 +2,6 @@ /** @var array $_ */ /** @var \OCP\IL10N $l */ script('encryption', 'settings-personal'); -script('core', 'multiselect'); ?> <form id="ocDefaultEncryptionModule" class="section"> <h2 data-anchor-name="basic-encryption-module"><?php p($l->t('Basic encryption module')); ?></h2> diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index bac2a5ebd21..699f884ba24 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -96,16 +96,6 @@ * Renders this details view */ render: function() { - // remove old instances - var $appSidebar = $('#app-sidebar'); - if ($appSidebar.length === 0) { - this.$el.insertAfter($('#app-content')); - } else { - if ($appSidebar[0] !== this.el) { - $appSidebar.replaceWith(this.$el); - } - } - var templateVars = { closeLabel: t('files', 'Close') }; diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 94fdada937d..047837cd9d7 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -584,12 +584,36 @@ } this._currentFileModel = model; + + this._replaceDetailsViewElementIfNeeded(); + this._detailsView.setFileInfo(model); - this._detailsView.render(); this._detailsView.$el.scrollTop(0); }, /** + * Replaces the current details view element with the details view + * element of this file list. + * + * Each file list has its own DetailsView object, and each one has its + * own root element, but there can be just one details view/sidebar + * element in the document. This helper method replaces the current + * details view/sidebar element in the document with the element from + * the DetailsView object of this file list. + */ + _replaceDetailsViewElementIfNeeded: function() { + var $appSidebar = $('#app-sidebar'); + if ($appSidebar.length === 0) { + this._detailsView.$el.insertAfter($('#app-content')); + } else if ($appSidebar[0] !== this._detailsView.el) { + // "replaceWith()" can not be used here, as it removes the old + // element instead of just detaching it. + this._detailsView.$el.insertBefore($appSidebar); + $appSidebar.detach(); + } + }, + + /** * Event handler for when the window size changed */ _onResize: function() { diff --git a/apps/oauth2/l10n/cs.js b/apps/oauth2/l10n/cs.js index 746f621d458..f194f53b7b8 100644 --- a/apps/oauth2/l10n/cs.js +++ b/apps/oauth2/l10n/cs.js @@ -6,12 +6,15 @@ OC.L10N.register( "Allows OAuth2 compatible authentication from other web applications." : "Umožní ověřování kompatibilní s OAuth2 z ostatních webových aplikací.", "The OAuth2 app allows administrators to configure the built-in authentication workflow to also allow OAuth2 compatible authentication from other web applications." : "Aplikace OAuth2 umožňuje správcům nastavit vestavěný postup ověřování tak, aby podporoval také OAuth2 kompatibilní ověřování z ostatních webových aplikací.", "OAuth 2.0 clients" : "OAuth 2.0 klienti", + "OAuth 2.0 allows external services to request access to {instanceName}." : "OAuth 2.0 umožňuje externím službám vyžádat si přístup k {instanceName}.", "Name" : "Název", "Redirection URI" : "URL pro přesměrování", "Client Identifier" : "Identifikátor klienta", "Secret" : "Tajemství", "Add client" : "Přidat klienta", "Add" : "Přidat", + "Show client secret" : "Zobrazit klientské tajemství", + "Delete" : "Smazat", "OAuth 2.0 allows external services to request access to %s." : "OAuth 2.0 umožňuje cizím službám žádat přístup k %s." }, "nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;"); diff --git a/apps/oauth2/l10n/cs.json b/apps/oauth2/l10n/cs.json index 49ef6f72457..637b4184b67 100644 --- a/apps/oauth2/l10n/cs.json +++ b/apps/oauth2/l10n/cs.json @@ -4,12 +4,15 @@ "Allows OAuth2 compatible authentication from other web applications." : "Umožní ověřování kompatibilní s OAuth2 z ostatních webových aplikací.", "The OAuth2 app allows administrators to configure the built-in authentication workflow to also allow OAuth2 compatible authentication from other web applications." : "Aplikace OAuth2 umožňuje správcům nastavit vestavěný postup ověřování tak, aby podporoval také OAuth2 kompatibilní ověřování z ostatních webových aplikací.", "OAuth 2.0 clients" : "OAuth 2.0 klienti", + "OAuth 2.0 allows external services to request access to {instanceName}." : "OAuth 2.0 umožňuje externím službám vyžádat si přístup k {instanceName}.", "Name" : "Název", "Redirection URI" : "URL pro přesměrování", "Client Identifier" : "Identifikátor klienta", "Secret" : "Tajemství", "Add client" : "Přidat klienta", "Add" : "Přidat", + "Show client secret" : "Zobrazit klientské tajemství", + "Delete" : "Smazat", "OAuth 2.0 allows external services to request access to %s." : "OAuth 2.0 umožňuje cizím službám žádat přístup k %s." },"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;" }
\ No newline at end of file diff --git a/apps/oauth2/l10n/fr.js b/apps/oauth2/l10n/fr.js index 9975d9e8d45..a00901bf05b 100644 --- a/apps/oauth2/l10n/fr.js +++ b/apps/oauth2/l10n/fr.js @@ -13,6 +13,7 @@ OC.L10N.register( "Secret" : "Secret", "Add client" : "Ajouter un client", "Add" : "Ajouter", + "Show client secret" : "Afficher client secret", "Delete" : "Supprimer", "OAuth 2.0 allows external services to request access to %s." : "OAuth 2.0 permet à des services externes de demander l'accès à %s." }, diff --git a/apps/oauth2/l10n/fr.json b/apps/oauth2/l10n/fr.json index 60833263f8e..6d64340dd40 100644 --- a/apps/oauth2/l10n/fr.json +++ b/apps/oauth2/l10n/fr.json @@ -11,6 +11,7 @@ "Secret" : "Secret", "Add client" : "Ajouter un client", "Add" : "Ajouter", + "Show client secret" : "Afficher client secret", "Delete" : "Supprimer", "OAuth 2.0 allows external services to request access to %s." : "OAuth 2.0 permet à des services externes de demander l'accès à %s." },"pluralForm" :"nplurals=2; plural=(n > 1);" diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss index e2cd8fb11ee..ea3792458fa 100644 --- a/apps/theming/css/theming.scss +++ b/apps/theming/css/theming.scss @@ -82,10 +82,9 @@ $invert: luma($color-primary) > 0.6; @include icon-color('checkbox-mark', 'actions', $color-white, 1, true); } } - #body-user { - .primary { - border: 1px solid transparent; - } + /* Always give primary button a border for light primary colors */ + .primary { + border-color: var(--color-border) !important; } } @else { #appmenu:not(.inverted) svg { diff --git a/core/css/apps.scss b/core/css/apps.scss index b9c2b50c6f2..32b34f2651a 100644 --- a/core/css/apps.scss +++ b/core/css/apps.scss @@ -445,7 +445,7 @@ kbd { .app-navigation-entry-utils-menu-button { /* Prevent bg img override if an icon class is set */ button:not([class^='icon-']):not([class*=' icon-']) { - background-image: url('../img/actions/more.svg?v=1'); + @include icon-color('more', 'actions', $color-black, 1, true); } &:hover button, &:focus button { @@ -805,6 +805,10 @@ $min-content-width: $breakpoint-mobile - $navigation-width - $list-min-width; margin-bottom: 1px; padding: 5px; + &.hidden { + display: none; + } + /* Use same amount as sidebar padding */ &:first-child { padding-left: 15px; diff --git a/core/css/header.scss b/core/css/header.scss index 72863696d6a..bf360843707 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -461,6 +461,9 @@ nav[role='navigation'] { li { position: relative; cursor: pointer; + margin: 0 2px; + display: flex; + justify-content: center; a { position: relative; @@ -472,82 +475,73 @@ nav[role='navigation'] { justify-content: center; opacity: .6; } - } - .app-loading { - > svg { - display: none; + /* focused app visual feedback */ + &:hover a, + a:focus, + a.active { + opacity: 1; } - .icon-loading-small-dark { - width: 20px; - height: 20px; - display: block !important; + + &:hover a + span, + a:focus + span, + &:hover span, + &:focus span, + a:focus span { + display: inline-block; + text-overflow: initial; + width: auto; + overflow: hidden; + background-color: var(--color-primary-element); + padding: 0 5px; } - } - /* focused app visual feedback */ - li:hover a, - li a:focus, - li a.active { - opacity: 1; - } - - li:hover a, - li a:focus { - + span { + /* hidden apps menu */ + img, + .icon-more-white { display: inline-block; + width: 20px; + height: 20px; + } + + /* App title */ + span { + opacity: 0; + position: absolute; + color: var(--color-primary-text); + bottom: -5px; + width: calc(100% - 4px); + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + transition: all var(--animation-quick) ease; } - } - - li:hover span, - li:focus span, - li a:focus span { - display: inline-block; - } - - /* hidden apps menu */ - li img, - .icon-more-white { - display: inline-block; - width: 20px; - height: 20px; - } - - /* App title */ - li span { - opacity: 0; - position: absolute; - color: var(--color-primary-text); - bottom: -5px; - width: 100%; - text-align: center; - overflow: hidden; - text-overflow: ellipsis; - } - - - /* Set up transitions for showing app titles on hover */ - li { - /* Prevent flicker effect because of low-hanging span element */ - overflow-y: hidden; + /* Set up transitions for showing app titles on hover */ /* App icon */ svg, .icon-more-white { transition: transform var(--animation-quick) ease; } - /* App title */ - span { - transition: all var(--animation-quick) ease; - } - /* Triangle */ a::before { transition: border var(--animation-quick) ease; } } + .app-loading { + > svg { + display: none; + } + .icon-loading-small-dark { + width: 20px; + height: 20px; + display: block !important; + } + } + + /* Show all app titles on hovering app menu area */ &:hover { li { diff --git a/core/css/inputs.scss b/core/css/inputs.scss index fde251075a8..8b4198644da 100644 --- a/core/css/inputs.scss +++ b/core/css/inputs.scss @@ -85,14 +85,22 @@ div[contenteditable=true], /* Primary action button, use sparingly */ &.primary { background-color: var(--color-primary-element); - border: 1px solid var(--color-primary-text); + border-color: var(--color-primary-element); color: var(--color-primary-text); cursor: pointer; + + /* Apply border to primary button if on log in page (and not in a dark container) or if in header */ + #body-login :not(.body-login-container) &, + #header & { + border-color: var(--color-primary-text); + } + &:not(:disabled) { &:hover, &:focus, - &:active { - background-color: var(--color-primary-element-light) + &:active { + background-color: var(--color-primary-element-light); + border-color: var(--color-primary-element-light); } &:active { color: var(--color-primary-text-dark); diff --git a/core/css/multiselect.scss b/core/css/multiselect.scss deleted file mode 100644 index 6df137cc0f9..00000000000 --- a/core/css/multiselect.scss +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com> - * @copyright Copyright (c) 2016, Julius Haertl <jus@bitgrid.net> - * @copyright Copyright (c) 2016, Sergio Bertolín <sbertolin@solidgear.es> - * @copyright Copyright (c) 2015, Hendrik Leppelsack <hendrik@leppelsack.de> - * @copyright Copyright (c) 2014, Vincent Petry <pvince81@owncloud.com> - * @copyright Copyright (c) 2013, Vincent Petry <pvince81@owncloud.com> - * @copyright Copyright (c) 2013, raghunayyar <me@iraghu.com> - * @copyright Copyright (c) 2013, Victor Dubiniuk <victor.dubiniuk@gmail.com> - * @copyright Copyright (c) 2013, kondou <kondou@ts.unde.re> - * @copyright Copyright (c) 2012, Thomas Tanghus <thomas@tanghus.net> - * @copyright Copyright (c) 2012, Lukas Reschke <lukas@statuscode.ch> - * @copyright Copyright (c) 2012, Jan-Christoph Borchardt <hey@jancborchardt.net> - * - * @license GNU AGPL version 3 or any later version - * - */ - -ul.multiselectoptions { - background-color: var(--color-main-background); - border: 1px solid var(--color-primary); - border-top: none; - box-shadow: 0 1px 10px var(--color-box-shadow); - padding-top: 8px; - position: absolute; - max-height: 20em; - overflow-y: auto; - z-index: 149; - &.down { - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; - width: 100%; - /* do not cut off group names */ - box-shadow: 0 1px 10px var(--color-box-shadow); - } - &.up { - border-top-left-radius: 3px; - border-top-right-radius: 3px; - } - > li { - overflow: hidden; - white-space: nowrap; - margin-left: 7px; - input[type='checkbox'] { - + label { - font-weight: normal; - display: inline-block; - width: 100%; - padding: 5px 27px; - margin-left: -27px; - /* to have area around checkbox clickable as well */ - text-overflow: ellipsis; - overflow: hidden; - } - &:checked + label { - font-weight: bold; - } - } - } - input.new { - padding-bottom: 3px; - padding-top: 3px; - margin: 0; - } - > li.creator { - padding: 10px; - margin: 0; - font-weight: bold; - > input { - width: 95% !important; - /* do not constrain size of text input */ - padding: 5px; - margin: -5px; - } - } -} - -/* TODO drop old legacy multiselect! */ -div.multiselect:not(.multiselect-vue), -select.multiselect:not(.multiselect-vue) { - display: inline-block; - max-width: 200px; - min-width: 150px !important; - padding-right: 10px; - min-height: 20px; - position: relative; - vertical-align: bottom; -} - -select.multiselect { - height: 30px; - min-width: 113px; -} - -/* To make a select look like a multiselect until it's initialized */ -div.multiselect { - &.active { - background-color: var(--color-main-background); - position: relative; - z-index: 150; - } - &.up { - border-top: 0 none; - border-top-left-radius: 0; - border-top-right-radius: 0; - } - &.down { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - } - > span { - &:first-child { - float: left; - margin-right: 32px; - overflow: hidden; - text-overflow: ellipsis; - width: 90%; - white-space: nowrap; - line-height: 20px; - } - &:last-child { - position: absolute; - right: 8px; - top: 8px; - padding: 0 !important; - min-width: 16px; - min-height: 16px; - background-position: center; - } - } -} diff --git a/core/css/server.scss b/core/css/server.scss index 9b512038015..7269847ad91 100644 --- a/core/css/server.scss +++ b/core/css/server.scss @@ -6,7 +6,6 @@ @import 'apps.scss'; @import 'global.scss'; @import 'fixes.scss'; -@import 'multiselect.scss'; @import 'mobile.scss'; @import 'tooltip.scss'; @import 'public.scss';
\ No newline at end of file diff --git a/core/js/multiselect.js b/core/js/multiselect.js deleted file mode 100644 index bdf420a2f7f..00000000000 --- a/core/js/multiselect.js +++ /dev/null @@ -1,344 +0,0 @@ -/** - * @param 'createCallback' A function to be called when a new entry is created. - * Two arguments are supplied to this function: - * The select element used and the value of the option. If the function - * returns false addition will be cancelled. If it returns - * anything else it will be used as the value of the newly added option. - * @param 'createText' The placeholder text for the create action. - * @param 'title' The title to show if no options are selected. - * @param 'checked' An array containing values for options that should be - * checked. Any options which are already selected will be added to this array. - * @param 'labels' The corresponding labels to show for the checked items. - * @param 'oncheck' Callback function which will be called when a - * checkbox/radiobutton is selected. If the function returns false the input will be unchecked. - * @param 'onuncheck' @see 'oncheck'. - * @param 'singleSelect' If true radiobuttons will be used instead of - * checkboxes. - */ -(function( $ ){ - var multiSelectId=-1; - $.fn.multiSelect=function(options) { - multiSelectId++; - var settings = { - 'createCallback':false, - 'createText':false, - 'singleSelect':false, - 'selectedFirst':false, - 'sort':true, - 'title':this.attr('title'), - 'checked':[], - 'labels':[], - 'oncheck':false, - 'onuncheck':false, - 'minWidth': 'default;' - }; - var slideDuration = 0; - $(this).attr('data-msid', multiSelectId); - $.extend(settings,options); - $.each(this.children(),function(i,option) { - // If the option is selected, but not in the checked array, add it. - if ( - $(option).attr('selected') && - settings.checked.indexOf($(option).val()) === -1 - ) { - settings.checked.push($(option).val()); - settings.labels.push($(option).text().trim()); - } - // If the option is in the checked array but not selected, select it. - else if ( - settings.checked.indexOf($(option).val()) !== -1 && - !$(option).attr('selected') - ) { - $(option).attr('selected', 'selected'); - settings.labels.push($(option).text().trim()); - } - }); - var button=$('<div class="multiselect button"><span>'+settings.title+'</span><span class="icon-triangle-s"></span></div>'); - var span=$('<span/>'); - span.append(button); - button.data('id',multiSelectId); - button.selectedItems=[]; - this.hide(); - this.before(span); - if(settings.minWidth=='default') { - settings.minWidth=button.width(); - } - button.css('min-width',settings.minWidth); - settings.minOuterWidth=button.outerWidth()-2; - button.data('settings',settings); - - if(!settings.singleSelect && settings.checked.length>0) { - button.children('span').first().text(settings.labels.join(', ')); - } else if(settings.singleSelect) { - button.children('span').first().text(this.find(':selected').text()); - } - - var self = this; - self.menuDirection = 'down'; - - function closeDropDown() { - if(!button.parent().data('preventHide')) { - // How can I save the effect in a var? - if(self.menuDirection === 'down') { - button.parent().children('ul').slideUp(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active down'); - $(self).trigger($.Event('dropdownclosed', settings)); - }); - } else { - button.parent().children('ul').fadeOut(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active up'); - $(self).trigger($.Event('dropdownclosed', settings)); - }); - } - } - } - - button.click(function(event){ - - var button=$(this); - if(button.parent().children('ul').length>0) { - if(self.menuDirection === 'down') { - button.parent().children('ul').slideUp(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active down'); - $(self).trigger($.Event('dropdownclosed', settings)); - }); - } else { - button.parent().children('ul').fadeOut(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active up'); - $(self).trigger($.Event('dropdownclosed', settings)); - }); - } - return; - } - // tell other lists to shut themselves - var lists=$('ul.multiselectoptions'); - lists.trigger($.Event('shut')); - button.addClass('active'); - event.stopPropagation(); - var options=$(this).parent().next().children(); - var list=$('<ul class="multiselectoptions"/>').hide().appendTo($(this).parent()); - var inputType = settings.singleSelect ? 'radio' : 'checkbox'; - function createItem(element, checked){ - element=$(element); - var item=element.val(); - var id='ms'+multiSelectId+'-option-'+item; - var input=$('<input type="' + inputType + '"/>'); - input.attr('id',id); - if(inputType === 'checkbox') { - input.addClass('checkbox'); - } - if(settings.singleSelect) { - input.attr('name', 'ms'+multiSelectId+'-option'); - } - var label=$('<label/>'); - label.attr('for', id); - label.text(element.text() || item); - label.attr('title', element.text() || item); - if(settings.checked.indexOf(item) !== -1 || checked) { - input.prop('checked', true); - } - if(checked){ - if(settings.singleSelect) { - settings.checked = [item]; - settings.labels = [item]; - } else { - settings.checked.push(item); - settings.labels.push(item); - } - } - input.change(function(){ - var value = $(this).attr('id').substring(String('ms'+multiSelectId+'-option').length+1); - var label = $(this).next().text().trim(); - if($(this).is(':checked')) { - if(settings.singleSelect) { - settings.checked = []; - settings.labels = []; - $.each(self.find('option'), function() { - $(this).removeAttr('selected'); - }); - } - element.attr('selected','selected'); - if(typeof settings.oncheck === 'function') { - if(settings.oncheck(value)===false) { - $(this).prop('checked', false); - return; - } - } - settings.checked.push(value); - settings.labels.push(label); - $(this).parent().addClass('checked'); - } else { - var index=settings.checked.indexOf(value); - element.attr('selected',null); - if(typeof settings.onuncheck === 'function') { - if(settings.onuncheck(value)===false) { - $(this).prop('checked',true); - return; - } - } - $(this).parent().removeClass('checked'); - settings.checked.splice(index,1); - settings.labels.splice(index,1); - } - var oldWidth=button.width(); - button.children('span').first().text(settings.labels.length > 0 - ? settings.labels.join(', ') - : settings.title); - var newOuterWidth = Math.max( - (button.outerWidth() - 2), - settings.minOuterWidth - ) + 'px'; - var newWidth=Math.max(button.width(),settings.minWidth); - var pos=button.position(); - button.css('width',oldWidth); - button.animate({'width':newWidth},undefined,undefined,function(){ - button.css('width',''); - }); - list.animate({'width':newOuterWidth,'left':pos.left}); - self.change(); - }); - var li=$('<li></li>'); - li.append(input).append(label); - if(input.is(':checked')) { - li.addClass('checked'); - } - return li; - } - $.each(options,function(index,item){ - list.append(createItem(item)); - }); - button.parent().data('preventHide',false); - if(settings.createText){ - var li=$('<li class="creator" title="' + settings.createText + - '">+ ' + settings.createText + '</li>'); - li.click(function(event){ - li.empty(); - var input=$('<input type="text" class="new">'); - li.append(input); - input.focus(); - input.css('width',button.innerWidth()); - button.parent().data('preventHide',true); - input.keypress(function(event) { - if(event.keyCode === 13) { - event.preventDefault(); - event.stopPropagation(); - var value = $(this).val(); - var exists = false; - $.each(options,function(index, item) { - if ($(item).val() == value || $(item).text() == value) { - exists = true; - return false; - } - }); - if (exists) { - return false; - } - var li=$(this).parent(); - var val = $(this).val(); - var select=button.parent().next(); - if(typeof settings.createCallback === 'function') { - var response = settings.createCallback(select, val); - if(response === false) { - return false; - } else if(typeof response !== 'undefined') { - val = response; - } - } - if(settings.singleSelect) { - $.each(select.find('option:selected'), function() { - $(this).removeAttr('selected'); - }); - } - $(this).remove(); - li.text('+ '+settings.createText); - li.before(createItem(this)); - var option=$('<option selected="selected"/>'); - option.text($(this).val()).val(val).attr('selected', 'selected'); - select.append(option); - li.prev().children('input').prop('checked', true).trigger('change'); - button.parent().data('preventHide',false); - button.children('span').first().text(settings.labels.length > 0 - ? settings.labels.join(', ') - : settings.title); - if(self.menuDirection === 'up') { - var list = li.parent(); - list.css('top', list.position().top-li.outerHeight()); - } - } - }); - input.blur(function() { - event.preventDefault(); - event.stopPropagation(); - $(this).remove(); - li.text('+ '+settings.createText); - setTimeout(function(){ - button.parent().data('preventHide',false); - },100); - }); - }); - list.append(li); - } - - var doSort = function(list, selector) { - var rows = list.find('li'+selector).get(); - - if(settings.sort) { - rows.sort(function(a, b) { - return $(a).text().toUpperCase().localeCompare($(b).text().toUpperCase()); - }); - } - - $.each(rows, function(index, row) { - list.append(row); - }); - }; - if(settings.sort && settings.selectedFirst) { - doSort(list, '.checked'); - doSort(list, ':not(.checked)'); - } else if(settings.sort && !settings.selectedFirst) { - doSort(list, ''); - } - list.append(list.find('li.creator')); - var pos=button.position(); - if(($(document).height() > (button.offset().top + button.outerHeight() + list.children().length * button.height()) && - $(document).height() - button.offset().top > (button.offset().top+button.outerHeight() + list.children().length * button.height())) || - $(document).height() / 2 > button.offset().top - ) { - list.css({ - top:pos.top+button.outerHeight()-5, - left:pos.left, - width:(button.outerWidth()-2)+'px', - 'max-height':($(document).height()-(button.offset().top+button.outerHeight()+10))+'px' - }); - list.addClass('down'); - button.addClass('down'); - list.slideDown(slideDuration); - } else { - list.css('max-height', $(document).height()-($(document).height()-(pos.top)+50)+'px'); - list.css({ - top:pos.top - list.height(), - left:pos.left, - width:(button.outerWidth()-2)+'px' - - }); - list.detach().insertBefore($(this)); - list.addClass('up'); - button.addClass('up'); - list.show(); - self.menuDirection = 'up'; - } - list.click(function(event) { - event.stopPropagation(); - }); - list.one('shut', closeDropDown); - }); - - $(window).click(closeDropDown); - - return span; - }; -})( jQuery ); diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index f4a83138e4c..167690f3a6e 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -237,13 +237,13 @@ class URLGenerator implements IURLGenerator { * @return string the absolute version of the url */ public function getAbsoluteURL(string $url): string { - $separator = $url[0] === '/' ? '' : '/'; + $separator = strpos($url, '/') === 0 ? '' : '/'; if (\OC::$CLI && !\defined('PHPUNIT_RUN')) { return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/') . '/' . ltrim($url, '/'); } // The ownCloud web root can already be prepended. - if(substr($url, 0, \strlen(\OC::$WEBROOT)) === \OC::$WEBROOT) { + if(\OC::$WEBROOT !== '' && strpos($url, \OC::$WEBROOT) === 0) { $url = substr($url, \strlen(\OC::$WEBROOT)); } diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 0aa67bad900..9ad07e9cca5 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -103,6 +103,8 @@ ipad: /\(iPad\; *CPU +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */, iosClient: /^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/, androidClient:/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/, + iosTalkClient: /^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk.*$/, + androidTalkClient:/^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk.*$/, // DAVdroid/1.2 (2016/07/03; dav4android; okhttp3) Android/6.0.1 davDroid: /DAVdroid\/([0-9.]+)/, // Mozilla/5.0 (U; Linux; Maemo; Jolla; Sailfish; like Android 4.3) AppleWebKit/538.1 (KHTML, like Gecko) WebPirate/2.0 like Mobile Safari/538.1 (compatible) @@ -117,10 +119,12 @@ chrome: t('setting', 'Google Chrome'), safari: t('setting', 'Safari'), androidChrome: t('setting', 'Google Chrome for Android'), - iphone: t('setting', 'iPhone iOS'), - ipad: t('setting', 'iPad iOS'), - iosClient: t('setting', 'iOS Client'), - androidClient: t('setting', 'Android Client'), + iphone: t('setting', 'iPhone'), + ipad: t('setting', 'iPad'), + iosClient: t('setting', 'Nextcloud iOS app'), + androidClient: t('setting', 'Nextcloud Android app'), + iosTalkClient: t('setting', 'Nextcloud Talk for iOS'), + androidTalkClient: t('setting', 'Nextcloud Talk for Android'), davDroid: 'DAVdroid', webPirate: 'WebPirate', sailfishBrowser: 'SailfishBrowser' @@ -137,6 +141,8 @@ ipad: 'icon-tablet', iosClient: 'icon-phone', androidClient: 'icon-phone', + iosTalkClient: 'icon-phone', + androidTalkClient: 'icon-phone', davDroid: 'icon-phone', webPirate: 'icon-link', sailfishBrowser: 'icon-link' diff --git a/settings/l10n/fr.js b/settings/l10n/fr.js index 146f2862d82..45a2558f903 100644 --- a/settings/l10n/fr.js +++ b/settings/l10n/fr.js @@ -114,7 +114,11 @@ OC.L10N.register( "Two-factor authentication can be enforced for all\tusers and specific groups. If they do not have a two-factor provider configured, they will be unable to log into the system." : "L'authentification à deux facteurs peut être spécifiée pour tous les \tutilisateurs et groupes spécifiques. S'ils n'ont pas de fournisseur à deux facteurs configuré, ils seront dans l'incapacité de se connecter au système.", "Enforce two-factor authentication" : "Imposer l'authentification à deux facteurs", "Limit to groups" : "Limiter aux groupes", + "Enforcement of two-factor authentication can be set for certain groups only." : "L'application de l'authentification à deux facteurs ne peut être définie que pour certains groupes.", + "Two-factor authentication is enforced for all\tmembers of the following groups." : "L'authentification à deux facteurs est appliquée aux membres des groupes suivants.", + "Enforced groups" : "Groupes forcés", "Two-factor authentication is not enforced for\tmembers of the following groups." : "L'authentification à deux facteurs n'est pas appliquée aux \tutilisateurs des groupes suivants.", + "Excluded groups" : "Groupes exclus", "Save changes" : "Enregistrer les modifications", "Official apps are developed by and within the community. They offer central functionality and are ready for production use." : "Les applications officielles sont développées par et dans la communauté. Elles offrent les fonctionnalités indispensables et sont prêtes pour être utilisées en production.", "Official" : "Officielle", @@ -123,6 +127,7 @@ OC.L10N.register( "Remove" : "Supprimer", "Disable" : "Désactiver", "All" : "Tous", + "Limit app usage to groups" : "Limiter l'utilisation de l'application aux groupes", "No results" : "Aucun résultat", "View in store" : "Afficher dans le magasin d'application", "Visit website" : "Visiter le site web", @@ -134,6 +139,7 @@ OC.L10N.register( "This app has no maximum Nextcloud version assigned. This will be an error in the future." : "Cette application n'a pas de version maximum Nextcloud exigée. Ce sera considéré comme une erreur à l'avenir.", "This app cannot be installed because the following dependencies are not fulfilled:" : "Cette application ne peut être installée à cause de ces dépendances non satisfaites :", "Update to {update}" : "Mise à jour vers {update}", + "Results from other categories" : "Résultats d'autres catégories", "No apps found for your version" : "Pas d'application trouvée pour votre version", "Disable all" : "Tout désactiver", "Enable all" : "Tout activer", @@ -141,7 +147,10 @@ OC.L10N.register( "Enable" : "Activer", "The app will be downloaded from the app store" : "Cette application va être téléchargée depuis l'app store", "You do not have permissions to see the details of this user" : "Vous n'avez pas les autorisations pour voir le détail de cet utilisateur", + "The backend does not support changing the display name" : "Le backend ne prend pas en charge la modification du nom d'affichage", "New password" : "Nouveau mot de passe", + "Add user in group" : "Ajouter un utilisateur au groupe", + "Set user as admin for" : "Définir en tant qu'administrateur pour", "Select user quota" : "Sélectionner le quota de l'utilisateur ", "No language set" : "Aucune langue définie", "Never" : "Jamais", @@ -177,8 +186,10 @@ OC.L10N.register( "{license}-licensed" : "{license}-Sous licence", "Default quota:" : "Quota par défaut :", "Select default quota" : "Sélectionner le quota par défaut", + "Show Languages" : "Afficher les langues", "Show last login" : "Montrer la dernière connexion", "Show user backend" : "Montrer la source de l'identifiant", + "Show storage path" : "Afficher le chemin du stockage", "You are about to remove the group {group}. The users will NOT be deleted." : "Vous êtes sur le point de supprimer le groupe {group}. Les utilisateurs ne seront PAS supprimés.", "Please confirm the group removal " : "Veuillez confirmer la suppression du groupe", "Remove group" : "Supprimer le groupe", diff --git a/settings/l10n/fr.json b/settings/l10n/fr.json index f0805b4a890..e3884b3e22a 100644 --- a/settings/l10n/fr.json +++ b/settings/l10n/fr.json @@ -112,7 +112,11 @@ "Two-factor authentication can be enforced for all\tusers and specific groups. If they do not have a two-factor provider configured, they will be unable to log into the system." : "L'authentification à deux facteurs peut être spécifiée pour tous les \tutilisateurs et groupes spécifiques. S'ils n'ont pas de fournisseur à deux facteurs configuré, ils seront dans l'incapacité de se connecter au système.", "Enforce two-factor authentication" : "Imposer l'authentification à deux facteurs", "Limit to groups" : "Limiter aux groupes", + "Enforcement of two-factor authentication can be set for certain groups only." : "L'application de l'authentification à deux facteurs ne peut être définie que pour certains groupes.", + "Two-factor authentication is enforced for all\tmembers of the following groups." : "L'authentification à deux facteurs est appliquée aux membres des groupes suivants.", + "Enforced groups" : "Groupes forcés", "Two-factor authentication is not enforced for\tmembers of the following groups." : "L'authentification à deux facteurs n'est pas appliquée aux \tutilisateurs des groupes suivants.", + "Excluded groups" : "Groupes exclus", "Save changes" : "Enregistrer les modifications", "Official apps are developed by and within the community. They offer central functionality and are ready for production use." : "Les applications officielles sont développées par et dans la communauté. Elles offrent les fonctionnalités indispensables et sont prêtes pour être utilisées en production.", "Official" : "Officielle", @@ -121,6 +125,7 @@ "Remove" : "Supprimer", "Disable" : "Désactiver", "All" : "Tous", + "Limit app usage to groups" : "Limiter l'utilisation de l'application aux groupes", "No results" : "Aucun résultat", "View in store" : "Afficher dans le magasin d'application", "Visit website" : "Visiter le site web", @@ -132,6 +137,7 @@ "This app has no maximum Nextcloud version assigned. This will be an error in the future." : "Cette application n'a pas de version maximum Nextcloud exigée. Ce sera considéré comme une erreur à l'avenir.", "This app cannot be installed because the following dependencies are not fulfilled:" : "Cette application ne peut être installée à cause de ces dépendances non satisfaites :", "Update to {update}" : "Mise à jour vers {update}", + "Results from other categories" : "Résultats d'autres catégories", "No apps found for your version" : "Pas d'application trouvée pour votre version", "Disable all" : "Tout désactiver", "Enable all" : "Tout activer", @@ -139,7 +145,10 @@ "Enable" : "Activer", "The app will be downloaded from the app store" : "Cette application va être téléchargée depuis l'app store", "You do not have permissions to see the details of this user" : "Vous n'avez pas les autorisations pour voir le détail de cet utilisateur", + "The backend does not support changing the display name" : "Le backend ne prend pas en charge la modification du nom d'affichage", "New password" : "Nouveau mot de passe", + "Add user in group" : "Ajouter un utilisateur au groupe", + "Set user as admin for" : "Définir en tant qu'administrateur pour", "Select user quota" : "Sélectionner le quota de l'utilisateur ", "No language set" : "Aucune langue définie", "Never" : "Jamais", @@ -175,8 +184,10 @@ "{license}-licensed" : "{license}-Sous licence", "Default quota:" : "Quota par défaut :", "Select default quota" : "Sélectionner le quota par défaut", + "Show Languages" : "Afficher les langues", "Show last login" : "Montrer la dernière connexion", "Show user backend" : "Montrer la source de l'identifiant", + "Show storage path" : "Afficher le chemin du stockage", "You are about to remove the group {group}. The users will NOT be deleted." : "Vous êtes sur le point de supprimer le groupe {group}. Les utilisateurs ne seront PAS supprimés.", "Please confirm the group removal " : "Veuillez confirmer la suppression du groupe", "Remove group" : "Supprimer le groupe", diff --git a/settings/templates/settings/frame.php b/settings/templates/settings/frame.php index a4f44294ad0..1734a92b064 100644 --- a/settings/templates/settings/frame.php +++ b/settings/templates/settings/frame.php @@ -23,7 +23,7 @@ style('settings', 'settings'); script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); -script('core', ['multiselect', 'setupchecks']); +script('core', 'setupchecks'); script('files', 'jquery.fileupload'); ?> diff --git a/tests/acceptance/features/app-comments.feature b/tests/acceptance/features/app-comments.feature index a5bdb0aa745..1ee113d0aac 100644 --- a/tests/acceptance/features/app-comments.feature +++ b/tests/acceptance/features/app-comments.feature @@ -6,3 +6,26 @@ Feature: app-comments And I open the "Comments" tab in the details view When I create a new comment with "Hello world" as message Then I see a comment with "Hello world" as message + + Scenario: open the comments for a different file + Given I am logged in + And I create a new folder named "Folder" + And I open the details view for "welcome.txt" + And I open the "Comments" tab in the details view + And I create a new comment with "Hello world" as message + And I see a comment with "Hello world" as message + When I open the details view for "Folder" + # The "Comments" tab should already be opened + Then I see that there are no comments + + Scenario: write a comment in a file right after writing a comment in another file + Given I am logged in + And I create a new folder named "Folder" + And I open the details view for "Folder" + And I open the "Comments" tab in the details view + And I create a new comment with "Comment in Folder" as message + And I open the details view for "welcome.txt" + # The "Comments" tab should already be opened + When I create a new comment with "Comment in welcome.txt" as message + Then I see a comment with "Comment in welcome.txt" as message + And I see that there is no comment with "Comment in Folder" as message diff --git a/tests/acceptance/features/app-files-tags.feature b/tests/acceptance/features/app-files-tags.feature index 3da24b7e1c2..d606c7a88a4 100644 --- a/tests/acceptance/features/app-files-tags.feature +++ b/tests/acceptance/features/app-files-tags.feature @@ -8,6 +8,17 @@ Feature: app-files-tags When I open the input field for tags in the details view Then I see that the input field for tags in the details view is shown + Scenario: show the input field for tags in the details view after closing and opening the details view again + Given I am logged in + And I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + And I see that the details view is closed + And I open the details view for "welcome.txt" + And I see that the details view is open + When I open the input field for tags in the details view + Then I see that the input field for tags in the details view is shown + Scenario: show the input field for tags in the details view after the sharing tab has loaded Given I am logged in And I open the details view for "welcome.txt" diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index 33bed4a3ef2..61b7678e843 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -1,5 +1,42 @@ Feature: app-files + Scenario: open and close the details view + Given I am logged in + When I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + Then I see that the details view is closed + + Scenario: open and close the details view twice + Given I am logged in + And I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + And I see that the details view is closed + When I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + Then I see that the details view is closed + + Scenario: open and close the details view again after coming back from a different section + Given I am logged in + And I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + And I see that the details view is closed + And I open the "Recent" section + And I see that the current section is "Recent" + And I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + And I see that the details view is closed + When I open the "All files" section + And I see that the current section is "All files" + And I open the details view for "welcome.txt" + And I see that the details view is open + And I close the details view + Then I see that the details view is closed + Scenario: viewing a favorite file in its folder shows the correct sidebar view Given I am logged in And I create a new folder named "other" @@ -292,3 +329,22 @@ Feature: app-files When I unmark "welcome.txt" as favorite Then I see that "welcome.txt" is not marked as favorite And I see that "A name alphabetically lower than welcome.txt" precedes "welcome.txt" in the file list + + Scenario: mark a file as favorite in the details view + Given I am logged in + And I open the details view for "welcome.txt" + And I see that the details view is open + When I mark the file as favorite in the details view + Then I see that "welcome.txt" is marked as favorite + And I see that the file is marked as favorite in the details view + + Scenario: unmark a file as favorite in the details view + Given I am logged in + And I open the details view for "welcome.txt" + And I see that the details view is open + And I mark the file as favorite in the details view + And I see that "welcome.txt" is marked as favorite + And I see that the file is marked as favorite in the details view + When I unmark the file as favorite in the details view + Then I see that "welcome.txt" is not marked as favorite + And I see that the file is not marked as favorite in the details view diff --git a/tests/acceptance/features/bootstrap/CommentsAppContext.php b/tests/acceptance/features/bootstrap/CommentsAppContext.php index 13d8af4e60e..5d19412c30e 100644 --- a/tests/acceptance/features/bootstrap/CommentsAppContext.php +++ b/tests/acceptance/features/bootstrap/CommentsAppContext.php @@ -63,6 +63,15 @@ class CommentsAppContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function emptyContent() { + return Locator::forThe()->css(".emptycontent")-> + descendantOf(FilesAppContext::detailsView())-> + describedAs("Empty content in details view in Files app"); + } + + /** * @When /^I create a new comment with "([^"]*)" as message$/ */ public function iCreateANewCommentWithAsMessage($commentText) { @@ -71,10 +80,29 @@ class CommentsAppContext implements Context, ActorAwareInterface { } /** + * @Then /^I see that there are no comments$/ + */ + public function iSeeThatThereAreNoComments() { + PHPUnit_Framework_Assert::assertTrue( + $this->actor->find(self::emptyContent(), 10)->isVisible()); + } + + /** * @Then /^I see a comment with "([^"]*)" as message$/ */ public function iSeeACommentWithAsMessage($commentText) { PHPUnit_Framework_Assert::assertTrue( $this->actor->find(self::commentWithText($commentText), 10)->isVisible()); } + + /** + * @Then /^I see that there is no comment with "([^"]*)" as message$/ + */ + public function iSeeThatThereIsNoCommentWithAsMessage($commentText) { + try { + PHPUnit_Framework_Assert::assertFalse( + $this->actor->find(self::commentWithText($commentText))->isVisible()); + } catch (NoSuchElementException $exception) { + } + } } diff --git a/tests/acceptance/features/bootstrap/FilesAppContext.php b/tests/acceptance/features/bootstrap/FilesAppContext.php index d9ac6431716..a5d2c636f3e 100644 --- a/tests/acceptance/features/bootstrap/FilesAppContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppContext.php @@ -89,6 +89,33 @@ class FilesAppContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function favoriteActionInFileDetailsInDetailsView() { + return Locator::forThe()->css(".action-favorite")-> + descendantOf(self::fileDetailsInDetailsView())-> + describedAs("Favorite action in file details in details view in Files app"); + } + + /** + * @return Locator + */ + public static function notFavoritedStateIconInFileDetailsInDetailsView() { + return Locator::forThe()->css(".icon-star")-> + descendantOf(self::favoriteActionInFileDetailsInDetailsView())-> + describedAs("Not favorited state icon in file details in details view in Files app"); + } + + /** + * @return Locator + */ + public static function favoritedStateIconInFileDetailsInDetailsView() { + return Locator::forThe()->css(".icon-starred")-> + descendantOf(self::favoriteActionInFileDetailsInDetailsView())-> + describedAs("Favorited state icon in file details in details view in Files app"); + } + + /** + * @return Locator + */ public static function fileDetailsInDetailsViewWithText($fileDetailsText) { return Locator::forThe()->xpath("//span[normalize-space() = '$fileDetailsText']")-> descendantOf(self::fileDetailsInDetailsView())-> @@ -373,6 +400,24 @@ class FilesAppContext implements Context, ActorAwareInterface { } /** + * @When I mark the file as favorite in the details view + */ + public function iMarkTheFileAsFavoriteInTheDetailsView() { + $this->iSeeThatTheFileIsNotMarkedAsFavoriteInTheDetailsView(); + + $this->actor->find(self::favoriteActionInFileDetailsInDetailsView(), 10)->click(); + } + + /** + * @When I unmark the file as favorite in the details view + */ + public function iUnmarkTheFileAsFavoriteInTheDetailsView() { + $this->iSeeThatTheFileIsMarkedAsFavoriteInTheDetailsView(); + + $this->actor->find(self::favoriteActionInFileDetailsInDetailsView(), 10)->click(); + } + + /** * @When I check the tag :tag in the dropdown for tags in the details view */ public function iCheckTheTagInTheDropdownForTagsInTheDetailsView($tag) { @@ -501,6 +546,22 @@ class FilesAppContext implements Context, ActorAwareInterface { } /** + * @Then I see that the file is marked as favorite in the details view + */ + public function iSeeThatTheFileIsMarkedAsFavoriteInTheDetailsView() { + PHPUnit_Framework_Assert::assertNotNull( + $this->actor->find(self::favoritedStateIconInFileDetailsInDetailsView(), 10)); + } + + /** + * @Then I see that the file is not marked as favorite in the details view + */ + public function iSeeThatTheFileIsNotMarkedAsFavoriteInTheDetailsView() { + PHPUnit_Framework_Assert::assertNotNull( + $this->actor->find(self::notFavoritedStateIconInFileDetailsInDetailsView(), 10)); + } + + /** * @Then I see that the input field for tags in the details view is shown */ public function iSeeThatTheInputFieldForTagsInTheDetailsViewIsShown() { diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php index 0e50f4d92ec..9a8e588a229 100644 --- a/tests/lib/UrlGeneratorTest.php +++ b/tests/lib/UrlGeneratorTest.php @@ -14,8 +14,6 @@ use OCP\IURLGenerator; /** * Class UrlGeneratorTest - * - * @group DB */ class UrlGeneratorTest extends \Test\TestCase { @@ -74,7 +72,7 @@ class UrlGeneratorTest extends \Test\TestCase { * @dataProvider provideSubDirAppUrlParts */ public function testLinkToSubDir($app, $file, $args, $expectedResult) { - \OC::$WEBROOT = '/owncloud'; + \OC::$WEBROOT = '/nextcloud'; $result = $this->urlGenerator->linkTo($app, $file, $args); $this->assertEquals($expectedResult, $result); } @@ -84,32 +82,32 @@ class UrlGeneratorTest extends \Test\TestCase { */ public function testLinkToRouteAbsolute($route, $expected) { $this->mockBaseUrl(); - \OC::$WEBROOT = '/owncloud'; + \OC::$WEBROOT = '/nextcloud'; $result = $this->urlGenerator->linkToRouteAbsolute($route); $this->assertEquals($expected, $result); } public function provideRoutes() { - return array( - array('files_ajax_list', 'http://localhost/owncloud/index.php/apps/files/ajax/list.php'), - array('core.Preview.getPreview', 'http://localhost/owncloud/index.php/core/preview.png'), - ); + return [ + ['files_ajax_list', 'http://localhost/nextcloud/index.php/apps/files/ajax/list.php'], + ['core.Preview.getPreview', 'http://localhost/nextcloud/index.php/core/preview.png'], + ]; } public function provideDocRootAppUrlParts() { - return array( - array('files', 'ajax/list.php', array(), '/index.php/apps/files/ajax/list.php'), - array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), - array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php?trut=trat&dut=dat'), - ); + return [ + ['files', 'ajax/list.php', [], '/index.php/apps/files/ajax/list.php'], + ['files', 'ajax/list.php', ['trut' => 'trat', 'dut' => 'dat'], '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'], + ['', 'index.php', ['trut' => 'trat', 'dut' => 'dat'], '/index.php?trut=trat&dut=dat'], + ]; } public function provideSubDirAppUrlParts() { - return array( - array('files', 'ajax/list.php', array(), '/owncloud/index.php/apps/files/ajax/list.php'), - array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), - array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php?trut=trat&dut=dat'), - ); + return [ + ['files', 'ajax/list.php', [], '/nextcloud/index.php/apps/files/ajax/list.php'], + ['files', 'ajax/list.php', ['trut' => 'trat', 'dut' => 'dat'], '/nextcloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'], + ['', 'index.php', ['trut' => 'trat', 'dut' => 'dat'], '/nextcloud/index.php?trut=trat&dut=dat'], + ]; } /** @@ -131,34 +129,36 @@ class UrlGeneratorTest extends \Test\TestCase { */ function testGetAbsoluteURLSubDir($url, $expectedResult) { $this->mockBaseUrl(); - \OC::$WEBROOT = '/owncloud'; + \OC::$WEBROOT = '/nextcloud'; $result = $this->urlGenerator->getAbsoluteURL($url); $this->assertEquals($expectedResult, $result); } public function provideDocRootURLs() { - return array( - array("index.php", "http://localhost/index.php"), - array("/index.php", "http://localhost/index.php"), - array("/apps/index.php", "http://localhost/apps/index.php"), - array("apps/index.php", "http://localhost/apps/index.php"), - ); + return [ + ['index.php', 'http://localhost/index.php'], + ['/index.php', 'http://localhost/index.php'], + ['/apps/index.php', 'http://localhost/apps/index.php'], + ['apps/index.php', 'http://localhost/apps/index.php'], + ]; } public function provideSubDirURLs() { - return array( - array("index.php", "http://localhost/owncloud/index.php"), - array("/index.php", "http://localhost/owncloud/index.php"), - array("/apps/index.php", "http://localhost/owncloud/apps/index.php"), - array("apps/index.php", "http://localhost/owncloud/apps/index.php"), - ); + return [ + ['', 'http://localhost/nextcloud/'], + ['/', 'http://localhost/nextcloud/'], + ['index.php', 'http://localhost/nextcloud/index.php'], + ['/index.php', 'http://localhost/nextcloud/index.php'], + ['/apps/index.php', 'http://localhost/nextcloud/apps/index.php'], + ['apps/index.php', 'http://localhost/nextcloud/apps/index.php'], + ]; } public function testGetBaseUrl() { $this->mockBaseUrl(); \OC::$WEBROOT = '/nextcloud'; $actual = $this->urlGenerator->getBaseUrl(); - $expected = "http://localhost/nextcloud"; + $expected = 'http://localhost/nextcloud'; $this->assertEquals($expected, $actual); } |