Commit graph

77 commits

Author SHA1 Message Date
Iris Morelle
4335bedeff wam: Allow using embedded data URIs as add-on icons
[ci skip]
2018-05-08 02:26:34 -03:00
Wedge009
f1bcdc7f1b Update text to match changes in dialogues (fixes #2882).
[ci skip]
2018-05-06 18:40:35 +02:00
Iris Morelle
39b05dd0db wam: Update description and name for Modifications
They are no longer just for multiplayer mode (see issue #1475, commit
a09e2bb858).

[ci skip]
2018-03-21 00:14:41 -03:00
Iris Morelle
8413b1014e wesmere: Copyright/attribution update
[ci skip]
2018-02-16 19:56:31 -03:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Ignacio R. Morelle
cd23596993 wam: Add --datadir option to set the path to the Wesnoth data dir
[ci skip]

This is needed to use the 1.13.x WAM with older versions without messing
up icons due to files that have been moved or deleted over time.
2017-10-10 14:54:08 -03:00
Elvish_Hunter
f6fbd6351a Added missing Python shebangs to several scripts 2017-10-02 21:30:00 +02:00
Ignacio R. Morelle
3b1083f4e7 wesmere: status.w.o supports secure connections
[ci skip]
2017-09-06 13:04:50 -03:00
Ignacio R. Morelle
49bf9debbf wam: Add forum links provided by the add-ons server to the web index
[ci skip]
2017-09-04 16:48:02 -03:00
Ignacio R. Morelle
10b175a73f wam: Percent-encode add-on tarball names
This is *not* really necessary right now because of the limited
character set we allow for add-on names (currently [A-Za-z0-9_-]), but
it doesn't hurt to future-proof this since odds that someone will change
the limitations in the C++ code at some point without remembering to
update this script are staggeringly high these days.

[ci skip]
2017-09-04 16:06:47 -03:00
Ignacio R. Morelle
5124b2b626 wam: Full refactor/reformatting of the HTML writer module
This is primarily a code clean-up and there are no known behavior
changes. Some of the code changes follow:

 * The add-on type labels and explanations are now part of a dictionary
   rather than embedded in the program logic so it's easier to change
   them in the future if more add-on types get added.
 * The full URL to each add-on tarball is HTML-escaped, instead of just
   the add-on id.
 * The list of HTML/CSS resources that need to be copied into the output
   dir is somewhere more visible.
 * Some indentation issues have been fixed.
 * html.escape is used instead of cgi.escaped

[ci skip]
2017-09-04 16:06:47 -03:00
Ignacio R. Morelle
2bb3e791cc wesmere: Don't use explicit tabindex (see wesnoth/wesmere#8)
[ci skip]
2017-08-29 21:55:41 -03:00
Ignacio R. Morelle
0f171cd364 wam: Drop inline image dimensions as they force small images to be scaled up 2017-08-12 20:35:44 -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
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
aquileia
809e61db88 Python scripts: Unify encoding magic comments 2016-05-03 22:12:19 +02:00
Ignacio R. Morelle
9ee11c76cc addons.w.o: New Year copyright update 2016-01-04 00:45:38 -03:00
Elias Pschernig
900c84657b Upgraded wesnoth_addon_manager to Python 3
This includes campaignserver_client.py which is also used by wescamp.py
- however wescamp.py is still Python 2 at this point and will need to be
  upgraded at a later point in time.
2015-09-22 16:33:14 -04:00
Ignacio R. Morelle
c080ed5b21 addons.w.o: New Year copyright update 2015-01-01 19:07:35 -03:00
Ignacio R. Morelle
991b68a128 wam/html: Add add-on type labels for campaign_sp_mp and mod_mp 2014-06-26 19:17:54 -04:00
Groggy Dice
e3adf001a8 html.py: hone regexes for URL linking
First, a couple of extraneous quotes were left in the second regex around
"</a>".

Second, it is possible that a period or question mark could be used to end
a sentence, rather than be part of the URL. So check that these characters
are followed by an alphanumeric character to make them part of the URL.
2014-05-16 01:40:20 -04:00
Groggy Dice
cc059b64f6 style.css: no margin-bottom for <pre> 2014-05-15 03:53:04 -04:00
Groggy Dice
7fb303c57d html.py,style.css: use <pre> with no top-margin on all descriptions
After my last change dealing with this issue, I noticed that descriptions
with <pre> had an extra blank line at the top. Adding top-margin to the
CSS file made this go away, but it also made the <br/> superfluous. Thus,
it is simpler just to have every description use <pre> instead of <br/>.

This should finally resolve everything having to do with the add-on
descriptions.

If I'd noticed that the re module hadn't been imported, I probably wouldn't
have considered URL linking to be important enough to do so. Since I've
already written the code, however, I'll keep it.
2014-05-07 06:09:57 -04:00
Groggy Dice
7ba550a63e html.py: replace Windows backslashes in icon paths
This is one source of missing-image results.

There remain other reasons for missing icons. The script doesn't find images
in add-ons. And when resources are moved or renamed, they are no longer found
by the script, even if they had been found before.

Also, capitalize a sentence.
2014-05-05 04:21:40 -04:00
Groggy Dice
faf82bed92 style.css,html.py: use <pre> instead of <br/>; re.sub instead of re.finditer
After looking into it some more, I think I've figured out how to handle <pre>
in the CSS. So, use that, when description has more than one line.

Also, go to re.sub for turning URLs into links. The version of Python I was
testing my code on wasn't properly handling backreferences in the replacement
string when in the form "\#", causing me to use finditer instead of sub. But
I've discovered that it does handle backreferences in the form "\g<#>". So
switch to much simpler re.sub code.
2014-05-05 04:20:51 -04:00
Groggy Dice
2a8d4e2d28 html.py: import re module
Bugfix for last commit.
2014-04-25 02:45:26 -04:00
Groggy Dice
c85af755ac html.py: format add-on description for HTML
The description text does not get rendered very well on a webpage. One
solution might be to use pre-wrap/word-wrap in the CSS, but due to
differences between browsers, that's a can of worms (at least for me, I'm
not a web pro).

