import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Buefy, {Snackbar} from 'buefy'
import axios from 'axios'
import VueAxios from 'vue-axios'
import i18n from './i18n'
import moment from 'moment'
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import enUS from '@kangc/v-md-editor/lib/lang/en-US';
import createHljsTheme from '@kangc/v-md-editor/lib/theme/hljs';
import json from 'highlight.js/lib/languages/json';
const hljsTheme = createHljsTheme();
import io from 'socket.io-client'
import VueSocketIO from "vue-socket.io";
import NProgress from "vue-nprogress";
Vue.use(NProgress)
const nprogress = new NProgress()
Vue.use(
new VueSocketIO({
debug: true,
connection: io(process.env.VUE_APP_GATEWAYENDPOINT), // options object is Optional
})
);
Vue.use(VMdEditor)
VMdEditor.lang.use('en-US', enUS);
hljsTheme.extend((md, hljs) => {
md.set({
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (
).
// This is only for full CommonMark compatibility.
breaks: true, // Convert '\n' in paragraphs into
langPrefix: 'language-', // CSS language prefix for fenced blocks. Can be
// useful for external highlighters.
linkify: true, // Autoconvert URL-like text to links
image: false,
// Enable some language-neutral replacement + quotes beautification
typographer: true,
// Double + single quotes replacement pairs, when typographer enabled,
// and smartquotes on. Could be either a String or an Array.
//
// For example, you can use '«»„“' for Russian, '„“‚‘' for German,
// and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
quotes: '“”‘’'
})
md.disable('image')
hljs.registerLanguage('json', json);
});
Vue.use(VueAxios, axios)
Vue.use(Buefy)
Vue.config.productionTip = false
Vue.prototype.$snackbar = Snackbar
Vue.filter('formatDate', function(value) {
if (value) {
return moment(String(value)).format('hh:mm A, DD/MM/YYYY')
}
})
new Vue({
nprogress,
router,
store,
i18n,
render: h => h(App)
}).$mount('#app')