Commit graph

508 commits

Author SHA1 Message Date
Ed Sanders 18a154b989 build: Update devDependencies
Change-Id: I46f5317976ef9f818e30b0c81018e83800535389
2019-07-31 22:59:13 +01:00
Željko Filipin d4b61852cc Selenium: do not run selenium-MultimediaViewer Jenkins job on macOS
The job has been failing for months for macOS. Tests are not providing
any value.

Ruby Selenium framework has been deprecated since 2017. We are removing
support for it from CI.

Bug: T214389
Bug: T220035
Change-Id: I4fef826a7ac1e7b2d260b1bf8f5d42e3f214b07d
2019-07-11 15:14:03 +02:00
jenkins-bot 989af50dcf Merge "Make the download/share buttons actual links for right/middle click" 2019-06-15 22:09:38 +00:00
Fomafix f89d7dc878 Remove "window." for location and setTimeout
The JavaScript in core also don't use "window." for these browser
properties and methods.

Change-Id: I344573fd7ef0e73c252779b4e59a53168d16574f
2019-06-10 12:46:58 +02:00
jenkins-bot 0d4d5096b1 Merge "Replace moment.js with Date.toLocaleString" 2019-05-31 21:14:00 +00:00
Simon Legner 682873dd2d Replace moment.js with Date.toLocaleString
Bug: T224626
Change-Id: Ib312821d2c72c2570cec29153557fd44e4db2bf7
2019-05-31 21:56:45 +02:00
jenkins-bot c7e33d0f5e Merge "Download sizes: 480p, 720p, 1080p, 2160p" 2019-05-31 16:54:00 +00:00
jenkins-bot a4e63f623c Merge "Adopt mediawiki.router" 2019-05-28 15:14:50 +00:00
Simon Legner b1ade19388 Adopt mediawiki.router
Bug: T77258
Change-Id: Id4df92b0ebed3fb4f4b9269862c952f3968bf957
2019-05-26 19:46:38 +02:00
Simon Legner 2fbf2c06a9 Download sizes: 480p, 720p, 1080p, 2160p
Bug: T77642
Change-Id: I41b7d59d14342345fc060085b755ce28f3e9cf98
2019-05-26 19:15:09 +02:00
Ed Sanders 394b893c7d Use upstream CopyTextLayout in share/embed/download panels
Results in small UI changes, but allows us to delete a lot
of code duplication.

Depends-On: I9049f5a1c0d88680fc4a174e390dd08e27c0eee2
Change-Id: Iebe7bdc8a026b929a35e823d8107d90e7bb62b82
2019-05-23 20:01:36 +01:00
Thiemo Mättig 8b647c09e7 Make the download/share buttons actual links for right/middle click
Bug: T71469
Change-Id: Ib9dca98a70a056e93e252ba1d08479be509e7a18
2019-05-20 09:05:10 +00:00
jenkins-bot fb40e5b09f Merge "Do not clone CSS class names as well" 2019-05-19 13:12:18 +00:00
Thiemo Kreuz 26fbcd6095 Do not clone CSS class names as well
What MultiMediaViewer does is re-using the small thumbnail <img> that
is already present on the page, cloning it, blowing the size up, and
using it as a "placeholder thumbnail". The moment the bigger image
finished loading, it replaces the placeholder.

The issue here is that the cloning includes class names like the
<img class="thumbimage"> on every [[File:…|thumb]] image. This shows a
gray border. The cloned DOM node in MultiMediaViewer shows this gray
border around the placeholder for a short time. This can be distracting.

Change-Id: Ie83427fab478b6568731b9a0b1f7dbbcc6d5b0fb
2019-05-19 10:44:21 +00:00
Simon Legner e1caa0f65e Fix typos in code/comments
No functional change.

Change-Id: I6447aefe8fdd39642d613f55ad0a5537f64dcb9d
2019-05-19 10:17:44 +00:00
Dan Andreescu 51b31545ab Remove mentions of schema.* ResourceLoader modules
These modules are deprecated and will be removed, see parent task for
details and deprecation information.

