Commit graph

662 commits

Author SHA1 Message Date
Alex Monk 14b23d7ba4 Make sure mediawiki.notification is loaded -before- calling ViewPageTarget#checkForWikitextWarning
That function needs to return the result immediately, not wait for module loading (via mw.notify).
This was breaking us being able to keep track of what wikitextWarning object was in use (but only
the first time we used the module), and therefore fail to close the warning when the wikitext
disappeared.

Bug: 70168
Change-Id: I0f1427423a5fe82ec8e70e2f0462a3044ca7ace8
2014-08-29 21:18:24 +01:00
jenkins-bot 3286115c21 Merge "Return undefined, not null from onbeforeunload" 2014-08-28 23:11:30 +00:00
Roan Kattouw f0cadeca42 Return undefined, not null from onbeforeunload
IE doesn't accept null as a "do nothing" value, only undefined.
If you return null, it'll show a popup with the text "null".

Change-Id: I984a7ded483c4c178cbca2a9af9abd895e6ded56
2014-08-28 14:38:49 -07:00
jenkins-bot 7492cc7949 Merge "Pick up 'summary' parameter from URL to use as initial edit summary" 2014-08-28 21:29:07 +00:00
Alex Monk 2748366a8e Pick up 'summary' parameter from URL to use as initial edit summary
To match the wikitext editor

Bug: 69501
Change-Id: I3cfc269aa344d89cc30af29699aca70eda5565e2
2014-08-28 02:56:14 +01:00
Roan Kattouw 03c8ad7744 Fix various bugs in our Monobook stylesheet
* Toolbar was too tall
** The actions toolbar is nested in the main toolbar, so the rule
   increasing the font size by 25% for toolbars applied to it twice
