refactor: removed 1.x client files
This commit is contained in:
parent
30ce9c8670
commit
23a6be1219
4
.babelrc
4
.babelrc
@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"comments": true,
|
"comments": true,
|
||||||
|
"plugins": [
|
||||||
|
"lodash",
|
||||||
|
"graphql-tag"
|
||||||
|
],
|
||||||
"presets": [
|
"presets": [
|
||||||
["env"],
|
["env"],
|
||||||
"stage-2"
|
"stage-2"
|
||||||
|
@ -13,12 +13,14 @@ import { ApolloLink } from 'apollo-link'
|
|||||||
import { createApolloFetch } from 'apollo-fetch'
|
import { createApolloFetch } from 'apollo-fetch'
|
||||||
import { BatchHttpLink } from 'apollo-link-batch-http'
|
import { BatchHttpLink } from 'apollo-link-batch-http'
|
||||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
import { InMemoryCache } from 'apollo-cache-inmemory'
|
||||||
|
import Hammer from 'hammerjs'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
// Load Modules
|
// Load Modules
|
||||||
// ====================================
|
// ====================================
|
||||||
|
|
||||||
|
import boot from './modules/boot'
|
||||||
import localization from './modules/localization'
|
import localization from './modules/localization'
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
@ -27,47 +29,14 @@ import localization from './modules/localization'
|
|||||||
|
|
||||||
import helpers from './helpers'
|
import helpers from './helpers'
|
||||||
|
|
||||||
// ====================================
|
|
||||||
// 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 loginComponent from './components/login.vue'
|
|
||||||
import modalCreatePageComponent from './components/modal-create-page.vue'
|
|
||||||
import modalCreateUserComponent from './components/modal-create-user.vue'
|
|
||||||
import modalDeletePageComponent from './components/modal-delete-page.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 navigatorComponent from './components/navigator.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 Global Vars
|
// Initialize Global Vars
|
||||||
// ====================================
|
// ====================================
|
||||||
|
|
||||||
window.wiki = null
|
window.wiki = null
|
||||||
|
window.boot = boot
|
||||||
window.CONSTANTS = CONSTANTS
|
window.CONSTANTS = CONSTANTS
|
||||||
|
window.Hammer = Hammer
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
// Initialize Apollo Client (GraphQL)
|
// Initialize Apollo Client (GraphQL)
|
||||||
@ -128,38 +97,12 @@ Vue.use(VeeValidate, {
|
|||||||
// Register Vue Components
|
// Register Vue Components
|
||||||
// ====================================
|
// ====================================
|
||||||
|
|
||||||
Vue.component('alert', alertComponent)
|
Vue.component('login', () => import(/* webpackMode: "eager" */ './components/login.vue'))
|
||||||
Vue.component('adminEditUser', adminEditUserComponent)
|
Vue.component('navigator', () => import(/* webpackMode: "eager" */ './components/navigator.vue'))
|
||||||
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('login', loginComponent)
|
|
||||||
Vue.component('modalCreatePage', modalCreatePageComponent)
|
|
||||||
Vue.component('modalCreateUser', modalCreateUserComponent)
|
|
||||||
Vue.component('modalDeletePage', modalDeletePageComponent)
|
|
||||||
Vue.component('modalDeleteUser', modalDeleteUserComponent)
|
|
||||||
Vue.component('modalDiscardPage', modalDiscardPageComponent)
|
|
||||||
Vue.component('modalMovePage', modalMovePageComponent)
|
|
||||||
Vue.component('modalProfile2fa', modalProfile2faComponent)
|
|
||||||
Vue.component('modalUpgradeSystem', modalUpgradeSystemComponent)
|
|
||||||
Vue.component('navigator', navigatorComponent)
|
|
||||||
Vue.component('pageLoader', pageLoaderComponent)
|
|
||||||
Vue.component('search', searchComponent)
|
|
||||||
Vue.component('setup', () => import(/* webpackChunkName: "setup" */ './components/setup.vue'))
|
Vue.component('setup', () => import(/* webpackChunkName: "setup" */ './components/setup.vue'))
|
||||||
Vue.component('sourceView', sourceViewComponent)
|
Vue.component('toggle', () => import(/* webpackMode: "eager" */ './components/toggle.vue'))
|
||||||
Vue.component('toggle', toggleComponent)
|
|
||||||
Vue.component('tree', treeComponent)
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', ev => {
|
let bootstrap = () => {
|
||||||
// ====================================
|
// ====================================
|
||||||
// Notifications
|
// Notifications
|
||||||
// ====================================
|
// ====================================
|
||||||
@ -178,16 +121,15 @@ document.addEventListener('DOMContentLoaded', ev => {
|
|||||||
components: {},
|
components: {},
|
||||||
mixins: [helpers],
|
mixins: [helpers],
|
||||||
store,
|
store,
|
||||||
i18n,
|
i18n
|
||||||
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}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// Dispatch boot ready
|
||||||
|
// ----------------------------------
|
||||||
|
|
||||||
|
window.boot.notify('vue')
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
// Load Icons
|
// Load Icons
|
||||||
// ====================================
|
// ====================================
|
||||||
@ -195,4 +137,6 @@ document.addEventListener('DOMContentLoaded', ev => {
|
|||||||
import(/* webpackChunkName: "icons" */ '../svg/icons.svg').then(icons => {
|
import(/* webpackChunkName: "icons" */ '../svg/icons.svg').then(icons => {
|
||||||
document.body.insertAdjacentHTML('beforeend', icons)
|
document.body.insertAdjacentHTML('beforeend', icons)
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
|
window.boot.onDOMReady(bootstrap)
|
||||||
|
@ -1,14 +1,3 @@
|
|||||||
// =======================================
|
|
||||||
// Intl polyfill
|
|
||||||
// =======================================
|
|
||||||
// Requirement: Safari 9 and below
|
|
||||||
|
|
||||||
if (!global.Intl) {
|
|
||||||
require('intl')
|
|
||||||
require('intl/locale-data/jsonp/en')
|
|
||||||
require('intl/locale-data/jsonp/fr')
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================
|
// =======================================
|
||||||
// Promise polyfill
|
// Promise polyfill
|
||||||
// =======================================
|
// =======================================
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(name='alert', enter-active-class="animated zoomIn", leave-active-class="animated fadeOutRight")
|
|
||||||
.alert(v-if='shown', v-bind:class='style')
|
|
||||||
.alert-icon: i(v-bind:class='icon')
|
|
||||||
.alert-msg {{ msg }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'alert',
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
shown() { return this.$store.state.alert.shown },
|
|
||||||
style() { return 'is-' + this.$store.state.alert.style },
|
|
||||||
icon() { return 'nc-icon-outline ' + this.$store.state.alert.icon },
|
|
||||||
msg() { return this.$store.state.alert.msg }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,55 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-blue
|
|
||||||
span {{ $t('modal.anchortitle') }}
|
|
||||||
section
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', ref='anchorURLinput', v-model='anchorURL')
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-blue(v-clipboard='anchorURL', @success="clipboardSuccess", @error="clipboardError") {{ $t('modal.copyclipboard') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'anchor',
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
anchorURL () {
|
|
||||||
return window.location.href.split('#')[0] + '#' + this.$store.state.anchor.hash
|
|
||||||
},
|
|
||||||
isShown () {
|
|
||||||
return this.$store.state.anchor.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel () {
|
|
||||||
this.$store.dispatch('anchor/close')
|
|
||||||
},
|
|
||||||
clipboardSuccess () {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'business_notes',
|
|
||||||
msg: this.$t('modal.anchorsuccess')
|
|
||||||
})
|
|
||||||
this.$store.dispatch('anchor/close')
|
|
||||||
},
|
|
||||||
clipboardError () {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'business_notes',
|
|
||||||
msg: this.$t('modal.anchorerror')
|
|
||||||
})
|
|
||||||
this.$refs.anchorURLinput.select()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,41 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
.colorpicker
|
|
||||||
.colorpicker-choice(v-for='color in colors', :class='["is-" + color, color === value ? "is-active" : ""]', @click='setColor(color)')
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'color-picker',
|
|
||||||
props: ['value'],
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
colors: [
|
|
||||||
'red',
|
|
||||||
'pink',
|
|
||||||
'purple',
|
|
||||||
'deep-purple',
|
|
||||||
'indigo',
|
|
||||||
'blue',
|
|
||||||
'light-blue',
|
|
||||||
'cyan',
|
|
||||||
'teal',
|
|
||||||
'green',
|
|
||||||
'light-green',
|
|
||||||
'lime',
|
|
||||||
'yellow',
|
|
||||||
'amber',
|
|
||||||
'orange',
|
|
||||||
'deep-orange',
|
|
||||||
'brown',
|
|
||||||
'grey',
|
|
||||||
'blue-grey'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
setColor(color) {
|
|
||||||
this.$emit('input', color)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,128 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content.is-expanded(v-show='isShown')
|
|
||||||
header.is-green
|
|
||||||
span {{ $t('editor.codeblocktitle') }}
|
|
||||||
p.modal-notify(v-bind:class='{ "is-active": isLoading }')
|
|
||||||
span {{ $t('editor.codeblockloading', { name: modeSelected }) }}
|
|
||||||
i
|
|
||||||
section.is-gapless
|
|
||||||
.columns.is-stretched
|
|
||||||
.column.is-one-quarter.modal-sidebar.is-green(style={'max-width':'350px'})
|
|
||||||
.model-sidebar-header {{ $t('editor.codeblocklanguage') }}
|
|
||||||
.model-sidebar-content
|
|
||||||
p.control.is-fullwidth
|
|
||||||
select(v-model='modeSelected')
|
|
||||||
option(v-for='mode in modes', v-bind:value='mode.name') {{ mode.caption }}
|
|
||||||
.column.ace-container
|
|
||||||
#codeblock-editor
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('editor.discard') }}
|
|
||||||
a.button.is-green(v-on:click='insertCode') {{ $t('editor.codeblockinsert') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let codeEditor
|
|
||||||
let ace
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'editor-codeblock',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
modes: [],
|
|
||||||
modeSelected: 'text',
|
|
||||||
modelistLoaded: [],
|
|
||||||
isLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
content() {
|
|
||||||
return this.$store.state.editorCodeblock.content
|
|
||||||
},
|
|
||||||
isShown() {
|
|
||||||
return this.$store.state.editorCodeblock.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
modeSelected(val, oldVal) {
|
|
||||||
this.loadMode(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
let self = this
|
|
||||||
self._.delay(() => {
|
|
||||||
codeEditor = ace.edit('codeblock-editor')
|
|
||||||
codeEditor.setTheme('ace/theme/tomorrow_night')
|
|
||||||
codeEditor.getSession().setMode('ace/mode/' + self.modeSelected)
|
|
||||||
codeEditor.setOption('fontSize', '14px')
|
|
||||||
codeEditor.setOption('hScrollBarAlwaysVisible', false)
|
|
||||||
codeEditor.setOption('wrap', true)
|
|
||||||
codeEditor.setOption('useSoftTabs', true)
|
|
||||||
codeEditor.setOption('tabSize', 2)
|
|
||||||
codeEditor.setOption('showPrintMargin', false)
|
|
||||||
|
|
||||||
codeEditor.setValue(self.content)
|
|
||||||
|
|
||||||
codeEditor.focus()
|
|
||||||
codeEditor.renderer.updateFull()
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
loadMode(m) {
|
|
||||||
let self = this
|
|
||||||
if (self._.includes(self.modelistLoaded, m)) {
|
|
||||||
codeEditor.getSession().setMode('ace/mode/' + m)
|
|
||||||
} else {
|
|
||||||
self.isLoading = true
|
|
||||||
self.$http.get('/js/ace/mode-' + m + '.js').then(resp => {
|
|
||||||
if (resp.ok) {
|
|
||||||
eval(resp.bodyText) // eslint-disable-line no-eval
|
|
||||||
self.modelistLoaded.push(m)
|
|
||||||
ace.acequire('ace/mode/' + m)
|
|
||||||
codeEditor.getSession().setMode('ace/mode/' + m)
|
|
||||||
self._.delay(() => { self.isLoading = false }, 500)
|
|
||||||
} else {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.codeblockloadingerror')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
codeEditor.destroy()
|
|
||||||
this.$store.dispatch('editorCodeblock/close')
|
|
||||||
},
|
|
||||||
insertCode() {
|
|
||||||
let codeBlockText = '\n```' + this.modeSelected + '\n' + codeEditor.getValue() + '\n```\n'
|
|
||||||
this.$store.dispatch('editor/insert', codeBlockText)
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'files_archive-3d-check',
|
|
||||||
msg: this.$t('editor.codeblocksuccess')
|
|
||||||
})
|
|
||||||
this.cancel()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
FuseBox.import('/js/ace/ace.js', (acePkg) => {
|
|
||||||
ace = acePkg
|
|
||||||
this.modes = ace.acequire('ace/ext/modelist').modesByName
|
|
||||||
})
|
|
||||||
this.$root.$on('editorCodeblock/init', this.init)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,605 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content.is-expanded(v-show='isShown')
|
|
||||||
header.is-green
|
|
||||||
span {{ (mode === 'file') ? $t('editor.filetitle') : $t('editor.imagetitle') }}
|
|
||||||
p.modal-notify(:class='{ "is-active": isLoading }')
|
|
||||||
span {{ isLoadingText }}
|
|
||||||
i
|
|
||||||
.modal-toolbar.is-green
|
|
||||||
a.button(@click='newFolder')
|
|
||||||
i.nc-icon-outline.files_folder-14
|
|
||||||
span {{ $t('editor.newfolder') }}
|
|
||||||
a.button#btn-editor-file-upload
|
|
||||||
i.nc-icon-outline.arrows-1_cloud-upload-94
|
|
||||||
span {{ (mode === 'file') ? $t('editor.fileupload') : $t('editor.imageupload') }}
|
|
||||||
label
|
|
||||||
input(type='file', multiple, :disabled='isLoading', ref='editorFileUploadInput')
|
|
||||||
a.button(v-if='mode === "image"', @click='fetchFromUrl')
|
|
||||||
i.nc-icon-outline.arrows-1_cloud-download-93
|
|
||||||
span Fetch from URL
|
|
||||||
section.is-gapless
|
|
||||||
.columns.is-stretched
|
|
||||||
.column.is-one-quarter.modal-sidebar.is-green(style={'max-width':'350px'})
|
|
||||||
.model-sidebar-header {{ $t('editor.folders') }}
|
|
||||||
ul.model-sidebar-list
|
|
||||||
li(v-for='fld in folders')
|
|
||||||
a(@click='selectFolder(fld)', :class='{ "is-active": currentFolder === fld }')
|
|
||||||
i.nc-icon-outline.files_folder-17
|
|
||||||
span / {{ fld }}
|
|
||||||
.model-sidebar-header(v-if='mode === "image"') Alignment
|
|
||||||
.model-sidebar-content(v-if='mode === "image"')
|
|
||||||
p.control.is-fullwidth
|
|
||||||
select(v-model='currentAlign')
|
|
||||||
option(value='left') {{ $t('editor.imagealignleft') }}
|
|
||||||
option(value='center') {{ $t('editor.imagealigncenter') }}
|
|
||||||
option(value='right') {{ $t('editor.imagealignright') }}
|
|
||||||
option(value='logo') {{ $t('editor.imagealignlogo') }}
|
|
||||||
.column.editor-modal-choices.editor-modal-file-choices(v-if='mode === "file"')
|
|
||||||
figure(v-for='fl in files', :class='{ "is-active": currentFile === fl._id }', @click='selectFile(fl._id)', :data-uid='fl._id')
|
|
||||||
i(class='icon-file')
|
|
||||||
span: strong {{ fl.filename }}
|
|
||||||
span {{ fl.mime }}
|
|
||||||
span {{ filesize(fl.filesize) }}
|
|
||||||
em(v-show='files.length < 1')
|
|
||||||
i.icon-marquee-minus
|
|
||||||
| {{ $t('editor.filefolderempty') }}
|
|
||||||
.column.editor-modal-choices.editor-modal-image-choices(v-if='mode === "image"')
|
|
||||||
figure(v-for='img in files', v-bind:class='{ "is-active": currentFile === img._id }', v-on:click='selectFile(img._id)', v-bind:data-uid='img._id')
|
|
||||||
img(v-bind:src='"/uploads/t/" + img._id + ".png"')
|
|
||||||
span: strong {{ img.basename }}
|
|
||||||
span {{ filesize(img.filesize) }}
|
|
||||||
em(v-show='files.length < 1')
|
|
||||||
i.icon-marquee-minus
|
|
||||||
| {{ $t('editor.filefolderempty') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='cancel') {{ $t('editor.discard') }}
|
|
||||||
a.button.is-green(@click='insertFileLink') {{ (mode === 'file') ? $t('editor.fileinsert') : $t('editor.imageinsert') }}
|
|
||||||
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal.is-superimposed(v-show='newFolderShow')
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='newFolderShow')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='newFolderShow')
|
|
||||||
header.is-light-blue {{ $t('modal.newfoldertitle') }}
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.newfoldername') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', :placeholder='$t("modal.newfoldernameplaceholder")', v-model='newFolderName', ref='editorFileNewFolderInput', @keyup.enter='newFolderCreate', @keyup.esc='newFolderDiscard')
|
|
||||||
span.help.is-danger(v-show='newFolderError') {{ $t('modal.newfolderinvalid') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='newFolderDiscard') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-light-blue(@click='newFolderCreate') {{ $t('modal.create') }}
|
|
||||||
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal.is-superimposed(v-show='fetchFromUrlShow')
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='fetchFromUrlShow')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='fetchFromUrlShow')
|
|
||||||
header.is-light-blue Fetch Image from URL
|
|
||||||
section
|
|
||||||
label.label Enter full URL path to the image:
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', placeholder='http://www.example.com/some-image.png', v-model='fetchFromUrlURL', ref='editorFileFetchInput', @keyup.enter='fetchFromUrlGo', @keyup.esc='fetchFromUrlDiscard')
|
|
||||||
span.help.is-danger.is-hidden This URL path is invalid!
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='fetchFromUrlDiscard') Discard
|
|
||||||
a.button.is-light-blue(v-on:click='fetchFromUrlGo') Fetch
|
|
||||||
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal.is-superimposed(v-show='renameFileShow')
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='renameFileShow')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='renameFileShow')
|
|
||||||
header.is-indigo {{ $t('modal.renamefiletitle') }}
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.renamefilename') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input#txt-editor-file-rename(type='text', :placeholder='$t("modal.renamefilenameplaceholder")', v-model='renameFileFilename', ref='editorFileRenameInput', @keyup.enter='renameFileGo', @keyup.esc='renameFileDiscard')
|
|
||||||
span.help.is-danger.is-hidden {{ $t('modal.renamefileinvalid') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='renameFileDiscard') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-light-blue(@click='renameFileGo') {{ $t('modal.renamefile') }}
|
|
||||||
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal.is-superimposed(v-show='deleteFileShow')
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='deleteFileShow')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='deleteFileShow')
|
|
||||||
header.is-red {{ $t('modal.deletefiletitle') }}
|
|
||||||
section
|
|
||||||
span {{ $t('modal.deletefilewarn') }} #[strong {{deleteFileFilename}}]?
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='deleteFileWarn(false)') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-red(@click='deleteFileGo') {{ $t('modal.delete') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/* global $, socket */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'editor-file',
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
isLoading: false,
|
|
||||||
isLoadingText: '',
|
|
||||||
newFolderName: '',
|
|
||||||
newFolderShow: false,
|
|
||||||
newFolderError: false,
|
|
||||||
fetchFromUrlURL: '',
|
|
||||||
fetchFromUrlShow: false,
|
|
||||||
folders: [],
|
|
||||||
currentFolder: '',
|
|
||||||
currentFile: '',
|
|
||||||
currentAlign: 'left',
|
|
||||||
files: [],
|
|
||||||
uploadSucceeded: false,
|
|
||||||
postUploadChecks: 0,
|
|
||||||
renameFileShow: false,
|
|
||||||
renameFileId: '',
|
|
||||||
renameFileFilename: '',
|
|
||||||
deleteFileShow: false,
|
|
||||||
deleteFileId: '',
|
|
||||||
deleteFileFilename: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
return this.$store.state.editorFile.shown
|
|
||||||
},
|
|
||||||
mode () {
|
|
||||||
return this.$store.state.editorFile.mode
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init () {
|
|
||||||
$(this.$refs.editorFileUploadInput).on('change', this.upload)
|
|
||||||
this.refreshFolders()
|
|
||||||
},
|
|
||||||
cancel () {
|
|
||||||
$(this.$refs.editorFileUploadInput).off('change', this.upload)
|
|
||||||
this.$store.dispatch('editorFile/close')
|
|
||||||
},
|
|
||||||
filesize (rawSize) {
|
|
||||||
return this.$helpers.common.filesize(rawSize)
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// INSERT LINK TO FILE
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
selectFile(fileId) {
|
|
||||||
this.currentFile = fileId
|
|
||||||
},
|
|
||||||
insertFileLink() {
|
|
||||||
let selFile = this._.find(this.files, ['_id', this.currentFile])
|
|
||||||
selFile.normalizedPath = (selFile.folder === 'f:') ? selFile.filename : selFile.folder.slice(2) + '/' + selFile.filename
|
|
||||||
selFile.titleGuess = this._.startCase(selFile.basename)
|
|
||||||
|
|
||||||
let textToInsert = ''
|
|
||||||
|
|
||||||
if (this.mode === 'image') {
|
|
||||||
textToInsert = '![' + selFile.titleGuess + '](/uploads/' + selFile.normalizedPath + ' "' + selFile.titleGuess + '")'
|
|
||||||
switch (this.currentAlign) {
|
|
||||||
case 'center':
|
|
||||||
textToInsert += '{.align-center}'
|
|
||||||
break
|
|
||||||
case 'right':
|
|
||||||
textToInsert += '{.align-right}'
|
|
||||||
break
|
|
||||||
case 'logo':
|
|
||||||
textToInsert += '{.pagelogo}'
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
textToInsert = '[' + selFile.titleGuess + '](/uploads/' + selFile.normalizedPath + ' "' + selFile.titleGuess + '")'
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$store.dispatch('editor/insert', textToInsert)
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'ui-1_check-square-09',
|
|
||||||
msg: (this.mode === 'file') ? this.$t('editor.filesuccess') : this.$t('editor.imagesuccess')
|
|
||||||
})
|
|
||||||
this.cancel()
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// NEW FOLDER
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
newFolder() {
|
|
||||||
let self = this
|
|
||||||
this.newFolderName = ''
|
|
||||||
this.newFolderError = false
|
|
||||||
this.newFolderShow = true
|
|
||||||
this._.delay(() => { self.$refs.editorFileNewFolderInput.focus() }, 400)
|
|
||||||
},
|
|
||||||
newFolderDiscard() {
|
|
||||||
this.newFolderShow = false
|
|
||||||
},
|
|
||||||
newFolderCreate() {
|
|
||||||
let self = this
|
|
||||||
let regFolderName = new RegExp('^[a-z0-9][a-z0-9-]*[a-z0-9]$')
|
|
||||||
this.newFolderName = this._.kebabCase(this._.trim(this.newFolderName))
|
|
||||||
|
|
||||||
if (this._.isEmpty(this.newFolderName) || !regFolderName.test(this.newFolderName)) {
|
|
||||||
this.newFolderError = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.newFolderDiscard()
|
|
||||||
this.isLoadingText = this.$t('modal.newfolderloading')
|
|
||||||
this.isLoading = true
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsCreateFolder', { foldername: self.newFolderName }, (data) => {
|
|
||||||
self.folders = data
|
|
||||||
self.currentFolder = self.newFolderName
|
|
||||||
self.files = []
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'files_folder-check',
|
|
||||||
msg: self.$t('modal.newfoldersuccess', { name: self.newFolderName })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// FETCH FROM URL
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
fetchFromUrl() {
|
|
||||||
let self = this
|
|
||||||
this.fetchFromUrlURL = ''
|
|
||||||
this.fetchFromUrlShow = true
|
|
||||||
this._.delay(() => { self.$refs.editorFileFetchInput.focus() }, 400)
|
|
||||||
},
|
|
||||||
fetchFromUrlDiscard() {
|
|
||||||
this.fetchFromUrlShow = false
|
|
||||||
},
|
|
||||||
fetchFromUrlGo() {
|
|
||||||
let self = this
|
|
||||||
this.fetchFromUrlDiscard()
|
|
||||||
this.isLoadingText = 'Fetching image...'
|
|
||||||
this.isLoading = true
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsFetchFileFromURL', { folder: self.currentFolder, fetchUrl: self.fetchFromUrlURL }, (data) => {
|
|
||||||
if (data.ok) {
|
|
||||||
self.waitChangeComplete(self.files.length, true)
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.fileuploaderror', { err: data.msg })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// RENAME FILE
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
renameFile() {
|
|
||||||
let self = this
|
|
||||||
let c = this._.find(this.files, [ '_id', this.renameFileId ])
|
|
||||||
this.renameFileFilename = c.basename || ''
|
|
||||||
this.renameFileShow = true
|
|
||||||
this._.delay(() => {
|
|
||||||
self.$refs.editorFileRenameInput.select()
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
renameFileDiscard() {
|
|
||||||
this.renameFileShow = false
|
|
||||||
},
|
|
||||||
renameFileGo() {
|
|
||||||
let self = this
|
|
||||||
this.renameFileDiscard()
|
|
||||||
this.isLoadingText = this.$t('modal.renamefileloading')
|
|
||||||
this.isLoading = true
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsRenameFile', { uid: self.renameFileId, folder: self.currentFolder, filename: self.renameFileFilename }, (data) => {
|
|
||||||
if (data.ok) {
|
|
||||||
self.waitChangeComplete(self.files.length, false)
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('modal.renamefileerror', { err: data.msg })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// MOVE FILE
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
moveFile(uid, fld) {
|
|
||||||
let self = this
|
|
||||||
this.isLoadingText = this.$t('editor.filemoveloading')
|
|
||||||
this.isLoading = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsMoveFile', { uid, folder: fld }, (data) => {
|
|
||||||
if (data.ok) {
|
|
||||||
self.loadFiles()
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'files_check',
|
|
||||||
msg: self.$t('editor.filemovesuccess')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.filemoveerror', { err: data.msg })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// DELETE FILE
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
deleteFileWarn(show) {
|
|
||||||
if (show) {
|
|
||||||
let c = this._.find(this.files, [ '_id', this.deleteFileId ])
|
|
||||||
this.deleteFileFilename = c.filename || this.$t('editor.filedeletedefault')
|
|
||||||
}
|
|
||||||
this.deleteFileShow = show
|
|
||||||
},
|
|
||||||
deleteFileGo() {
|
|
||||||
let self = this
|
|
||||||
this.deleteFileWarn(false)
|
|
||||||
this.isLoadingText = this.$t('editor.filedeleteloading')
|
|
||||||
this.isLoading = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsDeleteFile', { uid: this.deleteFileId }, (data) => {
|
|
||||||
self.loadFiles()
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'ui-1_trash',
|
|
||||||
msg: self.$t('editor.filedeletesuccess')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// LOAD FROM REMOTE
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
selectFolder(fldName) {
|
|
||||||
this.currentFolder = fldName
|
|
||||||
this.loadFiles()
|
|
||||||
},
|
|
||||||
|
|
||||||
refreshFolders() {
|
|
||||||
let self = this
|
|
||||||
this.isLoadingText = this.$t('editor.foldersloading')
|
|
||||||
this.isLoading = true
|
|
||||||
this.currentFolder = ''
|
|
||||||
this.currentImage = ''
|
|
||||||
this.$nextTick(() => {
|
|
||||||
socket.emit('uploadsGetFolders', { }, (data) => {
|
|
||||||
self.folders = data
|
|
||||||
self.loadFiles()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
loadFiles(silent) {
|
|
||||||
let self = this
|
|
||||||
if (!silent) {
|
|
||||||
this.isLoadingText = this.$t('editor.fileloading')
|
|
||||||
this.isLoading = true
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
self.$nextTick(() => {
|
|
||||||
let loadAction = (self.mode === 'image') ? 'uploadsGetImages' : 'uploadsGetFiles'
|
|
||||||
socket.emit(loadAction, { folder: self.currentFolder }, (data) => {
|
|
||||||
self.files = data
|
|
||||||
if (!silent) {
|
|
||||||
self.isLoading = false
|
|
||||||
}
|
|
||||||
self.attachContextMenus()
|
|
||||||
resolve(true)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
waitChangeComplete(oldAmount, expectChange) {
|
|
||||||
let self = this
|
|
||||||
expectChange = (this._.isBoolean(expectChange)) ? expectChange : true
|
|
||||||
|
|
||||||
this.postUploadChecks++
|
|
||||||
this.isLoadingText = this.$t('editor.fileprocessing')
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
self.loadFiles(true).then(() => {
|
|
||||||
if ((self.files.length !== oldAmount) === expectChange) {
|
|
||||||
self.postUploadChecks = 0
|
|
||||||
self.isLoading = false
|
|
||||||
} else if (self.postUploadChecks > 5) {
|
|
||||||
self.postUploadChecks = 0
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.fileerror')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
self._.delay(() => {
|
|
||||||
self.waitChangeComplete(oldAmount, expectChange)
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------------------------
|
|
||||||
// IMAGE CONTEXT MENU
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
attachContextMenus() {
|
|
||||||
let self = this
|
|
||||||
let moveFolders = this._.map(this.folders, (f) => {
|
|
||||||
return {
|
|
||||||
name: (f !== '') ? f : '/ (root)',
|
|
||||||
icon: 'nc-icon-outline files_folder-15',
|
|
||||||
callback: (key, opt) => {
|
|
||||||
let moveFileId = self._.toString($(opt.$trigger).data('uid'))
|
|
||||||
let moveFileDestFolder = self._.nth(self.folders, key)
|
|
||||||
self.moveFile(moveFileId, moveFileDestFolder)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$.contextMenu('destroy', '.editor-modal-choices > figure')
|
|
||||||
$.contextMenu({
|
|
||||||
selector: '.editor-modal-choices > figure',
|
|
||||||
appendTo: '.editor-modal-choices',
|
|
||||||
position: (opt, x, y) => {
|
|
||||||
$(opt.$trigger).addClass('is-contextopen')
|
|
||||||
let trigPos = $(opt.$trigger).position()
|
|
||||||
let trigDim = { w: $(opt.$trigger).width() / 5, h: $(opt.$trigger).height() / 2 }
|
|
||||||
opt.$menu.css({ top: trigPos.top + trigDim.h, left: trigPos.left + trigDim.w })
|
|
||||||
},
|
|
||||||
events: {
|
|
||||||
hide: (opt) => {
|
|
||||||
$(opt.$trigger).removeClass('is-contextopen')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
items: {
|
|
||||||
rename: {
|
|
||||||
name: self.$t('editor.filerenameaction'),
|
|
||||||
icon: 'nc-icon-outline files_vector',
|
|
||||||
callback: (key, opt) => {
|
|
||||||
self.renameFileId = self._.toString(opt.$trigger[0].dataset.uid)
|
|
||||||
self.renameFile()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
move: {
|
|
||||||
name: self.$t('editor.filemoveaction'),
|
|
||||||
icon: 'fa-folder-open-o',
|
|
||||||
items: moveFolders
|
|
||||||
},
|
|
||||||
delete: {
|
|
||||||
name: self.$t('editor.filedeleteaction'),
|
|
||||||
icon: 'icon-trash2',
|
|
||||||
callback: (key, opt) => {
|
|
||||||
self.deleteFileId = self._.toString(opt.$trigger[0].dataset.uid)
|
|
||||||
self.deleteFileWarn(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
upload() {
|
|
||||||
let self = this
|
|
||||||
let curFileAmount = this.files.length
|
|
||||||
let uplUrl = (self.mode === 'image') ? '/uploads/img' : '/uploads/file'
|
|
||||||
|
|
||||||
$(this.$refs.editorFileUploadInput).simpleUpload(uplUrl, {
|
|
||||||
|
|
||||||
name: (self.mode === 'image') ? 'imgfile' : 'binfile',
|
|
||||||
data: {
|
|
||||||
folder: self.currentFolder
|
|
||||||
},
|
|
||||||
limit: 20,
|
|
||||||
expect: 'json',
|
|
||||||
allowedExts: (self.mode === 'image') ? ['jpg', 'jpeg', 'gif', 'png', 'webp'] : undefined,
|
|
||||||
allowedTypes: (self.mode === 'image') ? ['image/png', 'image/jpeg', 'image/gif', 'image/webp'] : undefined,
|
|
||||||
maxFileSize: (self.mode === 'image') ? 3145728 : 0, // max 3 MB
|
|
||||||
|
|
||||||
init: (totalUploads) => {
|
|
||||||
self.uploadSucceeded = false
|
|
||||||
self.isLoadingText = 'Preparing to upload...'
|
|
||||||
self.isLoading = true
|
|
||||||
},
|
|
||||||
|
|
||||||
progress: (progress) => {
|
|
||||||
self.isLoadingText = 'Uploading...' + Math.round(progress) + '%'
|
|
||||||
},
|
|
||||||
|
|
||||||
success: (data) => {
|
|
||||||
if (data.ok) {
|
|
||||||
let failedUpls = self._.filter(data.results, ['ok', false])
|
|
||||||
if (failedUpls.length) {
|
|
||||||
self._.forEach(failedUpls, (u) => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.fileuploaderror', { err: u.msg })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if (failedUpls.length < data.results.length) {
|
|
||||||
self.uploadSucceeded = true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.uploadSucceeded = true
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'arrows-1_cloud-upload-96',
|
|
||||||
msg: self.$t('editor.fileuploadsuccess')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.fileuploaderror', { err: data.msg })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
error: (error) => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: self.$t('editor.fileuploaderror', { err: error.message })
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
finish: () => {
|
|
||||||
if (self.uploadSucceeded) {
|
|
||||||
self.waitChangeComplete(curFileAmount, true)
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$root.$on('editorFile/init', this.init)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,94 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-green
|
|
||||||
span {{ $t('editor.videotitle') }}
|
|
||||||
section
|
|
||||||
label.label
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', placeholder='https://www.youtube.com/watch?v=xxxxxxxxxxx', v-model='link', ref='editorVideoInput', @keyup.enter='insertVideo', @keyup.esc='cancel')
|
|
||||||
span.help.is-red(v-show='isInvalid') {{ $t('editor.videonotsupported') }}
|
|
||||||
.note {{ $t('editor.videosupportedtitle') }}
|
|
||||||
ul
|
|
||||||
li
|
|
||||||
i.icon-youtube-play
|
|
||||||
span Youtube
|
|
||||||
li
|
|
||||||
i.icon-vimeo
|
|
||||||
span Vimeo
|
|
||||||
li
|
|
||||||
i.nc-icon-outline.media-1_play-69
|
|
||||||
span Dailymotion
|
|
||||||
li
|
|
||||||
i.icon-video
|
|
||||||
span {{ $t('editor.videoanymp4file') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('editor.discard') }}
|
|
||||||
a.button.is-green(v-on:click='insertVideo') {{ $t('editor.videoinsert') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const videoRules = {
|
|
||||||
'youtube': new RegExp('/(?:(?:youtu\\.be\\/|v\\/|vi\\/|u\\/\\w\\/|embed\\/)|(?:(?:watch)?\\?v(?:i)?=|&v(?:i)?=))([^#&?]*).*/', 'i'),
|
|
||||||
'vimeo': new RegExp('/vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/(?:[^/]*)\\/videos\\/|album\\/(?:\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)/', 'i'),
|
|
||||||
'dailymotion': new RegExp('/(?:dailymotion\\.com(?:\\/embed)?(?:\\/video|\\/hub)|dai\\.ly)\\/([0-9a-z]+)(?:[-_0-9a-zA-Z]+(?:#video=)?([a-z0-9]+)?)?/', 'i')
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'editor-video',
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
link: '',
|
|
||||||
isInvalid: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
return this.$store.state.editorVideo.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init () {
|
|
||||||
let self = this
|
|
||||||
self.isInvalid = false
|
|
||||||
self._.delay(() => {
|
|
||||||
self.$refs.editorVideoInput.focus()
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
cancel () {
|
|
||||||
this.$store.dispatch('editorVideo/close')
|
|
||||||
},
|
|
||||||
insertVideo () {
|
|
||||||
let self = this
|
|
||||||
|
|
||||||
if (this._.isEmpty(self.link) || self.link.length < 5) {
|
|
||||||
this.isInvalid = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let videoType = this._.findKey(videoRules, (vr) => {
|
|
||||||
return vr.test(self.link)
|
|
||||||
})
|
|
||||||
if (this._.isNil(videoType)) {
|
|
||||||
videoType = 'video'
|
|
||||||
}
|
|
||||||
let videoText = '[video](' + this.link + '){.' + videoType + '}\n'
|
|
||||||
this.$store.dispatch('editor/insert', videoText)
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'blue',
|
|
||||||
icon: 'media-1_action-74',
|
|
||||||
msg: self.$t('editor.videosuccess')
|
|
||||||
})
|
|
||||||
this.cancel()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.$root.$on('editorVideo/init', this.init)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,221 +0,0 @@
|
|||||||
/* global $, siteRoot */
|
|
||||||
|
|
||||||
let mde
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'editor',
|
|
||||||
props: ['currentPath'],
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
insertContent() {
|
|
||||||
return this.$store.state.editor.insertContent
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
insert(content) {
|
|
||||||
if (mde.codemirror.doc.somethingSelected()) {
|
|
||||||
mde.codemirror.execCommand('singleSelection')
|
|
||||||
}
|
|
||||||
mde.codemirror.doc.replaceSelection(this.insertContent)
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
let self = this
|
|
||||||
this.$http.put(window.location.href, {
|
|
||||||
markdown: mde.value()
|
|
||||||
}).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
if (resp.ok) {
|
|
||||||
window.location.assign(siteRoot + '/' + self.currentPath)
|
|
||||||
} else {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: resp.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let self = this
|
|
||||||
FuseBox.import('/js/simplemde/simplemde.min.js', (SimpleMDE) => {
|
|
||||||
mde = new SimpleMDE({
|
|
||||||
autofocus: true,
|
|
||||||
autoDownloadFontAwesome: false,
|
|
||||||
element: this.$refs.editorTextArea,
|
|
||||||
placeholder: 'Enter Markdown formatted content here...',
|
|
||||||
spellChecker: false,
|
|
||||||
status: false,
|
|
||||||
toolbar: [
|
|
||||||
{
|
|
||||||
name: 'bold',
|
|
||||||
action: SimpleMDE.toggleBold,
|
|
||||||
className: 'icon-bold',
|
|
||||||
title: 'Bold'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'italic',
|
|
||||||
action: SimpleMDE.toggleItalic,
|
|
||||||
className: 'icon-italic',
|
|
||||||
title: 'Italic'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'strikethrough',
|
|
||||||
action: SimpleMDE.toggleStrikethrough,
|
|
||||||
className: 'icon-strikethrough',
|
|
||||||
title: 'Strikethrough'
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
{
|
|
||||||
name: 'heading-1',
|
|
||||||
action: SimpleMDE.toggleHeading1,
|
|
||||||
className: 'icon-header fa-header-x fa-header-1',
|
|
||||||
title: 'Header (Level 1)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'heading-2',
|
|
||||||
action: SimpleMDE.toggleHeading2,
|
|
||||||
className: 'icon-header fa-header-x fa-header-2',
|
|
||||||
title: 'Header (Level 2)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'heading-3',
|
|
||||||
action: SimpleMDE.toggleHeading3,
|
|
||||||
className: 'icon-header fa-header-x fa-header-3',
|
|
||||||
title: 'Header (Level 3)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'quote',
|
|
||||||
action: SimpleMDE.toggleBlockquote,
|
|
||||||
className: 'nc-icon-outline text_quote',
|
|
||||||
title: 'Quote'
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
{
|
|
||||||
name: 'unordered-list',
|
|
||||||
action: SimpleMDE.toggleUnorderedList,
|
|
||||||
className: 'nc-icon-outline text_list-bullet',
|
|
||||||
title: 'Bullet List'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ordered-list',
|
|
||||||
action: SimpleMDE.toggleOrderedList,
|
|
||||||
className: 'nc-icon-outline text_list-numbers',
|
|
||||||
title: 'Numbered List'
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
{
|
|
||||||
name: 'link',
|
|
||||||
action: (editor) => {
|
|
||||||
window.alert('Coming soon!')
|
|
||||||
// todo
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline ui-2_link-68',
|
|
||||||
title: 'Insert Link'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'image',
|
|
||||||
action: (editor) => {
|
|
||||||
self.$store.dispatch('editorFile/open', { mode: 'image' })
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline design_image',
|
|
||||||
title: 'Insert Image'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'file',
|
|
||||||
action: (editor) => {
|
|
||||||
self.$store.dispatch('editorFile/open', { mode: 'file' })
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline files_zip-54',
|
|
||||||
title: 'Insert File'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'video',
|
|
||||||
action: (editor) => {
|
|
||||||
self.$store.dispatch('editorVideo/open')
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline media-1_video-64',
|
|
||||||
title: 'Insert Video Player'
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
{
|
|
||||||
name: 'inline-code',
|
|
||||||
action: (editor) => {
|
|
||||||
if (!editor.codemirror.doc.somethingSelected()) {
|
|
||||||
return self.$store.dispatch('alert', {
|
|
||||||
style: 'orange',
|
|
||||||
icon: 'design_drag',
|
|
||||||
msg: 'Invalid selection. Select at least 1 character.'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
let curSel = editor.codemirror.doc.getSelections()
|
|
||||||
curSel = self._.map(curSel, (s) => {
|
|
||||||
return '`' + s + '`'
|
|
||||||
})
|
|
||||||
editor.codemirror.doc.replaceSelections(curSel)
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline arrows-4_enlarge-46',
|
|
||||||
title: 'Inline Code'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'code-block',
|
|
||||||
action: (editor) => {
|
|
||||||
self.$store.dispatch('editorCodeblock/open', {
|
|
||||||
initialContent: (mde.codemirror.doc.somethingSelected()) ? mde.codemirror.doc.getSelection() : ''
|
|
||||||
})
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline design_code',
|
|
||||||
title: 'Code Block'
|
|
||||||
},
|
|
||||||
'|',
|
|
||||||
{
|
|
||||||
name: 'table',
|
|
||||||
action: (editor) => {
|
|
||||||
window.alert('Coming soon!')
|
|
||||||
// todo
|
|
||||||
},
|
|
||||||
className: 'nc-icon-outline ui-2_grid-square',
|
|
||||||
title: 'Insert Table'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'horizontal-rule',
|
|
||||||
action: SimpleMDE.drawHorizontalRule,
|
|
||||||
className: 'nc-icon-outline design_distribute-vertical',
|
|
||||||
title: 'Horizontal Rule'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
shortcuts: {
|
|
||||||
'toggleBlockquote': null,
|
|
||||||
'toggleFullScreen': null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Save
|
|
||||||
$(window).bind('keydown', (ev) => {
|
|
||||||
if (ev.ctrlKey || ev.metaKey) {
|
|
||||||
switch (String.fromCharCode(ev.which).toLowerCase()) {
|
|
||||||
case 's':
|
|
||||||
ev.preventDefault()
|
|
||||||
self.save()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Listeners
|
|
||||||
this.$root.$on('editor/save', this.save)
|
|
||||||
this.$root.$on('editor/insert', this.insert)
|
|
||||||
|
|
||||||
this.$store.dispatch('pageLoader/complete')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,127 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
.container.is-fluid
|
|
||||||
.columns.is-gapless
|
|
||||||
|
|
||||||
.column.is-narrow.is-hidden-touch.sidebar
|
|
||||||
aside.stickyscroll
|
|
||||||
.sidebar-label
|
|
||||||
span {{ $t('history.pastversions') }}
|
|
||||||
ul.sidebar-menu
|
|
||||||
li(v-for='item in versions')
|
|
||||||
a.is-multiline(:title='item.dateFull', @click='changeCommit(item)', :class='{ "is-active": item.commit === current.commit }')
|
|
||||||
span {{ item.dateCalendar }}
|
|
||||||
span.is-small {{ item.commitAbbr }}
|
|
||||||
|
|
||||||
.column
|
|
||||||
.history
|
|
||||||
.history-title {{ currentPath }}
|
|
||||||
.history-info
|
|
||||||
.columns
|
|
||||||
.column.history-info-meta
|
|
||||||
p
|
|
||||||
i.nc-icon-outline.ui-1_calendar-check-62
|
|
||||||
span {{ $t('history.timestamp') }}: #[strong {{ current.dateFull }}]
|
|
||||||
p
|
|
||||||
i.nc-icon-outline.i.nc-icon-outline.users_man-23
|
|
||||||
span {{ $t('history.author') }}: #[strong {{ current.name }} <{{ current.email }}>]
|
|
||||||
p
|
|
||||||
i.nc-icon-outline.media-1_flash-21
|
|
||||||
span {{ $t('history.commit') }}: #[strong {{ current.commit }}]
|
|
||||||
.column.history-info-actions
|
|
||||||
.button-group
|
|
||||||
button.button.is-blue-grey(@click='compareWith')
|
|
||||||
i.nc-icon-outline.design_path-intersect
|
|
||||||
span {{ $t('history.comparewith') }}
|
|
||||||
button.button.is-blue-grey(@click='view')
|
|
||||||
i.nc-icon-outline.ui-1_eye-17
|
|
||||||
span {{ $t('history.view') }}
|
|
||||||
button.button.is-blue-grey(@click='revertToVersion')
|
|
||||||
i.nc-icon-outline.arrows-4_undo-29
|
|
||||||
span {{ $t('history.reverttoversion') }}
|
|
||||||
toggle.is-dark(v-model='sidebyside', :desc='$t("history.sidebyside")')
|
|
||||||
.history-diff#diff
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/* global wiki, Diff2HtmlUI */
|
|
||||||
|
|
||||||
let diffui
|
|
||||||
let diffuiIsReady = false
|
|
||||||
export default {
|
|
||||||
name: 'history',
|
|
||||||
props: ['currentPath', 'historyData'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
versions: [],
|
|
||||||
current: {},
|
|
||||||
diffui: {},
|
|
||||||
sidebyside: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
sidebyside() {
|
|
||||||
this.draw()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
compareWith() {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'purple',
|
|
||||||
icon: 'objects_astronaut',
|
|
||||||
msg: 'Sorry, this function is not available. Coming soon!'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
view() {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'purple',
|
|
||||||
icon: 'objects_astronaut',
|
|
||||||
msg: 'Sorry, this function is not available. Coming soon!'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
revertToVersion() {
|
|
||||||
this.$store.dispatch('alert', {
|
|
||||||
style: 'purple',
|
|
||||||
icon: 'objects_astronaut',
|
|
||||||
msg: 'Sorry, this function is not available. Coming soon!'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
draw() {
|
|
||||||
if (diffuiIsReady) {
|
|
||||||
diffui.draw('#diff', {
|
|
||||||
inputFormat: 'diff',
|
|
||||||
outputFormat: this.sidebyside ? 'side-by-side' : 'line-by-line',
|
|
||||||
matching: 'words',
|
|
||||||
synchronisedScroll: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeCommit(cm) {
|
|
||||||
let self = this
|
|
||||||
diffuiIsReady = false
|
|
||||||
self.current = cm
|
|
||||||
self.$http.post(wiki.siteRoot + '/hist', {
|
|
||||||
path: self.currentPath,
|
|
||||||
commit: cm.commit
|
|
||||||
}).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
diffui = new Diff2HtmlUI({ diff: resp.diff })
|
|
||||||
diffuiIsReady = true
|
|
||||||
self.draw()
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.error
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.versions = JSON.parse(this.historyData)
|
|
||||||
this.changeCommit(this.versions[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,12 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
i.nav-item#notifload(v-bind:class='{ "is-active": loading }')
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapState } from 'vuex'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'loading-spinner',
|
|
||||||
computed: mapState(['loading'])
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -31,7 +31,6 @@
|
|||||||
/* global CONSTANTS, graphQL, siteConfig */
|
/* global CONSTANTS, graphQL, siteConfig */
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'login',
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
error: false,
|
error: false,
|
||||||
@ -50,6 +49,11 @@ export default {
|
|||||||
return siteConfig.title
|
return siteConfig.title
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$store.commit('navigator/subtitleStatic', 'Login')
|
||||||
|
this.refreshStrategies()
|
||||||
|
this.$refs.iptEmail.focus()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectStrategy (key, useForm) {
|
selectStrategy (key, useForm) {
|
||||||
this.selectedStrategy = key
|
this.selectedStrategy = key
|
||||||
@ -188,11 +192,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.$store.commit('navigator/subtitleStatic', 'Login')
|
|
||||||
this.refreshStrategies()
|
|
||||||
this.$refs.iptEmail.focus()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-light-blue {{ $t('modal.createpagetitle') }}
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.createpagepath') }}
|
|
||||||
p.control.is-fullwidth(v-bind:class='{ "is-loading": isLoading }')
|
|
||||||
input.input(type='text', placeholder='page-name', v-model='userPath', ref='createPageInput', @keyup.enter='create', @keyup.esc='cancel')
|
|
||||||
span.help.is-red(v-show='isInvalid') {{ $t('modal.createpageinvalid') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-light-blue(v-on:click='create') {{ $t('modal.create') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-create-page',
|
|
||||||
props: ['basepath'],
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
currentPath: '',
|
|
||||||
userPath: '',
|
|
||||||
isLoading: false,
|
|
||||||
isInvalid: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
if (this.$store.state.modalCreatePage.shown) {
|
|
||||||
this.makeSelection()
|
|
||||||
}
|
|
||||||
return this.$store.state.modalCreatePage.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
makeSelection: function () {
|
|
||||||
let self = this
|
|
||||||
self._.delay(() => {
|
|
||||||
let startPos = (self.currentPath.length > 0) ? self.currentPath.length + 1 : 0
|
|
||||||
self.$helpers.form.setInputSelection(self.$refs.createPageInput, startPos, self.userPath.length)
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
cancel: function () {
|
|
||||||
this.$store.dispatch('modalCreatePage/close')
|
|
||||||
},
|
|
||||||
create: function () {
|
|
||||||
this.isInvalid = false
|
|
||||||
let newDocPath = this.$helpers.pages.makeSafePath(this.userPath)
|
|
||||||
if (this._.isEmpty(newDocPath)) {
|
|
||||||
this.isInvalid = true
|
|
||||||
} else {
|
|
||||||
this.isLoading = true
|
|
||||||
window.location.assign('/create/' + newDocPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.currentPath = (this.basepath === 'home') ? '' : this.basepath
|
|
||||||
this.userPath = (this._.isEmpty(this.currentPath)) ? 'new-page' : this.currentPath + '/new-page'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,105 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-blue
|
|
||||||
span {{ $t('modal.createusertitle') }}
|
|
||||||
p.modal-notify(:class='{ "is-active": isLoading }'): i
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.createuseremail') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', :placeholder='$t("modal.createuseremailplaceholder")', v-model='email', ref='createUserEmailInput')
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.createuserprovider') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
select(v-model='provider')
|
|
||||||
option(value='local') Local Database
|
|
||||||
option(value='windowslive') Microsoft Account
|
|
||||||
option(value='google') Google ID
|
|
||||||
option(value='facebook') Facebook
|
|
||||||
option(value='github') GitHub
|
|
||||||
option(value='slack') Slack
|
|
||||||
section(v-if='provider=="local"')
|
|
||||||
label.label {{ $t('modal.createuserpassword') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='password', placeholder='', v-model='password')
|
|
||||||
section(v-if='provider=="local"')
|
|
||||||
label.label {{ $t('modal.createusername') }}
|
|
||||||
p.control.is-fullwidth
|
|
||||||
input.input(type='text', :placeholder='$t("modal.createusernameplaceholder")', v-model='name')
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='cancel') {{ $t('modal.discard') }}
|
|
||||||
a.button(@click='create', v-if='provider=="local"', :disabled='isLoading', :class='{ "is-disabled": isLoading, "is-blue": !loading }') {{ $t('modal.createuser') }}
|
|
||||||
a.button(@click='create', v-if='provider!="local"', :disabled='isLoading', :class='{ "is-disabled": isLoading, "is-blue": !loading }') {{ $t('modal.createuserauthorize') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-create-user',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
email: '',
|
|
||||||
provider: 'local',
|
|
||||||
password: '',
|
|
||||||
name: '',
|
|
||||||
isLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown() {
|
|
||||||
return this.$store.state.modalCreateUser.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
let self = this
|
|
||||||
self._.delay(() => {
|
|
||||||
self.$refs.createUserEmailInput.focus()
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
this.$store.dispatch('modalCreateUser/close')
|
|
||||||
this.email = ''
|
|
||||||
this.provider = 'local'
|
|
||||||
},
|
|
||||||
create() {
|
|
||||||
let self = this
|
|
||||||
this.isLoading = true
|
|
||||||
this.$http.post('/admin/users/create', {
|
|
||||||
email: this.email,
|
|
||||||
provider: this.provider,
|
|
||||||
password: this.password,
|
|
||||||
name: this.name
|
|
||||||
}).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
this.isLoading = false
|
|
||||||
if (resp.ok) {
|
|
||||||
this.cancel()
|
|
||||||
window.location.reload(true)
|
|
||||||
} else {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: resp.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
this.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$root.$on('modalCreateUser/init', this.init)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,66 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-red
|
|
||||||
span {{ $t('modal.deletepagetitle') }}
|
|
||||||
p.modal-notify(v-bind:class='{ "is-active": isLoading }'): i
|
|
||||||
section
|
|
||||||
span {{ $t('modal.deletepagewarning') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='discard') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-red(v-on:click='deletePage') {{ $t('modal.delete') }}
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-delete-page',
|
|
||||||
props: ['currentPath'],
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
isLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
return this.$store.state.modalDeletePage.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
discard () {
|
|
||||||
this.isLoading = false
|
|
||||||
this.$store.dispatch('modalDeletePage/close')
|
|
||||||
},
|
|
||||||
deletePage () {
|
|
||||||
let self = this
|
|
||||||
this.isLoading = true
|
|
||||||
this.$http.delete(window.location.href).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
if (resp.ok) {
|
|
||||||
window.location.assign('/')
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: resp.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,65 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-red
|
|
||||||
span {{ $t('modal.deleteusertitle') }}
|
|
||||||
p.modal-notify(v-bind:class='{ "is-active": isLoading }'): i
|
|
||||||
section
|
|
||||||
span {{ $t('modal.deleteuserwarning') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='cancel') {{ $t('modal.abort') }}
|
|
||||||
a.button.is-red(@click='deleteUser') {{ $t('modal.delete') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-delete-user',
|
|
||||||
props: ['currentUser'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown() {
|
|
||||||
return this.$store.state.modalDeleteUser.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel: function () {
|
|
||||||
this.isLoading = false
|
|
||||||
this.$store.dispatch('modalDeleteUser/close')
|
|
||||||
},
|
|
||||||
deleteUser: function () {
|
|
||||||
let self = this
|
|
||||||
this.isLoading = true
|
|
||||||
this.$http.delete('/admin/users/' + this.currentUser).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
if (resp.ok) {
|
|
||||||
window.location.assign('/admin/users')
|
|
||||||
} else {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: resp.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
self.isLoading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,43 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-orange {{ $t('modal.discardpagetitle') }}
|
|
||||||
section
|
|
||||||
span(v-if='mode === "create"') {{ $t('modal.discardpagecreate') }}
|
|
||||||
span(v-else) {{ $t('modal.discardpageedit') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='stay') {{ $t('modal.discardpagestay') }}
|
|
||||||
a.button.is-orange(v-on:click='discard') {{ $t('modal.discard') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-discard-page',
|
|
||||||
props: ['mode', 'currentPath'],
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
return this.$store.state.modalDiscardPage.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
stay: function () {
|
|
||||||
this.$store.dispatch('modalDiscardPage/close')
|
|
||||||
},
|
|
||||||
discard: function () {
|
|
||||||
if (this.mode === 'create') {
|
|
||||||
window.location.assign('/')
|
|
||||||
} else {
|
|
||||||
window.location.assign('/' + this.currentPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,86 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
header.is-indigo {{ $t('modal.movepagetitle') }}
|
|
||||||
section
|
|
||||||
label.label {{ $t('modal.movepagepath') }}
|
|
||||||
p.control.is-fullwidth(v-bind:class='{ "is-loading": isLoading }')
|
|
||||||
input.input(type='text', v-bind:placeholder='$t("modal.movepageplaceholder")', v-model='movePath', ref='movePageInput', @keyup.enter='move', @keyup.esc='cancel')
|
|
||||||
span.help.is-red(v-show='isInvalid') {{ $t('modal.movepageinvalid') }}
|
|
||||||
span.note {{ $t('modal.movepagewarning') }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('modal.discard') }}
|
|
||||||
a.button.is-indigo(v-on:click='move') {{ $t('modal.move') }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-move-page',
|
|
||||||
props: ['currentPath'],
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
movePath: '',
|
|
||||||
isLoading: false,
|
|
||||||
isInvalid: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown () {
|
|
||||||
if (this.$store.state.modalMovePage.shown) {
|
|
||||||
this.movePath = this.currentPath
|
|
||||||
this.makeSelection()
|
|
||||||
}
|
|
||||||
return this.$store.state.modalMovePage.shown
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
makeSelection() {
|
|
||||||
let self = this
|
|
||||||
self._.delay(() => {
|
|
||||||
let startPos = (self._.includes(self.currentPath, '/')) ? self._.lastIndexOf(self.movePath, '/') + 1 : 0
|
|
||||||
self.$helpers.form.setInputSelection(self.$refs.movePageInput, startPos, self.movePath.length)
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
this.$store.dispatch('modalMovePage/close')
|
|
||||||
},
|
|
||||||
move () {
|
|
||||||
this.isInvalid = false
|
|
||||||
let newDocPath = this.$helpers.pages.makeSafePath(this.movePath)
|
|
||||||
if (this._.isEmpty(newDocPath) || newDocPath === this.currentPath || newDocPath === 'home') {
|
|
||||||
this.isInvalid = true
|
|
||||||
} else {
|
|
||||||
this.isLoading = true
|
|
||||||
this.$http.put(window.location.href, {
|
|
||||||
move: newDocPath
|
|
||||||
}).then(resp => {
|
|
||||||
return resp.json()
|
|
||||||
}).then(resp => {
|
|
||||||
if (resp.ok) {
|
|
||||||
window.location.assign('/' + newDocPath)
|
|
||||||
} else {
|
|
||||||
this.loading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: resp.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
this.loading = false
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'ui-2_square-remove-09',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,66 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
template(v-if='step === "qr"')
|
|
||||||
header.is-blue Setup your 2FA app
|
|
||||||
section.modal-loading
|
|
||||||
i
|
|
||||||
span Wiki.js {{ mode }} in progress...
|
|
||||||
em Please wait
|
|
||||||
template(v-if='step === "error"')
|
|
||||||
header.is-red Error
|
|
||||||
section.modal-loading
|
|
||||||
span {{ error }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='cancel') Discard
|
|
||||||
template(v-if='step === "confirm"')
|
|
||||||
header.is-blue Two-Factor Authentication
|
|
||||||
section
|
|
||||||
label.label Do you want to enable 2FA?
|
|
||||||
span.note Two-Factor Authentication (2FA) provides an extra layer of security for your account. Upon login, you will be prompted to enter a token generated by a 2FA app (e.g. Authy, Google Authenticator, etc.).
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='cancel') Discard
|
|
||||||
a.button.is-blue(@click='confirm') Setup
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-profile-2fa',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isLoading: false,
|
|
||||||
error: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown() {
|
|
||||||
return this.$store.state.modalProfile2fa.shown
|
|
||||||
},
|
|
||||||
step() {
|
|
||||||
return this.$store.state.modalProfile2fa.step
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel() {
|
|
||||||
this.isLoading = false
|
|
||||||
this.$store.dispatch('modalProfile2fa/close')
|
|
||||||
},
|
|
||||||
confirm() {
|
|
||||||
this.$http.post('/admin/profile/2fa', {
|
|
||||||
action: 'setup'
|
|
||||||
}).then(resp => {
|
|
||||||
this.$store.commit('modalProfile2fa/stepChange', 'qr')
|
|
||||||
}).catch(err => {
|
|
||||||
this.$store.commit('modalProfile2fa/stepChange', 'error')
|
|
||||||
this.error = err.body.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,70 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(:duration="400")
|
|
||||||
.modal(v-show='isShown', v-cloak)
|
|
||||||
transition(name='modal-background')
|
|
||||||
.modal-background(v-show='isShown')
|
|
||||||
.modal-container
|
|
||||||
transition(name='modal-content')
|
|
||||||
.modal-content(v-show='isShown')
|
|
||||||
template(v-if='step === "running"')
|
|
||||||
header.is-blue Install
|
|
||||||
section.modal-loading
|
|
||||||
i
|
|
||||||
span Wiki.js {{ mode }} in progress...
|
|
||||||
em Please wait
|
|
||||||
template(v-if='step === "error"')
|
|
||||||
header.is-red Installation Error
|
|
||||||
section.modal-loading
|
|
||||||
span {{ error }}
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='upgradeCancel') Abort
|
|
||||||
a.button.is-deep-orange(@click='upgradeStart') Try Again
|
|
||||||
template(v-if='step === "confirm"')
|
|
||||||
header.is-deep-orange Are you sure?
|
|
||||||
section
|
|
||||||
label.label You are about to {{ mode }} Wiki.js.
|
|
||||||
span.note You will not be able to access your wiki during the operation. Content will not be affected. However, it is your responsability to ensure you have a backup in the unexpected event content gets lost or corrupted.
|
|
||||||
footer
|
|
||||||
a.button.is-grey.is-outlined(@click='upgradeCancel') Abort
|
|
||||||
a.button.is-deep-orange(@click='upgradeStart') Start
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'modal-upgrade-system',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShown() {
|
|
||||||
return this.$store.state.modalUpgradeSystem.shown
|
|
||||||
},
|
|
||||||
mode() {
|
|
||||||
return this.$store.state.modalUpgradeSystem.mode
|
|
||||||
},
|
|
||||||
step() {
|
|
||||||
return this.$store.state.modalUpgradeSystem.step
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
upgradeCancel() {
|
|
||||||
this.isLoading = false
|
|
||||||
this.$store.dispatch('modalUpgradeSystem/close')
|
|
||||||
},
|
|
||||||
upgradeStart() {
|
|
||||||
this.$store.commit('modalUpgradeSystem/stepChange', 'running')
|
|
||||||
this.$http.post('/admin/system/install', {
|
|
||||||
mode: this.mode
|
|
||||||
}).then(resp => {
|
|
||||||
// todo
|
|
||||||
}).catch(err => {
|
|
||||||
this.$store.commit('modalUpgradeSystem/stepChange', 'error')
|
|
||||||
this.error = err.body
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,23 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
transition(name='page-loader')
|
|
||||||
.page-loader(v-if='isShown')
|
|
||||||
i
|
|
||||||
span {{ msg }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script type='js'>
|
|
||||||
export default {
|
|
||||||
name: 'page-loader',
|
|
||||||
props: ['text'],
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
msg () { return this.$store.state.pageLoader.msg },
|
|
||||||
isShown () { return this.$store.state.pageLoader.shown }
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$store.commit('pageLoader/msgChange', this.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,103 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
.nav-item
|
|
||||||
p.control(v-bind:class='{ "is-loading": searchload > 0 }')
|
|
||||||
input.input#search-input(type='text', v-model='searchq', autofocus, @keyup.esc='closeSearch', @keyup.down='moveDownSearch', @keyup.up='moveUpSearch', @keyup.enter='moveSelectSearch', debounce='400', v-bind:placeholder='$t("search.placeholder")')
|
|
||||||
|
|
||||||
transition(name='searchresults')
|
|
||||||
.searchresults(v-show='searchactive', v-cloak)
|
|
||||||
p.searchresults-label {{ $t('search.results') }}
|
|
||||||
ul.searchresults-list
|
|
||||||
li(v-if='searchres.length === 0')
|
|
||||||
a: em {{ $t('search.nomatch') }}
|
|
||||||
li(v-for='sres in searchres', v-bind:class='{ "is-active": searchmovekey === "res." + sres.entryPath }')
|
|
||||||
a(v-bind:href='sres.entryPath') {{ sres.title }}
|
|
||||||
p.searchresults-label(v-if='searchsuggest.length > 0') {{ $t('search.didyoumean') }}
|
|
||||||
ul.searchresults-list(v-if='searchsuggest.length > 0')
|
|
||||||
li(v-for='sug in searchsuggest', v-bind:class='{ "is-active": searchmovekey === "sug." + sug }')
|
|
||||||
a(v-on:click='useSuggestion(sug)') {{ sug }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/* global siteRoot, socket, $ */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchq: '',
|
|
||||||
searchres: [],
|
|
||||||
searchsuggest: [],
|
|
||||||
searchload: 0,
|
|
||||||
searchactive: false,
|
|
||||||
searchmoveidx: 0,
|
|
||||||
searchmovekey: '',
|
|
||||||
searchmovearr: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
searchq: function (val, oldVal) {
|
|
||||||
let self = this
|
|
||||||
self.searchmoveidx = 0
|
|
||||||
if (val.length >= 3) {
|
|
||||||
self.searchactive = true
|
|
||||||
self.searchload++
|
|
||||||
socket.emit('search', { terms: val }, (data) => {
|
|
||||||
self.searchres = self._.map(data.match, m => {
|
|
||||||
m.entryPath = `${siteRoot}/${m.entryPath}`
|
|
||||||
return m
|
|
||||||
})
|
|
||||||
self.searchsuggest = data.suggest
|
|
||||||
self.searchmovearr = self._.concat([], self.searchres, self.searchsuggest)
|
|
||||||
if (self.searchload > 0) { self.searchload-- }
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
self.searchactive = false
|
|
||||||
self.searchres = []
|
|
||||||
self.searchsuggest = []
|
|
||||||
self.searchmovearr = []
|
|
||||||
self.searchload = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
searchmoveidx: function (val, oldVal) {
|
|
||||||
if (val > 0) {
|
|
||||||
this.searchmovekey = (this.searchmovearr[val - 1]) ?
|
|
||||||
'res.' + this.searchmovearr[val - 1].entryPath :
|
|
||||||
'sug.' + this.searchmovearr[val - 1]
|
|
||||||
} else {
|
|
||||||
this.searchmovekey = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
useSuggestion: function (sug) {
|
|
||||||
this.searchq = sug
|
|
||||||
},
|
|
||||||
closeSearch: function () {
|
|
||||||
this.searchq = ''
|
|
||||||
},
|
|
||||||
moveSelectSearch: function () {
|
|
||||||
if (this.searchmoveidx < 1) { return }
|
|
||||||
let i = this.searchmoveidx - 1
|
|
||||||
|
|
||||||
if (this.searchmovearr[i]) {
|
|
||||||
window.location.assign(this.searchmovearr[i].entryPath)
|
|
||||||
} else {
|
|
||||||
this.searchq = this.searchmovearr[i]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
moveDownSearch: function () {
|
|
||||||
if (this.searchmoveidx < this.searchmovearr.length) {
|
|
||||||
this.searchmoveidx++
|
|
||||||
}
|
|
||||||
},
|
|
||||||
moveUpSearch: function () {
|
|
||||||
if (this.searchmoveidx > 0) {
|
|
||||||
this.searchmoveidx--
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted: function () {
|
|
||||||
let self = this
|
|
||||||
$('main').on('click', self.closeSearch)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,84 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
.has-collapsable-nav
|
|
||||||
ul.collapsable-nav(v-for='treeItem in tree', :class='{ "has-children": treeItem.hasChildren }', v-cloak)
|
|
||||||
li(v-for='page in treeItem.pages', :class='{ "is-active": page.isActive }')
|
|
||||||
a(v-on:click='mainAction(page)')
|
|
||||||
template(v-if='page._id !== "home"')
|
|
||||||
i(:class='{ "icon-folder2": page.isDirectory, "icon-file-text-o": !page.isDirectory }')
|
|
||||||
span {{ page.title }}
|
|
||||||
template(v-else)
|
|
||||||
i.icon-home
|
|
||||||
span {{ $t('nav.home') }}
|
|
||||||
a.is-pagelink(v-if='page.isDirectory && page.isEntry', v-on:click='goto(page._id)')
|
|
||||||
i.icon-file-text-o
|
|
||||||
i.icon-arrow-right2
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/* global socket, siteRoot */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'tree',
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
tree: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fetch (basePath) {
|
|
||||||
let self = this
|
|
||||||
self.$store.dispatch('startLoading')
|
|
||||||
self.$nextTick(() => {
|
|
||||||
socket.emit('treeFetch', { basePath }, (data) => {
|
|
||||||
if (self.tree.length > 0) {
|
|
||||||
let branch = self._.last(self.tree)
|
|
||||||
branch.hasChildren = true
|
|
||||||
self._.find(branch.pages, { _id: basePath }).isActive = true
|
|
||||||
}
|
|
||||||
self.tree.push({
|
|
||||||
hasChildren: false,
|
|
||||||
pages: data
|
|
||||||
})
|
|
||||||
self.$store.dispatch('stopLoading')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goto (entryPath) {
|
|
||||||
window.location.assign(siteRoot + '/' + entryPath)
|
|
||||||
},
|
|
||||||
unfold (entryPath) {
|
|
||||||
let self = this
|
|
||||||
let lastIndex = 0
|
|
||||||
self._.forEach(self.tree, branch => {
|
|
||||||
lastIndex++
|
|
||||||
if (self._.find(branch.pages, { _id: entryPath }) !== undefined) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
self.tree = self._.slice(self.tree, 0, lastIndex)
|
|
||||||
let branch = self._.last(self.tree)
|
|
||||||
branch.hasChildren = false
|
|
||||||
branch.pages.forEach(page => {
|
|
||||||
page.isActive = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
mainAction (page) {
|
|
||||||
let self = this
|
|
||||||
if (page.isActive) {
|
|
||||||
self.unfold(page._id)
|
|
||||||
} else if (page.isDirectory) {
|
|
||||||
self.fetch(page._id)
|
|
||||||
} else {
|
|
||||||
self.goto(page._id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
let basePath = window.location.pathname.slice(0, -4)
|
|
||||||
if (basePath.length > 1) {
|
|
||||||
basePath = basePath.slice(1)
|
|
||||||
}
|
|
||||||
this.fetch(basePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,13 +1,9 @@
|
|||||||
import filesize from 'filesize.js'
|
import filesize from 'filesize.js'
|
||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
/* global siteConfig */
|
/* global siteConfig */
|
||||||
|
|
||||||
const _ = require('./lodash')
|
|
||||||
const helpers = {
|
const helpers = {
|
||||||
/**
|
|
||||||
* Minimal set of lodash functions
|
|
||||||
*/
|
|
||||||
_,
|
|
||||||
/**
|
/**
|
||||||
* Convert bytes to humanized form
|
* Convert bytes to humanized form
|
||||||
* @param {number} rawSize Size in bytes
|
* @param {number} rawSize Size in bytes
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
// ====================================
|
|
||||||
// Load minimal lodash
|
|
||||||
// ====================================
|
|
||||||
|
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
|
||||||
import concat from 'lodash/concat'
|
|
||||||
import debounce from 'lodash/debounce'
|
|
||||||
import deburr from 'lodash/deburr'
|
|
||||||
import delay from 'lodash/delay'
|
|
||||||
import filter from 'lodash/filter'
|
|
||||||
import find from 'lodash/find'
|
|
||||||
import findKey from 'lodash/findKey'
|
|
||||||
import forEach from 'lodash/forEach'
|
|
||||||
import includes from 'lodash/includes'
|
|
||||||
import isBoolean from 'lodash/isBoolean'
|
|
||||||
import isEmpty from 'lodash/isEmpty'
|
|
||||||
import isNil from 'lodash/isNil'
|
|
||||||
import join from 'lodash/join'
|
|
||||||
import kebabCase from 'lodash/kebabCase'
|
|
||||||
import last from 'lodash/last'
|
|
||||||
import map from 'lodash/map'
|
|
||||||
import nth from 'lodash/nth'
|
|
||||||
import pullAt from 'lodash/pullAt'
|
|
||||||
import reject from 'lodash/reject'
|
|
||||||
import slice from 'lodash/slice'
|
|
||||||
import split from 'lodash/split'
|
|
||||||
import startCase from 'lodash/startCase'
|
|
||||||
import startsWith from 'lodash/startsWith'
|
|
||||||
import toString from 'lodash/toString'
|
|
||||||
import toUpper from 'lodash/toUpper'
|
|
||||||
import trim from 'lodash/trim'
|
|
||||||
|
|
||||||
// ====================================
|
|
||||||
// Build lodash object
|
|
||||||
// ====================================
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
deburr,
|
|
||||||
concat,
|
|
||||||
cloneDeep,
|
|
||||||
debounce,
|
|
||||||
delay,
|
|
||||||
filter,
|
|
||||||
find,
|
|
||||||
findKey,
|
|
||||||
forEach,
|
|
||||||
includes,
|
|
||||||
isBoolean,
|
|
||||||
isEmpty,
|
|
||||||
isNil,
|
|
||||||
join,
|
|
||||||
kebabCase,
|
|
||||||
last,
|
|
||||||
map,
|
|
||||||
nth,
|
|
||||||
pullAt,
|
|
||||||
reject,
|
|
||||||
slice,
|
|
||||||
split,
|
|
||||||
startCase,
|
|
||||||
startsWith,
|
|
||||||
toString,
|
|
||||||
toUpper,
|
|
||||||
trim
|
|
||||||
}
|
|
68
client/js/modules/boot.js
Normal file
68
client/js/modules/boot.js
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
export default {
|
||||||
|
readyStates: [],
|
||||||
|
callbacks: [],
|
||||||
|
/**
|
||||||
|
* Check if event has been sent
|
||||||
|
*
|
||||||
|
* @param {String} evt Event name
|
||||||
|
* @returns {Boolean} True if fired
|
||||||
|
*/
|
||||||
|
isReady (evt) {
|
||||||
|
return this.readyStates.indexOf(evt) >= 0
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Register a callback to be executed when event is sent
|
||||||
|
*
|
||||||
|
* @param {String} evt Event name to register to
|
||||||
|
* @param {Function} clb Callback function
|
||||||
|
* @param {Boolean} once If the callback should be called only once
|
||||||
|
*/
|
||||||
|
register (evt, clb, once) {
|
||||||
|
if (this.isReady(evt)) {
|
||||||
|
clb()
|
||||||
|
} else {
|
||||||
|
this.callbacks.push({
|
||||||
|
event: evt,
|
||||||
|
callback: clb,
|
||||||
|
once: false,
|
||||||
|
called: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Register a callback to be executed only once when event is sent
|
||||||
|
*
|
||||||
|
* @param {String} evt Event name to register to
|
||||||
|
* @param {Function} clb Callback function
|
||||||
|
*/
|
||||||
|
registerOnce (evt, clb) {
|
||||||
|
this.register(evt, clb, true)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Set ready state and execute callbacks
|
||||||
|
*/
|
||||||
|
notify (evt) {
|
||||||
|
this.readyStates.push(evt)
|
||||||
|
this.callbacks.forEach(clb => {
|
||||||
|
if (clb.event === evt) {
|
||||||
|
if (clb.once && clb.called) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
clb.called = true
|
||||||
|
clb.callback()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Execute callback on DOM ready
|
||||||
|
*
|
||||||
|
* @param {Function} clb Callback function
|
||||||
|
*/
|
||||||
|
onDOMReady (clb) {
|
||||||
|
if (document.readyState === 'interactive' || document.readyState === 'complete' || document.readyState === 'loaded') {
|
||||||
|
clb()
|
||||||
|
} else {
|
||||||
|
document.addEventListener('DOMContentLoaded', clb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,72 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'admin-edit-user',
|
|
||||||
props: ['usrdata'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
email: '',
|
|
||||||
password: '********',
|
|
||||||
name: '',
|
|
||||||
rights: [],
|
|
||||||
roleoverride: 'none'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
addRightsRow() {
|
|
||||||
this.rights.push({
|
|
||||||
role: 'write',
|
|
||||||
path: '/',
|
|
||||||
exact: false,
|
|
||||||
deny: false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
removeRightsRow(idx) {
|
|
||||||
this._.pullAt(this.rights, idx)
|
|
||||||
this.$forceUpdate()
|
|
||||||
},
|
|
||||||
saveUser() {
|
|
||||||
let self = this
|
|
||||||
let formattedRights = this._.cloneDeep(this.rights)
|
|
||||||
switch (this.roleoverride) {
|
|
||||||
case 'admin':
|
|
||||||
formattedRights.push({
|
|
||||||
role: 'admin',
|
|
||||||
path: '/',
|
|
||||||
exact: false,
|
|
||||||
deny: false
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
this.$http.post(window.location.href, {
|
|
||||||
password: this.password,
|
|
||||||
name: this.name,
|
|
||||||
rights: JSON.stringify(formattedRights)
|
|
||||||
}).then(resp => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'green',
|
|
||||||
icon: 'check',
|
|
||||||
msg: 'Changes have been applied successfully.'
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'square-cross',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let usr = JSON.parse(this.usrdata)
|
|
||||||
this.id = usr._id
|
|
||||||
this.email = usr.email
|
|
||||||
this.name = usr.name
|
|
||||||
|
|
||||||
if (this._.find(usr.rights, { role: 'admin' })) {
|
|
||||||
this.rights = this._.reject(usr.rights, ['role', 'admin'])
|
|
||||||
this.roleoverride = 'admin'
|
|
||||||
} else {
|
|
||||||
this.rights = usr.rights
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'admin-profile',
|
|
||||||
props: ['email', 'name', 'provider', 'tfaIsActive'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
password: '********',
|
|
||||||
passwordVerify: '********'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
tfaStatus() {
|
|
||||||
return this.tfaIsActive ? this.$t('profile.tfaenabled') : this.$t('profile.tfadisabled')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
saveUser() {
|
|
||||||
let self = this
|
|
||||||
if (this.password !== this.passwordVerify) {
|
|
||||||
return self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'square-cross',
|
|
||||||
msg: 'The passwords don\'t match. Try again.'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.$http.post(window.location.href, {
|
|
||||||
password: this.password,
|
|
||||||
name: this.name
|
|
||||||
}).then(resp => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'green',
|
|
||||||
icon: 'check',
|
|
||||||
msg: 'Changes have been applied successfully.'
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'square-cross',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'admin-settings',
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
flushcache() {
|
|
||||||
window.alert('Coming soon!')
|
|
||||||
},
|
|
||||||
resetaccounts() {
|
|
||||||
window.alert('Coming soon!')
|
|
||||||
},
|
|
||||||
flushsessions() {
|
|
||||||
window.alert('Coming soon!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'admin-theme',
|
|
||||||
props: ['themedata'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
primary: 'indigo',
|
|
||||||
alt: 'blue-grey',
|
|
||||||
footer: 'blue-grey',
|
|
||||||
codedark: 'true',
|
|
||||||
codecolorize: 'true'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
primary(val) {
|
|
||||||
this.$root.changeTheme(this.$data)
|
|
||||||
},
|
|
||||||
alt(val) {
|
|
||||||
this.$root.changeTheme(this.$data)
|
|
||||||
},
|
|
||||||
footer(val) {
|
|
||||||
this.$root.changeTheme(this.$data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
saveTheme() {
|
|
||||||
let self = this
|
|
||||||
this.$http.post(window.location.href, self.$data).then(resp => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'green',
|
|
||||||
icon: 'check',
|
|
||||||
msg: 'Theme settings have been applied successfully.'
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
self.$store.dispatch('alert', {
|
|
||||||
style: 'red',
|
|
||||||
icon: 'square-cross',
|
|
||||||
msg: 'Error: ' + err.body.msg
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
resetTheme() {
|
|
||||||
this.primary = 'indigo'
|
|
||||||
this.alt = 'blue-grey'
|
|
||||||
this.footer = 'blue-grey'
|
|
||||||
this.codedark = 'true'
|
|
||||||
this.codecolorize = 'true'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let theme = JSON.parse(this.themedata)
|
|
||||||
this.primary = theme.primary
|
|
||||||
this.alt = theme.alt
|
|
||||||
this.footer = theme.footer
|
|
||||||
this.codedark = theme.code.dark.toString()
|
|
||||||
this.codecolorize = theme.code.colorize.toString()
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
/* global $ */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'content-view',
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let self = this
|
|
||||||
$('a.toc-anchor').each((i, elm) => {
|
|
||||||
let hashText = $(elm).attr('href').slice(1)
|
|
||||||
$(elm).on('click', (ev) => {
|
|
||||||
ev.stopImmediatePropagation()
|
|
||||||
self.$store.dispatch('anchor/open', hashText)
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'source-view',
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let self = this
|
|
||||||
FuseBox.import('/js/ace/ace.js', (ace) => {
|
|
||||||
let scEditor = ace.edit('source-display')
|
|
||||||
scEditor.setTheme('ace/theme/dawn')
|
|
||||||
scEditor.getSession().setMode('ace/mode/markdown')
|
|
||||||
scEditor.setOption('fontSize', '14px')
|
|
||||||
scEditor.setOption('hScrollBarAlwaysVisible', false)
|
|
||||||
scEditor.setOption('wrap', true)
|
|
||||||
scEditor.setOption('showPrintMargin', false)
|
|
||||||
scEditor.setReadOnly(true)
|
|
||||||
scEditor.renderer.updateFull()
|
|
||||||
scEditor.renderer.on('afterRender', () => {
|
|
||||||
self.$store.dispatch('pageLoader/complete')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
|
|
||||||
import anchor from './modules/anchor'
|
|
||||||
import editor from './modules/editor'
|
|
||||||
import editorCodeblock from './modules/editor-codeblock'
|
|
||||||
import editorFile from './modules/editor-file'
|
|
||||||
import editorVideo from './modules/editor-video'
|
|
||||||
import modalCreatePage from './modules/modal-create-page'
|
|
||||||
import modalCreateUser from './modules/modal-create-user'
|
|
||||||
import modalDeleteUser from './modules/modal-delete-user'
|
|
||||||
import modalDeletePage from './modules/modal-delete-page'
|
|
||||||
import modalDiscardPage from './modules/modal-discard-page'
|
|
||||||
import modalMovePage from './modules/modal-move-page'
|
|
||||||
import modalProfile2fa from './modules/modal-profile-2fa'
|
|
||||||
import modalUpgradeSystem from './modules/modal-upgrade-system'
|
|
||||||
import navigator from './modules/navigator'
|
import navigator from './modules/navigator'
|
||||||
import pageLoader from './modules/page-loader'
|
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
@ -33,20 +19,6 @@ export default new Vuex.Store({
|
|||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
modules: {
|
modules: {
|
||||||
anchor,
|
navigator
|
||||||
editor,
|
|
||||||
editorCodeblock,
|
|
||||||
editorFile,
|
|
||||||
editorVideo,
|
|
||||||
modalCreatePage,
|
|
||||||
modalCreateUser,
|
|
||||||
modalDeletePage,
|
|
||||||
modalDeleteUser,
|
|
||||||
modalDiscardPage,
|
|
||||||
modalMovePage,
|
|
||||||
modalProfile2fa,
|
|
||||||
modalUpgradeSystem,
|
|
||||||
navigator,
|
|
||||||
pageLoader
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false,
|
|
||||||
hash: ''
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
anchorChange: (state, opts) => {
|
|
||||||
state.shown = (opts.shown === true)
|
|
||||||
state.hash = opts.hash || ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }, hash) {
|
|
||||||
commit('anchorChange', { shown: true, hash })
|
|
||||||
},
|
|
||||||
close({ commit }) {
|
|
||||||
commit('anchorChange', { shown: false })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
/* global wikijs */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false,
|
|
||||||
content: ''
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState },
|
|
||||||
contentChange: (state, newContent) => { state.content = newContent }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }, opts) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
commit('contentChange', opts.initialContent || '')
|
|
||||||
wikijs.$emit('editorCodeblock/init')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
/* global wikijs */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false,
|
|
||||||
mode: 'image'
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState },
|
|
||||||
modeChange: (state, modeState) => { state.mode = modeState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }, opts) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
commit('modeChange', opts.mode)
|
|
||||||
wikijs.$emit('editorFile/init')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
/* global wikijs */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
wikijs.$emit('editorVideo/init')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
/* global wikijs */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
busy: false,
|
|
||||||
insertContent: ''
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
busyChange: (state, busyState) => { state.shown = busyState },
|
|
||||||
insertContentChange: (state, newContent) => { state.insertContent = newContent }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
busyStart({ commit }) { commit('busyChange', true) },
|
|
||||||
busyStop({ commit }) { commit('busyChange', false) },
|
|
||||||
insert({ commit }, content) {
|
|
||||||
commit('insertContentChange', content)
|
|
||||||
wikijs.$emit('editor/insert')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) { commit('shownChange', true) },
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
/* global wikijs */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
wikijs.$emit('modalCreateUser/init')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) { commit('shownChange', true) },
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) { commit('shownChange', true) },
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) { commit('shownChange', true) },
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }) { commit('shownChange', true) },
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false,
|
|
||||||
step: 'confirm'
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState },
|
|
||||||
stepChange: (state, stepState) => { state.step = stepState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }, opts) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
commit('stepChange', 'confirm')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: false,
|
|
||||||
mode: 'upgrade',
|
|
||||||
step: 'confirm'
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState },
|
|
||||||
modeChange: (state, modeState) => { state.mode = modeState },
|
|
||||||
stepChange: (state, stepState) => { state.step = stepState }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
open({ commit }, opts) {
|
|
||||||
commit('shownChange', true)
|
|
||||||
commit('modeChange', opts.mode)
|
|
||||||
commit('stepChange', 'confirm')
|
|
||||||
},
|
|
||||||
close({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
export default {
|
|
||||||
namespaced: true,
|
|
||||||
state: {
|
|
||||||
shown: true,
|
|
||||||
msg: 'Loading...'
|
|
||||||
},
|
|
||||||
getters: {},
|
|
||||||
mutations: {
|
|
||||||
shownChange: (state, shownState) => { state.shown = shownState },
|
|
||||||
msgChange: (state, newText) => { state.msg = newText }
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
complete({ commit }) { commit('shownChange', false) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,6 +7,8 @@ module.exports = {
|
|||||||
removeAll: true
|
removeAll: true
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
},
|
||||||
|
'postcss-flexbugs-fixes': {},
|
||||||
|
'postcss-flexibility': {}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,16 +3,20 @@ const fs = require('fs-extra')
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
|
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
const ProgressBarPlugin = require('progress-bar-webpack-plugin')
|
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
const NameAllModulesPlugin = require('name-all-modules-plugin')
|
const NameAllModulesPlugin = require('name-all-modules-plugin')
|
||||||
|
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin')
|
||||||
|
|
||||||
const babelConfig = fs.readJsonSync(path.join(process.cwd(), '.babelrc'))
|
const babelConfig = fs.readJsonSync(path.join(process.cwd(), '.babelrc'))
|
||||||
const postCSSConfig = {
|
const postCSSConfig = {
|
||||||
config: {
|
config: {
|
||||||
path: path.join(process.cwd(), 'dev/webpack/postcss.config.js')
|
path: path.join(process.cwd(), 'dev/config/postcss.config.js')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const cacheDir = '.webpack-cache/cache'
|
||||||
|
const babelDir = path.join(process.cwd(), '.webpack-cache/babel')
|
||||||
|
|
||||||
|
process.noDeprecation = true
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
@ -32,14 +36,14 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
loader: 'cache-loader',
|
loader: 'cache-loader',
|
||||||
options: {
|
options: {
|
||||||
cacheDirectory: '.webpack-cache'
|
cacheDirectory: cacheDir
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
...babelConfig,
|
...babelConfig,
|
||||||
cacheDirectory: true
|
cacheDirectory: babelDir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -64,6 +68,12 @@ module.exports = {
|
|||||||
use: ExtractTextPlugin.extract({
|
use: ExtractTextPlugin.extract({
|
||||||
fallback: 'style-loader',
|
fallback: 'style-loader',
|
||||||
use: [
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'cache-loader',
|
||||||
|
options: {
|
||||||
|
cacheDirectory: cacheDir
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
loader: 'css-loader'
|
loader: 'css-loader'
|
||||||
},
|
},
|
||||||
@ -119,14 +129,14 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
loader: 'cache-loader',
|
loader: 'cache-loader',
|
||||||
options: {
|
options: {
|
||||||
cacheDirectory: '.webpack-cache'
|
cacheDirectory: cacheDir
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
babelrc: path.join(process.cwd(), '.babelrc'),
|
babelrc: path.join(process.cwd(), '.babelrc'),
|
||||||
cacheDirectory: true
|
cacheDirectory: babelDir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -173,17 +183,13 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new ProgressBarPlugin({
|
|
||||||
width: 72,
|
|
||||||
complete: '▇',
|
|
||||||
incomplete: '-'
|
|
||||||
}),
|
|
||||||
new webpack.BannerPlugin('Wiki.js - wiki.js.org - Licensed under AGPL'),
|
new webpack.BannerPlugin('Wiki.js - wiki.js.org - Licensed under AGPL'),
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
{ from: 'client/static' }
|
{ from: 'client/static' }
|
||||||
], {
|
], {
|
||||||
|
|
||||||
}),
|
}),
|
||||||
|
new LodashModuleReplacementPlugin(),
|
||||||
new webpack.NamedModulesPlugin(),
|
new webpack.NamedModulesPlugin(),
|
||||||
new webpack.NamedChunksPlugin((chunk) => {
|
new webpack.NamedChunksPlugin((chunk) => {
|
||||||
if (chunk.name) {
|
if (chunk.name) {
|
||||||
@ -207,7 +213,10 @@ module.exports = {
|
|||||||
symlinks: true,
|
symlinks: true,
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.join(process.cwd(), 'client'),
|
'@': path.join(process.cwd(), 'client'),
|
||||||
'vue$': 'vue/dist/vue.common.js'
|
'vue$': 'vue/dist/vue.common.js',
|
||||||
|
// Duplicates fixes:
|
||||||
|
'apollo-link': path.join(process.cwd(), 'node_modules/apollo-link'),
|
||||||
|
'apollo-utilities': path.join(process.cwd(), 'node_modules/apollo-utilities')
|
||||||
},
|
},
|
||||||
extensions: [
|
extensions: [
|
||||||
'.js',
|
'.js',
|
||||||
|
@ -3,6 +3,7 @@ const merge = require('webpack-merge')
|
|||||||
|
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
const WriteFilePlugin = require('write-file-webpack-plugin')
|
const WriteFilePlugin = require('write-file-webpack-plugin')
|
||||||
|
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin')
|
||||||
|
|
||||||
const common = require('./webpack.common.js')
|
const common = require('./webpack.common.js')
|
||||||
|
|
||||||
@ -15,6 +16,9 @@ module.exports = merge(common, {
|
|||||||
publicPath: '/'
|
publicPath: '/'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new SimpleProgressWebpackPlugin({
|
||||||
|
format: 'compact'
|
||||||
|
}),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env.NODE_ENV': JSON.stringify('development')
|
'process.env.NODE_ENV': JSON.stringify('development')
|
||||||
}),
|
}),
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
||||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
const OfflinePlugin = require('offline-plugin')
|
const OfflinePlugin = require('offline-plugin')
|
||||||
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin')
|
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin')
|
||||||
|
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin')
|
||||||
|
|
||||||
const common = require('./webpack.common.js')
|
const common = require('./webpack.common.js')
|
||||||
|
|
||||||
@ -14,6 +16,9 @@ module.exports = merge(common, {
|
|||||||
rules: []
|
rules: []
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new SimpleProgressWebpackPlugin({
|
||||||
|
format: 'expanded'
|
||||||
|
}),
|
||||||
new CleanWebpackPlugin([
|
new CleanWebpackPlugin([
|
||||||
'assets/js/*.*',
|
'assets/js/*.*',
|
||||||
'assets/css/*.*',
|
'assets/css/*.*',
|
||||||
@ -23,22 +28,44 @@ module.exports = merge(common, {
|
|||||||
root: process.cwd(),
|
root: process.cwd(),
|
||||||
verbose: false
|
verbose: false
|
||||||
}),
|
}),
|
||||||
new UglifyJSPlugin(),
|
new UglifyJSPlugin({
|
||||||
|
cache: path.join(process.cwd(), '.webpack-cache/uglify'),
|
||||||
|
parallel: true
|
||||||
|
}),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env.NODE_ENV': JSON.stringify('production')
|
'process.env.NODE_ENV': JSON.stringify('production')
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin('css/bundle.css'),
|
new ExtractTextPlugin('css/bundle.css'),
|
||||||
new OfflinePlugin({
|
new OfflinePlugin({
|
||||||
|
publicPath: '/',
|
||||||
|
externals: ['/'],
|
||||||
caches: {
|
caches: {
|
||||||
main: [
|
main: [
|
||||||
'js/runtime.js',
|
'js/runtime.js',
|
||||||
'js/vendor.js',
|
'js/vendor.js',
|
||||||
'js/client.js'
|
'js/client.js'
|
||||||
],
|
],
|
||||||
additional: [':externals:'],
|
additional: [
|
||||||
optional: ['*.chunk.js']
|
':externals:'
|
||||||
}
|
],
|
||||||
|
optional: [
|
||||||
|
'js/*.chunk.js'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
safeToUseOptionalCaches: true
|
||||||
}),
|
}),
|
||||||
new DuplicatePackageCheckerPlugin()
|
new DuplicatePackageCheckerPlugin(),
|
||||||
|
// Disable Extract Text Plugin stats:
|
||||||
|
{
|
||||||
|
apply(compiler) {
|
||||||
|
compiler.plugin('done', stats => {
|
||||||
|
if (Array.isArray(stats.compilation.children)) {
|
||||||
|
stats.compilation.children = stats.compilation.children.filter(child => {
|
||||||
|
return child.name.indexOf('extract-text-webpack-plugin') !== 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -148,6 +148,8 @@
|
|||||||
"babel-eslint": "8.2.1",
|
"babel-eslint": "8.2.1",
|
||||||
"babel-jest": "22.1.0",
|
"babel-jest": "22.1.0",
|
||||||
"babel-loader": "7.1.2",
|
"babel-loader": "7.1.2",
|
||||||
|
"babel-plugin-graphql-tag": "1.3.1",
|
||||||
|
"babel-plugin-lodash": "3.3.2",
|
||||||
"babel-preset-env": "1.6.1",
|
"babel-preset-env": "1.6.1",
|
||||||
"babel-preset-es2015": "6.24.1",
|
"babel-preset-es2015": "6.24.1",
|
||||||
"babel-preset-stage-2": "6.24.1",
|
"babel-preset-stage-2": "6.24.1",
|
||||||
@ -171,22 +173,25 @@
|
|||||||
"extract-text-webpack-plugin": "3.0.2",
|
"extract-text-webpack-plugin": "3.0.2",
|
||||||
"file-loader": "1.1.6",
|
"file-loader": "1.1.6",
|
||||||
"graphql-tag": "^2.6.1",
|
"graphql-tag": "^2.6.1",
|
||||||
|
"hammerjs": "2.0.8",
|
||||||
"i18next-xhr-backend": "1.5.1",
|
"i18next-xhr-backend": "1.5.1",
|
||||||
"intl": "1.2.5",
|
|
||||||
"jest": "22.1.4",
|
"jest": "22.1.4",
|
||||||
"jest-junit": "3.4.1",
|
"jest-junit": "3.4.1",
|
||||||
"js-cookie": "2.2.0",
|
"js-cookie": "2.2.0",
|
||||||
|
"lodash-webpack-plugin": "0.11.4",
|
||||||
"name-all-modules-plugin": "1.0.1",
|
"name-all-modules-plugin": "1.0.1",
|
||||||
"node-dev": "3.1.3",
|
"node-dev": "3.1.3",
|
||||||
"node-sass": "4.7.2",
|
"node-sass": "4.7.2",
|
||||||
"offline-plugin": "4.9.0",
|
"offline-plugin": "4.9.0",
|
||||||
|
"postcss-flexbugs-fixes": "3.3.0",
|
||||||
|
"postcss-flexibility": "2.0.0",
|
||||||
"postcss-loader": "2.0.10",
|
"postcss-loader": "2.0.10",
|
||||||
"postcss-selector-parser": "3.1.1",
|
"postcss-selector-parser": "3.1.1",
|
||||||
"progress-bar-webpack-plugin": "1.10.0",
|
|
||||||
"pug-lint": "2.5.0",
|
"pug-lint": "2.5.0",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "0.5.1",
|
||||||
"sass-loader": "6.0.6",
|
"sass-loader": "6.0.6",
|
||||||
"sass-resources-loader": "1.3.1",
|
"sass-resources-loader": "1.3.1",
|
||||||
|
"simple-progress-webpack-plugin": "1.0.4",
|
||||||
"style-loader": "0.20.1",
|
"style-loader": "0.20.1",
|
||||||
"svg-sprite-loader": "3.6.2",
|
"svg-sprite-loader": "3.6.2",
|
||||||
"twemoji-awesome": "1.0.6",
|
"twemoji-awesome": "1.0.6",
|
||||||
|
@ -115,13 +115,8 @@ module.exports = async () => {
|
|||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
if (global.DEV) {
|
if (global.DEV) {
|
||||||
const webpackDevMiddleware = require('webpack-dev-middleware')
|
app.use(global.WP_DEV.devMiddleware)
|
||||||
const webpackHotMiddleware = require('webpack-hot-middleware')
|
app.use(global.WP_DEV.hotMiddleware)
|
||||||
app.use(webpackDevMiddleware(global.WP, {
|
|
||||||
publicPath: global.WPCONFIG.output.publicPath,
|
|
||||||
logger: wiki.logger
|
|
||||||
}))
|
|
||||||
app.use(webpackHotMiddleware(global.WP))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
43
wiki.js
43
wiki.js
@ -71,26 +71,35 @@ const init = {
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const chokidar = require('chokidar')
|
const chokidar = require('chokidar')
|
||||||
|
|
||||||
global.WPCONFIG = require('./dev/webpack/webpack.dev.js')
|
|
||||||
global.DEV = true
|
global.DEV = true
|
||||||
global.WP = webpack(global.WPCONFIG)
|
global.WP_CONFIG = require('./dev/webpack/webpack.dev.js')
|
||||||
require('./server')
|
global.WP = webpack(global.WP_CONFIG)
|
||||||
|
global.WP_DEV = {
|
||||||
|
devMiddleware: require('webpack-dev-middleware')(global.WP, {
|
||||||
|
publicPath: global.WP_CONFIG.output.publicPath
|
||||||
|
}),
|
||||||
|
hotMiddleware: require('webpack-hot-middleware')(global.WP)
|
||||||
|
}
|
||||||
|
global.WP_DEV.devMiddleware.waitUntilValid(() => {
|
||||||
|
console.info('>>> Starting Wiki.js in DEVELOPER mode...')
|
||||||
|
require('./server')
|
||||||
|
|
||||||
const devWatcher = chokidar.watch('./server')
|
const devWatcher = chokidar.watch('./server')
|
||||||
devWatcher.on('ready', () => {
|
devWatcher.on('ready', () => {
|
||||||
devWatcher.on('all', () => {
|
devWatcher.on('all', () => {
|
||||||
console.warn('--- >>>>>>>>>>>>>>>>>>>>>>>>>>>> ---')
|
console.warn('--- >>>>>>>>>>>>>>>>>>>>>>>>>>>> ---')
|
||||||
console.warn('--- Changes detected: Restarting ---')
|
console.warn('--- Changes detected: Restarting ---')
|
||||||
console.warn('--- <<<<<<<<<<<<<<<<<<<<<<<<<<<< ---')
|
console.warn('--- <<<<<<<<<<<<<<<<<<<<<<<<<<<< ---')
|
||||||
global.wiki.server.destroy(() => {
|
global.wiki.server.destroy(() => {
|
||||||
global.wiki = {}
|
global.wiki = {}
|
||||||
for (const workerId in cluster.workers) {
|
for (const workerId in cluster.workers) {
|
||||||
cluster.workers[workerId].kill()
|
cluster.workers[workerId].kill()
|
||||||
}
|
}
|
||||||
Object.keys(require.cache).forEach(function(id) {
|
Object.keys(require.cache).forEach(function(id) {
|
||||||
if (/[/\\]server[/\\]/.test(id)) delete require.cache[id]
|
if (/[/\\]server[/\\]/.test(id)) delete require.cache[id]
|
||||||
|
})
|
||||||
|
require('./server')
|
||||||
})
|
})
|
||||||
require('./server')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
172
yarn.lock
172
yarn.lock
@ -324,6 +324,10 @@ ansi-escape-sequences@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
array-back "^1.0.3"
|
array-back "^1.0.3"
|
||||||
|
|
||||||
|
ansi-escapes@^1.0.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
|
||||||
|
|
||||||
ansi-escapes@^2.0.0:
|
ansi-escapes@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b"
|
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b"
|
||||||
@ -938,6 +942,13 @@ babel-helper-hoist-variables@^6.24.1:
|
|||||||
babel-runtime "^6.22.0"
|
babel-runtime "^6.22.0"
|
||||||
babel-types "^6.24.1"
|
babel-types "^6.24.1"
|
||||||
|
|
||||||
|
babel-helper-module-imports@^7.0.0-beta.3:
|
||||||
|
version "7.0.0-beta.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-helper-module-imports/-/babel-helper-module-imports-7.0.0-beta.3.tgz#e15764e3af9c8e11810c09f78f498a2bdc71585a"
|
||||||
|
dependencies:
|
||||||
|
babel-types "7.0.0-beta.3"
|
||||||
|
lodash "^4.2.0"
|
||||||
|
|
||||||
babel-helper-optimise-call-expression@^6.24.1:
|
babel-helper-optimise-call-expression@^6.24.1:
|
||||||
version "6.24.1"
|
version "6.24.1"
|
||||||
resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
|
resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
|
||||||
@ -988,6 +999,14 @@ babel-jest@22.1.0, babel-jest@^22.1.0:
|
|||||||
babel-plugin-istanbul "^4.1.5"
|
babel-plugin-istanbul "^4.1.5"
|
||||||
babel-preset-jest "^22.1.0"
|
babel-preset-jest "^22.1.0"
|
||||||
|
|
||||||
|
babel-literal-to-ast@^0.1.2:
|
||||||
|
version "0.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-literal-to-ast/-/babel-literal-to-ast-0.1.2.tgz#f50aa963711935adf19da0d5a4defc827ad5f403"
|
||||||
|
dependencies:
|
||||||
|
babel-traverse "^6.0.20"
|
||||||
|
babel-types "^6.0.19"
|
||||||
|
babylon "^6.0.18"
|
||||||
|
|
||||||
babel-loader@7.1.2:
|
babel-loader@7.1.2:
|
||||||
version "7.1.2"
|
version "7.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126"
|
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126"
|
||||||
@ -1008,6 +1027,14 @@ babel-plugin-check-es2015-constants@^6.22.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
babel-runtime "^6.22.0"
|
babel-runtime "^6.22.0"
|
||||||
|
|
||||||
|
babel-plugin-graphql-tag@1.3.1:
|
||||||
|
version "1.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-graphql-tag/-/babel-plugin-graphql-tag-1.3.1.tgz#a2f0696ec711464a2082011e0c796a2dacedd39a"
|
||||||
|
dependencies:
|
||||||
|
babel-literal-to-ast "^0.1.2"
|
||||||
|
babel-types "^6.24.1"
|
||||||
|
debug "^2.6.8"
|
||||||
|
|
||||||
babel-plugin-istanbul@^4.1.5:
|
babel-plugin-istanbul@^4.1.5:
|
||||||
version "4.1.5"
|
version "4.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e"
|
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e"
|
||||||
@ -1020,6 +1047,16 @@ babel-plugin-jest-hoist@^22.1.0:
|
|||||||
version "22.1.0"
|
version "22.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.1.0.tgz#c1281dd7887d77a1711dc760468c3b8285dde9ee"
|
resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.1.0.tgz#c1281dd7887d77a1711dc760468c3b8285dde9ee"
|
||||||
|
|
||||||
|
babel-plugin-lodash@3.3.2:
|
||||||
|
version "3.3.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-lodash/-/babel-plugin-lodash-3.3.2.tgz#da3a5b49ba27447f54463f6c4fa81396ccdd463f"
|
||||||
|
dependencies:
|
||||||
|
babel-helper-module-imports "^7.0.0-beta.3"
|
||||||
|
babel-types "^6.26.0"
|
||||||
|
glob "^7.1.1"
|
||||||
|
lodash "^4.17.4"
|
||||||
|
require-package-name "^2.0.1"
|
||||||
|
|
||||||
babel-plugin-syntax-async-functions@^6.8.0:
|
babel-plugin-syntax-async-functions@^6.8.0:
|
||||||
version "6.13.0"
|
version "6.13.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
|
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
|
||||||
@ -1464,6 +1501,20 @@ babel-template@^6.26.0:
|
|||||||
babylon "^6.18.0"
|
babylon "^6.18.0"
|
||||||
lodash "^4.17.4"
|
lodash "^4.17.4"
|
||||||
|
|
||||||
|
babel-traverse@^6.0.20, babel-traverse@^6.26.0:
|
||||||
|
version "6.26.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
|
||||||
|
dependencies:
|
||||||
|
babel-code-frame "^6.26.0"
|
||||||
|
babel-messages "^6.23.0"
|
||||||
|
babel-runtime "^6.26.0"
|
||||||
|
babel-types "^6.26.0"
|
||||||
|
babylon "^6.18.0"
|
||||||
|
debug "^2.6.8"
|
||||||
|
globals "^9.18.0"
|
||||||
|
invariant "^2.2.2"
|
||||||
|
lodash "^4.17.4"
|
||||||
|
|
||||||
babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.25.0:
|
babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.25.0:
|
||||||
version "6.25.0"
|
version "6.25.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1"
|
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1"
|
||||||
@ -1478,19 +1529,22 @@ babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.25.0:
|
|||||||
invariant "^2.2.0"
|
invariant "^2.2.0"
|
||||||
lodash "^4.2.0"
|
lodash "^4.2.0"
|
||||||
|
|
||||||
babel-traverse@^6.26.0:
|
babel-types@7.0.0-beta.3:
|
||||||
version "6.26.0"
|
version "7.0.0-beta.3"
|
||||||
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
|
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.3.tgz#cd927ca70e0ae8ab05f4aab83778cfb3e6eb20b4"
|
||||||
|
dependencies:
|
||||||
|
esutils "^2.0.2"
|
||||||
|
lodash "^4.2.0"
|
||||||
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
|
babel-types@^6.0.19, babel-types@^6.26.0:
|
||||||
|
version "6.26.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
|
||||||
dependencies:
|
dependencies:
|
||||||
babel-code-frame "^6.26.0"
|
|
||||||
babel-messages "^6.23.0"
|
|
||||||
babel-runtime "^6.26.0"
|
babel-runtime "^6.26.0"
|
||||||
babel-types "^6.26.0"
|
esutils "^2.0.2"
|
||||||
babylon "^6.18.0"
|
|
||||||
debug "^2.6.8"
|
|
||||||
globals "^9.18.0"
|
|
||||||
invariant "^2.2.2"
|
|
||||||
lodash "^4.17.4"
|
lodash "^4.17.4"
|
||||||
|
to-fast-properties "^1.0.3"
|
||||||
|
|
||||||
babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.25.0:
|
babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.25.0:
|
||||||
version "6.25.0"
|
version "6.25.0"
|
||||||
@ -1501,27 +1555,18 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.25
|
|||||||
lodash "^4.2.0"
|
lodash "^4.2.0"
|
||||||
to-fast-properties "^1.0.1"
|
to-fast-properties "^1.0.1"
|
||||||
|
|
||||||
babel-types@^6.26.0:
|
|
||||||
version "6.26.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
|
|
||||||
dependencies:
|
|
||||||
babel-runtime "^6.26.0"
|
|
||||||
esutils "^2.0.2"
|
|
||||||
lodash "^4.17.4"
|
|
||||||
to-fast-properties "^1.0.3"
|
|
||||||
|
|
||||||
babylon@7.0.0-beta.36:
|
babylon@7.0.0-beta.36:
|
||||||
version "7.0.0-beta.36"
|
version "7.0.0-beta.36"
|
||||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e"
|
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e"
|
||||||
|
|
||||||
|
babylon@^6.0.18, babylon@^6.18.0:
|
||||||
|
version "6.18.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
|
||||||
|
|
||||||
babylon@^6.17.2:
|
babylon@^6.17.2:
|
||||||
version "6.17.4"
|
version "6.17.4"
|
||||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a"
|
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a"
|
||||||
|
|
||||||
babylon@^6.18.0:
|
|
||||||
version "6.18.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
|
|
||||||
|
|
||||||
backo@^1.1.0:
|
backo@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/backo/-/backo-1.1.0.tgz#a36c4468923f2d265c9e8a709ea56ecdaff807e6"
|
resolved "https://registry.yarnpkg.com/backo/-/backo-1.1.0.tgz#a36c4468923f2d265c9e8a709ea56ecdaff807e6"
|
||||||
@ -2025,7 +2070,7 @@ center-align@^0.1.1:
|
|||||||
align-text "^0.1.3"
|
align-text "^0.1.3"
|
||||||
lazy-cache "^1.0.3"
|
lazy-cache "^1.0.3"
|
||||||
|
|
||||||
chalk@^1.0.0, chalk@^1.1, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
|
chalk@1.1.x, chalk@^1.0.0, chalk@^1.1, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -2173,7 +2218,7 @@ clean-webpack-plugin@0.1.18:
|
|||||||
dependencies:
|
dependencies:
|
||||||
rimraf "^2.6.1"
|
rimraf "^2.6.1"
|
||||||
|
|
||||||
cli-cursor@^2.1.0:
|
cli-cursor@^2.0.0, cli-cursor@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
|
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -3998,7 +4043,7 @@ feature-detect-es6@^1.3.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
array-back "^1.0.3"
|
array-back "^1.0.3"
|
||||||
|
|
||||||
figures@^2.0.0:
|
figures@2.0.x, figures@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
|
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -4568,6 +4613,10 @@ gzip-size@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
duplexer "^0.1.1"
|
duplexer "^0.1.1"
|
||||||
|
|
||||||
|
hammerjs@2.0.8:
|
||||||
|
version "2.0.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1"
|
||||||
|
|
||||||
handlebars@^4.0.3:
|
handlebars@^4.0.3:
|
||||||
version "4.0.10"
|
version "4.0.10"
|
||||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f"
|
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f"
|
||||||
@ -4627,10 +4676,6 @@ has-symbol-support-x@^1.4.0:
|
|||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.0.tgz#442d89b1d0ac6cf5ff2f7b916ee539869b93a256"
|
resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.0.tgz#442d89b1d0ac6cf5ff2f7b916ee539869b93a256"
|
||||||
|
|
||||||
has-symbols@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
|
|
||||||
|
|
||||||
has-to-string-tag-x@^1.2.0:
|
has-to-string-tag-x@^1.2.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.0.tgz#49d7bcde85c2409be38ac327e3e119a451657c7b"
|
resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.0.tgz#49d7bcde85c2409be38ac327e3e119a451657c7b"
|
||||||
@ -4997,10 +5042,6 @@ interpret@^1.0.0:
|
|||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
|
||||||
|
|
||||||
intl@1.2.5:
|
|
||||||
version "1.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde"
|
|
||||||
|
|
||||||
invariant@^2.2.0, invariant@^2.2.2:
|
invariant@^2.2.0, invariant@^2.2.2:
|
||||||
version "2.2.2"
|
version "2.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
|
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
|
||||||
@ -6200,6 +6241,12 @@ locate-path@^2.0.0:
|
|||||||
p-locate "^2.0.0"
|
p-locate "^2.0.0"
|
||||||
path-exists "^3.0.0"
|
path-exists "^3.0.0"
|
||||||
|
|
||||||
|
lodash-webpack-plugin@0.11.4:
|
||||||
|
version "0.11.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash-webpack-plugin/-/lodash-webpack-plugin-0.11.4.tgz#6c3ecba3d4b8d24b53940b63542715c5ed3c4ac5"
|
||||||
|
dependencies:
|
||||||
|
lodash "^4.17.4"
|
||||||
|
|
||||||
lodash._arraycopy@^3.0.0:
|
lodash._arraycopy@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1"
|
resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1"
|
||||||
@ -6425,6 +6472,14 @@ log-symbols@^2.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
chalk "^2.0.1"
|
chalk "^2.0.1"
|
||||||
|
|
||||||
|
log-update@2.0.x:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.0.0.tgz#7f4354d7be1be62b724fcbb3c4b94454c0db5e26"
|
||||||
|
dependencies:
|
||||||
|
ansi-escapes "^1.0.0"
|
||||||
|
cli-cursor "^2.0.0"
|
||||||
|
wrap-ansi "^2.1.0"
|
||||||
|
|
||||||
loglevelnext@^1.0.1:
|
loglevelnext@^1.0.1:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.3.tgz#0f69277e73bbbf2cd61b94d82313216bf87ac66e"
|
resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.3.tgz#0f69277e73bbbf2cd61b94d82313216bf87ac66e"
|
||||||
@ -7266,7 +7321,7 @@ object-copy@^0.1.0:
|
|||||||
define-property "^0.2.5"
|
define-property "^0.2.5"
|
||||||
kind-of "^3.0.3"
|
kind-of "^3.0.3"
|
||||||
|
|
||||||
object-keys@^1.0.11, object-keys@^1.0.8:
|
object-keys@^1.0.8:
|
||||||
version "1.0.11"
|
version "1.0.11"
|
||||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
||||||
|
|
||||||
@ -7284,15 +7339,6 @@ object-visit@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
isobject "^3.0.0"
|
isobject "^3.0.0"
|
||||||
|
|
||||||
object.assign@^4.0.1:
|
|
||||||
version "4.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
|
|
||||||
dependencies:
|
|
||||||
define-properties "^1.1.2"
|
|
||||||
function-bind "^1.1.1"
|
|
||||||
has-symbols "^1.0.0"
|
|
||||||
object-keys "^1.0.11"
|
|
||||||
|
|
||||||
object.getownpropertydescriptors@^2.0.3:
|
object.getownpropertydescriptors@^2.0.3:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
||||||
@ -8090,6 +8136,18 @@ postcss-filter-plugins@^2.0.0:
|
|||||||
postcss "^5.0.4"
|
postcss "^5.0.4"
|
||||||
uniqid "^4.0.0"
|
uniqid "^4.0.0"
|
||||||
|
|
||||||
|
postcss-flexbugs-fixes@3.3.0:
|
||||||
|
version "3.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-3.3.0.tgz#e00849b536063749da50a0d410ba5d9ee65e27b8"
|
||||||
|
dependencies:
|
||||||
|
postcss "^6.0.1"
|
||||||
|
|
||||||
|
postcss-flexibility@2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/postcss-flexibility/-/postcss-flexibility-2.0.0.tgz#5612c1b85d6595ed480966839928a41617a6a768"
|
||||||
|
dependencies:
|
||||||
|
postcss "^6.0.1"
|
||||||
|
|
||||||
postcss-load-config@^1.1.0, postcss-load-config@^1.2.0:
|
postcss-load-config@^1.1.0, postcss-load-config@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-1.2.0.tgz#539e9afc9ddc8620121ebf9d8c3673e0ce50d28a"
|
resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-1.2.0.tgz#539e9afc9ddc8620121ebf9d8c3673e0ce50d28a"
|
||||||
@ -8591,18 +8649,6 @@ process@~0.5.1:
|
|||||||
version "0.5.2"
|
version "0.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
|
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
|
||||||
|
|
||||||
progress-bar-webpack-plugin@1.10.0:
|
|
||||||
version "1.10.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/progress-bar-webpack-plugin/-/progress-bar-webpack-plugin-1.10.0.tgz#e0b1063aa03c79e298a9340598590bb61efef9a4"
|
|
||||||
dependencies:
|
|
||||||
chalk "^1.1.1"
|
|
||||||
object.assign "^4.0.1"
|
|
||||||
progress "^1.1.8"
|
|
||||||
|
|
||||||
progress@^1.1.8:
|
|
||||||
version "1.1.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
|
|
||||||
|
|
||||||
progress@^2.0.0:
|
progress@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
|
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
|
||||||
@ -9273,6 +9319,10 @@ require-main-filename@^1.0.1:
|
|||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
|
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
|
||||||
|
|
||||||
|
require-package-name@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/require-package-name/-/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9"
|
||||||
|
|
||||||
require-uncached@^1.0.3:
|
require-uncached@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
|
resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
|
||||||
@ -9709,6 +9759,14 @@ simple-lru-cache@0.0.x:
|
|||||||
version "0.0.2"
|
version "0.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/simple-lru-cache/-/simple-lru-cache-0.0.2.tgz#d59cc3a193c1a5d0320f84ee732f6e4713e511dd"
|
resolved "https://registry.yarnpkg.com/simple-lru-cache/-/simple-lru-cache-0.0.2.tgz#d59cc3a193c1a5d0320f84ee732f6e4713e511dd"
|
||||||
|
|
||||||
|
simple-progress-webpack-plugin@1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/simple-progress-webpack-plugin/-/simple-progress-webpack-plugin-1.0.4.tgz#b27127731040aa106500c43d043697cc9bac3743"
|
||||||
|
dependencies:
|
||||||
|
chalk "1.1.x"
|
||||||
|
figures "2.0.x"
|
||||||
|
log-update "2.0.x"
|
||||||
|
|
||||||
simple-swizzle@^0.2.2:
|
simple-swizzle@^0.2.2:
|
||||||
version "0.2.2"
|
version "0.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
||||||
@ -11115,7 +11173,7 @@ worker-farm@^1.5.2:
|
|||||||
errno "^0.1.4"
|
errno "^0.1.4"
|
||||||
xtend "^4.0.1"
|
xtend "^4.0.1"
|
||||||
|
|
||||||
wrap-ansi@^2.0.0:
|
wrap-ansi@^2.0.0, wrap-ansi@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Loading…
Reference in New Issue
Block a user