Commit graph

630 commits

Author SHA1 Message Date
Bartosz Dziewoński
5d62627a21 Update OOjs UI to v0.11.0
Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.11.0/History.md

Local changes to accommodate for font-size change.

This is a total hack. Sorry. I will get it killed.

Bug: T91152
Change-Id: Ie69d14b9094b8cbd4e051985ffd6aaac490be3a6
2015-04-29 18:53:56 -07:00
Bartosz Dziewoński
9e5c3e9521 Use ResourceLoaderImageModule to serve icons for OOjs UI
Benefits:
* Full per-language icons support. Icons that differ for each language
  (such as the 'Bold' icon) will now always display correctly
  according to user interface language, even on old browsers.
* MediaWiki UI icons support. When the 'mediawiki.ui.icon' module is
  loaded, you can use syntaxes such as below to display any OOUI icons
  (from the packs that were loaded) without involving OOUI itself.
    <div class="mw-ui-icon mw-ui-icon-before mw-ui-icon-check">OK</div>
    <div class="mw-ui-icon mw-ui-icon-after mw-ui-icon-check">OK</div>
    <div class="mw-ui-icon mw-ui-icon-element mw-ui-icon-check">OK</div>

Summary of changes:
* Resources.php:
  * Remove icons CSS files. Include image data JSON files instead.
  * Split the images from 'oojs-ui.styles' module to separate ones.
* OutputPage: Update enableOOUI() method for newly split modules.
* ResourceLoaderImageModule: Make it possible to load image data from
  a JSON file.
* update-oojs-ui.sh: Copy source files rather than distribution for
  icon packs.

