248 Commits

Author SHA1 Message Date
Ignacio R. Morelle
a0029c06d1 wmlunits: Couple of cosmetic fixes 2017-08-09 03:10:07 -04:00
Ignacio R. Morelle
4d5a4fc4c6 wmlunits: Escape generated URLs and WML-defined output
Some refactoring and a lot of code changes are involved in this.
Basically, wmlunits has always fully trusted its WML input. This has
several implications:

 * URLs such as the ones for unit detail views tend to contain
   unescaped characters which are forbidden in URLs, such as spaces.
   While browsers generally tolerate this well, the result is still
   invalid HTML. The same applies to URLs used for inline CSS (e.g.
   background-image).

 * Most information read from WML such as unit names, descriptions,
   campaign names, era names, and so on, was blindly trusted and could
   allow an attacker to inject malicious HTML into units.wesnoth.org by
   uploading an add-on that would pass the units.wesnoth.org build
   process.

The resulting code might not be extent of regressions, but hopefully
we'll identify them quickly. This commit contains some additional noise
in the form of style fixes around offending lines as well. Backporting
to 1.12 is, as far as I understand, unnecessary since units.wesnoth.org
uses the master branch version of wmlunits, but it might be worth
evaluating whether to issue a warning for the 1 person in the world who
might be running the 1.12 version of the units.wesnoth.org toolchain on
their own facilities (okay, let's face it, nobody would ever do that).
2017-08-09 02:51:57 -04:00
Ignacio R. Morelle
7625b5c5b2 wmlunits: Use www.wesnoth.org URLs for resources 2017-08-08 20:50:54 -04:00
Ignacio R. Morelle
edf270abef wmlunits: Tidy up unit tree attributes a bit using mini tables 2017-08-08 20:25:17 -04:00
Ignacio R. Morelle
2134d048a7 wmlunits: Use figure dashes instead of hyphens for empty placeholders 2017-08-08 05:24:01 -04:00
Ignacio R. Morelle
78e44d7270 wmlunits: Revised color scales per vultraz's feedback 2017-08-08 05:23:44 -04:00
Ignacio R. Morelle
692a59f297 wmlunits: Add coloring classes to unit attributes in the unit details view
This applies to resistances, movement costs, and defense.
2017-08-08 04:54:00 -04:00
Ignacio R. Morelle
c63102c4a9 wmlunits: Make sure all language menu table rows are equal in length 2017-08-08 04:53:36 -04:00
Ignacio R. Morelle
d14c0dccd4 wmlunits: Hide Terrain column label from the unit view page 2017-08-08 02:17:19 -04:00
Ignacio R. Morelle
75a5af127a wmlunits: Fix issues with off-by-one column counts in unit view tables 2017-08-08 02:15:45 -04:00
Ignacio R. Morelle
53bc16b91f wmlunits: Various formatting/structure improvements
* There is now a link back to units.wesnoth.org on the navbar preceding
  Home.
* The mulitplication sign is used for attack stats to match 1.13.x.
* Made the Terrain table in the unit detail pages a bit more proper
  markup-wise.
* Advances from/to on the unit detail page displays a dash when empty
  and also has a comma-separated list of unit links in it. The same goes
  for the abilities list.
2017-08-07 04:05:29 -04:00
Ignacio R. Morelle
7e2538a828 wmlunits: Allow styling unit attributes in the unit tree view 2017-08-07 02:36:54 -04:00
Ignacio R. Morelle
ee66b96025 wmlunits: Use CSS to ensure sprites still fit in the tree when overlaid 2017-08-07 02:35:56 -04:00
Ignacio R. Morelle
6b5ba55fbc wmlunits: Restore build timestamp at the end 2017-08-07 01:27:13 -04:00
Ignacio R. Morelle
d4fb543451 wmlunits: Make the sidebar and popup menus markup more proper (<ul>/<li>)
The language menu gets to stay as a <div> containing a table for now
since doing columns with lists is still not that well supported across
browsers (as well as the CSS columns spec as a whole -- too many legacy
browsers floating around).
2017-08-06 23:57:36 -04:00
Ignacio R. Morelle
e9287e5b6b wmlunits: Rechristening Overview as the Build Report, table structure cleanup 2017-08-06 16:36:14 -04:00
Ignacio R. Morelle
d0c43b89c4 wmlunits: SEO-friendly page titles, and extra root element classes 2017-08-06 16:35:00 -04:00
Ignacio R. Morelle
416e3b5479 wmlunits: First markup clean-up pass 2017-08-06 15:52:05 -04:00
Ignacio R. Morelle
8bf57d6fe0 wmlunits: Wire in Wesmere header and trailer 2017-08-06 14:10:48 -04:00
Allefant
c17d556016 [units.wesnoth.org] fix eras with all eras in an addon 2017-06-25 21:38:20 -04:00
Elias Pschernig
a843c7e187 small units.wesnoth.org fix 2017-06-04 15:46:40 -04:00
Allefant
ef27f8454b [units.wesnoth.org] prevent possible infinite loop when analyzing units in a broken addon 2017-05-19 13:26:33 -04:00
Elias Pschernig
6a287f22c5 [units.wesnoth.org] catch empty picture names in add-ons 2017-05-06 15:19:43 -04:00
Allefant
efb560a23a fix typo 2017-01-23 20:09:32 -05:00
Allefant
88a9929717 [wmlunits] ignore translation errors from gettext 2017-01-23 19:48:01 -05:00
Allefant
f904306b58 [wmlunits] use scons as cmake seems broken right now 2017-01-20 14:09:04 -05:00
Severin Glöckner
06d9909c86 Changed Shebang line of python scripts.
It's mostly about making the scripts run if python defaults to python3.
Has been tested for each script.
2016-11-25 09:57:25 +01:00
Elvish_Hunter
f07f893d34 Used argparse instead of optparse in TeamColorizer 2016-06-22 17:15:18 +02:00
Elvish_Hunter
1f3674dcf6 TeamColorizer: fix team_colors dict alignment 2016-06-22 17:15:18 +02:00
Elvish_Hunter
a53b6538ba Added more color ranges to TeamColorizer
The new ranges coming from core are lightblue, brightgreen, brightorange and gold. Ranges coming from IftU and used in other UMCs as well are cyan, yellow and pink (which was already present, but with the wrong values).
2016-06-22 17:15:18 +02:00
Elvish_Hunter
e4a0eaf52e TeamColorizer: replaced sys.stderr.write() with print(file=sys.stderr) 2016-06-22 17:15:18 +02:00
Elvish_Hunter
3607f8c004 Make TeamColorizer script run on Python 3 2016-06-22 17:15:18 +02:00
Ignacio R. Morelle
e86fea358a units.w.o: Use https where applicable 2016-06-12 00:20:54 -04:00
aquileia
809e61db88 Python scripts: Unify encoding magic comments 2016-05-03 22:12:19 +02:00
Ignacio R. Morelle
a5ba3273aa units.w.o: New Year copyright update 2016-01-04 00:45:38 -03:00
Elias Pschernig
4c034d7705 Clean up wmlparser3.py a bit, fix json and xml output. 2015-09-20 14:53:49 -04:00
Elias Pschernig
f8fb04093a [units.wesnoth.org] fix some small issues 2015-09-10 18:10:16 -04:00
Elias Pschernig
3ab3db3166 [units.wesnoth.org] Converted the script to Python 3.
Basically ran all .py files through 2to3. I made a copy of wmlparser2.py
called wmlparser3.py for the Python3 version, so as to not inconvenience anyone
who may be using it in their old Python2 scripts.
2015-09-09 22:52:23 -04:00
Elias Pschernig
00516dddbe [units.wesnoth.org] always clean up error log 2015-09-09 10:30:35 -04:00
Elias Pschernig
1961c43f16 [wmlunits] clear <config>/data/add-ons
Sometimes if the last run aborted in the wrong moment, add-ons may keep
left overs in there.
2015-09-08 20:15:37 -04:00
Allefant
c7eb80ed09 [units.wesnoth.org] fix bash script 2015-04-19 10:54:48 +02:00
Elias Pschernig
16778d6e92 [units.wesnoth.org] improve safeguard
...against overwriting the last successful version
2015-04-18 23:03:48 +02:00
Elias Pschernig
310f8092ad [units.wesnoth.org] update bash script 2015-03-28 16:09:01 +01:00
Elias Pschernig
0e9b76f03c [units.wesnoth.org] Add safeguard for mainline.
If parsing mainline WML failed for whatever reason, there's no point updating the live website copy.
2015-03-22 21:46:22 +01:00
Elias Pschernig
ee047e7ce9 [units.wesnoth.org] Make WML parsing timeout a commandline argument. 2015-03-22 21:38:39 +01:00
Elias Pschernig
5a599b935b [units.wesnoth.org] fix race links
Links to a race on unit description pages did not work, only links to the units themselves.
2015-01-10 21:55:49 +01:00
Ignacio R. Morelle
5d82848668 units.w.o: New Year copyright update 2015-01-01 19:07:35 -03:00
aquileia
c19e729c6b gitignore: Merge rules from doc/ and data/tools 2014-06-09 01:00:50 +02:00
Allefant
a425c951c2 [wmlunits] show vision and jamming for a unit
(if available)
2014-02-02 13:35:56 +01:00
Allefant
167a370787 [wmlunits] Fixed addon units with non-ascii UIDs 2014-01-29 14:56:11 +01:00