Files
filebrowser/assets/src/main.js
T

55 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-06-28 11:45:41 +01:00
import Vue from 'vue'
import App from './App'
2017-07-06 09:08:20 +01:00
import store from './store'
2017-07-03 10:40:24 +01:00
import router from './router'
2017-08-01 20:49:56 +01:00
import i18n from './i18n'
2017-08-24 14:13:29 +01:00
import Noty from 'noty'
2017-06-28 11:45:41 +01:00
2017-07-03 16:40:52 +01:00
Vue.config.productionTip = true
2017-06-28 16:05:30 +01:00
2017-08-24 14:13:29 +01:00
const notyDefault = {
type: 'info',
layout: 'bottomRight',
timeout: 1000,
progressBar: true
}
Vue.prototype.$noty = function (opts) {
new Noty(Object.assign({}, notyDefault, opts)).show()
}
Vue.prototype.$showSuccess = function (message) {
new Noty(Object.assign({}, notyDefault, {
text: message,
type: 'success'
})).show()
}
Vue.prototype.$showError = function (error) {
let n = new Noty(Object.assign({}, notyDefault, {
text: error,
type: 'error',
timeout: null,
buttons: [
2017-09-11 09:46:17 +01:00
Noty.button(i18n.t('buttons.reportIssue'), '', function () {
2017-08-24 14:13:29 +01:00
window.open('https://github.com/hacdias/filemanager/issues/new')
}),
Noty.button(i18n.t('buttons.close'), '', function () {
n.close()
})
]
}))
n.show()
}
2017-06-28 11:45:41 +01:00
/* eslint-disable no-new */
new Vue({
el: '#app',
2017-06-30 10:25:35 +01:00
store,
2017-07-03 10:40:24 +01:00
router,
2017-08-01 20:49:56 +01:00
i18n,
2017-06-28 11:45:41 +01:00
template: '<App/>',
components: { App }
})