This is not an improvement when it comes to code quality, though :(
Issues include some nasty code duplication, using "source code" (image
definitions) from OOUI rather than just distribution files, and hacky
methods to load image data from JSON files live.

Bug: T92551
Change-Id: Id369ecaec7048dcf68ba1e4df748362760533782
2015-04-28 13:48:30 +00:00
Stephane Bisson
5edae663bc Polyfill node types in browsers without DOM level 2
mediawiki.jqueryMsg.js:1144 was blowing up on Node.TEXT_NODE
because window.Node is undefined in IE8. The exception was ignored
and this was causing a message containing {{PLURAL...}} or
{{GENDER...}} to be rendered as is.

Bug: T87118
Change-Id: I8c5c2ae74b68eeabd93bb5b81a3061bcb31f6549
2015-04-20 15:05:47 -04:00
Florian
945eabb788 Add target mobile to jquery.textSelection
Bug: T91752
Change-Id: Idd2275788f11303bd965994c9fb2e6c2d59daa33
2015-04-18 18:55:37 +02:00
This, that and the other
5c4681012e UI for adding and removing change tags on revisions and log entries
There is a new special page, Special:EditTags, which is very similar to
Special:RevisionDelete in a lot of ways. In fact, the SpecialEditTags class
started off as a copy-paste of SpecialRevisiondelete.

You invoke this special page by going to an article history page, checking
some revisions, and clicking "Edit tags of selected revisions". Then you
pick the modifications you want to make and click "Apply". Very much like
the revision deletion workflow.

I had to restructure some of the Action routing code, which was only
designed to handle revision deletion. Also removing some code from
SpecialRevisiondelete which didn't work as advertised in the first place,
and definitely doesn't work now.

Change-Id: I7d3ef927b5686f6211bc5817776286ead19d916b
2015-04-15 18:31:12 +00:00
Matthew Flaschen
d49ea1bb8e MessagePoster followup: Dependency and docs
* WikitextMessagePoster depends on mediawiki.messagePoster
* Tweak how promises are documented

Change-Id: Ie48bde9d5995e86f22744d6b6f3773d125ccb1b0
2015-04-06 16:58:07 -07:00
Matthew Flaschen
061b987f1c Add pluggable talk page poster and use it for mediawiki.feedback
The core implementation will only support wikitext.
Flow will add its own implementation, and it can be used for any talk
page system identifiable by content model.

Bug: T91805
Change-Id: Ic69acafb24aa737536fe3a074e1958690732f0a7
2015-04-06 14:10:23 -07:00
Bartosz Dziewoński
215f0327fe Resources.php: Remove duplicate copy of 'oojs-ui.styles' module
derp

Change-Id: Id7cd440888818e387f5cae68a5a63d73d3e11876
2015-04-01 19:45:26 +02:00
kaldari
67c1308cee Adding mobile target to mediawiki.template.mustache
Otherwise we can't use the mustache compiler from MobileFrontend.

Change-Id: I36ac5478493af32673f2849c122efc24336b7f51
2015-03-30 17:11:54 -07:00
Gergő Tisza
23c1cebca0 Report uncaught errors via mw.track
Adds a global error handler that sends errors to mw.track as
an errorLogging.windowOnerror event.

Bug: T88874
Change-Id: Ic091c9f93c59bda47bda2cfd609c64cd1d014b39
2015-03-27 20:53:25 +00:00
jenkins-bot
39eeb0513d Merge "Move WikiEditor's special character data and messages into core for use in other extensions" 2015-03-27 18:40:36 +00:00
Alex Monk
ec2330f7f9 Move WikiEditor's special character data and messages into core for use in other extensions
Using a ResourceLoader module to send the data to the client

For I3fafc561

Message changes:
wikieditor-toolbar-characters-page-.* -> special-characters-group-
wikieditor-toolbar-characters-(endash|emdash|minus) -> special-characters-title-

Bug: T91608
Change-Id: If9c5cdbe077e8796e1ebae99f759331251b5c4b1
2015-03-27 17:40:09 +00:00
Florian
fce27ff328 Add mobile target for mediawiki.confirmCloseWindow
Bug: T88949
Change-Id: I1e06668cbd149c23f7b961f7603be07262a021a9
2015-03-27 17:57:33 +01:00
Derk-Jan Hartman
fa836dfd8e LivePreview: Notifiy user about errors
Bug: T90490
Change-Id: Ic52311839c175a213065eec442e50b4de0463822
2015-03-25 23:57:17 +01:00
Derk-Jan Hartman
a26ea0bf82 LivePreview: Support section=new for preview
Reproduce the new section behavior for the full submit preview.
Diffing will require a bit more additional work in Api.

Bug: T84877
Change-Id: Iec71fdc7ba09f91683214f3d65472ea2f72a06b1
2015-03-25 19:51:38 +00:00
Fomafix
3eafa8dd37 Update HTML title with displaytitle on live preview
Set the new global JavaScript variable 'wgEditMessage' with the name of the message.

Document this global JavaScript variable in
https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#mw.config
after merge.

Bug: T88117
Change-Id: Ida5c1d470908cefd16925bd5455758d25db02113
2015-03-24 22:34:18 +00:00
jdlrobson
7c52c9265b resourceloader: Add template compiler for Mustache JS
Compatible library for PHP backend added by I281acc49c1.
This adds the frontend compiler.

Change-Id: I2190276a629ca882f3f5535e4e73635d2494e944
2015-03-23 11:10:05 -07:00
jenkins-bot
a7192f0978 Merge "mediawiki.helplink: Use a SVG+PNG icon" 2015-03-21 17:50:39 +00:00
Bartosz Dziewoński
59428a375a mediawiki.helplink: Use a SVG+PNG icon
Icon copied from OOjs UI library.

Bug: T45591
Change-Id: I0378e26471a72ab3a756e3cbb8c16a6878b3dbde
2015-03-20 09:06:33 +00:00
Erik Bernhardson
de0c7cb1c1 Allow usage of mediawiki.api.options on mobile
Change-Id: Ic5b8bc2e5e5e87cd5545812b7c20d73f630ec8e7
2015-03-19 16:48:18 -07:00
Bartosz Dziewoński
9247607184 mediawiki.api.options: Add module for API action=options
Implemented mw.Api#saveOptions to save user preferences.

If necessary, the options will be saved using several parallel API
requests. Only one promise is returned that resolves when all requests
are complete.

If a value of `null` is provided, the given option will be to reset to
the default value.

Any warnings returned by the API, including warnings about invalid
option names or values, are currently ignored. This basically means
that all requests will succeed (barring networks problems, internal
server errors and such).

Change-Id: Ia015898ca910923e00bc53f099b4e5631d6ad45c
2015-03-18 19:03:16 +00:00
jenkins-bot
524d92b61f Merge "Add framework for file warnings" 2015-03-18 17:25:20 +00:00
Mark Holmquist
a398c0c933 Add framework for file warnings
See I674bf7f6c1b21ffc9870aa84382479af5f966561 for an example in the
PdfHandler extension.

Bug: T89765
Change-Id: I3c4b7af7284b5e16e458dd72de789e74db489895
2015-03-18 10:05:19 -05:00
Bartosz Dziewoński
5205405385 Emergency remove .mw-headline-anchor
Follows-up 6c7480e5f0, d2a6a73d2.

The should stop the § character from being indexed by Google et al.

Bug: T18691
Bug: T93000
Change-Id: Ie9e334e973e3ded270f1897a2c3816d9df739fc0
2015-03-17 22:31:45 +00:00
James D. Forrester
d1b8defcbb Update OOjs UI to v0.9.1
Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.9.1/History.md

Change-Id: I936ea56e1c99f576f44115a9b2fa075ef1ab14bd
2015-03-12 12:41:04 -07:00
James D. Forrester
97c4e93eef resources: Move to library version of jquery.client
The jQuery Client library is no longer mastered in MediaWiki, and is
instead a proper, published library, which is now tagged as v1.0.0.

Change-Id: Idd19d738b392a5f742fef6f98c885e8c391a5cbf
2015-03-11 16:47:16 -07:00
Timo Tijhof
ef3d4c20c4 jsduck: Add 'mediawiki.startUp.js' to eg-iframe
Follows-up 2ea420eed8. Without this, the startUp() is never called,
and mw.config remains undefined which caused some of the examples
to no longer work properly.

Also move onerror handler to first <script> (follows-up a64a07d).
Exceptions from other code (eg. startup or mediawiki modules),
were not being caught.

Also include 'error' in the line being logged from onerror.

Change-Id: I3956da40b0bd862acab6d4552932aa609c17d569
2015-03-11 14:47:51 +00:00
jenkins-bot
5907e840cc Merge "Add top help link to MediaWiki.org in several pages via indicator" 2015-03-04 16:15:53 +00:00
Nemo bis
376c0a13df Add top help link to MediaWiki.org in several pages via indicator
All the chosen targets are translatable public domain help pages
on MediaWiki.org. Mostly special pages and actions for privileged
users for now.

Adapted from the Translate extension, credit to Niklas Laxström
(TranslateUtils::addSpecialHelpLink).

Depends on 6f5b29ff4e, whose commit
message has a typo addIndicator() instead of setIndicator().

Bug: T45591
Change-Id: I2934b1708a0d207dcf3d940264f140613646f203
2015-03-04 10:59:03 +01:00
jenkins-bot
0d604ca809 Merge "resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule constructor" 2015-03-03 22:52:22 +00:00
jenkins-bot
34bec1b34e Merge "Refactoring mw.Feedback to work with OOUI elements" 2015-03-03 18:39:03 +00:00
Fomafix
ec7269c722 Resources.php: Simplify dependencies to single modules
Change-Id: Icaa81662243259f166a28e3b6bb5b8ac6fea4bb3
2015-03-03 18:00:19 +00:00
Kunal Mehta
870f50d45c resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule constructor
This makes it easier for subclasses to use ResourceLoaderWikiModule. Currently
many subclasses of this simply need to override the getPages() method.

UserModule and SiteModule keep their getPages override due to the set of pages
being dependent on context.

Change-Id: I388531398671afacfec36c6c5746d72267b5bdac
2015-03-03 17:17:02 +00:00
Moriel Schottlender
e75605bc0e Refactoring mw.Feedback to work with OOUI elements
Transform mw.Feedback into an ooui dialog.
* Added a configurable checkbox for useragent and terms
  of servvice options. The checkbox can be configured
  to be visible or not, and to be mandatory or optional.
  (useragent addition based largely on the unmerged
  fix I37b1a271af115)
* Transformed the 'feedback-bugornote' message to a
  configurable intro message with a link to the feedback
  page.
* Added a 'thank you' or 'error' dialog at the end of the
  operation indicating whether the feedback was sent or
  if there was some error.

Bug: T89878
Bug: T43291
Bug: T35365
Bug: T54588
Bug: T65290
Change-Id: Id1967a83a502f689c40f1af71398c3be99e30640
2015-02-26 16:54:52 -08:00
Sumit Asthana
8d25d1b1ea CategoryView modified to use css columns
The categories on Category page were listed using table layout. This layout has
been changed to the responsive css column structure, which is 3 column wide
beyond 768px, otherwise shrinks to a single column.

break-inside is used which needs some consideration, see here:
http://css-tricks.com/almanac/properties/b/break-inside/

Bug: T55130
Change-Id: I437e6079b20e110047f93fb5c09aae40189f1ec0
2015-02-23 16:54:24 +00:00
Derk-Jan Hartman
2550a3c691 Preferences: Use mediawiki.confirmCloseWindow module
This logic was duplicated into the preferences page module before we
had refactored it into a separate module.

Bug: T89819
Change-Id: I67a25ff8758f009123526d5194929bfcd7c3039b
2015-02-20 10:50:20 +00:00
Vivek Ghaisas
6c7480e5f0 Add clickable link for section headers
Changed the Linker::makeHeadline function to additionally generate an
anchor that uses a section symbol. Created mediawiki.sectionAnchor
module to style the anchors and included it in SkinTemplate so that
other skins automatically get those styles.

Bug: T18691
Change-Id: I562e437ec0bd337c9db0406f5dcab504dfa37034
2015-02-19 22:53:57 +01:00
Bartosz Dziewoński
d91f3fbe61 Resources: Use OOjs UI distribution with vector→raster fallback
Bug: T87501
Change-Id: Iff139bf2601d517d91f922c033f1e3e793757943
2015-02-18 17:41:11 -08:00
James D. Forrester
d50f6c0e22 Update OOjs UI to v0.8.0
Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.8.0/History.md

Change-Id: If14d382beae3f42d2ffb3a43ee0c3e2a488a5fa1
2015-02-18 17:39:13 -08:00
jenkins-bot
94e5ea8b10 Merge "resources: Move QUnit to resources/lib/qunitjs" 2015-02-10 15:06:01 +00:00
jenkins-bot
4ce714d6e2 Merge "Separate startUp() call from main script of mediawiki module" 2015-02-10 10:49:48 +00:00
Timo Tijhof
5f25ba11d5 resources: Move QUnit to resources/lib/qunitjs
This never belonged in resources/lib/jquery as it isn't a jQuery plugin.
It's its own package and library.

In fact, while it is a jQuery Foundation project, it does not even
depend on jQuery core (e.g. like Sizzle, and PEP).

Change-Id: Ibb00f47f4c9444870832ba8d327853f335708ae7
2015-02-10 06:38:24 +00:00
Geoffrey Mon
81ea10ffee Resources.php: Fix phpcs-strict
Make line 1076 multiline to shorten it and
pass the phpcs-strict test.

Change-Id: I9a26d8b562cfa33881cbc6fb7447bdd53e4a71c5
2015-02-07 19:08:33 +00:00
Gergő Tisza
2ea420eed8 Separate startUp() call from main script of mediawiki module
This allows adding new functionality to the startup module in
separate files, without further growing mediawiki.js.

Bug: T85263
Change-Id: I41177b730a7370b4c9ca13d758d9f8493ff5192e
2015-02-03 19:20:06 +00:00
Bartosz Dziewoński
1d96a7e7ec Revert "CategoryView modified to use css columns"
The new feature does not work very well, and the commit
breaks several unrelated things. Sorry, let's try again.

This reverts commit cb5a0f20a4.

Bug: T85496
Change-Id: I018050ec0bf773e6e22e99819fe3cad91171bbd2
2015-01-31 13:04:56 +00:00
Sumit Asthana
cb5a0f20a4 CategoryView modified to use css columns
The categories on Category page were listed using table layout. This layout has
been changed to the responsive css column structure, which is 3 column wide
beyond 768px otherwise shrinks to a single column.

Bug: T85496
Change-Id: I2d3583efd470500c374965a433538845fcfade26
2015-01-30 18:50:10 +05:30
Matthew Flaschen
81c11be76e Allow mobile for jquery.throttle-debounce
This will allow Flow to use core's module:
Ia59e14dc8d7838cfe237b99ee59053529a7235fa

Change-Id: Ia6502da0e10dfa91732b7ac7ac9921dc5cfd218c
2015-01-13 18:29:22 -05:00
Timo Tijhof
ba50b32556 SpecialJavaScriptTest: Add export feature
Add an 'export' subpage to SpecialJavaScriptTest which allows
one to request a self-sufficient JavaScript payload that will
bootstrap a ResourceLoader client and load the test suites.

This is needed for using Karma (which only loads JavaScript,
no full html pages). As such elements from the Skin and OutputPage
will not exist. While all QUnit tests in MediaWiki core and
most extensions I've seen already use #qunit-fixture, this is
now required. This to prevent leakage of elements from one
test to another, but it also prevents tests from depending
on elements provided by the server.

While the Karma setup is still in the pipeline (might land before
this commit loses WIP status), for now this can be tested via
the 'Special:JavaScriptTest/qunit/plain' subpage.

Refactor:
* Use HTTP status code 404 in the response for "noframework".
* Simplify HTML footprint by using <div id="qunit"> instead of
  hardcoding the full structure. This feature was added to QUnit
  since v1.3.0 (Feb 2012), we're using v1.14.0 (Jan 2014).
  QUnit's header is automatically derived from document.title.
* Remove redundant addModules() for 'test.mediawiki.qunit.testrunner'.
  This is already added by default.
* Move allowClickjacking() call so that it applies to other modes
  as well. The exported javascript needs to have wgBreakFrame set
  to false so that test runners can frame it.
* Change mediawiki.special.javaScriptTest to not depend on QUnit.
  It caused QUnit to load on error pages. And in theory the page
  is suited for other frameworks and shouldn't load QUnit this way.

Bug: T74063
Change-Id: I3d4d0df43bb426d9579eb0349b8b5477281a7cfc
2015-01-05 17:59:33 +00:00
jenkins-bot
0ef4c260a7 Merge "Adjust images in packed gallery on window resize" 2015-01-05 15:44:15 +00:00
m4tx
3768d9a620 Adjust images in packed gallery on window resize
Original element sizes are stored in data(), and on window resize,
they are restored, so elements can be justified as on just loaded
page.

Bug: T55664
Change-Id: I286e0a4c8230c11619ca30f8f3b66778de835a33
2015-01-05 15:59:18 +01:00