Commit graph

242 commits

Author SHA1 Message Date
Krenair c18fb662aa mw.ViewPageTarget: When saving a page as a redirect, update contentSub text
Or vice versa. Per my comment on bug 65621.

Change-Id: Ic51745103446dda8ea8ff901c4f211c30c39e45c
2014-06-10 17:34:52 +00:00
jenkins-bot a733ea2aa3 Merge "Use promises for confirmation dialog instead of done event" 2014-06-05 00:16:21 +00:00
jenkins-bot 05b377193b Merge "On category pages, only replace category description when saving" 2014-06-02 19:22:40 +00:00
Krenair e59b1e7f60 Use promises for confirmation dialog instead of done event
Should be merged at the same time as I70af4f4f
Unbreaks the confirm dialogs (I5f971852)

Change-Id: I7e7a5fcef4e749a3196f675e9f1f8e8bc5c11ca0
2014-05-31 16:25:27 +01:00
Trevor Parscal f65c3c6ef1 [BREAKING CHANGE] Update VE core submodule to master (88fe25f)
Switch to processes for windows (dialogs/inspectors)

This conversion also required the splitting of MWLinkInspector into
MWLinkNodeInspector and MWLinkAnnotationInspector.

New changes:
88fe25f [BREAKING CHANGE] Update OOjs UI to v0.1.0-pre (dd888aba5c)

Change-Id: I662d8985463c9fc881775f70aef87ebeb454a73f
2014-05-30 22:03:45 -07:00
Roan Kattouw d7ca1604d6 Clean up interaction with confirmation dialog
It now only sends a single 'done' event, which we can use .once on

Relies on I4f485d4f in OOjs UI.

New changes:
418cd67 Update OOjs UI to v0.1.0-pre (0f101c6f5d)

Bug: 65571
Change-Id: I19aa65612bf02bed056de292f212d2f5732a8fec
2014-05-30 16:39:07 -07:00
Alex Monk b10d30084b On category pages, only replace category description when saving
Instead of overwriting everything else on the page (e.g. 'Pages in category ...')

See also bug 65349 / Ib6c49286 for file pages with a similar issue

Bug: 64239
Change-Id: I59ff9de5d0463f0f1ae8a18d54ebea5844fb1af5
2014-05-30 14:07:37 +01:00
Alex Monk 837eea324e Fix beta warning appearing for some users that it shouldn't.
Check that the user is anonymous before looking at their cookie to decide whether
to show beta warning dialog.
With the existing code, we would see that the preference is false and then check
that they have no cookie. But being logged in should make the cookie existence
be disregarded.

Fixes Ica9e5a92

Bug: 65821
Change-Id: I84e31323930c404222388bb74e4b4ca8d303e05c
2014-05-29 17:54:51 +01:00
Matthew Flaschen d62c12ce7b Add a hook so GuidedTour, etc. can know when save button is clickable
Change-Id: I9b8ef8a193810c5e7275a61ba1a874d378c8b030
2014-05-25 15:13:51 -04:00
James D. Forrester 0d4aaf5b4c Move Safari 5.x to greylist because dialogs aren't working well
Bug: 65656
Change-Id: Idb1236d199e323381bcd69a50b34d8ba05ecc145
2014-05-23 20:05:01 -07:00
Roan Kattouw 293609e5d8 Unbind confirm dialog handlers after either of the events fires once
We weren't unbinding these handlers at all, and so the 'ok' or 'cancel'
handlers could run multiple times for one button click, and even worse,
you could get in a situation where clicking 'ok' in one confirm dialog
would also run the 'ok' handler for the other one. This happens because
the ConfirmDialog instance is recycled by the WindowSet.

The way the unbinding is done is ugly; we should either consolidate the
'ok' and 'cancel' events so we can use .once(), or come up with some other
way to automatically unbind the handlers.

