Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/firstrunwizard.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-01-09 16:45:43 +0300
committerJulius Härtl <jus@bitgrid.net>2019-01-09 16:45:43 +0300
commit0d4c689f40afc110626d6da5f973d395655ac25c (patch)
treefaf0441ff445ec29cd669dd47a57812b55a84d45 /src
parent8541ba04fdcb9332d5f4d107497c6069a79e37da (diff)
Add linter and fix style errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r--src/App.vue64
-rw-r--r--src/main.js27
2 files changed, 43 insertions, 48 deletions
diff --git a/src/App.vue b/src/App.vue
index b08704bc..80c5bfad 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,5 @@
<template>
- <transition name="modal" v-if="showModal">
+ <transition v-if="showModal" name="modal">
<div id="firstrunwizard" class="modal-mask">
<div id="firstrunwizard-navigation">
<a v-if="hasPrevious" id="prev" @click="previous">
@@ -12,7 +12,7 @@
<span class="hidden-visually">{{ t('firstrunwizard', 'Close') }}</span>
</a>
</div>
- <div class="modal-wrapper" v-on:click.self="close">
+ <div class="modal-wrapper" @click.self="close">
<div class="modal-container">
<div class="modal-header">
<div class="firstrunwizard-header">
@@ -21,19 +21,19 @@
{{ oc_defaults.name }}
</p>
</div>
- <h2 v-html="oc_defaults.slogan"></h2>
- <p></p>
+ <h2 v-html="oc_defaults.slogan" />
+ <p />
</div>
</div>
<div class="modal-body">
- <slot name="body" v-if="slides.length > 0">
+ <slot v-if="slides.length > 0" name="body">
<transition name="fade" mode="out-in">
- <div v-if="slides[currentSlide].type === 'inline'" v-html="slides[currentSlide].content" :key="currentSlide"></div>
+ <div v-if="slides[currentSlide].type === 'inline'" :key="currentSlide" v-html="slides[currentSlide].content" />
</transition>
</slot>
</div>
<div class="modal-footer">
- <button class="primary modal-default-button" @click="close" v-if="isLast">
+ <button v-if="isLast" class="primary modal-default-button" @click="close">
{{ t('firstrunwizard', 'Start using Nextcloud') }}
</button>
</div>
@@ -315,11 +315,7 @@
display: inline-block;
}
- /*
- * The following styles are auto-applied to elements with
- * transition="modal" when their visibility is toggled
- * by Vue.js.
- */
+ /* Transitions */
.fade-enter-active, .fade-leave-active {
transition: transform .1s, opacity .25s;
@@ -396,37 +392,37 @@
</style>
<script>
-import axios from 'nextcloud-axios';
+import axios from 'nextcloud-axios'
export default {
name: 'FirstRunWizard',
- beforeMount() {
- axios.get(OC.generateUrl('/apps/firstrunwizard/wizard')).then((response) => {
- this.slides = response.data
- this.showModal = true
- })
- },
data() {
return {
showModal: false,
slides: [],
- currentSlide: 0,
- };
+ currentSlide: 0
+ }
},
computed: {
hasNext() {
- return this.currentSlide < this.slides.length-1
+ return this.currentSlide < this.slides.length - 1
},
hasPrevious() {
return this.currentSlide > 0
},
isLast() {
- return this.currentSlide === this.slides.length-1
+ return this.currentSlide === this.slides.length - 1
},
isFirst() {
return this.currentSlide === 0
}
},
+ beforeMount() {
+ axios.get(OC.generateUrl('/apps/firstrunwizard/wizard')).then((response) => {
+ this.slides = response.data
+ this.showModal = true
+ })
+ },
methods: {
open() {
this.showModal = true
@@ -452,18 +448,18 @@ export default {
},
handleKeydown(e) {
switch (e.keyCode) {
- case 37:
- this.previous()
- break
- case 13:
- case 39:
- this.next()
- break
- case 27:
- this.close()
- break
+ case 37:
+ this.previous()
+ break
+ case 13:
+ case 39:
+ this.next()
+ break
+ case 27:
+ this.close()
+ break
}
}
}
-};
+}
</script>
diff --git a/src/main.js b/src/main.js
index 79a14806..6564feae 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,25 +1,24 @@
-import Vue from 'vue';
+import Vue from 'vue'
import { generateFilePath } from 'nextcloud-server/dist/router'
-__webpack_public_path__ = generateFilePath('firstrunwizard', '', 'js/')
-import App from './App.vue';
+import App from './App.vue'
+// eslint-disable-next-line
+__webpack_public_path__ = generateFilePath('firstrunwizard', '', 'js/');
-
-
-/* global t */
+/* global t OC oc_defaults */
// bind to window
-Vue.prototype.OC = OC;
-Vue.prototype.t = t;
-Vue.prototype.oc_defaults = oc_defaults;
-
+Vue.prototype.OC = OC
+Vue.prototype.t = t
+// eslint-disable-next-line
+Vue.prototype.oc_defaults = oc_defaults
-let el = document.createElement('div');
+let el = document.createElement('div')
el.id = 'firstrunwizard'
-document.querySelector('body').appendChild(el);
+document.querySelector('body').appendChild(el)
const app = new Vue({
el: '#firstrunwizard',
render: h => h(App)
-});
+})
-window.OCA.FirstRunWizard = app.$children[0];
+window.OCA.FirstRunWizard = app.$children[0]