Commit graph

159 commits

Author SHA1 Message Date
Ed Sanders 9ad112910c Avoid jQuery event aliases
Use #on for event binding and #trigger for event firing.

Change-Id: I75ca1cfac8419204399e27941c9f424664b56113
2018-05-11 18:46:50 +00:00
Kunal Mehta fc165aa5a0 Use explicit HTTPS in help URLs
Change-Id: I2c387f6d10e31607b6c864cf39dfaa6503181a30
2018-04-14 01:05:07 -07:00
Prateek Saxena b6136712a4 Use findSelectedItem instead of getSelectedItem
Bug: T76630
Depends-on: I0f1d9c1f31efcc10d3647103548770d2101050d9
Change-Id: Id81bbe7b0daf104484272e05730e16f495cfd0e1
2018-02-27 15:34:10 +00:00
Ed Sanders 42b577bae9 build: Update linters
Change-Id: I7262fb369df0428c39adaf55128b83f019afb4c0
2017-10-31 18:42:04 +00:00
Gergő Tisza bbe174bca8 Display warning for licence/attribution problems
Bug: T76030
Bug: T71389
Bug: T71557
Change-Id: I38c1548a0de6cfd3a48db7efd7502a99f168d4a5
2017-09-28 15:34:30 +02:00
Ed Sanders 2156f3f485 Remove jquery.scrollTo library
This is an old library that is broken in Chrome 61.
Rather than updating it we can just use $(window).scrollTop/Left
which works in all the browsers we currently support.

Fix MPSP.toggle to return a promise, instead of a deferred
(although this return value is not used yet).

Bug: T173618
Change-Id: Iaec56debbb808bd95cf65c1ebfe22bdf0116da68
2017-09-14 12:45:46 +01:00
Timo Tijhof 7ae8401c22 Avoid use of deprecated QUnit.asyncTest and QUnit.start/stop
Change-Id: I9cc132f71df072c724b6cff6f1d935abbe092596
2017-07-25 17:59:27 -07:00
Timo Tijhof 5bf1466e7f Remove use of QUnit.test(, testCount, )
* Removed deprecated testCount, which is no longer supported in this way.
  It's only useful when wanting to explicitly expect 0 assertions (normally
  considered an error).
* Replaced use of testCount = 0, with assert.expect( 0 ).

Change-Id: I8fe82032d3af2a1ad2ed7febdb90a95d56dd3fc4
2017-07-26 00:12:06 +00:00
Matthias Mullie 3e5ad4c83a Replace all direct localStorage interaction by mw.storage
Meanwhile I also updated a few places where a non-string was
passed to/expected from localStorage - this could’ve led to
inconsistencies because localStorage stringifies everything.

And I also removed CP.canSetMediaViewerEnabledOnClick, which
was no longer used anywhere except for a test case.

Bug: T137777
Change-Id: I21ad4ba15ca751bb03e5e2c523d09a45c0444ccf
2017-06-02 11:52:34 +02:00
Matthias Mullie d96a587a38 Fix mmw.ui.metadataPanel qunit tests
Bug: T164473
Change-Id: Iefad324be86c59ac9bf44363bcbbb98a70769499
2017-05-16 14:52:25 +00:00
Ed Sanders d7ea64137c build: Replace jshint/jscs with eslint
Change-Id: I423add157245353031e36b7e44fee7ace7c753c7
2017-01-10 10:24:39 -08:00
Ed Sanders b46529d1b2 build: Introduce jshint & jscs and make a pass
These replace the hard-coded jshint task in CI.

Change-Id: Id14eec1ecba4ceae735ffd10f9114233a580302f
2016-07-19 13:48:06 -07:00
Julius Alphonso a9758d21e0 Remove uploader's name from MediaViewer
Only last uploader's name is shows, this turns out to be
more confusing than useful.

Bug: T59308
Change-Id: I7d06b72c581fe8738bffc64b5e36be9983b01ccf
2015-12-29 10:56:08 +05:30
Gilles Dubuc be1ba4622f Turn mmv-next/mmv-prev into OO events
More of those events sent to the document can be converted, but it's a start...

Bug: T77253
Change-Id: I6100ce303346ab9fa94332e91f5d730dc83f4e65
2015-09-29 13:11:22 +02:00
Gilles Dubuc a05eedb941 Set test assertions to new date format
Bug: T107417
Change-Id: I1f36ff5d6ae0e1edb5f066ec44c355bdc5f59bb0
2015-07-30 14:13:27 +02:00
Geoffrey Mon a7f11a7c45 Moar restriction icons!
Icons for all important non-copyright restriction types.
Also, some tweaks made in CSS e.g. add 1 px margin to top of mw-mmv-labels
Finally, new test to check if default restriction is placed last.