Bug: 65557
Change-Id: Iabf0c0d0229add09cc775358fc5a4e5ae783db04
2014-05-20 19:11:45 -07:00
jenkins-bot 8c95826338 Merge "Set flags for confirm dialog buttons for switching to source mode" 2014-05-19 21:56:38 +00:00
jenkins-bot 1d0e42a6ce Merge "Set flags for confirm dialog buttons" 2014-05-19 21:14:31 +00:00
jenkins-bot cd3264889c Merge "Use OOUI confirmation dialog rather than native confirm() for switching to source editing" 2014-05-19 20:50:31 +00:00
Roan Kattouw 96809998f2 Set flags for confirm dialog buttons for switching to source mode
"Yes, switch" isn't constructive; make it primary instead.
"No, cancel" isn't destructive; make it neutral (no flags) instead.

Change-Id: I841cbed4a81eaed679a8c7da89942c6b030a1217
2014-05-19 13:49:52 -07:00
Roan Kattouw 5b93980b68 Set flags for confirm dialog buttons
"Discard edits" isn't constructive, and "Continue editing" isn't destructive.
Instead, mark "Discard edits" as destructive, and make the continue
button neutral (no flags).

Change-Id: I7648555ad47be698e75b5019d7738b0afb8611aa
2014-05-19 13:46:36 -07:00
jenkins-bot fefd3a5d72 Merge "Whitelist Opera 15+" 2014-05-19 19:42:59 +00:00
Krenair a5dd438725 Use OOUI confirmation dialog rather than native confirm() for switching to source editing
Per TTO on bug 51655, the implementation of confirm() in most browsers is crappy and we
shouldn't use it.

Change-Id: I755085a253c05958e4b50af57b19dab90f2f0fb6
2014-05-17 18:24:04 +01:00
Krenair eb7b727a53 On file pages, only replace the (local) image description when saving
Instead of overwriting everything else on the page (including the thumbnail!)

Bug: 65349
Change-Id: Ib6c4928646d6d278e29fbe31ae1902b0dc3b146a
2014-05-17 17:53:15 +01:00
Krenair 411f0a7729 Set up edit notices for things like unknown browsers on each activation
The list is cleared on cancel

Bug: 65236
Change-Id: I96a1d95535ec0569e3e25adaa64625fc3a0c4b97
2014-05-15 21:01:30 +01:00
Timo Tijhof 25d00cc777 build: Update jscs and jshint
jshint:
* Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0).
* Remove coding style options covered by jscs.
* Enable new option "freeze" (prohibits changing native prototypes).
  http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze
* Re-order to match http://www.jshint.com/docs/options/

