annotate client/src/main.js @ 1243:24797f66f268

Client: remove (minor) superfluous things
author Bernhard Reiter <bernhard@intevation.de>
date Wed, 21 Nov 2018 10:23:53 +0100
parents fb5c83d4ea1d
children bc55ffaeb639
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
1 /* This is Free Software under GNU Affero General Public License v >= 3.0
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
2 * without warranty, see README.md and license for details.
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
3 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
4 * SPDX-License-Identifier: AGPL-3.0-or-later
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
5 * License-Filename: LICENSES/AGPL-3.0.txt
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
6 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
7 * Copyright (C) 2018 by via donau
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
8 * – Österreichische Wasserstraßen-Gesellschaft mbH
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
9 * Software engineering by Intevation GmbH
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
10 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
11 * Author(s):
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
12 * Thomas Junk <thomas.junk@intevation.de>
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
13 */
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
14
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 import Vue from "vue";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 import App from "./App.vue";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 import router from "./router";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 import store from "./store";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
19 import GetTextPlugin from "vue-gettext";
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
20 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
21 import locale2 from "locale2";
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
22 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
23 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
24 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
25 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
26 import "../node_modules/ol/ol.css";
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
27 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
28 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
29 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
30 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
31 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
32 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
1163
fb5c83d4ea1d added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents: 1097
diff changeset
33 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
34
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
35 library.add(faEye, faEyeSlash);
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
36 Vue.component("font-awesome-icon", FontAwesomeIcon);
565
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
37
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
38 Vue.use(VTooltip);
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
39
1163
fb5c83d4ea1d added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents: 1097
diff changeset
40 Vue.use(VueClipboard);
fb5c83d4ea1d added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents: 1097
diff changeset
41
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
42 var toastrConfigs = {
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
43 position: "bottom center",
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
44 showDuration: 2000,
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
45 timeOut: 8000,
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
46 closeButton: true
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
47 };
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 Vue.use(CxltToastr, toastrConfigs);
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
50
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
51 let browserLanguage = locale2;
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
52
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
53 // 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
54 const supportedLanguages = {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
55 en_GB: "British English",
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
56 de_AT: "Deutsch"
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
57 };
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 if (browserLanguage === "de-DE") {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
60 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
61 }
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 const language = browserLanguage.replace("-", "_");
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
64 const isLanguageAvailable = supportedLanguages[language];
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
65 let defaultLanguage = isLanguageAvailable ? language : "en_GB";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
66
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
67 Vue.use(GetTextPlugin, {
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
68 translations: translations,
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
69 availableLanguages: supportedLanguages,
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
70 defaultLanguage: defaultLanguage
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
71 });
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
72
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 Vue.config.productionTip = false;
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
75 const app = new Vue({
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 router,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 store,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78 render: h => h(App)
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 }).$mount("#app");
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
80
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
81 export default app;