Commit graph

61 commits

Author SHA1 Message Date
jenkins-bot a9ce868498 Merge "Utilities to transform HTML to plain or filtered text" 2014-03-28 13:43:16 +00:00
Gergő Tisza 23dc942334 Use MakeGlobalVariablesScript to set wgMediaViewerOnClick
Use MakeGlobalVariablesScript instead of ResourceLoaderGetConfigVars
to set wgMediaViewerOnClick because the first is cached per-site
and we need per-user caching.

Change-Id: Ib4d99698030b69532b5996fa6b981f2b5c556a23
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/263
2014-03-27 22:46:51 +00:00
jenkins-bot 2c4fb103a3 Merge "More preference and config fixes" 2014-03-27 21:55:15 +00:00
Mark Holmquist 85e52088e8 More preference and config fixes
Change-Id: If19531c3c0f58a271bbaab11e10a987d2fa0224f
2014-03-27 14:42:22 -07:00
Mark Holmquist afb1310c65 Fix failed attempt at configuration defaults
The default needs to be changed later. Oops.

Change-Id: Ibcdc646a1e961a428f500d3d57b39c0a905880d2
2014-03-27 14:01:56 -07: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
Gilles Dubuc 3733a4ac32 Use the new way of specifying beta screenshots
Change-Id: I9489895cdc098cc33e7c2f5b4b417d6f5ab97b59
2014-03-27 10:48:59 +01:00
jenkins-bot a1b7c285c3 Merge "Adds help link" 2014-03-27 04:23:41 +00:00
Gilles Dubuc 57852962ef Adds help link
Pointing to //mediawiki.org/wiki/Special:MyLanguage/Multimedia/About_Media_Viewer/Help

Change-Id: I90747e269e07dd27a4fa21470ec1563518177bb2
2014-03-27 05:22:07 +01:00
jenkins-bot 9e2d1bd121 Merge "Add user preference for non-beta disabling" 2014-03-26 18:27:26 +00:00
Mark Holmquist 3a87587fe3 Load MMV scripts for everyone; handle hashes
The latter was already built in but impossible with how our config was
set up until now.

Change-Id: Ic1718968790e2247cba509635a4e9b1eab5fd948
2014-03-24 17:09:07 -07:00
Mark Holmquist 59c1f3f6bd Add user preference for non-beta disabling
Change-Id: I3f581975cfdf33bc15b8a4b23549c6401b4bfb87
(cherry picked from commit b0b1446f5b)
2014-03-24 20:49:16 +00:00
jenkins-bot 6d11e15cd5 Merge "Add getSiteLink() to Repo model" 2014-03-24 12:27:29 +00:00
jenkins-bot cf2450ccd1 Merge "Get more license info" 2014-03-24 12:18:18 +00:00
Gergő Tisza 27bde3effe Add getSiteLink() to Repo model
This is needed for the HTML embed text.

Change-Id: I286a0dde81675370fe9381651bd10437617426d0
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-21 01:19:33 +00:00
jenkins-bot 24ba37d57b Merge "Add client-side flag for disabling the viewer" 2014-03-20 23:51:00 +00:00
jenkins-bot e127b3a13d Merge "Add feature flags for Media Viewer" 2014-03-20 23:50:22 +00:00
Mark Holmquist 547ddc97b1 Add client-side flag for disabling the viewer
Also set it on server-side. Use mw.config to override.

Change-Id: I00ea1ee8544d2c802f09fd25f7abaf29752f3641
2014-03-20 23:43:27 +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
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
Gilles Dubuc 56f923ae21 Add share panel, replace reuse
Mingle: 147

Change-Id: I5678002ac84965a80f5e63635151032e6c293194
2014-03-19 02:06:21 +00:00
Mark Holmquist 4b3c7867e7 Add feature flags for Media Viewer
$wgMediaViewerIsInBeta is one, $wgEnableMediaViewerForLoggedInUsers is
the other - use the former on all sites, the latter on pilot sites in
April.

Before merging, MERGE https://gerrit.wikimedia.org/r/117376