jscs:
* Update to grunt-jscs-checker v0.4.4 (jscs v1.4.5).
* Format .jscsrc file in a more spacious way and order the
  properties less arbitrarily (using the jscs's readme order).
* Enforce more details of our coding style
* Get rid of the unsable "sticky" operator rules which have been
  deprecated in favour of using other rules instead that are able
  to enforce this more accurately.
  - disallowLeftStickedOperators: Remove deprecated rule.
    * Ternary covered by requireSpacesInConditionalExpression.
    * Rest covered by requireSpace{Before,After}BinaryOperators.

  - requireLeftStickedOperators: Remove deprecated rule.
     * Comma covered by disallowSpaceBeforeBinaryOperators.

  - requireRightStickedOperators: Remove deprecated rule.
    * Logical not (!) covered by disallowSpaceAfterPrefixUnaryOperators.

See also If46b94ce1, Ib731f11b1 and I0b0cadbc5 in oojs/core.

Also:
* Update grunt-contrib-watch to latest upstream version.
  Change log at https://github.com/gruntjs/grunt-contrib-watch/blob/v0.6.1/CHANGELOG#L1-L17

Change-Id: I6c5a34afea8b05a3dca617897c192594df06ca90
2014-05-15 16:52:34 +00:00
jenkins-bot f0d19359a6 Merge "Fire hook when VE activates/deactivates" 2014-05-14 23:29:34 +00:00
Krenair 28fb8c8d4c Fire hook when VE activates/deactivates
Bug: 65320
Change-Id: I3658d6cbe6dd81d8d143fce9659f2c8c4e25ba07
2014-05-15 00:26:36 +01:00
jenkins-bot fb4b6f0b0d Merge "Move shortcut keys help from "Page options" dropdown to "Help" popup" 2014-05-14 23:16:48 +00:00
jenkins-bot 0680c02aa7 Merge "Hide PageTriage curation toolbar while VE is open" 2014-05-14 23:04:03 +00:00
Krenair 204554a567 Swap from using native confirm() to using an OOUI dialog when cancelling
Relies on:
* I292fb34d in OOjs UI to add the confirmation dialog
** I67329820 in MediaWiki core to use the messages added in OOjs UI
** I38f5bb63 in VisualEditor core to register the confirmation dialog

Bug: 50955
Change-Id: I98f9a03d780556b360b57c018c05a27cc1b3862e
2014-05-14 23:00:35 +00:00
Krenair ddd43b8227 Hide PageTriage curation toolbar while VE is open
Bug: 56731
Change-Id: Iee842d4444ead00587dbfb21f93b65bdec728405
2014-05-14 23:19:39 +01:00
Bartosz Dziewoński 885bf01b7e Whitelist Opera 15+
It's using the Blink engine like Chrome.

Change-Id: Ia1c145ebdac0fb099051d32785a7929c19f5d7d0
2014-05-13 20:57:23 +02:00
Bartosz Dziewoński d8de718a5d Move shortcut keys help from "Page options" dropdown to "Help" popup
Obviously it doesn't belong there. I think I'm getting the hang of this. :D

Change-Id: I5933e32bb8a803d004c2e33d55d7900d1b18a44e
2014-05-12 15:28:30 +00:00
James D. Forrester 80fc16a57e Follow-up Ica9e5a9284: Actually make visualeditor-hidebetawelcome work
Three 'minor' points:

* You have to declare even hidden preferences. Whoops.
* There's no such thing as an "optionsToken", use "editToken".
* You need to POST action=options API calls.

Ahem.

Change-Id: I9c4358107af7bcfca157bd014de49882914e990c
2014-05-10 20:02:40 +00:00
James D. Forrester fab7aacc12 mw.ViewPageTarget: Hide the welcome dialog via a preference if possible
For logged-in users, we can a preference instead of a cookie. This way it is
also preserved between browsers and when cookies are cleared.

Keep using cookies for logged-out users, except if the beta welcome dialog
has been suppressed using the one-off GET parameter 'vehidebetadialog'.

Bug: 55551
Change-Id: Ica9e5a92841fec003ce4a21d740a9bc6ff3da9c7
2014-05-10 09:46:45 +02:00
Timo Tijhof ad2fdfb66b ve.init.mw.ViewPageTarget: Actually animate the toolbar during setup
There was a slideDown() call, but this didn't do anything since
toolbars are visible and in the DOM by default.

As a temporary hack, hide it synchronously after creation and
then do the slideDown still.

This could ever so briefly cause a flash, though that didn't
happen in my testing.

This makes the experience smoother when we initialise the surface.
In particular the moment where we swap #bodyContent for our Surface
(which should look visually almost identical), before this change
it was still a bit of a flash since the Surface version has a
toolbar on top, and thus instead of swapping smoothly, we hide
content and show a similar piece of content that has an incompatible
offset from the top.

Bug: 64751
Change-Id: Id94974ba71fd887ce494d7b2b16ec62d43b18575
2014-05-06 02:43:37 +00:00
Juliusz Gonera 72fdab7a0d Enable references on mobile
Further styling and UI improvements in upcoming patches.

Change-Id: I8f93f2a2a6a6eb0c3a9953c7c479f92872d5b621
2014-05-02 14:49:19 -07:00
jenkins-bot 9f3f95d095 Merge "ve.init.mw.ViewPageTarget: Hide #contentSub in addition to #toc when muted" 2014-05-02 18:03:37 +00:00
Timo Tijhof 0b96e0dc3a ve.init.mw.ViewPageTarget: Hide #contentSub in addition to #toc when muted
Yet a another visual shift eliminated. Getting closer..

Bug: 64751
Change-Id: I9ae7afc439648e62712f6dedb7cecc07a653675a
2014-05-02 18:52:02 +02:00
Krenair 12109027a9 Switch to use MediaWiki's built-in messages for post-edit notifications
Bug: 52871
Change-Id: Ibb56fc298c2116c071bf4ed910d175282dcdb741
2014-05-01 21:51:32 +01:00
jenkins-bot 48d025aead Merge "Support QuestyCaptcha and (kind of) MathCaptcha" 2014-04-30 21:34:04 +00:00
Timo Tijhof 4a5bede30e mw.ViewPageTarget: Simplify tab transform/restore logic
Follows-up I4b6e5c898a8af2b40415.

Change-Id: I5fc0f554d1770d3c8e5b961e74bdfb5741324910
2014-04-30 21:05:33 +02:00
Krenair 032d9d53ec Fix tab selection on monobook
Don't unselect article tab when loading VE, do unselect when restoring normal view mode.

Bug: 49407
Change-Id: I4b6e5c898a8af2b404151bba46359dc4bfbd739e
2014-04-28 16:42:01 +01:00
Krenair 94b5c8dfa5 Support QuestyCaptcha and (kind of) MathCaptcha
MathCaptcha just extends SimpleCaptcha, so its output is fine to show as
text. Doing that because I'm not sure how to render TeX and this is a
reasonable fallback

Also tidy up the order of some message entries in my last commit.

Bug: 64328
Change-Id: I98312f61471667e7c4dcf715295f85642c31a688
2014-04-24 21:45:20 +01:00
jenkins-bot 2a675d0ce8 Merge "Add support for SimpleCaptcha" 2014-04-24 01:09:29 +00:00
Krenair 62e07f8008 Add support for SimpleCaptcha
Bug: 64328
Change-Id: I04dd82e72184dcef6a660c0886b16a1086ed0b26
2014-04-23 23:30:52 +01:00
Krenair df38c8b55e Hide some tools when VE is open
Bug: 57940
Change-Id: I2f586e8c73affe1b7f14c40ba892774e784f09c8
2014-04-22 23:47:54 +01:00
jenkins-bot a1c4df7980 Merge "Update wgRevisionId when we change wgCurRevisionId" 2014-04-21 19:06:44 +00:00
Krenair 167a2f341e Update wgRevisionId when we change wgCurRevisionId
Bug: 56532
Change-Id: Ibb5a92d66a7a60ef516d3ef385b4473919a6ac63
2014-04-19 17:59:28 +01:00
Krenair b6f1793bf8 Use new OOUI pending feature rather than loading bar thing on save dialog
See I5c45cc6 for the oojs-ui change and I2fa71a1d for a similar commit

Change-Id: I77e3274a196bc13ae19a9520197f4a8b624fd528
2014-04-18 21:57:14 +01:00
Alex Monk ca547a7f7c Check useeditwarning preference before showing warning when browsing away from editor
Bug: 51057
Change-Id: Ic4b02372e6e08d3a0d36457457a2e2bbfbaa797d
2014-04-17 15:57:10 +01:00
Roan Kattouw 2262073c9c Update VE core submodule to master (4366f20)
Use new dm.Surface method for checking undo history state
(hasPastState -> hasBeenModified).

New changes:
38776df [BREAKING CHANGE] Refactor history state methods to better suit uses
3412b41 Localisation updates from https://translatewiki.net.
0c5238c Add system to dm.Surface for staging changes
8f0077c Only hide popups on selection change
4575f82 Fix initial selection when focusing in Firefox
debfd4e Document focus/blur cleanup

Change-Id: Ic66c96a4f64ad82a01a84535ca8cd19332065b37
2014-04-16 15:57:28 -07:00
jenkins-bot 266bc709f6 Merge "Always replace state with VE tag when loading" 2014-04-16 18:50:09 +00:00
Krenair e9153fdccf Always replace state with VE tag when loading
Instead of just when venotify is used. To stop the back button breaking.

Bug: 63739
Change-Id: I637818f34a9015076c85c6daccb337503ad2499d
2014-04-16 18:02:10 +01:00