Commit 0ed183c
Balloon: tighten generator, escape tooltips, prune dead WebKit CSS
Generator (CollectEarthBalloonGenerator):
- Cache the HTML template in a static volatile field; the template is an
immutable classpath resource and was being re-read on every call.
- Replace ten sequential String.replace() passes in
replaceButtonLocalizationText with a single LinkedHashMap + regex pass.
- Reuse the existing balloonInputFieldsUtils field in
getIdAttributesSurvey instead of allocating a new instance.
- Introduce CALCULATED_FIELD_CLASS so calculated fields can be styled
separately from CSV-extras; emitted in addition to the existing "extra"
class so current hide-logic still applies.
Formatter (CEComponentHTMLFormatter):
- HTML-escape the code-item description before embedding it in the
Bootstrap tooltip title blob; with data-html="true" the tooltip is
parsed as HTML and unescaped <, &, " would break the markup.
- Rename helper to escapeHtml since it is now used for both attribute and
text contexts.
- Tighten the &# post-fix to a numeric-character-reference regex so
it can only fire on actual &#xNNNN; / &#NNNN; sequences.
- Drop vestigial "selectboxit show-menu-arrow show-tick" classes from
both select fields - bootstrap-select is not bundled, those classes
were dead weight.
- Add an empty "no value" option to buildCodeRange so a freshly-opened
range field does not silently take the "from" value (parity with
buildCodeSelect).
- Move the tooltip-icon inline display:inline-block to a CSS class.
CSS (earth.css):
- Remove the dead .bootstrap-select:not([class*="span"]) rule.
- Replace the six-layer inset box-shadow on .btn.active with a two-layer
equivalent - WebKit 538 (Google Earth Pro) composites each shadow per
paint, this is the bulk of the per-paint cost when many active code
buttons are visible.
- Collapse the 48-selector .col-xs-1...col-lg-12 rule into 4 prefix-
anchored attribute selectors with the same precision.
- Add .ui-icon.tooltip-icon { display: inline-block } to replace the
inline style now removed from the markup.
Template (balloon_template_new.txt):
- Modernise the meta tag to <meta charset="utf-8">.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 14b0571 commit 0ed183c
4 files changed
Lines changed: 97 additions & 60 deletions
File tree
- collect-server/src/main
- java/org/openforis/collect/io/metadata/collectearth/balloon
- resources/org/openforis/collect/designer/templates/collectearth
- earthFiles/css
Lines changed: 36 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
318 | | - | |
| 326 | + | |
319 | 327 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 328 | + | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
326 | 333 | | |
327 | 334 | | |
328 | 335 | | |
329 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
330 | 339 | | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
334 | | - | |
| 343 | + | |
335 | 344 | | |
336 | 345 | | |
337 | 346 | | |
| |||
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
371 | | - | |
| 380 | + | |
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
375 | 384 | | |
376 | | - | |
| 385 | + | |
377 | 386 | | |
378 | 387 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
385 | 397 | | |
386 | 398 | | |
387 | 399 | | |
| |||
439 | 451 | | |
440 | 452 | | |
441 | 453 | | |
442 | | - | |
443 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
444 | 458 | | |
445 | 459 | | |
446 | 460 | | |
| |||
465 | 479 | | |
466 | 480 | | |
467 | 481 | | |
468 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
469 | 486 | | |
470 | 487 | | |
471 | 488 | | |
| |||
492 | 509 | | |
493 | 510 | | |
494 | 511 | | |
495 | | - | |
| 512 | + | |
496 | 513 | | |
497 | 514 | | |
498 | 515 | | |
| |||
Lines changed: 41 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
142 | | - | |
143 | | - | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
150 | | - | |
| 159 | + | |
151 | 160 | | |
152 | 161 | | |
153 | 162 | | |
| |||
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
178 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
179 | 196 | | |
180 | 197 | | |
181 | 198 | | |
182 | 199 | | |
183 | 200 | | |
184 | 201 | | |
185 | 202 | | |
186 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
187 | 206 | | |
188 | 207 | | |
189 | 208 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 19 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 98 | | |
103 | 99 | | |
104 | 100 | | |
| |||
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
142 | 141 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 142 | + | |
| 143 | + | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
| |||
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
188 | 183 | | |
189 | 184 | | |
190 | 185 | | |
| |||
325 | 320 | | |
326 | 321 | | |
327 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
0 commit comments