feat: login page UI

This commit is contained in:
NGPixel
2017-09-10 01:41:22 -04:00
parent dd73b036d2
commit 52630127cd
21 changed files with 940 additions and 869 deletions

View File

@@ -1,28 +1,21 @@
'use strict'
/* global $, siteRoot */
/* global siteConfig */
/* eslint-disable no-new */
import Vue from 'vue'
import VueResource from 'vue-resource'
import VueClipboards from 'vue-clipboards'
import VueLodash from 'vue-lodash'
import store from './store'
import io from 'socket-io-client'
import i18next from 'i18next'
import i18nextXHR from 'i18next-xhr-backend'
import VueI18Next from '@panter/vue-i18next'
import 'jquery-contextmenu'
import 'jquery-simple-upload'
import 'jquery-smooth-scroll'
import 'jquery-sticky'
// ====================================
// Load Helpers
// ====================================
import helpers from './helpers'
import _ from './helpers/lodash'
// ====================================
// Load Vue Components
@@ -63,7 +56,6 @@ import sourceViewComponent from './pages/source-view.component.js'
Vue.use(VueResource)
Vue.use(VueClipboards)
Vue.use(VueI18Next)
Vue.use(VueLodash, _)
Vue.use(helpers)
// ====================================
@@ -105,39 +97,27 @@ i18next
.use(i18nextXHR)
.init({
backend: {
loadPath: siteRoot + '/js/i18n/{{lng}}.json'
loadPath: siteConfig.path + '/js/i18n/{{lng}}.json'
},
lng: siteLang,
fallbackLng: siteLang
lng: siteConfig.lang,
fallbackLng: siteConfig.lang
})
$(() => {
document.addEventListener('DOMContentLoaded', ev => {
// ====================================
// Notifications
// ====================================
$(window).bind('beforeunload', () => {
window.addEventListener('beforeunload', () => {
store.dispatch('startLoading')
})
$(document).ajaxSend(() => {
store.dispatch('startLoading')
}).ajaxComplete(() => {
store.dispatch('stopLoading')
})
// ====================================
// Establish WebSocket connection
// ====================================
let socket = io(window.location.origin)
window.socket = socket
// ====================================
// Bootstrap Vue
// ====================================
const i18n = new VueI18Next(i18next)
window.wikijs = new Vue({
window.wiki = new Vue({
mixins: [helpers],
components: {},
store,
@@ -151,9 +131,7 @@ $(() => {
}
},
mounted() {
$('a:not(.toc-anchor)').smoothScroll({ speed: 500, offset: -50 })
$('#header').sticky({ topSpacing: 0 })
$('.sidebar-pagecontents').sticky({ topSpacing: 15, bottomSpacing: 75 })
}
})
})