Commit graph

316 commits

Author SHA1 Message Date
Alex Monk 07ac5df5f6 Add redirect=no to new URL when creating a new page as a redirect
Bug: 65621
Change-Id: I8a59958c51f537976843a564c49aed0328d044fb
2014-06-10 17:50:17 +00:00
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
jrobson fef33d30ec Add use existing reference to toolbar on mobile
Note currently a blank icon appears to the left of this.
This will need to be removed later.

Change-Id: Ia8be1f0e83a2154a48de3c3a47bd8feb0c9a2a2c
2014-06-02 12:12:32 -07: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
Ed Sanders 2122ccb654 Cleanup createSurface methods
No need to set in mw.Target as it now exists in core Target.

Add config param to MobileViewTarget override.

Depends on I555935d2 in core.

Change-Id: I72be9098bd9d59272ca3d7a9a64dca4271ef3ee5
2014-05-30 20:36:26 +00: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
jenkins-bot 1f4a1c9cf2 Merge "Add a hook so GuidedTour, etc. can know when save button is clickable" 2014-05-29 00:09:20 +00:00
kaldari d7bf3fabbe Adding header to top of citation pop-up list in mobile view
Per https://trello.com/c/xCo6uLAZ/9-5-references-dropdown-from-toolbar-styling

Also adding down-arrow indicator next to icon in handler (per Kaity)

Change-Id: I637891232f40ad217b4d3bd62bbecc502bf4cefb
Dependency: Id54100c55b05bdae5858ca72e4fd4418ceff0454
2014-05-27 23:16:25 +00:00
James D. Forrester e2fab2f1eb Dump raster support (unuseful) and assert SVG works before loading
Depends on Idb26804576 in core.

Change-Id: I17481b2d52ab2c33c26ff935b0fd58deb4aa207b
2014-05-27 15:22:26 -07: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
jenkins-bot a8910ca542 Merge "Remove edit tab from the DOM if it's hidden" 2014-05-19 17:51:12 +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 e7787db92d Remove edit tab from the DOM if it's hidden
Fixed bug 64142, works around bug 65292

Bug: 64142
Bug: 65292
Change-Id: I31d8f7b149d657a678ed6ebc56b92305934f34bc
2014-05-17 00:56:38 +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 2ef5468471 mw.ViewPageTarget.init: Remove redundant hasOwn check
Follows-up e3be4a6. Object properties default to undefined, no
need to check existance first. Looks like like an "isset()" in
PHP for preventing E_NOTICE.

Change-Id: I594b23e6caf1e17d6d5d37e6a5fd81152e78b3a6
2014-05-15 16:58:03 +00: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
kaldari e2f29231cb Changing formatting of Cite drop-down for mobile/tablet interface
These changes are to accomodate the design for the mobile/tablet
version of VisualEditor which uses an icon rather than a label
for the drop-down button.

Change-Id: I1086ed4a84ae4061fcc79cc7f587657232c5d5df
2014-05-13 16:49:22 -07: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 7dae6496b3 mw.ViewPageTarget: Get rid of FOUC on edit section brackets
We don't have a FOUC on the appearing of the 'edit' link. That
one is handled quite intelligently:
* Via the stylesheet that is also loaded in noscript mode, its
  (hidden) appearance is already predetermined. So as soon as
  those elements are seen by the browser they style correctly
  for users without JavaScript (display: none).
* This same stylesheet also hides it for users with JavaScript
  but where VE is not available (e.g. due to browser support).
  While ve-not-available is added very early on (before
  document ready), it could in theory cause a short FOUC, but
  that's okay. We simply don't know that VE isn't supported
  until then. We optimise for the common case (JavaScript
  enabled, VE available), while still ensuring that it is
  always hidden in noscript, and is hidden as soon as possible
  when VE turns out not to be available.

For some reason, one small detail (the little bit of whitespace
added inside the brackets), was left out of this and was
implemented by adding the class 'mw-editsection-expanded' to them
from a document ready handler.

* First step, get rid of the script that adds this class and
  use ve-available instead. That means they're styled
  correctly much earlier (we add the class to <html> before
  document ready). This can still cause a brief FOUC, though
  in most cases they're correct from the start.

* Step two, make brackets expand by default for script users,
  and let ve-not-available reset it. This way, like with edit tabs,
  a FOUC will never happen for ve-available. And even for
  ve-not-available, a FOUC is rare since we add it before
  document ready via <html> look-ahead styling.

There was still a brief reflow jump because of negative margins
between two paint events. One was undoing the other at a later
time. These negative margins are a remnant of when we were doing
animations (follows-up I4b9c47fd65a70). They were added to reduce
reflows and content shift, but were now actually causing them.

Removed "padding-right" from mw-editsection, and negative margin
from the brackets.

Also:

* Don't add inline 'style="direction: ltr;"' on every single
  editsection throughout the DOM. This was the only operation we
  were doing unconditionally. While I doubt the need of it in
  general, we can at least allow MediaWiki to do it right, and
  only add the override if needed. This saves quite a few DOM
  operations.

Change-Id: I7a729edc2cd4a66ebc0ad6935ffd02cb9b948bff
2014-05-09 12:20:24 +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
jenkins-bot 43c0341ad3 Merge "Fix tab selection on monobook" 2014-04-30 18:10:53 +00:00