* 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
When an svg file is requested, returns the 1024px file and displays at
max possible size
Bug: T71237
Change-Id: I797794d1f9b1aa66cbb9bd9fec57274554292fb1
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
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
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
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
* 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
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
This heavily relied on deferreds getting resolved synchroneously,
which (for .then) is no longer the case with jQuery 3.
There's also a difference in how chained .then's get resolved,
and $.when no longer propagates notify().
The changes in here are basically:
* fix use of $.when, manually passing along notify()
* use .then in some places, instead of .done, .fail, .progress
* fix progress bar hiding in setupProgressBar, which assumed sync
* fixed tests, mostly by using fake timers to give async stuff a
chance to execute
Bug: T164473
Change-Id: Ib51ddd8bc6254a477861588fb16f57565353afe1
This heavily relied on deferreds getting resolved synchroneously,
which (for .then) is no longer the case with jQuery 3.
There's also a difference in how chained .then's get resolved.
These tests did not wait for the deferreds to get resolved async,
so that had to change. Worse even: some functionality was tested
by assuming a handler would not be called (= the test in that
handler would not be called), which didn't make the test run,
because we never even waited for it to be called.
The changes in here are basically:
* make mmv.bootstrap.js correctly use .then instead of .done & fail
* let mmw.bootstrap.test.js tests wait for unresolved async promises
* check call counts instead of running tests inside of callbacks
* limit use of fake timer to the 1 test that needs it (it interferes
with async, which otherwise don't get resolved)
Bug: T164473
Change-Id: I3ca4f786890ad1646f71fe336afdb61e5c3b01c7
* Buttons are semantically better.
* Neither <div> nor <button> elements can have the 'alt' attribute
so switching to 'title' instead.
Reverts parts of I6ea62124018b1a0ec5110bb500f690cb2368f102.
Bug: T58471
Change-Id: I991b40d3387f8d6dd7cdad8ccc5cc9660b9f139a
Previously, the clickable text in the generated HTML credit lines
was the entire link to the article. This is shortened to a localized
version of "Link".
Bug: T119686
Change-Id: I708f65a85bfa26c264cdd06a265096027266240c