mirror of https://github.com/requarks/wiki
parent
dd73b036d2
commit
52630127cd
After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 134 KiB |
@ -0,0 +1,153 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* 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 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
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
import alertComponent from './components/alert.vue'
|
||||||
|
import anchorComponent from './components/anchor.vue'
|
||||||
|
import colorPickerComponent from './components/color-picker.vue'
|
||||||
|
import editorCodeblockComponent from './components/editor-codeblock.vue'
|
||||||
|
import editorFileComponent from './components/editor-file.vue'
|
||||||
|
import editorVideoComponent from './components/editor-video.vue'
|
||||||
|
import historyComponent from './components/history.vue'
|
||||||
|
import loadingSpinnerComponent from './components/loading-spinner.vue'
|
||||||
|
import modalCreatePageComponent from './components/modal-create-page.vue'
|
||||||
|
import modalCreateUserComponent from './components/modal-create-user.vue'
|
||||||
|
import modalDeleteUserComponent from './components/modal-delete-user.vue'
|
||||||
|
import modalDiscardPageComponent from './components/modal-discard-page.vue'
|
||||||
|
import modalMovePageComponent from './components/modal-move-page.vue'
|
||||||
|
import modalProfile2faComponent from './components/modal-profile-2fa.vue'
|
||||||
|
import modalUpgradeSystemComponent from './components/modal-upgrade-system.vue'
|
||||||
|
import pageLoaderComponent from './components/page-loader.vue'
|
||||||
|
import searchComponent from './components/search.vue'
|
||||||
|
import toggleComponent from './components/toggle.vue'
|
||||||
|
import treeComponent from './components/tree.vue'
|
||||||
|
|
||||||
|
import adminEditUserComponent from './pages/admin-edit-user.component.js'
|
||||||
|
import adminProfileComponent from './pages/admin-profile.component.js'
|
||||||
|
import adminSettingsComponent from './pages/admin-settings.component.js'
|
||||||
|
import adminThemeComponent from './pages/admin-theme.component.js'
|
||||||
|
import contentViewComponent from './pages/content-view.component.js'
|
||||||
|
import editorComponent from './components/editor.component.js'
|
||||||
|
import sourceViewComponent from './pages/source-view.component.js'
|
||||||
|
|
||||||
|
// ====================================
|
||||||
|
// Initialize Vue Modules
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
Vue.use(VueResource)
|
||||||
|
Vue.use(VueClipboards)
|
||||||
|
Vue.use(VueI18Next)
|
||||||
|
Vue.use(VueLodash, _)
|
||||||
|
Vue.use(helpers)
|
||||||
|
|
||||||
|
// ====================================
|
||||||
|
// Register Vue Components
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
Vue.component('alert', alertComponent)
|
||||||
|
Vue.component('adminEditUser', adminEditUserComponent)
|
||||||
|
Vue.component('adminProfile', adminProfileComponent)
|
||||||
|
Vue.component('adminSettings', adminSettingsComponent)
|
||||||
|
Vue.component('adminTheme', adminThemeComponent)
|
||||||
|
Vue.component('anchor', anchorComponent)
|
||||||
|
Vue.component('colorPicker', colorPickerComponent)
|
||||||
|
Vue.component('contentView', contentViewComponent)
|
||||||
|
Vue.component('editor', editorComponent)
|
||||||
|
Vue.component('editorCodeblock', editorCodeblockComponent)
|
||||||
|
Vue.component('editorFile', editorFileComponent)
|
||||||
|
Vue.component('editorVideo', editorVideoComponent)
|
||||||
|
Vue.component('history', historyComponent)
|
||||||
|
Vue.component('loadingSpinner', loadingSpinnerComponent)
|
||||||
|
Vue.component('modalCreatePage', modalCreatePageComponent)
|
||||||
|
Vue.component('modalCreateUser', modalCreateUserComponent)
|
||||||
|
Vue.component('modalDeleteUser', modalDeleteUserComponent)
|
||||||
|
Vue.component('modalDiscardPage', modalDiscardPageComponent)
|
||||||
|
Vue.component('modalMovePage', modalMovePageComponent)
|
||||||
|
Vue.component('modalProfile2fa', modalProfile2faComponent)
|
||||||
|
Vue.component('modalUpgradeSystem', modalUpgradeSystemComponent)
|
||||||
|
Vue.component('pageLoader', pageLoaderComponent)
|
||||||
|
Vue.component('search', searchComponent)
|
||||||
|
Vue.component('sourceView', sourceViewComponent)
|
||||||
|
Vue.component('toggle', toggleComponent)
|
||||||
|
Vue.component('tree', treeComponent)
|
||||||
|
|
||||||
|
// ====================================
|
||||||
|
// Load Localization strings
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
i18next
|
||||||
|
.use(i18nextXHR)
|
||||||
|
.init({
|
||||||
|
backend: {
|
||||||
|
loadPath: siteConfig.path + '/js/i18n/{{lng}}.json'
|
||||||
|
},
|
||||||
|
lng: siteConfig.lang,
|
||||||
|
fallbackLng: siteConfig.lang
|
||||||
|
})
|
||||||
|
|
||||||
|
$(() => {
|
||||||
|
// ====================================
|
||||||
|
// Notifications
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
$(window).bind('beforeunload', () => {
|
||||||
|
store.dispatch('startLoading')
|
||||||
|
})
|
||||||
|
$(document).ajaxSend(() => {
|
||||||
|
store.dispatch('startLoading')
|
||||||
|
}).ajaxComplete(() => {
|
||||||
|
store.dispatch('stopLoading')
|
||||||
|
})
|
||||||
|
|
||||||
|
// ====================================
|
||||||
|
// Bootstrap Vue
|
||||||
|
// ====================================
|
||||||
|
|
||||||
|
const i18n = new VueI18Next(i18next)
|
||||||
|
if (document.querySelector('#root')) {
|
||||||
|
window.wikijs = new Vue({
|
||||||
|
mixins: [helpers],
|
||||||
|
components: {},
|
||||||
|
store,
|
||||||
|
i18n,
|
||||||
|
el: '#root',
|
||||||
|
methods: {
|
||||||
|
changeTheme(opts) {
|
||||||
|
this.$el.className = `has-stickynav is-primary-${opts.primary} is-alternate-${opts.alt}`
|
||||||
|
this.$refs.header.className = `nav is-${opts.primary}`
|
||||||
|
this.$refs.footer.className = `footer is-${opts.footer}`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
$('a:not(.toc-anchor)').smoothScroll({ speed: 500, offset: -50 })
|
||||||
|
$('#header').sticky({ topSpacing: 0 })
|
||||||
|
$('.sidebar-pagecontents').sticky({ topSpacing: 15, bottomSpacing: 75 })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
@ -1,7 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
/* global $ */
|
|
||||||
|
|
||||||
$(() => {
|
|
||||||
$('#login-user').focus()
|
|
||||||
})
|
|
@ -0,0 +1,30 @@
|
|||||||
|
doctype html
|
||||||
|
html
|
||||||
|
head
|
||||||
|
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
||||||
|
meta(charset='UTF-8')
|
||||||
|
meta(name='viewport', content='width=device-width, initial-scale=1')
|
||||||
|
meta(name='theme-color', content='#009688')
|
||||||
|
meta(name='msapplication-TileColor', content='#009688')
|
||||||
|
meta(name='msapplication-TileImage', content=config.site.path + '/favicons/ms-icon-144x144.png')
|
||||||
|
title= config.title
|
||||||
|
|
||||||
|
//- Favicon
|
||||||
|
each favsize in [57, 60, 72, 76, 114, 120, 144, 152, 180]
|
||||||
|
link(rel='apple-touch-icon', sizes=favsize + 'x' + favsize, href=config.site.path + '/favicons/apple-icon-' + favsize + 'x' + favsize + '.png')
|
||||||
|
link(rel='icon', type='image/png', sizes='192x192', href=config.site.path + '/favicons/android-icon-192x192.png')
|
||||||
|
each favsize in [32, 96, 16]
|
||||||
|
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href=config.site.path + '/favicons/favicon-' + favsize + 'x' + favsize + '.png')
|
||||||
|
link(rel='manifest', href=config.site.path + '/manifest.json')
|
||||||
|
|
||||||
|
//- Site Lang
|
||||||
|
script.
|
||||||
|
var siteConfig = !{JSON.stringify(config.site)}
|
||||||
|
|
||||||
|
//- JS / CSS
|
||||||
|
script(type='text/javascript', src=config.site.path + '/js/vendor.js')
|
||||||
|
script(type='text/javascript', src=config.site.path + '/js/app.js')
|
||||||
|
|
||||||
|
block head
|
||||||
|
|
||||||
|
block body
|
Loading…
Reference in new issue