annotate client/src/components/systemconfiguration/MorphologyClassbreaks.vue @ 3787:f86220aa8a72 yworks-svg2pdf

Waterlevel: prefetch images of template and convert to dataURI
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 03 Jul 2019 16:42:38 +0200
parents a1bb7c894058
children 0d0e52612c32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
2 <div class="d-flex flex-column pb-4 border-bottom">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
3 <h5 class="py-2 px-3 mb-2 m-0">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
4 <translate>Bottleneck Morphology Classbreaks</translate>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
5 </h5>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
6 <div class="px-3">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
7 <h6 class="font-weight-bold"><translate>Sounding Result</translate></h6>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
8 <div class="d-flex flex-wrap">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
9 <div
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
10 class="input-group mb-3 mr-2 classbreak"
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
11 v-for="(value, i) in morphologyClassbreaks"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
12 :key="i"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
13 >
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
14 <div class="input-group-prepend">
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
15 <button
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
16 class="btn btn-sm btn-outline-secondary"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
17 :style="
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
18 'width: 20px; background-color: ' +
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
19 (morphologyClassbreaks[i][1] || 'transparent')
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
20 "
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
21 type="button"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
22 @click="showColorPicker('sounding-' + i)"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
23 ></button>
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
24 <div
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
25 class="color-picker card shadow-sm"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
26 v-if="activeColorPicker === 'sounding-' + i"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
27 >
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
28 <UIBoxHeader
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
29 :title="colorPickerTitle"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
30 icon="paint-brush"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
31 :closeCallback="() => (activeColorPicker = null)"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
32 :actions="[
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
33 {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
34 callback: () => {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
35 morphologyClassbreaks[i][1] = '#ffffff';
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
36 activeColorPicker = null;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
37 },
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
38 icon: 'trash'
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
39 }
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
40 ]"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
41 />
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
42 <chrome-picker
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
43 v-model="morphologyClassbreaks[i][1]"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
44 @input="color => (morphologyClassbreaks[i][1] = color.hex)"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
45 />
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
46 </div>
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
47 </div>
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
48 <input
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
49 v-model="morphologyClassbreaks[i][0]"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
50 type="number"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
51 min="0"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
52 step="0.1"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
53 class="form-control form-control-sm"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
54 />
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
55 <div class="input-group-append">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
56 <button
3612
c48b1e0fccd0 client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents: 3611
diff changeset
57 class="btn btn-sm btn-outline-secondary"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
58 type="button"
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
59 @click="morphologyClassbreaks.splice(i, 1)"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 >
3614
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
61 <font-awesome-icon icon="times" />
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
62 </button>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
63 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
64 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
65 <button
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
66 class="btn btn-sm btn-success mb-3"
3611
eb694e47782a client: configuration: morphology: added default class breaks
Markus Kottlaender <markus@intevation.de>
parents: 3610
diff changeset
67 @click="
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
68 morphologyClassbreaks.push(
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
69 morphologyClassbreaks.length
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
70 ? morphologyClassbreaks[morphologyClassbreaks.length - 1]
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
71 : 1
3611
eb694e47782a client: configuration: morphology: added default class breaks
Markus Kottlaender <markus@intevation.de>
parents: 3610
diff changeset
72 )
eb694e47782a client: configuration: morphology: added default class breaks
Markus Kottlaender <markus@intevation.de>
parents: 3610
diff changeset
73 "
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
74 >
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
75 <font-awesome-icon icon="plus" />
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
76 </button>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
77 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
78 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
79 <div class="px-3">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80 <h6 class="font-weight-bold">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
81 <translate>Sounding Result Comparison</translate>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
82 </h6>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
83 <div class="d-flex flex-wrap">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
84 <div
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
85 class="input-group mb-3 mr-2 classbreak"
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
86 v-for="(value, i) in morphologyClassbreaksCompare"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
87 :key="i"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
88 >
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
89 <div class="input-group-prepend">
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
90 <button
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
91 class="btn btn-sm btn-outline-secondary"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
92 :style="
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
93 'width: 20px; background-color: ' +
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
94 (morphologyClassbreaksCompare[i][1] || 'transparent')
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
95 "
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
96 type="button"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
97 @click="showColorPicker('compare-' + i)"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
98 ></button>
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
99 <div
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
100 class="color-picker card shadow-sm"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
101 v-if="activeColorPicker === 'compare-' + i"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
102 >
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
103 <UIBoxHeader
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
104 :title="colorPickerTitle"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
105 icon="paint-brush"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
106 :closeCallback="() => (activeColorPicker = null)"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
107 :actions="[
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
108 {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
109 callback: () => {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
110 morphologyClassbreaksCompare[i][1] = '#ffffff';
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
111 activeColorPicker = null;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
112 },
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
113 icon: 'trash'
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
114 }
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
115 ]"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
116 />
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
117 <chrome-picker
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
118 v-model="morphologyClassbreaksCompare[i][1]"
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
119 @input="
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
120 color => (morphologyClassbreaksCompare[i][1] = color.hex)
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
121 "
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
122 />
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
123 </div>
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
124 </div>
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
125 <input
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
126 v-model="morphologyClassbreaksCompare[i][0]"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
127 type="number"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
128 step="0.1"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
129 class="form-control form-control-sm"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
130 />
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
131 <div class="input-group-append">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
132 <button
3612
c48b1e0fccd0 client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents: 3611
diff changeset
133 class="btn btn-sm btn-outline-secondary"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
134 type="button"
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
135 @click="morphologyClassbreaksCompare.splice(i, 1)"
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
136 >
3614
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
137 <font-awesome-icon icon="times" />
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
138 </button>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
140 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
141 <button
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
142 class="btn btn-sm btn-success mb-3"
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
143 @click="
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
144 morphologyClassbreaksCompare.push(
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
145 morphologyClassbreaksCompare.length
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
146 ? morphologyClassbreaksCompare[
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
147 morphologyClassbreaksCompare.length - 1
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
148 ]
3611
eb694e47782a client: configuration: morphology: added default class breaks
Markus Kottlaender <markus@intevation.de>
parents: 3610
diff changeset
149 : 1
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
150 )
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
151 "
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
152 >
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
153 <font-awesome-icon icon="plus" />
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
154 </button>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
155 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
156 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
157 <div class="mt-4 px-3">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
158 <a @click.prevent="submit" class="btn btn-info btn-sm text-white">
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
159 <translate>Send</translate>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
160 </a>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
161 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
162 </div>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
163 </template>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
164
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
165 <style lang="sass" scoped>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
166 .classbreak
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
167 width: 105px
3614
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
168 .btn-outline-secondary
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
169 border-color: #ccc
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
170 color: #ccc
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
171 &:hover
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
172 background: #eee
2055b689be54 client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents: 3612
diff changeset
173 color: #dc3545
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
174 .color-picker
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
175 position: absolute
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
176 top: -4px
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
177 left: 19px
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
178 z-index: 9
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
179 overflow: hidden
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
180 border-top-left-radius: 0 !important
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
181 .btn
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
182 border-radius: 0 !important
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
183 .vc-chrome
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
184 box-shadow: none
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
185 /deep/
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
186 .vc-chrome-alpha-wrap
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
187 display: none !important
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
188 .vc-chrome-hue-wrap
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
189 margin-top: 10px
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
190 .vc-chrome-saturation-wrap
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
191 border-radius: 0
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
192 </style>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
193
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
194 <script>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
195 /* This is Free Software under GNU Affero General Public License v >= 3.0
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
196 * without warranty, see README.md and license for details.
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
197 *
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
198 * SPDX-License-Identifier: AGPL-3.0-or-later
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199 * License-Filename: LICENSES/AGPL-3.0.txt
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
200 *
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 * Copyright (C) 2018 by via donau
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202 * – Österreichische Wasserstraßen-Gesellschaft mbH
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203 * Software engineering by Intevation GmbH
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
204 *
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205 * Author(s):
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 * Markus Kottländer <markus@intevation.de>
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
207 */
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
208 import { mapState } from "vuex";
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
209 import { Chrome } from "vue-color";
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
211 export default {
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
212 components: {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
213 "chrome-picker": Chrome
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
214 },
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
215 data() {
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
216 return {
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
217 morphologyClassbreaks: [],
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
218 morphologyClassbreaksCompare: [],
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
219 activeColorPicker: null,
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
220 closeColorPickerListener: null
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
221 };
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
222 },
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
223 computed: {
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
224 ...mapState("application", ["config"]),
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
225 colorPickerTitle() {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
226 return this.$gettext("Choose color");
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
227 }
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228 },
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 methods: {
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
230 showColorPicker(id) {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
231 this.activeColorPicker = this.activeColorPicker === id ? null : id;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
232 },
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
233 submit() {
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
234 this.$store.dispatch("application/saveConfig", {
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
235 morphology_classbreaks: this.morphologyClassbreaks
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
236 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":")))
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
237 .join(","),
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
238 morphology_classbreaks_compare: this.morphologyClassbreaksCompare
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
239 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":")))
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
240 .join(",")
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
241 });
3622
30a9fdac70f0 client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents: 3614
diff changeset
242 }
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
243 },
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
244 mounted() {
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
245 this.morphologyClassbreaks = this.config.morphology_classbreaks
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
246 .split(",")
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
247 .map(cb => cb.split(":"))
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
248 .map(cb => {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
249 cb[0] = Number(cb[0]);
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
250 cb[1] = cb[1] || "#ffffff";
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
251 return cb;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
252 });
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
253 this.morphologyClassbreaksCompare = this.config.morphology_classbreaks_compare
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
254 .split(",")
3763
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
255 .map(cb => cb.split(":"))
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
256 .map(cb => {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
257 cb[0] = Number(cb[0]);
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
258 cb[1] = cb[1] || "#ffffff";
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
259 return cb;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
260 });
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
261
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
262 this.closeColorPickerListener = e => {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
263 // Escape
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
264 if (e.keyCode === 27) {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
265 this.activeColorPicker = null;
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
266 }
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
267 };
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
268 window.addEventListener("keydown", this.closeColorPickerListener);
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
269 },
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
270 destroyed() {
a1bb7c894058 client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
271 window.removeEventListener("keydown", this.closeColorPickerListener);
3606
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
272 }
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
273 };
a8190a570b71 client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 </script>