* Font size in link suggestions was too big
** Remove 25% font size increase from overlays
** Add it back on the context (otherwise it's too small)
** But only on the main surface's context (otherwise contexts in dialogs are too big)
* Make highlights and context appear below, not above, toolbar menus
** z-index: 4 was too high for the overlay, because MenuToolGroup also has 4
** But the default of z-index: 1 is too low because it puts dialogs behind the surface
** z-index: 2 seems to work

Bug: 69949
Change-Id: I19da270abcdbe526ff213f0eb7d0859b48276930
2014-08-27 23:28:20 +00:00
jenkins-bot aa95f70c4e Merge "Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up" 2014-08-25 18:00:07 +00:00
jenkins-bot 8462907ae3 Merge "Do not focus CE on mobile when editor opens" 2014-08-22 22:50:59 +00:00
Ed Sanders 9a1e3852fc Update VE core submodule to master (c231b71)
New changes:
c9f1027 Remove broken ve.isMsie() function
6571da1 Fix case on language annotation CSS class
c231b71 Fix case in all annotation classes

Local changes:
Fix case in all annotation classes

Change-Id: Iba2596cde52d8f8be27e0257893ef8ec77798ae8
2014-08-22 14:27:14 -07:00
jenkins-bot 67877be2a2 Merge "Blacklist plain block images from MW paste" 2014-08-22 21:07:17 +00:00
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
Roan Kattouw c5281a4e4d Don't apply a background to language annotations in IE
Because doing that makes the text disappear if dir="rtl" is also set.

Bonus: explain why we're changing which nodes to set highlight
opacities on for IE.

Change-Id: I061e372b26a7b523fc1f307ad9897b884803fdf4
2014-08-22 13:34:45 -07:00
Ed Sanders 57cd852543 Blacklist plain block images from MW paste
Same as inline images, only MW images are allowed.

Change-Id: I0272ebb44c044cd6bcdb85cd5e11d3b50530cc73
2014-08-22 21:31:29 +01:00
Juliusz Gonera 7864de472e Do not focus CE on mobile when editor opens
Extract the part of mw.Target#restoreEditSection responsible for moving
cursor to a separate method and move the cursor only on desktop.

Bug: 68832
Change-Id: I4ffc54ced64ce9e52d0cbcffb2fb4d082239098c
2014-08-22 12:37:00 -07:00
Roan Kattouw 2cf3c8bcd8 Update VE core submodule to master (f1fd9a8)
New changes:
eaa4528 Queue up annotation changes to make operations safer
09fc01f [BREAKING CHANGE] Remove span-wrapping of images
b59f85f Followup b141a7d2: make inspectors not close immediately in IE
1088cac Define kbd font-family explicity in case environment overrides
137add3 Fix embeddable desktop context popups
a2f0f80 Rename getRelativeOffset to getBoundingRect and use in getSelectionRect
fc09114 Fallback to node position when getting selection rectangle
1506099 Change comment to meta in whitespace test case to actually test whitespace handling
7dc4854 Remove global overlay classes when destroying MobileSurface
6e6b08a Update OOjs UI to v0.1.0-pre (d6008381aa)
e0a8089 Destroy WindowManagers in Context and Surface destructors
8c71904 Never embed the context when an inspector is present
163bd50 [BREAKING CHANGE] Rename 'image' to 'inlineImage'
5dd8bad Make focusables behave correctly when $element != $focusable
ba6fba7 Basic block image (figure/figcaption) support

Update changes:
* ImageNode was renamed to InlineImageNode in VE core
* BlockImageNode and BlockImageCaptionNode were added in VE core
* ve.ce.ImageNode.css was removed in VE core

Change-Id: Ide31b47448a4b4d6388f84a7a6ee9d471c1331f6
2014-08-22 11:51:50 -07:00
jenkins-bot bea941d213 Merge "Followup 67f304a: use .openWindow(), not .open(), to open save dialog" 2014-08-21 19:06:16 +00:00
Roan Kattouw e33bcb02cc Followup 67f304a: use .openWindow(), not .open(), to open save dialog
Calling .open() directly doesn't work any more.

Change-Id: I986ad063f7b83992a8f96969ccb5f7e08fb9f386
2014-08-21 12:00:40 -07:00
Bartosz Dziewoński 8bb55d683b mw.ViewPageTarget: Be more careful when updating page title
If there is more than one span in #firstHeading, we only want to
update the first one.

This will still break if something inserts elements *before* the title
span, but fixing that would take more thought (we probably should
rebuild the entire heading element and fire 'wikipage.content' on it).

Bug: 69857
Change-Id: Id78b9b8275a57c9b3f3f1dbd0aaca356f94d0f03
2014-08-21 18:36:01 +02:00
Sam Smith 33ef289190 Reinstate the ve-ui-toolbar-saveButton class
The class provided a minimal coupling to the firsteditve guided tour,
which used it to attach a guider to the "Save page" button.

The class was removed in I30dc7020121f0dd6907b61ef674a7cb14eb00652.

Bug: 69784
Change-Id: I81fdc4f2fa41c86a6481cf478c154b5d6c99d41d
2014-08-20 17:39:40 +01:00
jenkins-bot 90110f53b1 Merge "Provide mw-redirect and mw-disambig classes for links on the surface" 2014-08-19 18:00:07 +00:00
Roan Kattouw 924e3c026d Update VE core submodule to master (03975f8)
New changes:
a28e085 Restore QUnit web UI
8e2477c [BREAKING CHANGE] Move modules to src and tests and i18n, UnicodeJS to lib
26adfaf Fix path prefix for tests/index.html so it actually runs
d87dab5 Work around getSystemPlatform() race condition
6682ebc Make getParsedMessage() test actually test getParsedMessage()

Local changes:
* Update paths from lib/ve/modules/ve to lib/ve/src or lib/ve/tests
* Update paths from lib/ve/modules/unicodejs to lib/ve/lib/unicodesjs
* Rename unicodejs.wordbreak module to unicodejs
* Update code for getSystemPlatform() and isInternetExplorer()
  being made static

Change-Id: I7bb3bb74addfd3fbb64795c5ac3ff791b8874a4f
2014-08-15 14:42:08 -07:00
Bartosz Dziewoński 066283dde7 Provide mw-redirect and mw-disambig classes for links on the surface
To mimic PHP parser, or, in the case of mw-disambig, what I would want
the PHP parser to be.

Change-Id: I70dc426a3b87daef27816d6d86130c39f30ba0f4
2014-08-14 16:56:07 +00:00
Ed Sanders 7c923c2044 Remove unused modules URL
Change-Id: I1e66866388ee862bc122faacebbd5f3883bd90f8
2014-08-12 23:54:30 +00:00
Inez Korczyński bd716eea55 Fix ve.init.mw.TargetEvents.js to subscribe to events that actually exist and are emitted
Change-Id: I63ea39d0628d33e5d1ced4650b1a166003e362d3
2014-07-31 23:23:00 +00:00
Amir E. Aharoni f4d6892fe4 Bidi-isolate the version in the help panel
Bug: 68688
Change-Id: Iaad230d64d923713c273bbbe2fefd94681e13a2d
2014-07-30 10:36:22 -07:00
jenkins-bot ccdc215a98 Merge "Don't show PostEdit message if we made a null edit" 2014-07-30 00:45:08 +00:00
Alex Monk 1468ab8277 Don't show PostEdit message if we made a null edit
Bug: 51243
Change-Id: I63b2405c854e2953976dc8ca7a5a136308a7dcf0
2014-07-29 17:42:57 -07:00
Ed Sanders c9c10cf5b8 Update VE core submodule to master (0709218)
New changes:
20c220a Remove unused CSS classes
9bdcc65 Comment icon positioning
e50e790 [BREAKING CHANGE] Fix ve.ui.Overlay classes
1ac4927 ve.ce.TextNode: Use getChar() helper
29fd0f8 ve.ce.TextNode: Simplify #getAnnotatedHtml logic
18336eb ve.ce.ResizableNode: Run find() once instead of 4x in showHandles()
febf125 Use getDescription for title attribute
ab3cb6c Localisation updates from https://translatewiki.net.

Local changes:
* Rename overlay class rules

Change-Id: Ia90b6afbd4abdf3267f4ccaac0b2a7d4101ccc7b
2014-07-29 16:31:42 -07:00
jenkins-bot 3783d6e328 Merge "Remove unused CSS classes" 2014-07-29 23:30:22 +00:00
Juliusz Gonera a43a87226d Remove timeout in scrolling to heading on mobile
No longer necessary after 859d8525.

Change-Id: I5b92a8c6acd3bbb8c563184fb2dda56e894a2c66
2014-07-29 15:07:36 -07:00
Roan Kattouw 859d85257b Delay scrollToHeading() until after the selection is rerendered
Otherwise either the focusing of the surface or the resetting
of the selection seems to cause the viewport to scroll back
up on mobile.

Change-Id: Ie3b104e04800d2753f99739f877c76e334965fc1
2014-07-29 14:58:24 -07:00
Juliusz Gonera 3224ceb41d Delay scrolling to a heading more on mobile
200ms are not enough for the surface to be rendered on iPad (especially
on older models).

Change-Id: I518312b3a038f2e5c9cc2022c51fc4e1e63f599d
2014-07-28 14:54:12 -07:00
Ed Sanders 840c871a97 Remove unused CSS classes
By searching for CSS classes that don't exist in the code.

In some cases the classes were used but had been renamed.

Change-Id: I76442a632c18d2133cdf78c4555da149c0a7888c
2014-07-28 19:43:35 +01:00
jenkins-bot e49138a8c6 Merge "Actually clear diff viewer after closing save dialog and changing document" 2014-07-26 00:11:16 +00:00
jenkins-bot 4d58b106f8 Merge "Attach mobile surface to the toolbar" 2014-07-25 23:24:21 +00:00
Roan Kattouw 1042733ee2 Attach mobile surface to the toolbar
Trevor promised to do this in Iafe64a6f but never did.

This needs styling changes to look right. It also means that
VE mobile standalone doesn't have a context at all right now,
which is horrible, but at least this makes MW mostly work.

Bug: 68546
Change-Id: Id8cc4b07905f777f667f36cbcc65e821847142d5
2014-07-25 23:10:15 +00:00
Roan Kattouw a6d94256d8 Actually clear diff viewer after closing save dialog and changing document
The window refactor removed the 'teardown' event from windows,
but ViewPageTarget was still listening to this event on the save dialog.
Instead, use the opening promise to be notified when the save dialog
closes and call onSaveDialogClose() at that time.

Change-Id: I31a9a359eb14a56b214a1240db08632bda6bc8b9
2014-07-25 13:14:07 -07:00
Alex Monk 14753500a6 Don't overwrite #contentSub just to try to get the correct subtitle for redirects
Because this breaks other subtitles such as subpage breadcrumbs
Instead, deal with the #redirectsub (added in I780c965) directly.

Bug: 68432
Change-Id: I646868916a4480404f6d466fd89f84798d0e9df5
2014-07-25 18:57:08 +01:00
Juliusz Gonera 8563668978 Allow for a custom mechanism for scrolling to a section
When I05f11246ca90a1ce3f741fd93194a827528cd597 gets merged, we will need
this to be able to scroll to a section on iOS (where the content will be
scrolled within a div, not as a whole page).

Change-Id: I6e47edfa8c3a3a46fd7a4f11e4a54955f3694b9b
2014-07-23 17:34:39 -07:00
Roan Kattouw 35e611369b Followup 3dd1a996: don't try to switch to source mode when surface is torn down
If you saved a change, then clicked Edit source, you'd get a JS error.

Change-Id: I589f9edb354afcd47d5c42ef9a6c73d49218b044
2014-07-22 17:29:31 -07:00
Alex Monk de2d5bd31b Don't confirm if there's no changes when switching to edit source mode through the page options menu
Also use a simpler way to discard changes

Bug: 68229
Change-Id: I1efc40f14fca0f743df699a4f3aadd4ba3a249e2
2014-07-23 00:23:53 +00:00
jenkins-bot f7c7efbad7 Merge "test: Move mw into the global list of globals for VE-MW" 2014-07-23 00:02:22 +00:00
James D. Forrester a9356992d8 Put "re-use reference" in the toolbar "Cite" menu, and give it an icon
Bug: 68201
Change-Id: I9fc61e498748fb086c3e506959bee2438b8cbea6
2014-07-22 13:10:06 -07:00
James D. Forrester c2f37a0450 test: Move mw into the global list of globals for VE-MW
Silly to have 38 MW-specific files needing to declare that they're using mw.

Change-Id: I97891ed922fe0c37d8c96425a4d23bd15098438b
2014-07-19 17:42:45 +00:00
James D. Forrester cc089d6bd3 Scrap the cancel button from the toolbar
It's unnecessary, big and ugly, way too close to an actually useful button, and
adds oodles of complexity to the mire that is VPT without significant user benefit
whilst taking up an unjustifiably huge amount of the already-over-burdened space.
This means that the minimum browser width for English on default Vector to show
the toolbar correctly is now 945px, down from 1029px.

Bonuses: fix MWCancelConfirmDialog's cancel button to be destructive (it is) and
remove a now-recently-fixed comment asking for the save button to be styled using
a generic class (provided by the constructive flag).

Change-Id: I30dc7020121f0dd6907b61ef674a7cb14eb00652
2014-07-18 16:38:17 -07:00
jenkins-bot 20205b1e99 Merge "Set title of page to use if discarding changes when changing to the wikitext editor" 2014-07-17 00:08:58 +00:00
Trevor Parscal 49ffef5a0f Close the save dialog on teardown only, not on save
Closing a dialog with specific data means closing it again with
potentially different data, while the dialog is already closing, means
someone wins and someone looses. Silently failing in this case is bad,
because if the first close call was a cancel, producing no side effects,
but the second close call would have produced some side effect, the side
effect would never occur.

The problem here really was that the save dialog needs to be closed
before we can destroy the surface so we can uphold the assumption that
hold and teardown processes are operating on an attached DOM.

The solution is to automatically close the save dialog on teardown,
rather than on save. Since save triggers teardown, this has and identical
user experience.

Bug: 68048
Change-Id: I669448739f168737d4eddd6496189a819ce894b1
2014-07-16 23:51:58 +00:00
James D. Forrester 040ef014bd Update VE core submodule to master (8bb3848)
New changes:
8bb3848 Bring back global/local specific CSS classes

Local changes:
Use global overlay class to target the z-index hack for the Vector skin.

Bug: 68066
Change-Id: If1b6ba0c9035ff32b61d34ee779a95554883a2ec
2014-07-16 23:48:07 +00:00
Trevor Parscal 1be1c469de Enable mwreference, mwtransclusion modules on all targets including mobile
Bug: 67701
Change-Id: Icdf2a208c9efa7abd897d48aed02bf923328d53c
2014-07-16 22:40:00 +00:00
Alex Monk c1c80f6985 Set title of page to use if discarding changes when changing to the wikitext editor
Turns out it's a bad idea to do most testing on the default page

Bug: 68121
Change-Id: Ie9729dba4e8ca690625a6553703e9ff30cb5106e
2014-07-16 23:15:26 +01:00
jenkins-bot de9491ea0e Merge "Make a message dialog for cancelling VE" 2014-07-16 20:45:28 +00:00
Alex Monk b9ad2fb406 Don't allow document save if we're already tearing down the surface
Otherwise you get "Uncaught TypeError: Cannot read property 'messages' of null"
if you press the save button late enough in the saving process. The bug refers
to a different error which I have not been able to reproduce.

Bug: 68073
Change-Id: Ia8fa325f1450329b6e0e4ee9af5302aa4857d637
2014-07-16 17:52:00 +01:00
Alex Monk 54a1a85e6e Make a message dialog for cancelling VE
Confirm dialog was replaced in refactor, so until this is merged the 'Cancel'
button is broken.

Bug: 68068
Change-Id: I77d1c82bf0d68013eef361174a134860a197cd44
2014-07-16 00:07:24 +01:00
James D. Forrester fbdff76263 Update VE core submodule to master (f2277ea)
New changes:
56de6f5 Localisation updates from https://translatewiki.net.
f8bda64 Widgetise demo menu
6ac48d8 Localisation updates from https://translatewiki.net.
365e131 builderloader: Omit value for boolean "disabled" attribute per HTML5
706e4b3 Prevent double counting of DM nodes in getNodeAndOffset
b141a7d Update OOjs UI to v0.1.0-pre (d2451ac748)
c5b3921 Localisation updates from https://translatewiki.net.
1606983 Update reference to ConfirmationDialog to use MessageDialog

Deletions:
* Styles for ve.ui.MWBetaWelcomeDialog - not needed anymore because
  OO.ui.MessageDialog provides them
* Styles for ve.ui.MWGalleryInspector - not needed anymore because
  ve.ui.MWExtensionInspector provides part of them and the rest are being
  replaced by programatic sizing

Modifications:
* ve.ui.MWLinkTargetInputWidget - Added support for validation and href
  getter
* Split message between tool and dialog title for ve.ui.MWEditModeTool
  and ve.ui.MWWikitextSwitchConfirmDialog

General changes:
* Updated inheritance.
* Added manager param to constructors of dialogs and inspectors.
* Updated use of show/hide with toggle.
* Added meaningful descriptions of dialog and inspector classes.
* Configured dialog and inspector sizes statically.
* Configured dialog action buttons statically.
* Interfaced with OO.ui.ActionSet to control action buttons.
* Moved applyChanges code into getActionProcess methods.
* Always using .next in setup/ready process getters and .first in
  hold/teardown process getters.

Change-Id: Ia74732e6e32c0808eee021f0a26225b9e6c3f971
2014-07-14 23:24:45 +00:00
jenkins-bot 6d8e900d57 Merge "Replace ve.bind( fn, ... ) calls with fn.bind( ... )" 2014-07-10 14:11:43 +00:00
Alex Monk 5054ee94f8 mw.ViewPageTarget: Remove vesection from URL on save/cancel
Bug: 66237
Change-Id: I1cc34176322cb768d1cb9711407ecdf91b3ca767
2014-07-10 14:02:44 +00:00
Alex Monk 51142e8b11 Replace ve.bind( fn, ... ) calls with fn.bind( ... )
Bug: 62762
Change-Id: I1a7fc7f27fa737d17f5c6b3d084ef4a35e4bebc0
2014-07-10 13:54:07 +00:00
Roan Kattouw a0989d15d4 Add stylesheet with IE hacks and only load it with IE
The stylesheet contains workarounds for highlights on references
being drawn in the wrong place, resize handles appearing on headings,
and highlights being opaque.

Change-Id: I78da4d6a751429cd160b693b4a524fc7ea1ef76f
2014-07-03 18:20:30 -07:00
Roan Kattouw b86d481871 Update VE core submodule to master (a887989)
Also implement isInternetExplorer() in mw.Platform using jquery.client.

New changes:
9b2102f Skip over nested handlesOwnChildren nodes in getRelativeOffset
30a9835 Localisation updates from https://translatewiki.net.
5d142a0 Restrict get relative offset to movements of +/-1
7a2c984 Check that the surface has a selection after focus
851a63d Remove jquery.client
8786e53 Add evil detection functionality for IE
96f19ad Disable triple-click handling in IE
d746d42 Revert "Restrict get relative offset to movements of +/-1"
859d578 Revert "Skip over nested handlesOwnChildren nodes in getRelativeOffset"

Change-Id: Ib2e6568a862336e2516e4c519468218ec2a84834
2014-07-03 17:59:37 -07:00
jenkins-bot 538992a24c Merge "Merge Media Edit and Media Insert dialogs" 2014-07-02 02:53:05 +00:00
Moriel Schottlender 6bd9fde5c5 Merge Media Edit and Media Insert dialogs
Merge the media edit and media insert dialogs. Allow editing
of media properties when inserting a new image, and also
allow the user to replace the image on edit.

Bug: 67170
Change-Id: I35bd95503565dbf95090ee8110284db5a8fbba83
2014-07-01 17:30:51 -07:00
Roan Kattouw da5eacbe2e Split mwtransclusion and mwreference into core and non-core modules
Mobile doesn't want the tool+dialog functionality for those yet,
so move them to a separate module and only load the bare bones
for mobile. We did the same with mwimage/mwimage.core.

Change-Id: I9185ce62f458b3de08cbd28f2a41370d2301de9d
2014-07-01 16:50:57 -07:00
jenkins-bot 01348dc05f Merge "Update displaytitle on save (try #3)" 2014-07-01 21:18:54 +00:00
jenkins-bot 28fc207aeb Merge "Get rid of ve.init.mw.ViewPageTarget-vector-hd.css and use a media query instead" 2014-07-01 21:13:49 +00:00
jenkins-bot 5ed0dae7a9 Merge "After showing missing edit summary error, mark the dialog as not pending anymore" 2014-07-01 16:28:58 +00:00
jenkins-bot c1b7da7533 Merge "Move reference tool into Cite menu, and language into styling" 2014-07-01 16:17:39 +00:00
Alex Monk 84270db5e6 After showing missing edit summary error, mark the dialog as not pending anymore
Reenables edit, etc.

Bug: 67345
Change-Id: Ic7029209b2ed84a61e2312067c513a9b4a0e2877
2014-07-01 15:53:53 +01:00
James D. Forrester f9e74d3c62 Move reference tool into Cite menu, and language into styling
This puts reference insertion and editing tools into the same menu (yay) and
applying-annotations-to-text tools into the same menu, too.

As part of this, I'm re-labelling the generic reference tool to "Basic" (now
that it has some context for users).