Example files:
copydesign: https://commons.wikimedia.org/wiki/File:Peugeot_404_dsc01875.jpg
trademark: https://commons.wikimedia.org/wiki/File:Logo_NIKE.svg
trademark+insignia: https://commons.wikimedia.org/wiki/File:Flag_of_UNESCO.svg
personality: https://commons.wikimedia.org/wiki/File:Vice_President_Megawati_Sukarnoputri_-_Indonesia.jpg
communist+insignia: https://commons.wikimedia.org/wiki/File:Flag_of_Georgian_SSR.svg
nazi: https://commons.wikimedia.org/wiki/File:PropagandaNaziJapaneseMonster.gif
costume: https://commons.wikimedia.org/wiki/File:Shrek_%26_Fiona.jpg
fan-art: https://commons.wikimedia.org/wiki/File:Magic_wand.gif
(I think that's enough)

Bug: T102693
Change-Id: I907396c59752511448145a4ac5d29096166f841f
2015-07-16 01:06:39 +00:00
Gilles Dubuc 95dcc971b0 Reduce number of RL modules in MultimediaViewer
Having many modules makes the startup module in the head
unnecessarily longer. Things should only be in their own
module if they're going to be loaded on demand on their
own or are a shared dependency of separate modules that
are.

This change brings down the amount of modules declared by
Media Viewer from 53 to 8. The ones that remain are
mostly things loaded on demand.

Bug: T103706
Change-Id: I5b0d29209599285b93217e96def818e641646c73
2015-07-10 00:07:14 +02:00
Thiemo Mättig 34a24b016a Fix two failing QUnit tests
These two tests fail on my local machine. I am making the two
assertions independent from
a) the order of HTML attributes (the test should not care about
   the order, only if the attributes are there or not)
b) the message (both messages are possible and valid, the question
   which message should appear is not part of that specific test).

Change-Id: I69b4793d365d3afebb869c787316e4242cb15b25
2015-05-20 12:48:59 +02:00
Gilles Dubuc a45f7b48f0 Make progress bar qunit tests more robust
Bug: T93540
Change-Id: Id46d3ffd4e9f89a834162b595e36a26e1186c0a5
2015-03-24 12:24:10 +01:00
Gilles Dubuc 1409475187 Adapt to OOUI change in dropdown widget
Bug: T89444
Change-Id: Ie65ad811296b5bce6c43f6c37a00f8d899418f8a
2015-02-13 15:20:59 -06:00
Divya adbf42280e Match size of preview and real image
Bug: T87295
Change-Id: I04746dcb80e571a624366b86fd5c5f4cbc31185b
2015-01-23 15:22:39 -05:00
Fomafix ae99be730e Apply coding conventions for JavaScript
Change-Id: I57a8f188eb1152438a8e94235a6f6801e2617c28
2015-01-23 12:48:27 +00:00
Geoffrey Mon cf67495467 Allow bold and italic text
Added mmv.HtmlUtils.htmlToTextWithTags()
  which is similar to htmlToTextWithLinks()
  but allows <b> and <i>
Added test for mmv.HtmlUtils.htmlToTextWithTags()
Most text fields now use htmlToTextWithTags()
  except Permission field which is not supposed to
  have HTML

Bug: T69887
Change-Id: I16833f218e2f64586aa13925356fa2b8b7ec3100
2014-12-31 01:01:50 +00:00
m4tx dac77cafc4 Change "view terms" to "hide terms" once clicked
metadataPanel overrides the grow() and shrink() methods in Permission
class instance, so the text is changed also when user clicks the
"view more" link inside the box.

Bug: T71233
Change-Id: I66fe57980c6f469d86e3d52b67d01e06a3a14270
2014-12-29 23:23:07 +01:00
jenkins-bot 9c6d50e55a Merge "Text changes for better handling of PD and nonfree licenses" 2014-11-26 14:52:39 +00:00
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
Timo Tijhof cf48687731 Migrate jQuery andSelf() to addBack()
Deprecated in jQuery 1.8
http://api.jquery.com/andSelf/

Change-Id: I4988c24c4f14c2962f12065acccc7dd51899a2e4
Task: T67399
2014-11-25 02:57:29 +00:00
Gilles Dubuc 0e01796a3c Track how long users are viewing images for
This is complete, but it would be better if the HEAD request
was actually aborted by Varnish when the viewDuration parameter is
present, or if the hit pointed to a script that does that.

Change-Id: I66cafd97427756411e967de1901324af2215e3ae
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1001
2014-11-21 00:39:29 +01:00
Gergő Tisza af508f066a Make the ellipsis of truncated texts more prominent
Also fixes popup texts which should have been updated in the parent commit
and the panel opening mechanism which did not work when the below-the-fold
description box was display:none-d.

Change-Id: I5fc37429a7dc7a8f1517fa42375cd140d7d11674
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/589
2014-11-11 15:37:14 +00:00
Gergő Tisza 3a18515163 Replace filename with caption/description
* when the caption is available, use it as the image title
* otherwise, fall back to description if available
* otherwise, fall back to filename
* if both caption and description are available, show caption as
  title and show description below the fold; otherwise don't show anything
  below the fold.

