Commit graph

113 commits

Author SHA1 Message Date
Ignacio R. Morelle
400d419b54 wmlunits: New pop-up menu implementation
The new code has a smaller markup fingerprint (no more inline event
Javascript attributes) and it also ports the outer-click-dismiss
functionality over from the wiki. It raises the Javascript engine
requirements to IE 9 and later, though, which is inline with the home
page code.
2017-08-11 00:02:04 -04:00
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
ef27f8454b [units.wesnoth.org] prevent possible infinite loop when analyzing units in a broken addon 2017-05-19 13:26:33 -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
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
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
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
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
Allefant
f4434f2df1 [wmlunits] more debugging 2014-01-29 13:42:40 +01:00
Allefant
c182e93441 [wmlunits] fix debug message
(time to move this to Python3...)
2014-01-28 16:18:48 +01:00
Allefant
62ddbd2f81 [wmlunits] add some debug info 2014-01-27 23:10:34 +01:00
Allefant
db98a2af1c [wmlunits] Don't store translations which are the same. 2014-01-19 21:34:26 +01:00
Ignacio R. Morelle
785d6c8a17 units.w.o: New Year copyright update 2014-01-01 02:16:52 -03:00
Elias Pschernig
12700cd539 [units.wesnoth.org] fix typo 2013-12-07 16:55:01 +01:00
Elias Pschernig
adf7cdf0e9 [units.wesnoth.org] Adjust for new WML terrain_types 2013-12-06 17:58:48 +01:00
Thibault Févry
e825989bbe More range() genocide. 2013-08-09 00:13:03 +02:00
Ignacio R. Morelle
30c8f93e6c website: New Year copyright update 2013-01-01 00:47:00 +00:00
Elias Pschernig
728f4b41cd [units.wesnoth.org] Use full locale names in language selection. 2012-11-03 20:53:06 +00:00
Elias Pschernig
b0e4f12b57 [[wmlunits fix]]
- Fixed a bug in wmlunits where the era tree omitted units whose
  parent units belonged to a different faction.

- Made wmlunits provide feedback about required parameters.
2012-08-23 18:11:50 +00:00
Elias Pschernig
1b4e09bc80 [wmlunits] Ignore hidden units also in the navigation bar. 2012-03-23 20:16:48 +00:00
Elias Pschernig
216443b910 [wmlunits] Treat negative defense values as if they were positive. 2012-03-11 23:24:53 +00:00
Elias Pschernig
b6089cba9f [wmlunits] Fix errors in The_Earths_Gut and Archaic_Era...
...due to mistakenly ignoring hide_help=true units being used in
[base_unit].
2012-03-09 20:22:54 +00:00
Elias Pschernig
1a45e8f61e [wmlunits] Add warnings about missing images to log. 2012-03-08 12:51:51 +00:00
Elias Pschernig
d815cabe7b [wmlunits] For units without a portrait use a scaled base image. 2012-03-07 17:46:23 +00:00
Elias Pschernig
80b2ae2cf2 [wmlunits] Added per-addon log pages. 2012-03-04 23:11:15 +00:00
Elias Pschernig
182dc77281 [wmlunits] Handle [advancefrom] WML tags for units. 2012-03-04 14:20:20 +00:00