Per TTO on bug 51655, the implementation of confirm() in most browsers is crappy and we
shouldn't use it.
Change-Id: I755085a253c05958e4b50af57b19dab90f2f0fb6
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
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
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
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
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
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
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
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
Don't unselect article tab when loading VE, do unselect when restoring normal view mode.
Bug: 49407
Change-Id: I4b6e5c898a8af2b404151bba46359dc4bfbd739e
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
Unfortunately the best way I've come up with to do this so far is
checking the namespace.
Bug: 53477
Change-Id: Ib2dbe91aff516f2d2408e07ff3f73ea861bfcbe2
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
Previous hack caused unwanted blur events and subsequent range changes.
Depends on I8388318311 in core.
Change-Id: I9163f4d9928887a5eec09f0651ec0a66cc221cd4