Change-Id: I8b8196d3c2e40237d61c8491ab30e737b82597d6
2014-06-30 19:24:15 -07:00
Alex Monk 3dd1a99660 Don't offer to retain changes when switching to wikitext editor by tab if no changes have been made
Bug: 57462
Change-Id: Ifa978447a5b6215ebdafdfd4fa8056a1ee11aea5
2014-07-01 01:01:39 +00:00
jenkins-bot caa2298198 Merge "Compress HTML data with deflate before POSTing" 2014-06-30 23:43:16 +00:00
jenkins-bot 87663c99e0 Merge "Offer to retain changes when switching to the wikitext editor" 2014-06-30 23:40:30 +00:00
James D. Forrester e1b9f9c745 Get rid of ve.init.mw.ViewPageTarget-vector-hd.css and use a media query instead
This will mean it will be more obvious if making a change to the SD or HD version
that an equivalent adjustment may be needed.

Change-Id: I6129220839ef55017fe69d723524ecdf6cf0234f
2014-06-28 15:03:59 -07:00
Ed Sanders 4c8da39618 Remove isMobileDevice property
1. It's a bad check, it tells you if the device supports mobile
events, not if it's mobile (e.g. a touch screen laptop has such events)
2. It's no longer used

Change-Id: Ic46bc5b8fdc33b7c2b2bd67e75d65a5e564dbeca
2014-06-28 22:56:24 +01:00
Ed Sanders 79a34aa844 Fix document margin trick for vector-sd
Existing styles were based on 1.5em padding which is
only true in vector-hd. vector-sd uses 1em.

