]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove old shipped background
authorJulius Härtl <jus@bitgrid.net>
Fri, 14 Aug 2020 15:21:35 +0000 (17:21 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 19 Aug 2020 15:07:27 +0000 (17:07 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Service/BackgroundService.php
apps/dashboard/src/App.vue
apps/dashboard/src/components/BackgroundSettings.vue

index e8676a76e89b952f3374d843396db0f9213827af..a651d11618f8bff30c4e93556946a7163dc85e81 100644 (file)
@@ -37,8 +37,6 @@ use OCP\IConfig;
 class BackgroundService {
 
        const SHIPPED_BACKGROUNDS = [
-               'flickr-148302424@N05-36591009215.jpg',
-               'flickr-paszczak000-8715851521.jpg',
                'anatoly-mikhaltsov-butterfly-wing-scale.jpg',
                'bernie-cetonia-aurata-take-off-composition.jpg',
                'dejan-krsmanovic-ribbed-red-metal.jpg',
index 33f820ecd7a2ecca0c1889587b0afa3736ee1f5a..c4a41f5dac47666d2ec45383d7bef16f9a56350c 100644 (file)
@@ -80,6 +80,19 @@ const background = loadState('dashboard', 'background')
 
 const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
 
+// FIXME: move out duplicate
+const getBackgroundUrl = (background, time = 0) => {
+       if (background === 'default') {
+               if (window.OCA.Accessibility.theme === 'dark') {
+                       return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
+               }
+               return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
+       } else if (background === 'custom') {
+               return generateUrl('/apps/dashboard/background') + '?v=' + time
+       }
+       return prefixWithBaseUrl(background)
+}
+
 export default {
        name: 'App',
        components: {
@@ -111,15 +124,7 @@ export default {
        },
        computed: {
                backgroundImage() {
-                       if (this.background === 'default') {
-                               if (window.OCA.Accessibility.theme === 'dark') {
-                                       return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
-                               }
-                               return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
-                       } else if (this.background === 'custom') {
-                               return generateUrl('/apps/dashboard/background') + '?v=' + this.backgroundTime
-                       }
-                       return prefixWithBaseUrl(this.background)
+                       return getBackgroundUrl(this.background, this.backgroundTime)
                },
                tooltip() {
                        if (!this.firstRun) {
index ad7898f8abec009ee39ddf32c97421ebd05e9da2..b704d4b0724142ceb1316fd710f64ada254ef0b1 100644 (file)
@@ -48,7 +48,6 @@
 import axios from '@nextcloud/axios'
 import { generateUrl, generateFilePath } from '@nextcloud/router'
 import { loadState } from '@nextcloud/initial-state'
-import isMobile from '../mixins/isMobile'
 
 const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
 const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
@@ -56,9 +55,9 @@ const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
 const getBackgroundUrl = (background, time = 0) => {
        if (background === 'default') {
                if (window.OCA.Accessibility.theme === 'dark') {
-                       return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
+                       return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
                }
-               return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
+               return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
        } else if (background === 'custom') {
                return generateUrl('/apps/dashboard/background') + '?v=' + time
        }