Commit graph

8 commits

Author SHA1 Message Date
Gergő Tisza 05d803e17a Text changes for better handling of PD and nonfree licenses
Bug: T70687
Change-Id: I84e0094559e5b438fcb33b8511dc0184435c1a37
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1004
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/631
2014-11-26 02:21:50 +00:00
Gergő Tisza 392e714cc6 Add icon for PD licenses
Change-Id: I82c56a420d8d529a4a50cb66e64b191bbb36997f
2014-10-29 14:03:36 +01:00
Mark Holmquist d137689b34 Fix for jsduck 5.x, rearrange categories
Should make for a nicer documentation experience.

Change-Id: I935cbab2b06c8cf482d3987905d2257d09bea3a3
2014-04-29 11:32:12 -07:00
Gergő Tisza 846019a08a Make License.isCc() really return booleans
Before it returned undefined if the license had no internal name,
which caused unexpected behavior when used with $.toggle().

Change-Id: I1dcee6c999982fde47f9d388381fc670d81a6c5d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/494
2014-04-23 20:30:03 +00:00
Gergő Tisza b00eca6ade Collect license handling code, remove unused data attribute
This just shuffles code around, should not change behavior.

Change-Id: Ieb0102300c8444f18444fae38e5ea813d8f682e5
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/472
2014-04-19 00:39:21 +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 d85e7bf32e Utilities to transform HTML to plain or filtered text
This takes care of several minor annoyances:
* centralizes all the text processing functions which have been
  floating all around the code, and adds proper tests
* filters out invisible elements (sometimes used for metadata)
* avoids merging separate words on HTML->text transformation
* adds caching since doing all this transformations could be
  processing-intensive for big chunks of HTML. (This might or
  might not be a good idea. I haven't done performance tests, so
  this might be premature optimization, and increases memory use.
  OTOH these functions are often called in situations where an
  immediate UI response is expected (such as selecting a size
  from the list) so even small delays would be perceivable.

Bug: 63126
Change-Id: I1ef1e3a33efdfea17612df00da6b629bf39e07aa
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/388
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-27 19:11:09 +00:00
Gergő Tisza c1ff536c3c Get more license info
Fetch more license information from the imageinfo API
(as needed by the reuse panel), store it in a new model

Change-Id: I331598b55b86d13e23a8bcd58c3ad8fcab749e6f
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-20 23:07:02 +00:00