So, the not-so-elegant solution is to add <br/> to every line.

URLs are also not linked in the plain text. Although in modern browsers
you can select the text and right-click, it's still convenient to turn
them into actual links.
2014-04-25 01:26:11 -04:00
Ignacio R. Morelle
1d2a59b0ab addons.w.o: New Year copyright update 2014-01-01 02:18:05 -03:00
Alexander van Gessel
38b224c1ff Revert "Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old""
This reverts commit 23b72d6956.
2013-08-09 00:13:46 +02:00
Thibault Févry
23b72d6956 Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old"
This reverts commit 5fa5c03411, reversing
changes made to 06374c64ba.
2013-08-08 18:50:46 +02:00
Groggy Dice
9903fd227e fix <title> to only display branch directory
OK, so it turns out basename() was required after all!
2013-07-31 05:12:30 -04:00
Groggy Dice
09073d3ff5 add a <title> to UMC listing pages
As I read it, basename() should not be required for path, and I've tested this locally.
2013-07-31 01:32:26 -04:00
Ignacio R. Morelle
30c8f93e6c website: New Year copyright update 2013-01-01 00:47:00 +00:00
Ignacio R. Morelle
334a4c0f28 Update page footers for units.wesnoth.org,
add-ons.wesnoth.org and the macro reference
2011-12-31 23:27:08 +00:00
Thibault Févry
2288ef0939 Removed a lot of trailing whitespaces. Shouldn't be anymore in python scripts. 2011-03-12 02:22:21 +00:00
Ignacio R. Morelle
2966c02ce8 New year copyright notice update 2011-02-13 07:56:23 +00:00