Change-Id: I232997918dee4a00be18c021eb351d81609df2b0
2014-03-18 21:17:58 +00:00
Gergő Tisza 5a3d56f81b Merge MultiLightbox into LightboxInterface
Change-Id: I4363095e0504dd941793ba3addc7ee3cbe835536
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/178
2014-03-08 01:14:07 +00:00
Gilles Dubuc 8beca0b106 Get rid of global viewer instance
- split event handler setup out of bootstrap and viewer creation
- simplify the tests setup/teardown

Change-Id: Icde1db81efd6191207ba35757192c800ea2d2e91
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/278
2014-03-05 02:33:06 +00:00
Gilles Dubuc a82728ccdb Add test for clicking prev/next
Change-Id: I02653d97500d5a876f142a518d9b53b0d4746aef
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/145
2014-03-03 09:27:23 +01:00
Aaron Arcos fedaa553b4 Fix resize issues (Part II)
I was going to stage this but better give you the whole enchilada,
it is not that bad, ;-). This is what I am doing:

- Delete  things that are not used anymore.
- Componentize image ui element (Canvas).

Bug: 56454
Change-Id: Ib5461639a86d9f8e0a150f6d9543a20058d31e00
Mingle: 239
2014-02-28 10:22:21 +01:00
Gergő Tisza 53da285b07 Merge MultiLightbox into MultimediaViewer
* merges parent classes into child classes
* moves some files and tests to have a consistent directory structure

Change-Id: I360cc0805d8a561f5105fb063747457f67e1fccd
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/177
2014-02-25 02:00:13 +00:00
Gergő Tisza a04631c405 Show permission
Change-Id: I0b8b0626b36baba9732f7350213d8b53ec2cca95
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/118
2014-02-24 21:41:25 +00:00
Gilles Dubuc a5cddef17a Lazy-load mmv
Also removes the index inside the location hash

Change-Id: I9429ff0101ab891f2c4c6aa2d989fbef0813252d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/136
2014-02-18 15:55:15 -08:00
Gergő Tisza 9881f9e7ae Add TaskQueue class
A simple task queue which can be processed or cancelled.
Will be used to handle preloading in a more robust way.

Change-Id: Ib33f9b2d814a35538f9d4f3691fce5ba5cdc82c1
2014-02-12 01:55:39 +00:00
Gergő Tisza 06cc6cca1a Refactor thumbnail size calculation
* moves generic logic into ThumbnailSizeCalculator class
* moves UI-specific logic into interface class
* fixes bug where non-bucketed sizes were served on devices with
  non-standard pixel density
* fixes bug where bucketed size was compared to css size instead of screen size
  for resizing

Change-Id: I8ba3380b74fcc8fb0a6ecc3f3140627411851ad0
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/196
2014-02-08 01:27:27 +00:00
Gilles Dubuc e74fc33e89 Track detailed content loading network performance
Leverages the W3C Navigation Timing API when available

Change-Id: Ief1d327d1bd8928bf5f2bf0bd4c7141a0a608a53
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/126
2014-02-07 19:37:22 +00:00
Gilles Dubuc 57434b5812 Refactor panel-related things into another class
mmv.lightboxinterface was getting way too clunky.

https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/124

Change-Id: Ie3a604b532ee853f9df673cc4d38c2c7594bdefa
2014-02-07 10:09:08 -08:00
Gergő Tisza b013ddbefe Userinfo provider
* userinfo api requests are cached now
* we use jsonp only if we have to (makes gender api calls measurable on WMF wikis)
* all API calls use providers now, provider.Api constructor can be used to
  wrap mw.Api with metrics

Does not return a proper model, and gender API calls are not preloaded together
with the rest of the calls. Maybe next time.

Change-Id: I9b3ea73c65eef57e160ac8636d9e45d349150884
2014-02-06 00:37:39 +00:00
jenkins-bot af1c2cbeee Merge "Add provider to for actual image loading" 2014-02-05 00:15:56 +00:00
jenkins-bot 97e29b9e00 Merge "Add imageinfo, thumbnail info, repoinfo provider" 2014-02-05 00:14:22 +00:00
Gergő Tisza 6068ffd58d Add provider to for actual image loading
Change-Id: I9ca9bce37c97648afa07db9f004138a791c74e65
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
2014-02-05 00:02:28 +00:00
Gergő Tisza 85a37d0e14 Add imageinfo, thumbnail info, repoinfo provider
Change-Id: I80ffec39ee6c9e0ea0b37be2fc48315063b5ff8a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
2014-02-04 23:46:02 +00:00
Gilles Dubuc d34fec4ff2 Add categories to the interface
Also move some things around a liiiittle bit. Not too much.

