]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use generateUrl and imagePath instead of OC.*
authorJoas Schilling <coding@schilljs.com>
Tue, 14 Jul 2020 09:05:17 +0000 (11:05 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 14 Jul 2020 13:30:59 +0000 (15:30 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
core/src/components/login/LoginForm.vue

index 113fe82191366285fccc3bfb6323995c83dff563..5adf5be0eaef4d9c7a2ae6a5a6a4f06aa600ed5f 100644 (file)
@@ -23,7 +23,7 @@
        <form ref="loginForm"
                method="post"
                name="login"
-               :action="OC.generateUrl('login')"
+               :action="loginActionUrl"
                @submit="submit">
                <fieldset>
                        <div v-if="apacheAuthFailed"
@@ -47,7 +47,7 @@
                                class="hidden">
                                <img class="float-spinner"
                                        alt=""
-                                       :src="OC.imagePath('core', 'loading-dark.gif')">
+                                       :src="loadingIcon">
                                <span id="messageText" />
                                <!-- the following div ensures that the spinner is always inside the #message div -->
                                <div style="clear: both;" />
@@ -82,7 +82,7 @@
                                <label for="password"
                                        class="infield">{{ t('Password') }}</label>
                                <a href="#" class="toggle-password" @click.stop.prevent="togglePassword">
-                                       <img :src="OC.imagePath('core', 'actions/toggle.svg')">
+                                       <img :src="toggleIcon">
                                </a>
                        </p>
 
 <script>
 import jstz from 'jstimezonedetect'
 import LoginButton from './LoginButton'
+import {
+       generateUrl,
+       imagePath,
+} from '@nextcloud/router'
 
 export default {
        name: 'LoginForm',
@@ -185,6 +189,15 @@ export default {
                userDisabled() {
                        return this.errors.indexOf('userdisabled') !== -1
                },
+               toggleIcon() {
+                       return imagePath('core', 'actions/toggle.svg')
+               },
+               loadingIcon() {
+                       return imagePath('core', 'loading-dark.gif')
+               },
+               loginActionUrl() {
+                       return generateUrl('login')
+               },
        },
        mounted() {
                if (this.username === '') {