Change-Id: I9738ca46620d7cf3b30f6e46790a37966d4b9eaf
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/589
2014-11-11 15:33:15 +00:00
Gergő Tisza b0bac10627 Display a placeholder text when author and source are missing
Change-Id: I38478956c5a0b5f204e5caa43e54db651f297887
2014-10-29 15:38:56 +00:00
Gergő Tisza f792a42f93 Change above-the-fold layout - step 2
* move license and terms link from title area to attribution area
* remove some ineffective styling for elements which have already been removed
  in earlier changes

Change-Id: I5bd41e337a4c8133bfa27e4c4d03162b2d6e35bb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/833
2014-10-28 21:18:53 +00:00
jenkins-bot fb7a04f5a2 Merge "Change above-the-fold layout - step 1" 2014-10-28 21:18:48 +00:00
Gergő Tisza a6adad35ed Change above-the-fold layout - step 1
* remove chevron
* adjust colors

Change-Id: I443fd757f5df18d099e42a81f1f323fadea77987
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/833
2014-10-28 20:02:22 +00:00
Mark Holmquist ff7a8b23c2 Add about link to disable/enable dialog
This was the last issue with the dialogs. Tests included.

Change-Id: Ic08af400893950a04489af4b166827d059561974
2014-10-24 13:51:32 -05:00
Gergő Tisza 2c578e6dc3 Show popup when the user visits a file page the first time after disabling MMV
Change-Id: Id2b121c930115373a8a81dc1091c4124807db053
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/719
2014-10-21 14:28:20 +00:00
Mark Holmquist feb8e43571 Add tests for viewing options panel
Change-Id: Ic7a856ac4d94f4a65224f4c6373938da7b05f0fd
2014-10-19 00:35:36 +02:00
Mark Holmquist 1853540cd3 Add viewing options panel
Enable, disable, and get confirmations.

Lots of UI work on this one.

Change-Id: I1f731992bd240e7ea403592872f7c7e270158753
2014-10-19 00:27:15 +02:00
Mark Holmquist 9187148b01 Remove duplicate details link in metadata panel
Change-Id: I2eaa221fa505e9f106fa8611adfe99677a24009b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/909
2014-09-28 21:45:55 +00:00
Mark Holmquist 0d4863dd91 Make the download pane into its own dialog
Change-Id: Ia92545ed1ef7f2e4ba7934c682eef684a22ca17f
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/841
2014-09-24 17:05:50 +02:00
Mark Holmquist 59d8c5d892 Make the reuse button part of the canvas
Moves it out of stripeButtons and into canvasButtons.

Will move download to its own thing later.

Change-Id: Iaf18914b29a6283c3bade954f1adb3f206c9c911
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/834
2014-09-18 12:43:45 -07:00
Mark Holmquist a82dfd6eb0 Remove tooltip for view-file
Change-Id: I89b2dfd43ea18a2e1fe9d2214b76218b24ce88cb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/886
2014-09-11 10:41:45 -07:00
Gilles Dubuc 2ef45b3058 Remove categories
Change-Id: I309b01592e874579d50bf5fc0810c238d47748f5
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/835
2014-09-09 13:23:50 +00:00
jenkins-bot 23c7258b31 Merge "Remove file usage" 2014-09-09 13:10:37 +00:00
Gilles Dubuc b70fa7251d Replace addEventListener call with jQuery's .on()
Bug: 70553
Change-Id: I24680e7b7759d30eca2a733d670e10c0b4bfe7ab
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/863
2014-09-09 11:18:03 +02:00
Mark Holmquist f94d3362d9 Go to the original image on image clicks
Also removes original file button.

Change-Id: I6e73e46e910313fe6c5efb3087ecb693e499e064
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/831
2014-09-05 10:19:00 -07:00
Gilles Dubuc caa624d711 Remove file usage
Change-Id: I538f7734e1c06a179ee98a5cd843ccee4d91349f
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/835
2014-09-05 08:14:52 +02:00
Gergő Tisza 4142696903 Fix moment tests
moment.js has a slight change in date output which broke some tests.

Change-Id: If5ffdaba8574e574d644f3d8bd987ee29aeb0bc9
2014-08-16 12:11:46 +00:00
Gergő Tisza 0423bfbe5a Reveal full text when metadata panel is opened
Automatically reveal/hide full text as metadata panel is opened/closed.
Also makes metadata open/close a proper event.
Changes scrollTop calculation for the fully open metadatapanel so it is not
confused by the size of the panel changing.

Also rename MetadataPanel.$controlBar to $aboveFold (that field was missed
when the corresponding CSS class got renamed).

Change-Id: I7e66ca0f45c2188dab4b78508ad7f91154187de4
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/396
2014-07-18 00:47:46 +00:00
Gergő Tisza f14d08fd75 Reveal full text when user clicks on title or credit
Reveal the full title + author + source when the user clicks one
of these, and make some related changes:
* expand the above-the-fold part of the metadata panel so they fit
* make the stripe buttons smaller and hide their text
* scroll the panel up if necessary
* modify tooltip texts when there is more text to show

Change-Id: I304297bc5e7be7b16e2fc4bde66ac19641b00029
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/396
2014-07-17 09:42:12 -04:00