-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
110 lines (85 loc) · 2.68 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
import Vue from 'vue';
import Vuex from 'vuex';
import VueRouter from 'vue-router';
import VueI18n from 'vue-i18n'
import {store} from './assets/js/store/store';
import router from './assets/js/routes';
import "jquery-ui/ui/effects/effect-slide";
import Vue2TouchEvents from "vue2-touch-events";
import AxiosPlugin from 'vue-axios-cors';
import App from './assets/js/components/App';
window.jQuery = require('jquery');
require('jquery.scrollto');
require('jquery-ui-dist/jquery-ui');
require('jquery-ui-touch-punch');
require('jquery-touch-events');
require('./assets/js/bootstrap');
require('./assets/js/lib/bootstrap.bundle.min');
require('@fancyapps/fancybox');
/**
* Vue.use() will make the plugin globally available in the project
*/
//Use Vuex Store
Vue.use(Vuex);
//Use Vue Router
Vue.use(VueRouter);
//Use Vue i18n
Vue.use(VueI18n);
Vue.use(Vue2TouchEvents);
Vue.use(AxiosPlugin);
/**
* Register components globally.
* You can choose to register components only when needed (i.e. import them inside the parent components,
* but since the scale of NSW frontend isn't large, we simply register most components globally here to make it more convenient.
*/
Vue.component('app', App);
//Define data to be passed to the Vue instance
Vue.prototype.$getDir = function(path) {
if (path.charAt(0) !== "/") {
return default_uri+"/"+path;
} else {
return default_uri+path;
}
};
/**
* Initialize the Vue instance.
* Pass variables so that we can access them like this.$myVar in the Vue components
*/
// const app = new Vue({
// el: '#app',
// store,
// router
// });
document.addEventListener('deviceready', function() {
const app = new Vue({
el: '#app',
store,
router
});
window.open = cordova.InAppBrowser.open;
if(MobileAccessibility){
MobileAccessibility.usePreferredTextZoom(false);
}
document.addEventListener("backbutton", function (e) {
e.preventDefault();
}, false );
setTimeout(function() {
navigator.splashscreen.hide();
if (isSmallScreen) {
// screen.orientation.unlock();
// screen.orientation.lock('portrait-primary');
} else {
if (screen.orientation.type !== "landscape-primary") {
// screen.orientation.unlock();
//
// screen.orientation.lock('portrait-primary');
// screen.orientation.lock('landscape-primary');
}
}
}, 1000);
});