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.
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).
* 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.
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).
it is now in a [side_drop] tag instead of on toplevel. this make it
easier process. In paarticular a workaround in playturn_network_adapter
is no longer needed and should be removed after 1.13.9
Fixes#1565
Previosuly the anitmators fake unit was reset whenever any wml/lua was executed
causing animations issues ( #1565 ). Now we only reset it when the unit
appearance was actually changed by wml.
appearance_changed_ is mutable because set_hidden() is const.
appearance_changed_ is initially true so that the code updates the unit in
case that the unit was completeley reset ( [unstore_unit] etc.)
EDIT: set_hidden() doesn't set appearance_changed_ anymore becasue it's also
called by the movement animation code which made appearance_changed_ always
true when we checked it at move.cpp
Basically switched this dialog to take userlist data from the server instead of the scenario config,
since the former caused various issues as listed in #1867.
I've also removed the manual call to update_player_list in pre_show since it's not really necessary
(and I don't have any list data to pass there anyway) since the network handler will call it once it
receives data.
A similar change isn't needed in MP Staging since the connect engine handles all the user list stuff.
For some reason, when I first implemented this dialog, I had it manage it own window pointer like modal_dialog
or modeless_dialog and display itself non-modal-y, despite being a modal dialog... IIRC it was probably some
ill-conceived attempt at "threading" so the game could load the config while it displayed. That's a moot point
now since the dialog was soon after refactored to use actual threading, rendering these bits useless.
# Conflicts:
# src/gui/dialogs/loading_screen.cpp
* Use a unique_ptr for the window member.
* Made use of the new remove_from_window_stack function (its impl was copied from this code)
* Only attempt ows removal if window display mode is modeless (since if mode is tooltip, no
ptr was added to the list anyway.
# Conflicts:
# src/gui/dialogs/modeless_dialog.cpp
This seems to have been the cause of some crashes and weird behavior with the new command console.
Likely the problem came from the wrong pointer being removed from the ows, but exactly why a modal
dialog was even being opened I don't know.
Still, this is a safer method overall and it guarantees the correct pointer is always removed.
Not sure why, but in some cases the overlay calculations were getting screwed up. This makes them use
the general centered image macro, with accompanying fallback safety checks.