Former-commit-id: ec29aa7447e3ad1c90dea24e94072d51f212333e [formerly d370cb523dde06fb6d5aab614bf6ec1d94097363] [formerly bbabc4da0a6128b3bd8ecfa226156c9c2be7297e [formerly 2789ff2161cb4c1b1dc51282cb7aaa539a272966]] Former-commit-id: fb3ae368534aa2bd7cc08283463ac9d8e0d1d825 [formerly efbb60cc4dd2856bbc004fcbdc0567540c72f5b3] Former-commit-id: d0c3699029c88a3ed2a8f5ab72c70d0f5289292d
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
// The Vue build version to load with the `import` command
|
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
|
import Vue from 'vue'
|
|
import App from './App'
|
|
import store from './store/store'
|
|
// simport page from './page.js'
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
var $ = (window.info || window.alert('Something is wrong, please refresh!'))
|
|
|
|
// TODO: keep this here? Maybe on app.vue?
|
|
document.title = $.req.data.name
|
|
|
|
// TODO: keep this here? Maybe on app.vue?
|
|
window.addEventListener('popstate', (event) => {
|
|
event.preventDefault()
|
|
event.stopPropagation()
|
|
|
|
$.req.kind = ''
|
|
$.selected = []
|
|
$.multiple = false
|
|
// TODO: find a better way to do this. Maybe on app.vue?
|
|
window.info.showHelp = false
|
|
window.info.showInfo = false
|
|
window.info.showDelete = false
|
|
window.info.showRename = false
|
|
window.info.showMove = false
|
|
|
|
let request = new window.XMLHttpRequest()
|
|
request.open('GET', event.state.url, true)
|
|
request.setRequestHeader('Accept', 'application/json')
|
|
|
|
request.onload = () => {
|
|
if (request.status === 200) {
|
|
$.req = JSON.parse(request.responseText)
|
|
document.title = event.state.name
|
|
} else {
|
|
console.log(request.responseText)
|
|
}
|
|
}
|
|
|
|
request.onerror = (error) => { console.log(error) }
|
|
request.send()
|
|
})
|
|
|
|
/* eslint-disable no-new */
|
|
new Vue({
|
|
el: '#app',
|
|
store,
|
|
template: '<App/>',
|
|
components: { App }
|
|
})
|