Commit graph

2674 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
98c83915ef wmlscope: Update macro reference bits to Wesmere 1.1.0 2017-08-08 21:18:24 -04:00
Ignacio R. Morelle
cd6f56e30b wam: Forgot to add the planned link back to addons.w.o 2017-08-08 21:16:59 -04:00
Ignacio R. Morelle
472983fa0e wam: Update to Wesmere 1.1.0 2017-08-08 21:16:16 -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
Ignacio R. Morelle
23df35f471 wam: Not the right time of day to write Python 2017-07-25 03:02:02 -04:00
Ignacio R. Morelle
9cb25b7b0d wam: Hardcode special cases for the 1.9 and trunk add-ons server names 2017-07-25 02:59:28 -04:00
Ignacio R. Morelle
ad2de1b918 wam: Remove icons' alt-text
Using the original paths given in WML as alt-text does not serve any
purpose other than breaking the layout when the page hasn't finished
loading and half the icons are overlong text. If anyone really needs
those they should use a data attribute instead. The alt attribute is for
accessibility, not for making programmers happy with themselves.
2017-07-24 22:45:51 -04:00
Ignacio R. Morelle
4ec6ef1734 wam: Left-align the whole tooltip, not just the contents 2017-07-24 22:34:04 -04:00
Ignacio R. Morelle
cf0a389e6f wam: Fix indentation 2017-07-24 21:53:35 -04:00
Ignacio R. Morelle
a642233513 wam: Fix add-on description tooltip's text alignment 2017-07-24 21:52:43 -04:00
Ignacio R. Morelle
79a294471f wam: Add a hidden copy of the add-on name for sorting purposes 2017-07-24 21:35:04 -04:00
Ignacio R. Morelle
9a7ef678ff wam: More styling work 2017-07-24 21:30:26 -04:00
Ignacio R. Morelle
8f60f69eb4 wam: Move add-ons web tip below the downloads explanation text 2017-07-24 20:26:39 -04:00
Ignacio R. Morelle
f7b34ce1e8 wam: Minor moving things around for float layout coherency, also tooltip 2017-07-24 15:47:13 -04:00
Ignacio R. Morelle
acf5e3ec64 wam: Some additional content and styling tweaks
* Relabeled the "Notes" column to "Translations" since that's what it
   really is.
 * Replaced the Download label with an icon and moved it to the add-on
   names column.
 * Restyled add-on version/author a bit.
 * Add-on type is now more or less aligned to the middle of the icon
   (regardless of what the cell height actually is -- there can be extra
   empty space below the type line if the add-on title is too long, for
   instance).
2017-07-24 15:36:30 -04:00
Ignacio R. Morelle
73a2e653b7 wam: Fix invalid HTML emitted for add-on icon <img> elements
The width/height attributes are always in pixel units. This is not CSS.
2017-07-24 14:54:52 -04:00
Ignacio R. Morelle
86984f0040 wam: Update styles and markup for Wesmere
This also adds SVG icons to be used in table headers instead of GIF
images for browsers that support SVG in background-image. It makes
things scale better for high DPI screens.
2017-07-24 14:49:08 -04:00
Ignacio R. Morelle
56990b17d9 wam: Fix HTML injection attack on the add-ons.wesnoth.org web interface
This escapes all strings provided by add-ons server data to guarantee
they can't be used to get extraneous and potentially harmful HTML into
the generated web index.

However, and because I don't have time to look into the dense regex
contained in the relevant code right now, it also removes the hidden
feature of linkifying any URLs found in add-on descriptions. It's a
small price to pay for our safety, really.
2017-07-24 03:05:12 -04:00
Ignacio R. Morelle
57f9c3eccd wmlscope: Fix file list column layout glitches on Edge and Chrome 2017-07-23 20:21:27 -04:00
Ignacio R. Morelle
1a03a5af57 wmlscope: Update macro reference templates and emitted markup for Wesmere 2017-07-23 19:59:19 -04:00
Ignacio R. Morelle
09d5f799ac wmlscope: Make this and the template prerequisites for macro-reference.html
This makes it so changes in these three actually cause make to
regenerate the file if they are newer than it.
2017-07-23 19:59:19 -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
b0f15a08c4 units.wesnoth.org update to understand new [difficulty] tag 2017-06-09 19:25:30 -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
Severin Glöckner
ccb2a5bf8d ported wescamp and libgithub to python3 2017-05-14 06:36:19 +11:00
Elias Pschernig
6a287f22c5 [units.wesnoth.org] catch empty picture names in add-ons 2017-05-06 15:19:43 -04:00
Charles Dang
bba5454443 Made README files Markdown
[ci skip]
2017-04-28 15:07:06 +11:00
Celtic Minstrel
5397c1eabc fix wmlparser2 and wmlparser2
fixup for 3d63f66dbb

After this commit, all the wmlparser tests pass (including the new one) and the issue stated in #907 has also been verified to be fixed.
2017-03-24 13:58:20 -04:00
Allefant
9f3ed8df4c [wmlunits] apply zookeeper's suggested eras.cfg fix 2017-03-24 13:13:59 -04:00
Celtic Minstrel
3d63f66dbb wmlparser.py: stricter determination of whether strings are translatable (fixes #907) 2017-03-18 14:31:36 -04:00