Change-Id: I7a5b8d900f5173fa20142d205e4992361b9e81a3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/41
2014-02-03 15:09:42 +01:00
Gergő Tisza e0edec21b2 Move providers into their own subdirectory
Also refactor MultimediaViewer.php a bit to get rid of all the globals.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
Change-Id: Ieca4263ecc7652dc6bc36db63b99d3813c4653e4
2014-02-01 03:49:30 +00:00
Gilles Dubuc 30563de71d Add file usage data to MMV metadata panel
Interface code is its own class which does not depend on the main
interface class it can be unit tested (and eventually moved into its
own file to make browsing the code easier). IMO we should aim to
eventually break up the interface into similar classes (with a simple
init/empty/set interface + custom events where it makes sense).

Also, sneak-introducing LESS!

API usage could be more effective (globalusage is a separate API call;
it needn't be), but we will have to rewrite that part soon anyway, so
it should pass for now.

Bug: 60087
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/44
Change-Id: Ibe5c323cdeab4a378316925f0c3efb3dc7ef5997
2014-01-30 13:03:28 +01:00
Gilles Dubuc 98e03d31c8 Test metadata visibility in fullscreen mode
Add metadata visibility logic to the test
Convert the code to CSS since writing the test made me
realise that the current JS was superfluous

Change-Id: I80c2f1860cc021e9bdf09345647b288de746f1e3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/140
2014-01-30 08:39:55 +01:00
Mark Holmquist 5e4a544133 Moving things around for module renames
This is a big change, but should change nothing except the sizes of some
files and where they all are.

There are no more ext.multimediaViewer strings ANYWHERE, so let's keep
it that way. :)

Change-Id: Ic0892f5894700938bfa01f3f9bc8e5ab8276eb72
2014-01-24 09:21:16 -08:00
jenkins-bot d245703241 Merge "A bunch of description fixes" 2014-01-22 23:51:50 +00:00
Mark Holmquist 22d2a69979 A bunch of description fixes
* Move description and caption to both be in the bottom left
* Make empty description grey and italic
* Fix problem where description was sometimes appended twice
* Move description UI stuff into a separate file, and make it more MVCy
* Tests for description UI stuff
* General framework, to an extent, for UI classes

Change-Id: Ibc8c576cd8a41c2e3cf7e13f1b9e093384fb4655
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/120
2014-01-22 14:46:39 -08:00
Gergő Tisza fed238fcd6 Create model & providers for file usage information
Bug: 60087
Change-Id: I0e72c1e4590714e92a365f9741633221af5b0553
2014-01-21 18:04:51 -08:00
Mark Holmquist 89417163a9 Refactor to a data model
Image information and repo information are now both stored somewhere
else entirely, so we don't need to keep accessing weird API return
values to sort things out. fetchImageInfo now uses those classes to
an extent, and we now cache thumbnail URLs for different sizes.

Change-Id: Ife8293c86683ea914b1a5a60000584b501d92e55
2014-01-12 12:50:34 -08:00
Aaron Arcos ffc8f4948d Add smoke test to class mw.LightboxInterface.
- Moved tests that were meant for LightboxInterface objects.
  - Fixed space naming issues.

Change-Id: Ib83904eab5fa542330ea559d420efa5f1de8c3eb
2013-12-13 10:39:13 -08:00
Aaron Arcos 83aa9c6a6b Smoke test for MultiLightbox class.
Change-Id: Iab8a80d842d4252a68bca2a4de92acccd835c978
2013-12-09 18:18:42 -08:00
Aaron Arcos 5fd02ad8f2 Create smoke tests for the LightboxImage class.
Change-Id: I0e5cec7bbcc4140fc6b74e3cf39c0a7b08891194
2013-12-10 00:59:37 +00:00