Bug: T223284
Change-Id: I2532e20659a59cdd036a7d8ad5a040ae136848f5
2019-05-14 21:22:28 -04:00
Thiemo Kreuz f733d8bbd1 Fix typos in JSDocs type hint
Change-Id: Id590ba6a587dbe5b38bd998d93f07221cfcfeae2
2019-05-10 15:42:20 +00:00
jenkins-bot a6e1a69a69 Merge "Fix browser test failures" 2019-05-08 22:27:35 +00:00
Mark Holmquist 93d948b21c Fix browser test failures
Sauce labs removed support for OSX 10.9, so we've seen failures in the
browser tests for a while apparently.

The generic "macos" should just work, and is sufficient for our testing
needs.

Bug: T214389
Change-Id: I01c1e9e03dc5b658aa3e2b3ee6a7b5f503488f97
2019-05-08 14:40:17 -07:00
James D. Forrester 23b2f78642 Remove the BetaFeatures integration
Not used in years. Sadly $wgMediaViewerEnableByDefault has to remain
for now.

Change-Id: If2d90627de230b9b36e7b24abe0d4bdee8a2ef35
2019-05-08 11:22:35 -07:00
Kunal Mehta 60d08ba00b Upgrade to newer phan
Bug: T216928
Change-Id: I2b812745176550616c8d37859f2ad29cdf8fd4c3
2019-03-17 16:14:02 -07:00
James D. Forrester c6008c7844 build: Be more aggressive in fixing old bad JS code style
Change-Id: I7f734f1440a4a3216e774d2bddbc39b34f4125d2
2019-02-20 19:28:25 +00:00
James D. Forrester 1b21470703 build: Update eslint-config-wikimedia to 0.11.0
Change-Id: I66788a2c1fa59b617abd13b7c8e8fb59ad74130c
2019-02-20 19:22:21 +00:00
Ed Sanders 92157f6b05 build: Update eslint-config-wikimedia to 0.10.1
Change-Id: Icd89819ef38142e55c0bd4cc8dbb73745123f9f6
2019-02-06 01:56:53 +00:00
Eric Gardner bbaf7a38b4 Get Rid of EmbedFileInfo
* Deletes the mmv.model.EmbedFileInfo class file and its test file
* Updates the extension.json and MultimediaViewerHooks.php files to reflect
  these deletions (by removing entries from dependency lists)
* Refactors all instances of `new mmv.model.EmbedFileInfo()` to instead use a
  POJO with appropriate properties. Conditional assignment is used for the
  caption and alt properties if there is any chance they won't be available, to
  keep from adding props with falsy values.
* Refactors JSDoc method annotations so that `@param` tags expecting an
  EmbedFileInfo instance now expect an object; relevant properties of this
  object and their types have been added to the method annotations as well.

Bug: T77320
Change-Id: Ie9f5f24136f4b73000259685474ce4d765a3ccd3
2019-02-05 15:31:49 -08:00
Ed Sanders a518cb03a5 build: Update eslint-config-wikimedia to 0.9.0
Change-Id: I92ed1f7093cfaed47f0372f9cb063fe4e65b4f55
2019-01-03 13:47:16 +00:00
Gergő Tisza 9901520ae5 Ignore TemplateStyle-generated content when textifying HTML
Not tested.

Bug: T211444
Change-Id: Id6fcd20d1d7d3b811623e6267cb9f74be9569b1b
2018-12-07 22:02:14 +00:00
flutters 2fad4daa43 SVG files display at max resolution
When an svg file is requested, returns the 1024px file and displays at
max possible size

Bug: T71237
Change-Id: I797794d1f9b1aa66cbb9bd9fec57274554292fb1
2018-11-26 20:37:34 +00:00
Ed Sanders 1ded292f83 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ice695dfb489974faa23ba19d74cf17b06e3f6075
2018-11-12 16:33:24 +00:00
Ed Sanders 053d1a9d8b build: Update linters
Change-Id: Ie6e85abdc0714adf4d89e515967bf2ab4c393215
2018-09-13 22:13:56 +01:00
Fomafix 965b496850 Replace jQuery by native JavaScript
Change-Id: I8ae88f9f569be61902e19f89c687b0188a7c099c
2018-09-11 21:15:07 +02:00
Timo Tijhof 5c9faa580e Move files to their own directory per module
Bug: T193826
Change-Id: I925b1c7be2dbbb50994ed9f1ef12b5978ba175ff
2018-07-30 15:15:25 +02:00
Matthias Mullie 4627adb9b1 Fix mw.storage typehint
Change-Id: I758ca9375c479098edae98a78c1ee9170df7afc2
2018-07-28 17:14:32 +00:00
Ed Sanders dec9c6321c build: Enable more qunit lint rules
Where appropriate, convert assert.ok to assert.strictEqual.