Change-Id: I2d73aa55a01f4524ba1d9352b1882632e92ebaa3
2014-06-28 17:47:46 +01:00
Alex Monk 237d68f6db Offer to retain changes when switching to the wikitext editor
Bug: 57462
Change-Id: I4e57f9dff4479531e7c715966bdad2cabb97ca8c
2014-06-27 22:31:07 +01:00
Timo Tijhof 19afd65a08 build: Update jscs and use new "wikimedia" preset
Our coding style has been upstreamed and first released
in node-jscs v1.5.0 (grunt-jscs-checker v0.6.0).

Change-Id: Ifc0cfc7177946b9d11407f60e38b0177883724c5
2014-06-26 17:00:15 +00:00
jenkins-bot 6c9a99756a Merge "Add missing TableCell CSS file and Vector-specific rule" 2014-06-25 18:14:07 +00:00
Ed Sanders e4e9405452 Don't try to change offset for vesection=0
Bug: 66674
Change-Id: I33db33af38b554c9bf3c13b14ce67bcac2e70573
2014-06-25 16:38:56 +01:00
Ed Sanders f2fe87f1b3 Add missing TableCell CSS file and Vector-specific rule
Bug: 65416
Change-Id: I202893322866cf42b8fbe950224b6be08c35c4d6
2014-06-25 15:08:30 +01:00
Ed Sanders 288da5b704 Compress HTML data with deflate before POSTing
Bug: 66914
Change-Id: I7b0a9cfd4d4c10986769a868884688ffca833cb6
2014-06-24 17:39:03 +01:00
Alex Monk dc6840c3a0 Update displaytitle on save (try #3)
Parse the wikitext we already have.

This is mostly a revert of commit f84b880a54.

Bug: 50341
Change-Id: I312bafb0e7d61b0abd42d6ca7ea2e4b5dcdc61be
2014-06-23 15:32:15 +00:00
jenkins-bot 9e7c60a4e4 Merge "Revert "Update displaytitle on save (try #2)"" 2014-06-19 00:36:19 +00:00
Alex Monk f84b880a54 Revert "Update displaytitle on save (try #2)"
This reverts commit b7401f838b.

Didn't break everything, but we should probably avoid this getting deployed until I can work out wtf is going wrong with it.

Change-Id: I048143239e998b30aba79fa395a0af1cb06c6a9b
2014-06-19 00:34:26 +00:00
jenkins-bot 29d5bf6e51 Merge "Update displaytitle on save (try #2)" 2014-06-18 23:41:29 +00:00
Alex Monk b7401f838b Update displaytitle on save (try #2)
This reverts commit 5565ccca54.

I have no idea what is going wrong on deployment-prep to cause
the error in bug 66792. Let's try to find out.

Bug: 50341
Change-Id: I5041de838128bb55c57baddae01cdcb263626537
2014-06-19 00:04:51 +01:00
jenkins-bot f8dbe1878c Merge "Show wikitext warnings in the reference and media caption dialogs" 2014-06-18 21:00:29 +00:00
Krenair 143c21999e Port MWSaveDialog to use ActionDialog
Relies on Id17d150d

Change-Id: I80dd89fa7ad55daa3ae7e9c01c4a78f6e54105ca
2014-06-18 20:43:45 +00:00
jenkins-bot c92285e75f Merge "Revert "Update displaytitle on save"" 2014-06-18 20:23:35 +00:00
Catrope 5565ccca54 Revert "Update displaytitle on save"
Causing HTTP 500 errors in ApiVisualEditorEdit.php (calling
getDisplayTitle() on a non-object).

This reverts commit dedc89b5ff.

Bug: 66792
Change-Id: Iaf438660f0623dc05f76294ad847b2fc5e25bed6
2014-06-18 20:21:10 +00:00
Krenair 046979ae80 Show wikitext warnings in the reference and media caption dialogs
Bug: 56213
Change-Id: I9da0ae627a990864cc8b9466d97c4419f315f65e
2014-06-18 16:12:02 +00:00
jenkins-bot dc81adeb36 Merge "Update displaytitle on save" 2014-06-18 02:23:28 +00:00
Ed Sanders c70d32c017 Use registered target, instead of ve.init.Target
Depends on I468d4eb4 in core.

Uses various hacks to trick the test runner into thinking
an MW target is in use, when in fact we still use SA targets.

Change-Id: If4611307d5d7aaee4af84f86ef82faf9078043b6
2014-06-17 20:41:01 +01:00
Roan Kattouw ee1bea701e Followup 00af434: only tear down debug bar if it exists
Bug: 66692
Change-Id: I3ec8cf9579da785327abbab5dd3618bb3f20895f
2014-06-16 15:54:12 -07:00
Ed Sanders 00af43495b Update VE core submodule to master (155f4ab)
Use new setupToolbar and setupDebugbar methods in base target.

New changes:
7ff523d Localisation updates from https://translatewiki.net.
3815224 [BREAKING CHANGE] Debug bar refactor
155f4ab Edit HTML mode in demo

Change-Id: I554ce51eae872ab0f741a913bf10394c2a8c3e52
2014-06-16 14:52:48 -07:00
Ed Sanders 71395e1fa4 Wait for onDocumentFocus to happen before setting section range
Bug: 65928
Change-Id: If76408b6b89541f0ecb065d4860e0652b6bdebb5
2014-06-15 13:07:32 +01:00
Krenair dedc89b5ff Update displaytitle on save
Also fix a couple of missing param docs

Bug: 50341
Change-Id: I1e73153dca5eb9343bbcda1fc2f9799e72f6f03c
2014-06-12 22:21:35 +01:00
Ed Sanders 0791d86b77 Update VE core submodule to master (4d919d2)
Implement new language platform functions.

Also remove unused MWLanguageSearchDialog and MWLanguageSearchWidget.

New changes:
4d919d2 [BREAKING CHANGE] Move language functions to the platform

Change-Id: I54c0a8e5816a3c81851f95f1d3062a6091a9f4a3
2014-06-12 19:42:35 +00:00
Krenair 638ad9e985 Wrap external URL protocols regex in brackets.
Bug: 65547
Change-Id: Ie69bfa2bbf3db01b89242655c8aa36c2483e7265
2014-06-12 17:05:43 +01:00
Trevor Parscal 06f00d73ae [BREAKING CHANGE] Update VE core submodule to master (43a48cb) for window process cleanup
* Update size of save dialog earlier on, and swap back to save panel in
  save dialog on setup instead of ready to avoid scaling and sizing
  simultaneously
* Update use of closing/closed/opening/open events to use
  setup/ready/teardown events instead

New changes:
43a48cb [BREAKING CHANGE] Update OOjs UI to v0.1.0-pre (9f4f250f88) for window process cleanup

Bug: 65705
Bug: 65343
Bug: 60843
Change-Id: Idf6f85ae12f6ca80fde57a400cb5b11270938c1a
2014-06-12 00:42:13 +00:00
Roan Kattouw 310601ef47 Update VE core submodule to master (e1b0e33)
Remove ProtectedNode mixins for new FocusableNode.

New changes:
e1b0e33 [BREAKING CHANGE] Merge ProtectedNode into FocusableNode

Change-Id: Ie515704163c24317739fd34d35094b9ada6bfa66
2014-06-10 16:52:49 -07:00
Roan Kattouw 1455c72a35 Update VE core submodule to master (ba8872e)
Replace instances of target.$document, which was removed
in VE core.

New changes:
8083623 [BREAKING CHANGE] Remove $document cache from target
9256158 Cleanup target properties
cc0d71f Multi-surface fixes
ba8872e Localisation updates from https://translatewiki.net.

Change-Id: Ibff83cae770c056ed64bcf438ed74b44d929cdc0
2014-06-10 13:52:34 -07:00
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
Krenair bf42b1a742 Send language when making API requests
The API moans about it in a warning, but it works.

Along with edit page checkboxes, this also fixes edit notices.

Bug: 65455
Change-Id: I7c319d43fd06ab04ab4e4cc099ae49b11c31fabd
2014-06-09 20:49:28 +01: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
jenkins-bot a7bf8b6a7f Merge "Convert toolbar structure group from bar to list" 2014-05-28 23:06:36 +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
James D. Forrester 47e19a9873 Convert toolbar structure group from bar to list
Aligns with I84a4d948ae in stand-alone.

Change-Id: I533355a20bb329b91d6550bde4afa18180b38f59
2014-05-22 17:47:29 -07:00
Moriel Schottlender 963e133851 Remove media item styling moved to MW-core in I400336c12d.
Change-Id: I348e55ddea94f3b67f647c66ba53f7384d683584
2014-05-22 12:34:00 -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
Krenair 81801edb50 Only send useful oldid while switching to wikitext editor if it's specifically requested
Usually we can just send 0. Sending anything else makes PostEdit think we're restoring an old revision.

Bug: 65269
Change-Id: I60454a7a4ea3f6c7cef4c707da3016dd0ec29b88
2014-05-14 22:24:47 +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
jenkins-bot b84bceda7a Merge "Follow-up Id401d973: mw.Target: Make the "Cite" label in the toolbar translatable" 2014-05-11 07:18:10 +00:00
Bartosz Dziewoński 5e253306d1 Follow-up Id401d973: mw.Target: Make the "Cite" label in the toolbar translatable
Also, re-alpha-sort the ve-mw i18n files.

Change-Id: Id3fc7894b3774042c5eda877c9edf55ef4941ebf
2014-05-11 09:09:09 +02: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 b272845791 mw.ViewPageTarget: Move .mw-body-content down to .ve-ce-surface
Update VE core submodule to master (109a3cf):

* 109a3cf ve.ce.Surface: Remove font-size: 1em;

Follows-up I5818dce6265.

* When applied to ve-ui-surface, it applies to both of its children,
  namely ve-ce-surface and ve-ui-surface-overlay. The latter
  (containing things like context menu and inspectors) should not
  inherit styles intended for rendering of wikipage content by
  the skin.

* Move mw-content-{ltr,rtl} from an outer parent to a slightly
  deeper parent of the actual content. It's now on documentNode.
  Still high enough to apply to all content. This was to ensure
  it remains a child of mw-body-content, like in MediaWiki core.

* Updated padding/margin hack again. Since now the font-size
  applies on the surface, this once again means that now 1em
  on the surface != 1em on the documentNode, so we need the
  calculation again. Brought it back and this time documented
  what it is based on.

Bug: 64599
Change-Id: I9ee4582a6a0ec9e128f5c36a6dbf2adbd0b216a1
2014-04-30 21:09:54 +00:00
jenkins-bot c4b1d3cff9 Merge "Add class name to protected pages, to allow for specific CSS styling of edit area" 2014-04-30 21:01:39 +00:00
Krenair f8d609a8c7 Add class name to protected pages, to allow for specific CSS styling of edit area
Also get rid of checking for NS_MEDIAWIKI explictly and use
MWNamespace::getRestrictionLevels instead

Bug: 50783
Change-Id: I5986ddb9b6f17e4a2aca12dbb551cce4a6cfd663
2014-04-30 13:59:30 -07: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
jenkins-bot da577b21d5 Merge "mw.ViewPageTarget: Use .mw-body-content for content styling" 2014-04-29 22:25:53 +00:00
Trevor Parscal e0e08388ce mw.ViewPageTarget: Use .mw-body-content for content styling
* font-size and line-height differed between read mode and
  edit mode. This makes them match by using the same css class
  as MediaWiki core uses for the body content.
  Depends on I66c56c57 in MediaWiki core.

* Document padding / margin hack on surface, and sync the values.
  In edit mode, the text was being nudged to the right by a few
  pixels.

* Bump the wfUseMw call as this is a symptom of how VisualEditor
  now depends on MediaWiki 1.23.

Bug: 64599
Change-Id: I5818dce626545c4cbc8bd84fd551dc08baedbe32
2014-04-29 21:04:05 +00:00
jenkins-bot 27d3286362 Merge "Don't change section edit links on foreign file description pages" 2014-04-28 18:53:06 +00:00
Krenair e815d586cc Don't change section edit links on foreign file description pages
We have no proper way to check whether VE is enabled on the remote wiki.

Bug: 54259
Change-Id: I4b0edc00ee9736b282820d4a504f1702ab0590fc
2014-04-28 11:49:14 -07: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
jenkins-bot d2e5874ece Merge "Hide some tools when VE is open" 2014-04-23 23:06:52 +00:00
Krenair 62e07f8008 Add support for SimpleCaptcha
Bug: 64328
Change-Id: I04dd82e72184dcef6a660c0886b16a1086ed0b26
2014-04-23 23:30:52 +01:00
Roan Kattouw 54d06b2a3d Unbreak badtoken recovery on mobile
When recovering from a badtoken error, mw.Target called saveDocument(),
but that method only exists in ViewPageTarget. Instead, call .save()
again.

Also pass the HTMLDocument and the save options around to the success
and error handlers, because we need them in order to be able to
call .save().

Bug: 64267
Change-Id: I4743f855dc77f4a9ac427d67d15fb96b7ad770f2
2014-04-23 12:30:48 -07:00
Krenair df38c8b55e Hide some tools when VE is open
Bug: 57940
Change-Id: I2f586e8c73affe1b7f14c40ba892774e784f09c8
2014-04-22 23:47:54 +01:00
Roan Kattouw ba455643fc [BREAKING CHANGE] Update VE core to master (cb2e61b)
Update dialogs and inspectors for breaking change in VE core

New changes:
a553012 [BREAKING CHANGE] Merge dialog and inspector actions into window actions
f9a0419 Localisation updates from https://translatewiki.net.
cbe81a0 Fix path to spinner in ve.ui.SpecialCharacterInspector.css

Change-Id: Icf90ace6442364283b66b234e3c78fc65212f070
2014-04-21 15:32:59 -07: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
jenkins-bot 987b10da94 Merge "Check useeditwarning preference before showing warning when browsing away from editor" 2014-04-18 19:24:23 +00:00
jenkins-bot caecb84b9b Merge "Remove Function.prototype.bind from compatibility check" 2014-04-18 04:16:49 +00: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
James D. Forrester df31082085 Remove Function.prototype.bind from compatibility check
We aren't using it anyway, and it blocks some browsers unnecessarily
(PhantomJS in particular).

Change-Id: I90b1124704bfaf571212fdf9e187a450104176dc
2014-04-17 03:49:03 +00:00
jenkins-bot a1fd95e522 Merge "Don't change tabs on Education Program pages" 2014-04-17 03:38:50 +00:00
Krenair e3be4a6588 Don't change tabs on Education Program pages
Unfortunately the best way I've come up with to do this so far is
checking the namespace.

Bug: 53477
Change-Id: Ib2dbe91aff516f2d2408e07ff3f73ea861bfcbe2
2014-04-16 20:33:24 -07:00
Roan Kattouw 5b0d4b5286 Use the correct classname in MobileViewTarget
Change-Id: I7e0a5aa56116dd7f44cbac29e0b6bc5d760e157e
2014-04-16 17:41:18 -07: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
Ed Sanders b019036a2c Hide inspectors using new method when saving
Previous hack caused unwanted blur events and subsequent range changes.

Depends on I8388318311 in core.

Change-Id: I9163f4d9928887a5eec09f0651ec0a66cc221cd4
2014-04-14 17:17:42 -07:00
Ed Sanders 3bba5e4d3b Pass required params to open for save dialog
Change-Id: Ib2e8f6255544894d54d9a89a579241b40c58ef90
2014-04-14 16:18:22 -07:00
jenkins-bot d20ff82e5c Merge "Use updated tab labels on description pages for files in foreign repos" 2014-04-11 19:11:10 +00:00
jenkins-bot d8453acff5 Merge "Remove remaining uses of surfaceModel#getSelection in dialogs" 2014-04-11 18:43:14 +00:00
Ed Sanders 340a939c97 Remove remaining uses of surfaceModel#getSelection in dialogs
These were being used indirectly in the MW*Model's. Use surface
fragments instead.

Fixes I0fae3e5ff2bd.

Change-Id: I1d6aa5e00a9315cf7088f87f9e9d828833feec64
2014-04-11 11:14:43 -07:00
Roan Kattouw 989fd6214c Fix JS error when opening VE on redirect page
Change-Id: I95dd2dc2c52ffa3d420a579592e84001bd2b10e8
2014-04-11 10:13:51 -07:00
Trevor Parscal afb182c23c Limit the number of citation tools to 5
Don't let too much toothpaste get out of that tube aye!?

Change-Id: I5cd92b7826d55ddde505f1bb883c6f8ed3223ec0
2014-04-10 11:47:34 -07:00
Ed Sanders 0e51180709 Update VE core submodule to master (55a5cdc): use new ve.ui.Dialogs and ve.ui.Inspectors
Move various bits of code from initialize to setup as required.

MWDialog is now useless so use ve.ui.Dialog directly.

New changes:
0b2d03f [BREAKING CHANGE] Pass fragments, not surfaces, to windows (reprise)
0101ac4 Update OOjs UI to v0.1.0-pre (ac6848398c)

Change-Id: I0fae3e5ff2bd0da5b74c244af226b07b1f5883bd
2014-04-09 20:28:30 -07:00
Ed Sanders 164cf27299 Use new model directionality in MW
Depends on I2065e17020dc89 in core.

Change-Id: I6e99db601af58a9c4200f885887de451f9f70daa
2014-04-09 18:21:25 +00:00
Krenair 99640bf1a7 Use updated tab labels on description pages for files in foreign repos
See I4a43b759

Bug: 63666
Change-Id: Ie4aeddde4909f455472dc5239156c23200033ee8
2014-04-09 00:26:29 +01:00
jenkins-bot b71e58c0f7 Merge "Give the edit tab <li> closest to the collapsed tabs menu class=collapsible" 2014-04-04 19:32:21 +00:00
jenkins-bot aeb4fabd2d Merge "Fix order of start and base timestamps when switching to the wikitext editor" 2014-04-04 19:31:58 +00:00
Krenair 9dac9f2c04 Fix order of start and base timestamps when switching to the wikitext editor
These were backwards which was triggering edit conflict detection for all users.

Fortunately for logged in users, if Revision::userWasLastToEdit was given a bad
timestamp (e.g. when we submitted here), it would just return true, suppressing
the conflict. It always showed a conflict for anonymous users however.

Bug: 56835
Change-Id: Ib07f965238ca96e17bf59b34da8a8e789954da61
2014-04-03 23:06:41 +01:00
Krenair e3b7827c44 Give the edit tab <li> closest to the collapsed tabs menu class=collapsible
Bug: 50225
Change-Id: Ib2e6237483338c8072d5f7919c6459bf7418946a
2014-04-03 02:16:13 +01:00