Commit graph

7 commits

Author SHA1 Message Date
Gergő Tisza 59b8e5c82a Use localized namespace name in embed wikitext
Bug: 64710
Change-Id: I2164e3dfafe8ddf4b88ae0d2f23e8573cf162b89
2014-05-04 05:01:48 +00:00
Gergő Tisza 9b1e756c3b Replace current URL generation logic with routing classes
* deduplicates URL generating/parsing code
* gets rid of spaces in URLs
* fixes error for file names with / in them (in case they exist;
  current MediaWiki seems to disallow such names anyway)

Change-Id: I5aad43f6af1b99523c597c39befcc9db1ecab83a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/371
2014-04-16 12:51:38 +02:00
Gergő Tisza fff25694bb Sanitize embed HTML
Make sure tables, lists and other complex stuff do not get into the
embed HTML code.

Change-Id: I559dc7892e058e403ddde6994a7e1ac0c9585325
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-27 19:14:06 +00:00
Gergő Tisza b9b1529e9b Add more information to embed HTML
Adds site link, license link and long name, replaces internal license name
(we don't have it for most licenses) with short name.

Also fixes some problems in previous changesets that I stumbled on,
renames things to be more consistent/less misleading, and makes
EmbedFileInfo a thin container for existing classes. (That results
in a lot of Demeter's law violations, but it means one less model
to remember, which is a good thing since our property names are
often not very informative (e.g. EmbedFileInfo.url and
Image.url which had completely different meanings))

We always have the site information for embed texts (comes from the repo
API); that part of the tests was pointless, but now that EmbedFileInfo
depends on Repo they became impossible to maintain, hence the
deletion of half the test cases in getThumbnailHtml().

Change-Id: I94e1d0aca14e2a7d5fad983412090add8ad6bfa3
Mingle:  https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-27 19:14:06 +00:00
Gergő Tisza 341d0199f1 Improve embed credit line
Gets the text closer to the spec:
* links have #mediaviewer (lots of code duplication, see #373)
* image has alt text (was title in the spec but that made less sense)
* less convoluted logic in getCreditHtml()

Change-Id: I43db84adb7fe29850706f92ee978016939b59aaa
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-20 22:08:28 +00:00
Gergő Tisza 466735fc10 Add HTML text to embed tab
Change-Id: Idcafe6dad9ffb17ffac365a350feff3903b37ff3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/148
2014-03-19 05:47:47 +00:00
Gergő Tisza f650813eb5 Add embed tab to reuse dialog
Implements the wikitext part of the mingle card

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/148
Change-Id: I5bcd8e2171f45c70736b7a7cfc695134269ed12d
2014-03-19 05:46:55 +00:00