Change-Id: I098ade9928958e8c2d36de221361d89b5c70ec35
2018-06-06 12:18:24 -07:00
Ed Sanders 2c3213485d build: Introduce eslint-plugin-qunit and enforce
Change-Id: I16c00628a0f8a4f505fc0c78991bd7d9394c18d9
2018-06-06 12:17:23 -07:00
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
Ed Sanders 9987491fdf Pass mw.Title to #click in tests
Change-Id: I616d13bf11ce38ac9bd400a568ab791a07cf0392
2018-05-11 18:46:42 +00:00
James D. Forrester 2078fbfb53 tests: Comment out failing tests
Bug: T192932
Change-Id: Iba81676ebb13407679bd99b0e08d29e225a7ebde
2018-05-11 09:50:31 -07:00
Kunal Mehta b24f75a2ef Add phan configuration
Change-Id: I5d1c03978d6d018ea3e6fc0927598b5a2c931b85
2018-04-14 01:05:33 -07: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
Derk-Jan Hartman 340e7680a1 MMV: Allow <sub> and <sup> in captions
As we already allow visual markup in captions, I see no reason to not
whitelist sup and sub. These elements are even allowed in the
displaytitle whitelist for articles, so seems appropriate to have them
for media captions as well.

Bug: T186844
Change-Id: I4339ee85d139301770a4e15650c9dc0d64c136cd
2018-02-09 10:34:53 +01:00
Fomafix 61581fa905 Use saveOption from 'mediawiki.api.options'
Change-Id: I33a60cbaf10f5d53a4e49f335ce8f16d108f9dfb
2018-02-03 16:37:21 +01:00
Gergő Tisza db3975fb1a Fix title detection on file pages
Media Viewer tries to detect the file name from the thumbnail name.
That can break for the main image of a file page, which is normally
a preview (ie. a normal thumbnail) but for unhandled types it can
be some asset (such as a PDF icon).

Bug: T137477
Change-Id: Ie6b23d7ef213087971b320460129910f2efd248e
2017-11-27 14:23:51 +01:00
Ed Sanders 42b577bae9 build: Update linters
Change-Id: I7262fb369df0428c39adaf55128b83f019afb4c0
2017-10-31 18:42:04 +00:00
Umherirrender 590c6cdf32 Allow https in test regex
Test failure from jenkins:
https://integration.wikimedia.org/ci/job/mwext-mw-selenium-jessie/6608/console
   Background:                             # features/mmv.download.feature:4
     Given I am viewing an image using MMV # features/step_definitions/mmv_steps.rb:21
       expected "https://creativecommons.org/licenses/by-sa/3.0" to match /^http:\/\/creativecommons.org\/licenses\/by-sa\/3.0$/
       Diff:
       @@ -1,2 +1,2 @@
       -/^http:\/\/creativecommons.org\/licenses\/by-sa\/3.0$/
       +"https://creativecommons.org/licenses/by-sa/3.0"
        (RSpec::Expectations::ExpectationNotMetError)
       ./features/step_definitions/mmv_steps.rb:126:in `check_elements_in_viewer_for_image2'
       ./features/step_definitions/mmv_steps.rb:73:in `block (2 levels) in <top (required)>'
       ./features/step_definitions/mmv_steps.rb:70:in `/^the image metadata and the image itself should be there$/'
       ./features/step_definitions/mmv_steps.rb:25:in `/^I am viewing an image using MMV$/'
       features/mmv.download.feature:5:in `Given I am viewing an image using MMV'
 
   Scenario: Download menu can be opened   # features/mmv.download.feature:7
     When I click the download icon        # features/step_definitions/mmv_download_steps.rb:8
     Then the download menu should appear  # features/step_definitions/mmv_download_steps.rb:54

Change-Id: I6feda65ca8ff2bc8f790eaaac8f63e1feafcbdfd
2017-10-07 20:17:55 +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