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',
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: {
},
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) {
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')
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
}