Mercurial > gemma
annotate client/src/main.js @ 1163:fb5c83d4ea1d
added copy coordinates button to fairway profile
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 14 Nov 2018 07:29:51 +0100 |
parents | 874d19f32015 |
children | 24797f66f268 |
rev | line source |
---|---|
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
1 /* |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
2 * This is Free Software under GNU Affero General Public License v >= 3.0 |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
3 * without warranty, see README.md and license for details. |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
4 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
5 * SPDX-License-Identifier: AGPL-3.0-or-later |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
6 * License-Filename: LICENSES/AGPL-3.0.txt |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
7 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
8 * Copyright (C) 2018 by via donau |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
9 * – Österreichische Wasserstraßen-Gesellschaft mbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
10 * Software engineering by Intevation GmbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
11 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
12 * Author(s): |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
13 * Thomas Junk <thomas.junk@intevation.de> |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
14 */ |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
15 |
3 | 16 import Vue from "vue"; |
17 import App from "./App.vue"; | |
18 import router from "./router"; | |
19 import store from "./store"; | |
141 | 20 import GetTextPlugin from "vue-gettext"; |
21 import translations from "./translations.json"; | |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
22 import locale2 from "locale2"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
23 import CxltToastr from "cxlt-vue2-toastr"; |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
24 import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
25 import "../node_modules/font-awesome/css/font-awesome.min.css"; |
428
d7a06b9fffc9
feat: Usability for usermanagement improved.
Thomas Junk <thomas.junk@intevation.de>
parents:
375
diff
changeset
|
26 import "../node_modules/animate.css/animate.min.css"; |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
27 import "../node_modules/ol/ol.css"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
28 import "../node_modules/cxlt-vue2-toastr/dist/css/cxlt-vue2-toastr.css"; |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
565
diff
changeset
|
29 import "../node_modules/highlight.js/styles/paraiso-dark.css"; |
565
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
30 import VTooltip from "v-tooltip"; |
1097
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
31 import { library } from "@fortawesome/fontawesome-svg-core"; |
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
32 import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons"; |
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
33 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; |
1163
fb5c83d4ea1d
added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents:
1097
diff
changeset
|
34 import VueClipboard from "vue-clipboard2"; |
1097
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
35 |
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
36 library.add(faEye, faEyeSlash); |
874d19f32015
added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
37 Vue.component("font-awesome-icon", FontAwesomeIcon); |
565
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
38 |
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
39 Vue.use(VTooltip); |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
40 |
1163
fb5c83d4ea1d
added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents:
1097
diff
changeset
|
41 Vue.use(VueClipboard); |
fb5c83d4ea1d
added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents:
1097
diff
changeset
|
42 |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
43 var toastrConfigs = { |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
44 position: "bottom center", |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
45 showDuration: 2000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
46 timeOut: 8000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
47 closeButton: true |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
48 }; |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
49 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
50 Vue.use(CxltToastr, toastrConfigs); |
141 | 51 |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
52 let browserLanguage = locale2; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
53 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
54 // planned also SK, HU, HR, RS, BiH, BG, RO, UA |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
55 const supportedLanguages = { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
56 en_GB: "British English", |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
57 de_AT: "Deutsch" |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
58 }; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
59 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
60 if (browserLanguage === "de-DE") { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
61 browserLanguage = "de-AT"; // map german to austrian variant for now |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
62 } |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
63 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
64 const language = browserLanguage.replace("-", "_"); |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
65 const isLanguageAvailable = supportedLanguages[language]; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
66 let defaultLanguage = isLanguageAvailable ? language : "en_GB"; |
141 | 67 |
68 Vue.use(GetTextPlugin, { | |
69 translations: translations, | |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
70 availableLanguages: supportedLanguages, |
141 | 71 defaultLanguage: defaultLanguage |
72 }); | |
73 | |
3 | 74 Vue.config.productionTip = false; |
75 | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
76 const app = new Vue({ |
3 | 77 router, |
78 store, | |
79 render: h => h(App) | |
80 }).$mount("#app"); | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
81 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
82 export default app; |