Commit graph

965 commits

Author SHA1 Message Date
Alex Monk e084df2df6 Load all of WikiEditor's special characters
Relies on If9c5cdbe and I8fafd734

Bug: T91608
Change-Id: I3fafc561ceae969e4ecc12881154cd8a3568bebb
2015-03-27 22:13:38 +00:00
jenkins-bot 4fbb11e40a Merge "Verify welcome dialog exists before trying to close it" 2015-03-27 18:48:39 +00:00
Moriel Schottlender db9e565a09 Verify welcome dialog exists before trying to close it
When deactivating, verify first that the welcome dialog was
initialized before calling 'close' on it.

Change-Id: Ife98b396f3d8641e2bd313c549fe867bcd84db9b
2015-03-27 11:45:26 -07:00
Bartosz Dziewoński 4bfc19349a Correct font sizes of everything on MonoBook
This is not pretty and probably isn't optimal, but it works well
enough. The bug about getting rid of this all is T91152.

Bug: T94071
Change-Id: If926286f1d0c7835489914ed653a0d65ed24f53a
2015-03-27 19:42:33 +01:00
ecotg 175e60edaf Strip X-Parsoid Performance Headers from Visual Editor
Stripped out X-Parsoid Performance Headers, previously used to gather and
forward Parsoid's performance information, from ApiVisualEditor.php,
ve.init.mw.Target.js and ve.init.mw.TargetLoader.js. Change I936ada7b1 strips
out the corresponding X-Parsoid Performance Headers from Parsoid. Parsoid's
current performance instrumentation is achieved using Graphite and txstatsd.

Change-Id: I57d6f866a7d8287a5115e6236b0fb25bc4d0eabd
2015-03-27 12:03:15 -06:00
Roan Kattouw 6bd5142f2a When content and metadata have different revids, explicitly retry the higher one
It's much less likely we'll get another conflict if we retry
with ?oldid=12345 than if we retry omitting the oldid again.

Change-Id: I10e40f714fd44d7f0ac16c9d0dc6239a95c0ec51
2015-03-26 16:07:43 -07:00
Roan Kattouw b19104ed04 Send requests to RESTbase directly when so configured
Also introduces paction=metadata in ApiVisualEditor which
doesn't hit Parsoid but gets all the other information we need.

Bug: T90374
Change-Id: I71edbc0f8dc15a6f8d3672c10ca3c641cc172be7
2015-03-26 16:00:54 -07:00
jenkins-bot 25aedfd0fb Merge "Show beta welcome dialog before surface is ready" 2015-03-26 19:40:54 +00:00
Moriel Schottlender 74c3b758e2 Show beta welcome dialog before surface is ready
Split up beta and meta dialog show methods so that beta dialog
is displayed as soon as possible, regardless of the surface being
ready. Also make sure that we destroy the temporary window
manager on destroy.

Bug: T90454
Change-Id: Ib8f94518af431487ce940a74a8c268dbdbe403d2
2015-03-26 12:36:40 -07:00
Alex Monk 024823e560 Fix revId check on new pages
Makes it possible to edit new pages again.

Follows up Ifbf44b7772

Change-Id: If170a367dc2f531d11f09569c7ab45ebd414dff6
2015-03-26 17:39:45 +00:00
Alex Monk 9019f02130 Check for the two revision IDs returned by the server being different
With RESTbase we'll be able to retry the older one, but right now we have to do
both with the same request.

This commit retries loading once, then starts emitting errors.

Bug: T92993
Change-Id: Ifbf44b777279dafbe31ab438838d70acd44de726
2015-03-25 20:46:27 +00:00
jenkins-bot 5f3e0b033b Merge "Emit activation entry/exit traces at the appropriate times" 2015-03-25 03:15:56 +00:00
Amir E. Aharoni 1d1ffac74e [BrowserTest] Capture the whole formatting button in the screenshot
This makes the screenshot nicer and more complete.

Change-Id: I0dd9efd2978ff5468ab6101b11b7e6fdd3b0da30
2015-03-24 12:34:42 +02:00
Ori Livneh 13292744b1 Emit activation entry/exit traces at the appropriate times
Due to changes in the way VisualEditor is loaded, the trace.activate.{enter,exit}
events no longer enclose the entire VisualEditor initialization process. This
change ensures that trace.activate.enter is emitted as soon as the user clicks
on an edit link / tab and that the trace.activate.exit is not emitted until the
toolbar has been fully activated.

Change-Id: Ief798faa95a58898b9ae4dcbbbd30506c5dbd9a7
2015-03-23 23:19:12 +00:00
Ed Sanders e006449c7f Vertically center the progress bar within the visible part of #content
On short pages which don't extend below the fold, the progress
bar should center within the #content element.

Change-Id: I0b99e42f5bab8177d3b4ca6dd372d6403ae9b136
2015-03-23 02:34:40 +00:00
Ed Sanders 6d8fbd8221 Make loading progress bar determinate
Estimate loading times to show smooth loading progress.

Bug: T90622
Bug: T92456
Bug: T52206
Change-Id: Ic6e31a938b474c5a11c0c12302ec6c0ebc2c414d
2015-03-20 20:08:01 +00:00
Alex Monk 74cb83d2f8 Fix edit conflicts
When we moved to mw.Api, edit conflict errors stopped going via onSave and
started going to onSaveError instead. So the case to check for them in onSave
would not have worked - instead, they would go through onSaveError and get
picked up by our unknown error code, which just picks out error.info and shows
it, instead of showing our edit conflict screen.

Also return in a couple of other error cases where we probably should've been
(but not necessarily must've been... that didn't necessarily show to the user
if another error emit already caused saveDeferred to be rejected)

Change-Id: Iae7a66a8aa96ee777e9fa780005feeb429129d5f
2015-03-19 02:36:21 +00:00
Ori Livneh 94877eb668 Set mwtiming events' target to 'mwTarget', if unset
We're currently rewriting "mwtiming.performance.system.domLoad" to
"timing.ve.undefined.performance.system.domLoad". The "undefined" comes from
the missing targetName property on the event. I'm not sure why it is missing,
but having it default to 'mwTarget' will Do the Right Thing™.

Task: T93156
Change-Id: If70ff601b6c54ec8f95171cbc43c82c87a177508
2015-03-19 00:40:28 +00:00
jenkins-bot 1046d309b2 Merge "Handle TitleBlacklist errors" 2015-03-18 22:44:36 +00:00
Alex Monk 88088d4ecc Set action.saveFailure.message key in Edit schema
This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.

Change-Id: Iee97fdd2a867f2c252ca7756f2e6341377d9fbb7
2015-03-18 22:24:40 +00:00
Alex Monk c286511f17 Handle TitleBlacklist errors
Relies on I69cf0a88

Using our own new message because TitleBlacklist's own one includes text that
we can't parse on the client and relies on a parameter we don't get from the
API.

This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.

Change-Id: I4c75369b8b97973b72899bfaecbd5a996a440c68
2015-03-18 21:58:51 +00:00
jenkins-bot 05766564d1 Merge "Remove font tags on import (paste/drop)" 2015-03-18 18:29:57 +00:00
jenkins-bot 275ba972bb Merge "Follow-up f620111b: pass parameters to fallback requestPageData() call" 2015-03-18 18:25:24 +00:00
Ed Sanders ba20a26292 mw.ViewPageTarget: Grey-out body content as soon as edit is clicked
Set 've-activated' as soon as edit is clicked, with a 've-loading' state.

This necessitates moving the relevant styles to mw.ViewPageTarget.init.css.

Change-Id: Ic9757cdbf63a2f72eda0dd03ff5588d79028ba0e
2015-03-18 17:56:28 +00:00
Roan Kattouw 3375411afd Follow-up f620111b: pass parameters to fallback requestPageData() call
Bug: T93036
Change-Id: I84eba70d9c0af63b442993c8c59fee89da45c14f
2015-03-18 16:23:37 +00:00
Ed Sanders fbe207fabf Remove font tags on import (paste/drop)
Change-Id: I46c7d4aee2f35ccf8ab6967c0273bc46c5a79347
2015-03-18 08:51:13 +00:00
jenkins-bot 4ef6eb8010 Merge "Unbreak TargetLoader when ViewPageTarget.init isn't present" 2015-03-18 00:42:10 +00:00
Roan Kattouw 812cb9aa2c Unbreak TargetLoader when ViewPageTarget.init isn't present
By lazy-initializing mw.libs.ve

Change-Id: I2fea8a0935b43b5a25287f68bd7487c448d006b6
2015-03-17 17:38:29 -07:00
Alex Monk aac31c9c72 Fix action.abort.mechanism value in ViewPageTarget#onUnload
Was causing EventLogging schema validation failures.

Bug: T92869
Change-Id: I6ecdb4b5b39fe05448664316894314492da4379b
2015-03-17 19:02:44 +00:00
Roan Kattouw f620111b9e Send Parsoid API request immediately when user clicks edit
Move requestPageData from mw.Target to TargetLoader, call it
in init init, and pass the promise it returns into load()
via activate().

Bug: T90372
Change-Id: I828b8474e5a76b3d0d7d08735b4d865c29d2f820
2015-03-16 08:56:42 -07:00
Roan Kattouw d371014e5d Load RL modules in one load.php request, rather than in two stages
This introduces TargetLoader, which manages plugins and RL modules
in a slightly more generic fashion so that Targets themselves don't
have to. This allows us to load all RL modules in one load.php
request, rather than first loading ViewPageTarget which then
loads the other modules.

TargetLoader loads in the bottom queue, so it will be loaded
as part of the main load.php request, but in VPT.init.js we
still have to wait for it with using() because it might not
have arrived yet. This also degrades gracefully on cached pages
where TargetLoader isn't in the bottom queue: it'll be loaded
as a separate request instead, which is suboptimal but no
worse that what we were doing before.

Right now TargetLoader is small enough that it could also be in
the top queue, but in the future we want to add things like
the action=visualeditor API request to it, and mw.Api is
relatively big.

Note: this also makes a breaking change to the plugin API:
plugin callbacks no longer receive the target instance
as a parameter, as they're now executed before the target
has been constructed rather than after. In the long term,
if we want to give plugins access to the target instance,
we could give them the target promise somehow. For now,
I've killed this feature because nothing used it and
the change from a direct object reference to a promise
would have been a breaking change anyway.

Also fixed incorrect documentation index for ve.init.mw.ViewPageTarget.init.

Bug: T53569
Change-Id: Ibfa6abbeaf872ae2aadc6ed9d5beba7473ea441a
2015-03-15 03:43:05 +01:00
Timo Tijhof 93f5697586 mw.ViewPageTarget: Hide ve-ui-surface during activation as well
Follows-up 77f016a.

Bug: T91442
Change-Id: I69072b25add712c8acfcf6fc45aeb6abe8afb0c2
2015-03-12 16:04:13 +00:00
Timo Tijhof caa58d31c5 mw.ViewPageTarget: Hide ve-ui-surface instead of ve-ce-surface
ve-ce-surface is a child of ve-ui-surface. The ve-ui-surface has
margins that would remain in the document flow causing a temporary
growth outwards to the bottom during deactivation (causing the
white area and blue border on Vector's grey background to move down)
after which it would restore again.

Follows-up 77f016a.

Bug: T91442
Change-Id: I5b999b580c968fcd24f07d9a895cfa17afc80c0d
2015-03-12 17:03:30 +01:00
jenkins-bot 9249b4a70f Merge "ve.init.mw.ViewPageTarget: Recalculate toolbar sizes when adding "Save" button" 2015-03-10 21:48:06 +00:00
jenkins-bot 46a9718c74 Merge "Focus the surface after VE is already active" 2015-03-10 20:57:58 +00:00
jenkins-bot a9f2b7e717 Merge "Remove unused iconModuleStyles property" 2015-03-10 19:50:14 +00:00
Roan Kattouw afa4f20e62 Remove unused iconModuleStyles property
It seems to have been intended to allow overriding of which icons
are used, but this isn't used anywhere.

Change-Id: I312f6c8e69d5a4d9c11f4af5f9487d0890a1f4e1
2015-03-10 20:32:47 +01:00
Moriel Schottlender 1fd395e26e Focus the surface after VE is already active
Move the surface focus() call to be done after VE has loaded, to
make sure that the position of the content editable field is at the
top of the page and not -- as happens in Firefox -- after the read
page contents.

Bug: T90420
Change-Id: If91cea42c083d67b1ee6396402c3f607dde70471
2015-03-10 19:22:17 +00:00
jenkins-bot ff31db5314 Merge "Reduce complexity around onbeforeunload handler" 2015-03-10 19:17:34 +00:00
jenkins-bot 07f2992a6a Merge "Do not call Toolbar#initialize twice during editor setup" 2015-03-10 18:16:09 +00:00
Bartosz Dziewoński 11d9c55b07 ve.init.mw.ViewPageTarget: Recalculate toolbar sizes when adding "Save" button
This really should not be necessary.

Depends on I17d22ba6 in OOjs UI.

Bug: T52227
Change-Id: I024dccb0c1cc24dd8390dd44fb7a2d987eef56ea
2015-03-10 17:30:56 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
Bartosz Dziewoński 1dced9e78d Do not call Toolbar#initialize twice during editor setup
Depends on Ib9471bc0 in VisualEditor core. Without that patch
this is actually necessary, because we were removing some event
handlers in the meantime.

Change-Id: I145f1891efd1c91eeb6154e11e96e3fc160e2be3
2015-03-10 14:11:16 +00:00
jenkins-bot eb79687c83 Merge "mw.ViewPageTarget: Hide ve-ce-surface during deactivation" 2015-03-10 09:58:52 +00:00
Timo Tijhof c1accbb61d mw.ViewPageTarget: Cache '#mw-imagepage-content' query
Follows-up eb7b727a53.

Change-Id: If8bed5626ccba9e69d30b770bb2eeed3c6264c7d
2015-03-10 02:53:05 +01:00
Timo Tijhof 77f016ae8f mw.ViewPageTarget: Hide ve-ce-surface during deactivation
While showing the content earlier as soon as possible is nice, the ve-ce-surface
remained visible until toolbar and surface were torn down.

This avoids the split second where the new pageview content *and*
CE surface were visible in the page (this it also messed with the scroll position,
and would temporarily cause a scrollbar to appear).

Bug: T91442
Change-Id: I0a7232cd0264bff28ad66aa328de29d339891aa1
2015-03-10 02:48:24 +01:00
Bartosz Dziewoński d5bf7e9e9e ve.init.mw.ViewPageTarget: Use mw.Api#postWithToken for setting hidebetawelcome pref
We can't use it for saving because we need to display a warning if
the user's identity changed.

Change-Id: I05919e407cd19d96c506671020bcdb95f3e2acaf
2015-03-06 11:11:03 +00:00
Bartosz Dziewoński 1656d3495e ve.init.mw.Target: Don't go into infinite recursion on API errors
The #tryWithPreparedCacheKey method was assuming that the request
could only fail because of invalid cache key. It can also fail because
of a bad token, and probably for a number of other reasons.

So only retry only once, and then fail. If it's a 'badtoken' error
during save, the caller will handle it and retry with a working token.
If it's something else, who knows, but we don't go into infinite loop
at least.

Failing in a way that will be handled is weird because 8e48f945 changed
the signatures of the promises, but not the functions that use them.
This must be fixed later.

Bug: T91158
Change-Id: I103cf888d339b44e3fd4fe2376edf5e37ce4157f
2015-03-06 02:47:47 +01:00
Ed Sanders 94fe054257 Update VE core submodule to master (a65ad7c)
New changes:
a65ad7c Move special character inserter to toolbar dialog manager

… and add it to the toolbar as a terminal option.

Change-Id: I35834d866a13c5dea7f5a520c63b8a99451fcf6d
2015-03-03 18:20:13 -08:00
Roan Kattouw ea3fccccaa Reduce complexity around onbeforeunload handler
We used to attempt to not break Firefox's bfcache, but this
didn't really work very well, and it's not clear that avoiding
bfcache breakage is even a good idea. It's more sensible and
consistent to deliberately break bfcache while VE is active.
On top of that, the Firefox people believe that our trick
shouldn't even have worked to begin with:
https://bugzilla.mozilla.org/show_bug.cgi?id=1102664

Because the onbeforeunload handler is removed when VE
is deactivated, bfcache still works if you first click
Read, then navigate away.

Also clean up the management of the unload handler, using
addEventListener() and removing the return value fallback
code that is needed for beforeunload but not unload.
For beforeunload this is harder to clean up because
the addEventListener()-based API for returning a value
isn't consistent across browsers.

Change-Id: Ie4fe9ea3a59a54ba462733aa5e42bfc0ed5b15eb
2015-03-03 16:36:22 +01:00
Alex Monk 6f1b6c85a5 Send abort event on unload
Still misses some preinit aborts because we need to figure out
a way to attach the unload handler early enough to catch these.

Change-Id: I0ce721e24e69c31318064c6b443c1bfe01077546
2015-03-03 15:25:57 +00:00
jenkins-bot 4b840ab725 Merge "Promote the Language tool Beta Feature to always-on status" 2015-03-02 23:58:27 +00:00
jenkins-bot 91d0c4ff03 Merge "mw.ViewPageTarget: Use CSS for toolbar transition" 2015-03-02 11:39:13 +00:00
jenkins-bot 78a014ce9f Merge "Show the toolbar as soon as the target has been activated" 2015-03-02 11:32:48 +00:00
James D. Forrester bddd84b1e9 Promote the Language tool Beta Feature to always-on status
No complaints in over nine months. Time to just make this available.

Change-Id: I601699573c0d50384720e5a1f0098c7f780de8cf
2015-03-01 17:15:48 -08:00
jenkins-bot 6c5cb61139 Merge "ImageInfoCache: Don't try to access imageinfo result if it's not set" 2015-02-28 01:40:52 +00:00
Alex Monk 944e7d7a86 ImageInfoCache: Don't try to access imageinfo result if it's not set
Bug: T90916
Change-Id: Iebd393b0cff8016cc8917b86ca277eddf7810d4e
2015-02-28 01:25:12 +00:00
Roan Kattouw 2b67617179 Make generateCitationFeatures() idempotent
Add checks so it doesn't generate and register the same
tool twice. This makes it safe to run it multiple times.

Change-Id: I882b51bd0422222f2e80555910c69b059136a503
2015-02-27 16:18:15 -08:00
Trevor Parscal 34da7d56b8 Update VE core submodule to master (2e1a0bb)
New changes:
04a5947 Localisation updates from https://translatewiki.net.
dd4691b Update OOjs to v1.1.5
2e1a0bb Context refactor

Local changes:
Add context item support for references, citations, templates and links

Change-Id: I5d488ecbf9768dc63de6e545505dbfd5eb84cc61
2015-02-27 18:21:13 -05:00
Alex Monk a6dbdb4788 Follow-up I18162f04: Send uselang parameter with paction=parse request
Change-Id: I70c2e6c448c175ebe9d46c2003499e22a79b28b1
2015-02-26 01:45:48 +00:00
Alex Monk ac2242af5f Follow-up I18162f04: Set contentType: 'multipart/form-data' on some requests again
But not all

Change-Id: If9d88bb8d6c532992e8118e504f2fae45c0ca96a
2015-02-26 01:24:16 +00:00
Alex Monk 8e48f94580 Use mw.Api to run requests rather than our own stuff in ve.init.mw.Target
Bug: T58659
Bug: T89435
Change-Id: I18162f04c50f48606378aed62ee99fccdc3159f6
2015-02-25 01:57:22 +00:00
jenkins-bot 057b24ce13 Merge "Factor out the Parsoid API request into its own method" 2015-02-24 02:45:20 +00:00
Roan Kattouw 86e1d1214b Factor out the Parsoid API request into its own method
This will allow us to more easily split the API request
into two requests (one for the HTML, one for metadata)
by returning a $.when() promise, and to initiate these
requests earlier (by storing a promise and returning it
in this method).

Change-Id: I4a5d1b8c47a3dc2edfe89925e63dcf90d7038e45
2015-02-24 02:41:21 +00:00
Ed Sanders d73e9d6a84 Update VE core submodule to master (e6a37e2)
New changes:
822236c Simplify slug behaviour

Local changes:
Add Vector-specific rules for slug animation

Change-Id: I812f6f8afc8733aae245f3606302f032e5e54675
2015-02-23 17:18:40 -08:00
Timo Tijhof 1c5c13fd16 mw.ViewPageTarget: Use CSS for toolbar transition
The toolbar now uses a CSS transition for its height instead of
JavaScript animation through slideDown().

* The animation is on toolbar instead of toolbar-bar so that it
  contains the padding and borders. Otherwise it slides up until
  there is the top and left (quite thick) borders stacked on
  each other which then disappear at once.

* Add transform/translateY so that toolbar also transitions
  when it is in floating state.

* Move class addition to attachToolbar() to avoid additional
  reflow.

Bug: T89543
Change-Id: I30a7b69b77b874d220f60ebe7f7e616cd77bcc36
2015-02-23 19:25:58 +00:00
Ed Sanders 703b2c2ed0 Show the toolbar as soon as the target has been activated
Still to load at this point are
* Additional modules (first load only)
* Parsoid HTML

To account for this we disable the toolFactory event listeners
to prevent flickering, and create a hidden blank dummy surface to
attach the toolbar to.

Bug: T76523
Change-Id: Iab24858f23f4db944dcaa6683a82b950ea9ee1b1
2015-02-23 17:50:17 +00:00
Timo Tijhof 4c1de2edb2 mw.ViewPageTarget: Remove obsolete transitions for margin
These were there to match Vector, however as of 4cec8a70589
Vector no longer has these. Having these in VisualEditor causes
the toolbar to be a few pixels behind (like a slingshot) when the
rest of the skin has already moved.

Change-Id: Ia5886a58316ccb3b0420553c3f466b5256089c73
2015-02-23 17:16:46 +00:00
jenkins-bot f17414f9d5 Merge "Use prefixed page title for browser title bar" 2015-02-23 17:12:20 +00:00
Roan Kattouw f69eb9fef8 Use prefixed page title for browser title bar
We can't use wgTitle directly because it has spaces
but no namespace prefix (e.g. "Foo bar"), and we can't
use wgPageName directly because it has the namespace prefix
but underscores instead of spaces (e.g. "Project:Foo_bar"),
so run wgPageName through mw.Title.

Bug: T90433
Change-Id: If431f5b9f6efa2690cfd964f80d6ac71cb568087
2015-02-23 08:55:47 -08:00
jenkins-bot d9734f56ad Merge "mw.ViewPageTarget: Remove workaround for cascading defaultUserOptions" 2015-02-23 16:51:12 +00:00
Roan Kattouw c57b89616d Follow-up 14a4a4ae1: *actually* fix back compat for this.timeStamp
Introducing a variable doesn't help if you then don't use it :|

Change-Id: Ibf1c230dcb8b17941fcd6e0c82dd7a054a3287f0
2015-02-23 16:14:07 +00:00
Timo Tijhof 60e5ac0902 mw.ViewPageTarget: Remove JS animations from transformPage()
Follows-up 62c1d64ad0.

* Remove '.mw-indicators' animation for opacity. Was a left-over from other
  elements previously stripped in 62c1d64ad0.

* '#siteNotice' no longer slides. It's hidden at the same time as '#contentSub',
  '#toc', and other elements. This is an annoying jump, and we should find a
  way to do it consistently and in a performant manner.

* Fix state classes added in 62c1d64ad0. During deactivation, the ve-active
  class was kept for too long. This created a temporary state in which ve-active
  *and* ve-deactivating were applied. This was harmless as nothing ises the
  've-deactivating' class yet.

* Leaving toolbar as-is for another commit.

Bug: T89543
Change-Id: Ide49f93c45a12f2c13eb4412a9a16a82fefeb43e
2015-02-23 09:08:21 +00:00
Timo Tijhof f687ba7ce0 mw.ViewPageTarget.init: Add missing 'return target'
Follows-up I002322beaae. I had this in the local patch but got
lost in rebasing. The missing return statement caused an uncaught
error when clicking section edit links as it was not forwarding
the return value.

Change-Id: I66b6a789f7182a4446122e94f19cfdb324f8d675
2015-02-23 08:51:20 +00:00
jenkins-bot 07077da54e Merge "mw.ViewPageTarget.init: Reduce duplication around getTarget() calls" 2015-02-22 21:44:36 +00:00
Roan Kattouw 14a4a4ae1e Follow-up 9b582485: implement back compat for timeStamp correctly
timeStamp was used in two places, but we only had back-compat
code in one, so the other ended up using NaN.

Bonus: make jshint happy with the indentation of the $.extend() call.

Change-Id: I69000d11822658f2a227f9756093bc278f5fbaf5
2015-02-22 18:33:19 +00:00
Timo Tijhof a34ccc2f3b mw.ViewPageTarget.init: Reduce duplication around getTarget() calls
De-duplicate the logic of:
* Call showLoading()
* Call getTarget()
* Call activate()
* Bind always(hideLoading)

Also use then() instead of done() on getTarget() so that failures
propagate to the always() handler. Previously the interface would
indefinitely be in a loading state if target fails to load.

Change-Id: I002322beaae64c0de96457eb56dbc68a5fc16369
2015-02-22 15:30:25 +00:00
Ed Sanders db8a36820d Use new attachToolbar method for attaching the toolbar
Depends on I53f032e59 in core.

Change-Id: I85cb73a0ead6c73915b25f5be09c898cb5e1ecb4
2015-02-21 22:29:05 +00:00
Timo Tijhof 5fa98dc803 ve.init.mw.ViewPageTarget: Avoid content shift due to #contentSub
While #contentSub element tends to be empty, it does take up
line-height in most skins (incl. Vector). Previously, hiding this
would cause the content to be shiften upwards one line, only to
be shiften down one line again once activated.

While there are other edge cases to be straightened out, this
makes the content a lot more stationary during activation.

Change-Id: I784436c0f60a63e1a77aba5b8afeacbbdd6932be
2015-02-21 21:18:37 +00:00
Timo Tijhof a3efd1e4f5 ve.init.mw.ViewPageTarget: Update toolbox on activated instead of active
This hides the links at the same time as other parts, right when the
module is loaded, instead of after the surface is ready.

Change-Id: Ifda6985636f354060f43b7e9ecc9425b30c513c9
2015-02-21 15:08:35 +00:00
Alex Monk c6dbdc92ea Don't try to route any events into schema.Edit if it's not actually installed
E.g. no WikimediaEvents

Bug: T88667
Change-Id: I33a13abf22da0caa1282652fa1a078ffcae11e97
2015-02-21 02:41:33 +00:00
Ori Livneh 9b582485f9 Fix ve.init.mw.trackSubscriber.js
* Use the event's timeStamp rather than the current time in the event
  subscriber.
* Instead of using ve.trackSubscribeAll() and then branching on the topic
  prefix, just use ve.trackSubscribe( prefix, ... ) to bind prefix-specific
  handlers.
* Round timing measurements after performing arithmetic, and use Math#round
  rather than Math#floor.
* Rename 'getDefaultTiming' to 'computeDuration'.

Change-Id: I27ff1622ecea9b82d414f871441f127fc2dbd2cc
2015-02-20 14:00:26 -08:00
James D. Forrester a3d2516479 Blacklist Safari versions 6 and below; whitelist 7+
Change-Id: Ie21b15c0e591c0df0793fd58b550728150ed0999
2015-02-20 09:51:05 -08:00
Ori Livneh 429d55cda8 Update ve.init.mw.trackSubscriber to emit 'wgVersion'
Depends on I6cebac796: Update Edit schema to revision 11319708.

Change-Id: I31ce78a573ef0cdab1162c6b78142fd511b9e0ec
2015-02-19 11:20:53 -08:00
jenkins-bot 7c838d839c Merge "Don't log against undefined target constructor name" 2015-02-19 00:55:38 +00:00
Roan Kattouw 3611664663 Update VE core submodule to master (7d2a68e)
New changes:
0ceafd5 Fix V8 deopt for ve.ce.BranchNode#onSplice
01d2d4b [BREAKING CHANGE] Store originalDomElements instead of htmlAttributes
96005a7 Localisation updates from https://translatewiki.net.
42e672e ve.ui.Toolbar: Don't call #updateToolState from #initialize
373562d Localisation updates from https://translatewiki.net.

Local changes:
Update for htmlAttributes going away

Change-Id: I576a1e5d5883b03d1fff6666926f80a5682a280f
2015-02-18 15:35:46 -08:00
Roan Kattouw 71a26929e4 In setupSurface, build the model tree separately
Otherwise it gets built lazily when building the view tree,
and that makes it difficult to instrument it separately.

Change-Id: Ie8c2027e87a87e59323165f0edbba49c4a66d1b3
2015-02-18 21:12:36 +00:00
Roan Kattouw 70db70bc0e Add a bunch of trace.foo.{enter|exit} events logged through ve.track()
Tracked stages are:
* activate: wraps the entire activation
* domLoad: API request for Parsoid HTML
* parseResponse: parse HTML, interpret things like link cache data
* convertModelFromDom: create linear model from Parsoid DOM
* createSurface: build DM and CE trees, create DM, CE and UI surfaces
* initializeSurface: initialize UI and CE surfaces, and CE nodes
* setupToolbar: toolbar setup and attachment
* initializeToolbar: toolbar initialization (deferred so not wrapped by activate)

Bug: T89536
Change-Id: Ife5664e872bad68dcf3c123f274f9c8a38a06031
2015-02-18 21:11:25 +00:00
Roan Kattouw 237bb053d6 Remove the sanity check
It's slow, especially on large pages, and it's triggered
very infrequently these days, and only for known bugs.

In the future we should replace this with a debugging
interface that displays the DOM diff between the original
DOM and the round-tripped DOM, as opposed to the boolean
interface we have now.

By extension, this also means the visualeditor-needcheck
tag won't be applied to new edits any more, although
its registration and messages are kept around because
edits with this tag still exist in page histories.

Bug: T87161
Change-Id: I909153492a5786b4b69fccd42ce3c1d4bdb3a059
2015-02-17 17:14:34 -08:00
Roan Kattouw 70c64e0613 mw.Target: Hopefully fix plugin garbage removal code
Follows-up 0547d8c8.

It's still very difficult to test whether this code works, but
doing $( newDoc ).remove( 'selector1' ).remove( 'selector2' )...
demonstrably doesn't work, because 1) the selector passed to remove()
filters the collection, it doesn't descend into it, and 2) remove()
returns the collection of removed items, so chaining it doesn't work.

Instead, use $( newDoc ).find( 'selector1, selector2, ...' ).remove();

Also normalise selectors.

Change-Id: I97f3b28c4d5120f08e5d7fbf4598ddc0c01d4ecf
2015-02-17 23:52:41 +00:00
Alex Monk 77b59981fa Don't log against undefined target constructor name
This targetName property is expected by the trackSubscriber code for mwtiming.

Bug: T89735
Change-Id: Ie75054a4eb3387f0be0decfe5499af40eea8c6c0
2015-02-17 20:30:52 +00:00
Timo Tijhof 7f05f8877e mw.ViewPageTarget: Remove workaround for cascading defaultUserOptions
Originally added in 5036099906.

* Account for bug T89513 for 'tempdisable' (was done for 'enable' in 9cba9910c6).

* MediaWiki core now loads user defaults in a separate module not
  subject to page caching, making our workaround obsolete.

  Keeping defaultthumbsize as that is intentionally ignoring the user's
  preferences.

Change-Id: I07a7aa8e08c728ddeba67f36a98e989c220dcb50
2015-02-14 03:20:59 +00:00
Ed Sanders 2b48c4991e Fix DOM structure on setup/teardown
* Ensure that the toolbar remains inside the target so that
  target triggers still work
* To keep the page title beneath the toolbar, move it inside
  the target on setup, and restore it on teardown
* Have teardownToolBar/DebugBar return promises so we know
  when teardown is completely finished.

Change-Id: If2a9ce9a653aed51d21c8e8dd7795f2533d54f70
2015-02-10 16:59:43 -08:00
jenkins-bot b4e20aacec Merge "mw.ViewPageTarget: Use CSS instead of JS for DOM hiding/muting" 2015-02-05 22:37:56 +00:00
jenkins-bot 3351d84bf0 Merge "[BrowserTest] Restore the indentation list screenshot scenario" 2015-02-05 09:17:55 +00:00
Timo Tijhof 62c1d64ad0 mw.ViewPageTarget: Use CSS instead of JS for DOM hiding/muting
* Use .ve-activated for elements changed in activate()
  - hideReadOnlyContent()
  - mutePageContent()
  - mutePageTitle

* Use .ve-active for elements changed in onSurfaceReady()
  - hidePageContent()

* Set 've-activated' class from activate() instead of transformPage()
  to consolidate reflows and minimise DOM interaction. It's still
  in the same (synchronous) execution path, but a few statements
  earlier now.

* Remove obsolete #toc wrapper. This <div> (with data property
  to distinguish it from potentially foreign parents in the future)
  was there to aid slideDown/slideUp animations, because those
  don't work well on table elements. See eba7d58dd1.

* Remove obsolete setTimeout in restorePageTitle().
  The removal of .ve-init-mw-viewPageTarget-pageTitle was delayed
  by one second (introduced in Ibc3fa2fb7 / 4cc88b9850). This
  was to account for a jQuery animation we no longer use.

* Remove unused '.ve-init-mw-viewPageTarget-transform-muted'
* Remove unused '.ve-init-mw-viewPageTarget-transform'
* Remove unused '.ve-init-mw-viewPageTarget-pageTitle'

The resulting stylesheet exposes that we're not consistent in
whether elements hide immediately (ve-activated) or once the
surface is ready (ve-active). This is intentionally kept as-is
within this commit.

Of the different elements that had their opacity changed, only
firstHeading was being animated. This animation was removed.

Bug: T88590
Bug: T87160
Change-Id: I87033456f715d99a88425e38e8ac5171144f4ec8
2015-02-04 19:24:29 -08:00
Alex Monk dd52503b6a Unbind watch event handler in VPT when necessary
Caught by Timo in I1df2836f

Change-Id: I0f0af71cdca26f7e8d13f9ea50d22c833b6e1683
2015-02-05 01:16:11 +00:00
jenkins-bot b43e798bb4 Merge "Make API module's LinkCache data transmission format more efficient" 2015-02-04 01:18:21 +00:00
Roan Kattouw e367ecc948 Make API module's LinkCache data transmission format more efficient
We used to send data like { title: { missing: true|false } }
With this change, we send data like { missing: [titles], existing: true|[titles] }
where 'existing' is set to true (assume all non-missing titles exist)
for current revisions and to an array of existing titles for
old revisions.

This is because we always output this data for links in the current
revision, even when loading an old revision: in that case we rely
on the client to request the omitted information, so there we can't
assume that all pages we don't have information about exist.

Bug: T88259
Change-Id: I7b58b3f669cc78fd81b60859cf76928a9087066f
2015-02-03 11:30:40 -08:00
jenkins-bot 0e926f5fcd Merge "Wait with showing edit notices until after the welcome dialog is closed" 2015-02-03 18:44:02 +00:00
Timo Tijhof 1d00894497 mw.Target: Add mw-body-content class before we attach surface
If added afterwards, this causes child elements styles with
'em'-values to get redrawn (or even animated).

Bug: T88387
Change-Id: Ic1aba14b7cfe0ff6e7191f0b6052ed9cc4585fcd
2015-02-02 20:25:02 -08:00
James D. Forrester bed038b509 build: Bump devDependencies to latest
Updates:
* grunt-contrib-csslint  0.3.1  ->  0.4.0
* grunt-contrib-jslint   0.10.0 -> 0.11.0
* grunt-jscs             0.8.1  ->  1.2.0

For jscs, leaving requireSpacesInsideArrayBrackets to avoid headaches for now.

Change-Id: I62d34444edbba65c8bd22d2fa5e50e16cabb0042
2015-02-02 14:30:39 -08:00
jenkins-bot d5f7bac940 Merge "Combine imageinfo requests" 2015-02-02 19:32:00 +00:00
Bartosz Dziewoński c0d69dd3db Wait with showing edit notices until after the welcome dialog is closed
Its white overlay is pretty good at obscuring them, and the notices popup
would close when the dialog is closed, making it very easy to miss them.

Also fixed indentation.

Bug: T86987
Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
2015-02-02 17:25:02 +00:00
Alex Monk 9841d1012c Update "Watch this page" option when necessary
On load and change the user presses the button

Bug: T78694
Change-Id: I1df2836f8ba4ae647bfb142513e5de9f32ecd0fe
2015-01-31 02:43:59 +00:00
Alex Monk 7876cc957a Combine imageinfo requests
By generalising LinkCache into ApiBatchQueue to request them all centrally

Bug: T75822
Change-Id: I097311ec2487bb1ae9f5d927c2c13c274ba716f9
2015-01-30 17:20:04 -08:00
Alex Monk f6bf40a19a Update permanent link and PDF download link oldids on save
Bug: T74461
Change-Id: Ic66de6e685d23cac1c9870529f42e1aa6348ac7a
2015-01-28 13:16:12 -08:00
Amir E. Aharoni 8da4c9b3cc [BrowserTest] Restore the indentation list screenshot scenario
* Add a class to the indentation toolbar button, similarly to what was done in
  Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
* Fix the definition of the indentation pull-down element acordingly.
* Restore the Indentation menu screenshot scenario, which was disabled in
  I3e892baa9cb2c8c1303fab232a2b1c64ebdd8f26

Change-Id: If2d92aab6d04aa487d6f753fa7cac94f8d8215c8
2015-01-27 13:35:39 -08:00
jenkins-bot 7dee4f18d7 Merge "Don't rely on 'user' and 'site' modules working correctly" 2015-01-26 22:31:28 +00:00
Roan Kattouw 6623ff4197 Use DOM rather than jQuery for <base> resolution
Avoiding a Sizzle context switch, see https://github.com/jquery/sizzle/issues/311

Bug: T87416
Change-Id: I40dd2cb17f9c3d14d0ee1aa5b542263775feedb7
2015-01-26 10:00:32 -08:00
Alex Monk 34e4c6a51b Check for venotify on page load, not when VPT is created
Not sure what could have broken this or when. Or if it ever worked to be honest...

Bug: T58921
Change-Id: I069b5ccb4a78a6790e5791354402503676faa7fa
2015-01-22 23:50:02 +00:00
Bartosz Dziewoński 4cce592cce Don't rely on 'user' and 'site' modules working correctly
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.

(Once more, with feeling. Reverted broken attempt: aa531488.)

Change-Id: I252c5c20f75b3bbea51200560408dc4cfc7174f6
2015-01-13 19:18:54 +00:00
jenkins-bot c878a3e7e9 Merge "build: Bump copyright notices to 2015" 2015-01-13 16:21:37 +00:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
James D. Forrester 6ce2210222 Toolbar: Make save button progressive, not constructive
Bug: T86507
Change-Id: I082d1b4ba09abf74e4c6438ef8b93fcc7de7a41b
2015-01-12 17:50:45 -08:00
Jforrester c17e3f89c6 Revert "Don't rely on 'user' and 'site' modules working correctly"
This reverts commit aa53148852.

Bug: T86550
Change-Id: Id97dec739939312caaa10d36197f105a595c1365
2015-01-12 18:49:39 +00:00
Bartosz Dziewoński aa53148852 Don't rely on 'user' and 'site' modules working correctly
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.

Change-Id: I3abecacf083c1c9dfb2ea30207a9911eeea54b50
2015-01-11 19:01:56 +01:00
jenkins-bot d4aa0aef7f Merge "Add classes to toolbar UI elements" 2015-01-06 20:02:45 +00:00
Alex Monk 9600d28ebc Don't break "Edit source" link after VE has closed
Bug: T85552
Change-Id: I6db6fcff24110e749e3a0c1aa7c0528527b53d44
2014-12-30 21:07:04 +00:00
Amir E. Aharoni cd4bd7a73c Add classes to toolbar UI elements
This cleans up the selectors for the elements on the toolbar
so that they can be tested.

Class names in the form of ve-test-* are added to elements
that have words for labels: 'Paragraph', 'Cite', 'Insert'.
There is no other way to look up these elements in the DOM
except using the UI text, but it is different in different languages,
so this is unusable for the language_screenshots job,
which is multilingual by its nature.

Bug: T76143
Change-Id: Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
2014-12-30 12:16:44 +00:00
Ed Sanders f49bbf783a Update setupToolbar signature in mobile target
This method now takes arguments to make sure they are passed.

Bug: T78710
Change-Id: Ifba696c2a1b60690bdccd1b58d347c254dec5432
2014-12-18 11:25:34 +00:00
Alex Monk c5d927552a Fix Ia6bf604c: Update another caller to ve.init.mw.Target
MobileViewTarget.

Due to this being missed, pageName was getting set to a jQuery object,
which eventually got passed as a data value in a $.ajax call, causing
jQuery to emit a TypeError: Illegal invocation.

I guess this needs a MobileFrontend commit as well. Don't think it fixes
all the issues with loading VE mobile though.

Bug: T78710
Change-Id: I431a902563f608a7a33028cd60112f39c57000a4
2014-12-18 00:59:04 +00:00
jenkins-bot f1103d2bf0 Merge "VE-MW fix commit for I4efbae614e" 2014-12-17 20:03:46 +00:00
Roan Kattouw 08bebc9b2b VE-MW fix commit for I4efbae614e
Local changes:
* Call bindHandlers()/unbindHandlers() in activate/deactivate
* Extend onDocumentKeyDown rather than overwriting it

Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
2014-12-16 15:42:27 -08:00
Timo Tijhof 2b7ae8c175 Remove use of bind() for inline functions
Follows-up b0e8900, 447e8de, d3f26e65.

Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.

Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
  without additional overhead and without confusion association
  with "html" which isn't used (it doesn't serialise and re-parse
  or clone, it just appends when given one or more nodes).

Change-Id: I797a3667c67d52568150be9be5d043d149f22077
2014-12-16 23:27:53 +00:00
Alex Monk f9339d070b Edit/view source tab: Do not hijack middle click to display confirmation, only left click
Middle click is supposed to open the link in a new tab.

Bug: T78546
Change-Id: I594f1dff072d54c0a8d7112a1eaa0c1c84d0ffc1
2014-12-15 20:24:11 +00:00
jenkins-bot e6997350ba Merge "Check for stopped propagation before showing close dialog" 2014-12-13 00:52:57 +00:00
Ed Sanders 9459e4e240 Check for stopped propagation before showing close dialog
Various VE elements use escape to perform tasks. Particularly
difficult are OOUI dialogs which listen to the document and thus
fire after this target's listener, so defer and check if the
event was previously stopped.

Bug: T78201
Change-Id: Ie335f199766923833588202626c3af8e4cbcb9b5
2014-12-12 22:38:40 +00:00
jenkins-bot 87143d4c36 Merge "Mark primary buttons as progressive as well" 2014-12-11 22:59:04 +00:00
James D. Forrester 57a68d082b Mark primary buttons as progressive as well
Also make save button primary.

In anticipation of Iee91d2c6 in OOjs UI

Change-Id: I123044bfaba631866ad32a35643f23686a17a16f
2014-12-11 22:55:16 +00:00
Ed Sanders 45518019eb Update VE core submodule to master (9ac8136)
New changes:
9929b6d [BREAKING CHANGE] Make ve.init.target an OO.ui.Element

Local changes:
* Fix target constructors now they generate this.$element

Change-Id: Ia6bf604c67305834a3f73863a10336cfbb83fa77
2014-12-11 14:00:28 -08:00
Ed Sanders d6067d5718 Update VE core submodule to master (cf1e167)
New changes:
776e801 Delimit text nodes in debug observations
72643bc Remove debug bar hiding now it is handled by the surface
cf1e167 [BREAKING CHANGE] Multiple surface support and demo

Local changes:
Account for detachable toolbars in core being setup in a different order.

Change-Id: I29156948711d55ba5f6dd4f6c35ca0e4cca32373
2014-12-11 12:49:29 -08:00
jenkins-bot eacb364ed1 Merge "Add timing data for the first transaction" 2014-12-11 03:06:14 +00:00
Roan Kattouw 49b26f886e Add timing data for the first transaction
This doesn't quite tell us about the user's first interaction with
VE (if they open a dialog, for instance, it could be minutes before
that results in a transaction), but it's a good start.

Bug: T76524
Change-Id: I6bac987332802d7363ed65a471b2b1ece67086d8
2014-12-11 03:02:11 +00:00
Ed Sanders 34a82928c1 Update VE core submodule to master (3feadb2)
New changes:
fc4af20 Fix filibuster expansion bug
3feadb2 [BREAKING CHANGE] Refactor for multiple surfaces

Local changes:
* Use target.getSurface now that targets can have multiple surfaces
* Remove debug bar code now surfaces manage their own
* Remove import rules code now implemented in base target

Change-Id: I18d6f9f2f36431959d31347b4c1952a1aca1350e
2014-12-10 16:39:10 -08:00
Roan Kattouw a032ea039e Move from legacy TimingData schema to new statsd API
This API doesn't have the ability to track any other data
in addition to a name and a duration in milliseconds, so
we add the target name ('mwTarget' or 'mobile') to the
event name and discard all other data.

Change-Id: I25ae0243f8983142d7755b65b05c18d5df36a253
2014-12-10 00:25:42 +00:00
jenkins-bot ed22cbffea Merge "Prefer localStorage to store ve-beta-welcome-dialog" 2014-12-09 22:39:09 +00:00
Alex Monk 51b091b9cd Prefer localStorage to store ve-beta-welcome-dialog
Bug: 62884
Change-Id: I3fe45e890c29aaa8d28edfb6986dc8c7541861c7
2014-12-09 21:04:13 +00:00
Roan Kattouw 29995d806b Remove IEHacks.css in favor of .ve-init-target-ie class
Move reference style hack to MWReferenceNode.css, and move
heading style hack to ve.init.mw.Target.css

Change-Id: Icbd53f8df998c9f7bcc701b7c29dc226dfc5c05f
2014-12-08 15:45:23 -08:00
Roan Kattouw 3321261e98 Split up ve.init.mw.ViewPageTarget.css
* Move styles that apply to all targets to ve.init.mw.Target.css
* Move styles for MWPopupTool subclasses to ve.ui.MWPopupTool.css

Change-Id: I34c8a6200ee337debf00c4e432948f1b86f1b60a
2014-12-08 15:42:19 -08:00
jenkins-bot 09bfc0cb9c Merge "Followup 1c04d32d: release saveDialog reference even if closed" 2014-12-08 23:06:37 +00:00
Roan Kattouw dad06ef495 Followup 1c04d32d: release saveDialog reference even if closed
It's good that we're not trying to close the save dialog
if it's not open, but we still need to release our reference
to it in that case, otherwise trying to open the save dialog
in a new incarnation of the editor will fail.

If you opened VE, opened the save dialog, closed it,
went back to read mode, opened VE again, and tried to open the
save dialog again, it would fail because it tried to open
the cached reference to the previous editor's save dialog.

Bonus: prevent JS errors in this case by only attaching an
onClose handler if the dialog actually opened successfully.
If opening the dialog failed, the callback parameter isn't
a promise but an OO.ui.Error, and calling .always() causes
a JS error.

Change-Id: I62d6d3e7cd3df2c29a0c99e2e23bf1aac5187a12
2014-12-08 14:49:39 -08:00
Timo Tijhof ee954cbdd5 Use String#slice instead of discouraged String#substr
Aside from the confusion and differences between substr() and
substring() and IE8 bugs with substr(), substr() was removed from
the spec as of ECMAScript 5. It's been standardised in the
optional Annex B section of ES5.

Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1
2014-12-06 21:26:20 +00:00
James D. Forrester baffe9d7e1 Update VE core submodule to master (32397d8)
New changes:
5e60f12 Ensure clipboard key is removed from paste target
32397d8 Update OOjs UI to v0.4.0

Local changes to compensate for new OOUI version, and updated wfUseMW call.

Change-Id: I005f7b23a36e04f1305d4aa037c19a5c7db9a699
2014-12-06 12:28:07 -08:00
Alex Monk b0b53befdc Fix call to mw.log.warning
Should be mw.log.warn

Added by I111176b8

Change-Id: I58b78e89a7f5a21fe050e2a90bf856c388f7213d
2014-12-03 23:35:51 +00:00
James D. Forrester e722c1726f Update VE core submodule to master (0229301)
New changes:
5eb7294 Find and replace
123a6ad Find and replace tool
557f70f Go backwards through find and replace results on shift enter
4a4ed81 Allow language widget to filter on available languages

Local changes to adjust.

Change-Id: I15e14d6d3c7ee60e465baf3a4df7572851cbca3e
2014-12-03 10:36:39 -08:00
Roan Kattouw dbf232a7dc Clean up deactivate mess
Both onDocumentKeyDown and onViewTabClick would check
this.activating and invoke deactivate() differently depending
on its value. That's ugly, so incorporate the "don't show a dialog
if deactivating during activation" logic into deactivate() itself.

Rename the override parameter to noDialog, and fix the broken
logic around it (it overrode too much).

Also move setting this.activating = false; out of these event
handlers into cancel(), where it clearly belongs because
activatingDeferred is being rejected there.

Change-Id: I6c040c74d36f829128a175f00d4e712dd19d31a7
2014-12-02 16:50:36 -08:00
jenkins-bot 45e98c7699 Merge "Cancel VE when escape key pressed" 2014-12-03 00:33:19 +00:00
Alex Monk c0fd5e616d Cancel VE when escape key pressed
Or at least open the confirmation dialog about it.

Relies on I0047bd9d to not break stuff on the second try.

Bug: T52868
Change-Id: Id178a2a0aad2f4bf5f589d66efde61aaa6fae498
2014-12-02 16:29:15 -08:00
jenkins-bot d7f954b1b5 Merge "Make LinkCache fail more gracefully when given undefined" 2014-12-02 22:45:08 +00:00
Roan Kattouw 2ed648c4db Make LinkCache fail more gracefully when given undefined
If you tried to do styleElement( undefined, $element ), you'd
get an exception in the mw.Title constructor from a setTimeout.
That's not very nice, and there's no point sending non-strings
through the queue and other data structures in LinkCache, so
instead just make get() return a rejected promise when given
non-string values.

Change-Id: Iab06929d7e232a8ecd8eb1eff9d1190c303421c1
2014-12-02 14:02:45 -08:00
jenkins-bot d71279cdfe Merge "ViewPageTarget.init: Correct docs: ve.libs.mw → mw.libs.ve" 2014-12-02 21:50:12 +00:00
jenkins-bot 6c4c3408b8 Merge "Track new pagedeleted save error in TargetEvents" 2014-12-02 02:04:11 +00:00
Roan Kattouw 915278dfea Track new pagedeleted save error in TargetEvents
Change to Schema:Edit takes it to revision 10676603.

Change-Id: I87a3812585ac0dd22a66ceffdf320ad8bc326155
2014-12-01 17:58:31 -08:00
Bartosz Dziewoński e6ea9db351 ViewPageTarget.init: Correct docs: ve.libs.mw → mw.libs.ve
Change-Id: I265aba968d861020852ada5034e166189efd3218
2014-12-01 20:59:53 +01:00
jenkins-bot 0445ee640d Merge "Remove duplicate startSanityCheck from ViewPageTarget" 2014-12-01 19:22:56 +00:00
Ed Sanders 7dc4dd66a0 Remove duplicate startSanityCheck from ViewPageTarget
Method was moved to parent, but not deleted from child. Also move
sanityCheckPromise to parent where it is used.

Change-Id: Ie2b00330d796cd089fd4bc84d9332c316500633f
2014-12-01 19:19:51 +00:00
Amir E. Aharoni 9dad03819e Mention the "Continue" label as a parameter in visualeditor-recreate
Bug: T75971
Change-Id: Id075233da4e8a2978b07b5f2735ac6620ff5330d
2014-11-27 22:33:35 +02:00
Roan Kattouw 616a9cd1bf Followup 6d21d83: unbreak switching to edit source
Forgot to pass the wikitext parameter through, oops :(

Bug: T76114
Change-Id: Ic852e4b10c17b2417f582f35fabb87823e0202e3
2014-11-26 16:24:50 -08:00
James D. Forrester e90cbe6a37 Follow-up I5bc30eca7: Register <visualeditor-formatdropdown-format-blockquote>
Also push it into correct place in the toolbar, and disable it from media and
reference dialogs' toolbars.

Change-Id: Icc3bf056860e35def13e03e77ffc6782acc4196a
2014-11-25 19:01:02 -08:00
Catrope 64ce195fae Revert "ve.init.mw.trackSubscriber: Populate platform field with hack"
Caused JS errors when invoked too early.

This reverts commit 35d3898543.

Change-Id: Ie7dd4ef8323a16bb694e6300a096ba53cf4a0a91
2014-11-26 01:55:30 +00:00
Roan Kattouw 35d3898543 ve.init.mw.trackSubscriber: Populate platform field with hack
Use the target used as a proxy for the platform.
Assuming all mobile target users are tablets for now.

Change-Id: I24610e6b6d472744dc1011385c8810a65e06decf
2014-11-25 17:23:50 -08:00
Ed Sanders 5ce4885529 Replace hacky wikitext warning listener with sequences
Uses the generic sequence detection now available in core instead
of a custom hack that had to been manually bound and unbound to
every surface and surface widget.

As the sequence detection looks at just-typed characters the behaviour
has reverted to showing a auto-hide message. This resolves an issue
with the previous system whereby typing in the same paragraph as existing
wikitext patterns triggered the warning.

Depends on I6a4d71d in core.

Bug: T53751
Change-Id: I7d914b1b60a1cf8c79a724e5f634e1e666c9562d
2014-11-25 22:39:29 +00:00
jenkins-bot 69fe06a7ae Merge "Check wgRelevantArticleId to determine relevant page existence even on special pages" 2014-11-25 19:44:02 +00:00
jenkins-bot a7dc4af551 Merge "Catch pagedeleted errors and give the ability to re-create the page" 2014-11-25 19:42:58 +00:00
jenkins-bot f3d772a709 Merge "Only try to close save dialog before destroying surface if it's currently open" 2014-11-25 03:12:03 +00:00
Ed Sanders f79aed7572 Update VE core submodule to master (8ca8c41)
Local changes:
* Rename paste rules to import rules (also used by drag and drop)

New changes:
f5d83f8 Remove data-parsoid removal hack
99f938f Create 'preserveGenerated' mode for cloneElements and use in copy
938b44d [BREAKING CHANGE] Rename paste rules to import rules
c51288c ve.ce.Surface: Move insert HTML path to DM
10ce4cf Provide a FileDropHandler for HTML files
701bb9c Provide a FileDropHandler for CSV and TSV files
ca6b444 build: Update update-oojs.sh and update-oojs-ui.sh scripts

Change-Id: I5cfa15ab3efd03e2c64c2f9f725cb3098f53b32a
2014-11-24 18:55:32 -08:00
jenkins-bot 5861db05b0 Merge "Filter out comments from external paste" 2014-11-25 02:07:24 +00:00
jenkins-bot 17fd82b99a Merge "Fix MW skin hacks" 2014-11-25 00:47:32 +00:00
jenkins-bot 330a1732cb Merge "Change command list from whitelist to blacklist" 2014-11-25 00:42:48 +00:00
jenkins-bot 35cbae3d76 Merge "Fix the "you are now logged in/out" warning" 2014-11-25 00:19:14 +00:00
Ed Sanders c56a921585 Change command list from whitelist to blacklist
Also remove toolbar definitions as they can now be derived from
command availability.

Depends on If32d514a in core.

Change-Id: I2313f3cc2531686b27f96dc1110b28bb4b295f89
2014-11-24 18:28:37 +00:00
Ed Sanders 325bd0994e Filter out comments from external paste
Bug: T71821
Change-Id: I165efd75adf3d4092860c6d2bc408469dba31388
2014-11-24 11:20:18 +00:00
Alex Monk 1c04d32d75 Only try to close save dialog before destroying surface if it's currently open
Otherwise the closure promise will be rejected as it was already closed with
different data, if you ever opened and closed the save dialog before pressing
the 'Read' button. This means the code in the $.when will never be run, and
the surface never destroyed.

Bug: T75589
Change-Id: I3ffdd1c82506bcd2accc0f3fa113c0950a31918e
2014-11-23 22:30:40 +00:00
Ed Sanders 2653ce3bb3 Fix MW skin hacks
* Ensure surface widget font size matches main surface,
  move vector-specific hack to vector css file and fix.
* Fix base font size in non-isolated monobook windows.
* Move monobook z-index hack to global overlay only.

Change-Id: I1607dc77f81ac9c522e09a3b502aeb38fee02178
2014-11-22 17:52:46 +00:00
jenkins-bot 268a852455 Merge "Follow-up I19da270a: Make overlay appear above non-VE skin items in Monobook" 2014-11-22 02:29:01 +00:00
Roan Kattouw 9b3316a360 Fix the "you are now logged in/out" warning
It would tell you you were logged out when you were actually
logged in, and when I looked into it, I found lots of broken
things, including lots of confusion between the current
anon-ness and username and the new anon-ness and username.

ve.init.mw.Target:
* Check the new isAnon value, not the old one
* Pass the username to the event, rather than just anon-ness

ve.init.mw.ViewPageTarget:
* Use the passed username (new username) rather than the
  username from mw.config (which is updated, but confusing)

Change-Id: Icf406d49100d81e87c677fd6b57ff93cc29f601f
2014-11-21 18:23:11 -08:00
Alex Monk 9bb766c5bb Catch pagedeleted errors and give the ability to re-create the page
Bug: 52073
Change-Id: I86a6e1510ccb5e59e94a5262dd3ccd91fdf05a70
2014-11-21 21:44:15 +00:00
James D. Forrester 6f446e0d1a Follow-up I19da270a: Make overlay appear above non-VE skin items in Monobook
In I19da270a we bumped the z-index for the overlay from 4 down to 2, to avoid
clashing with the toolbar. However, the site logo, search box and personal
tools all have a z-index of 3, so 4 is required. Instead, bump the toolbar's
z-index up by 1 to 5.

Change-Id: I7e1edcf05cde054c7bcb8c13b5633930fb5ed3b5
2014-11-21 13:29:16 -08:00
Roan Kattouw 6d21d83244 Add instrumentation for edit schema
Move ve.track() subscriber to its own file, and have it
route mwtiming.* events (for TimingData) and mwedit.* events
(for Edit schema) differently. Most of the data population
lives in the subscriber, so actual ve.track() calls are
pretty lightweight.

Existing ve.track() calls with timing data were kept with
their names intact for backwards compatibility, but
we may eventually want to throw them out and start from scratch.

ve.init.mw.ViewPageTarget.init.js:
* Remove old track subscriber
* Track init and ready events
* Remove old ve.track( 'Edit', ... ) crap that didn't work

ve.init.mw.ViewPageTarget.js:
* Fire the saveWorkflowBegin event before the save dialog
  loads rather than after
* Remove unnecessary this.events.trackSaveError() calls:
  TargetEvents already listens to these events itself
* Remove badtoken handler because all it was was an
  unnecessary trackSaveError() call
* Add abort tracking
** Pass trackMechanism through deactivate() and cancel()

ve.init.mw.Target.js:
* Add static.integrationType to populate the 'integration'
  field in the schema

ve.init.mw.TargetEvents.js:
* Simplify onSaveError* methods away into connect bindings
* Map track topics to mwtiming.* so they can be routed separately
* Track save-related mwedit.* events

Depends on I978eda96c in WikimediaEvents

Change-Id: Iae677d9b15c71d2b18e795bd5179d11876c06abd
2014-11-21 11:59:15 -08:00
jenkins-bot 1b3fe26a3a Merge "Move tearDownBeforeUnloadHandler() to cancel()" 2014-11-21 19:42:59 +00:00
jenkins-bot ad908a666d Merge "Prevent JS errors when surfaceReady fires after deactivation" 2014-11-21 19:41:00 +00:00
James D. Forrester a1d75042c0 Update VE core submodule to master (fb57e24)
New changes:
7d8ed7f Copy in some IE CSS hacks from ve-mw
a2e962e Update OOjs UI to v0.1.0-pre (20c61ec865)
d99c62f Update OOjs UI to v0.1.0-pre (d4cfcce969)
7fe02b3 Fix lots of spelling mistakes and typos

Local changes:
Remove redundant IE CSS rules since core's I013688c5

Bug: 73565
Change-Id: Ic60cd5290932ec38fab26492fffa17c3a8e91398
2014-11-21 10:28:34 -08:00
Ed Sanders 2997cee444 Fix lots of spelling mistakes and typos
Change-Id: Icf78d3d599326d3f12d09edcd2b8491ed35ade04
2014-11-21 13:00:50 +00:00
jenkins-bot c8028dfe06 Merge "Fix ridiculously small font size in overlays under MonoBook" 2014-11-20 20:01:22 +00:00
Roan Kattouw 9ed9c6cfe0 Move tearDownBeforeUnloadHandler() to cancel()
Make sure it always gets torn down on deactivate, not
just on save. Otherwise we end up with multiple copies of it.

Change-Id: I7b95c316641fc48ce7087a0042ec6174fe03180b
2014-11-20 19:23:17 +00:00
Roan Kattouw 5317ce8082 Prevent JS errors when surfaceReady fires after deactivation
If you clicked "Read" while the editor was loading
(but only while the "Edit" tab was already active, not before)
then you could get in a situation where surfaceReady fired
on an already-aborted target, which caused JS errors.

It seems like we should clean more things up in this
case, but I don't know what they are. In any case,
we should not try to set things up on a non-activating
target when surfaceReady fires.

Change-Id: Id57bd63ff288156725e472e7d89009022090253a
2014-11-20 19:22:49 +00:00
jenkins-bot d8808da403 Merge "Insert last modified text as HTML" 2014-11-20 19:12:07 +00:00
jenkins-bot 921f606209 Merge "Remove unused CSS: toolbar contains no PopupButtonWidgets" 2014-11-20 18:27:55 +00:00
Alex Monk 8a1adef97c Fix ridiculously small font size in overlays under MonoBook
Copy in the font-size:127%; rule from MonoBook's main.css which is applied to
div#globalWrapper

Caused by Id425c56d

Bug: 73660
Change-Id: I05502295b81c62fd1180dff860dea68d76c2dfa9
2014-11-20 17:56:38 +00:00
Ed Sanders 6ffbc72f82 Remove unused CSS: toolbar contains no PopupButtonWidgets
Change-Id: I719a4dec30d5ca52337bd3a7d2506065562d831d
2014-11-20 13:56:48 +00:00
James D. Forrester 7317114187 Update VE core submodule to master (029fc7e)
New changes:
029fc7e Update OOjs UI to v0.1.0-pre (1fa4eb7a73)

Update changes:
Changes were generated by running this script:
https://gist.github.com/trevorparscal/265f1b8c854190637a1e

File changes:

Scripts (modules/ve-mw/ui/widgets)
- ve.ui.MWInternalLinkMenuItemWidget.js → ve.ui.MWInternalLinkMenuOptionWidget.js
- ve.ui.MWLinkMenuItemWidget.js → ve.ui.MWLinkMenuOptionWidget.js

File content changes:

Scripts (*.js)
- MWInternalLinkMenuItemWidget → MWInternalLinkMenuOptionWidget
- MWLinkMenuItemWidget → MWLinkMenuOptionWidget
- ContextMenuWidget → ContextSelectWidget
- ContextItemWidget → ContextOptionWidget
- TextInputMenuWidget → TextInputMenuSelectWidget
- MenuWidget → MenuSelectWidget
- MenuItemWidget → MenuOptionWidget
- MenuSectionItemWidget → MenuSectionOptionWidget
- OutlineWidget → OutlineSelectWidget
- OutlineItemWidget → OutlineOptionWidget

Styles (*.less)
- contextMenuWidget → contextSelectWidget
- contextItemWidget → contextOptionWidget
- textInputMenuWidget → textInputMenuSelectWidget
- menuWidget → menuSelectWidget
- menuItemWidget → menuOptionWidget
- menuSectionItemWidget → menuSectionOptionWidget
- outlineWidget → outlineSelectWidget
- outlineItemWidget → outlineOptionWidget

Change-Id: Ifded7f9e17923dbb56a722b7424ccd2854194c21
2014-11-19 17:04:26 -08:00
Alex Monk b50ad63fb5 Check wgRelevantArticleId to determine relevant page existence even on special pages
Added to core in I06cd0378

Bug: 66885
Change-Id: I9ce889be0ae1cbaab13a9f408d07b168da8affdd
2014-11-19 22:45:23 +00:00
jenkins-bot 30d8bf60f1 Merge "ViewPageTarget#onSaveErrorSpamBlacklist: Use mw.language.listToText now it exists" 2014-11-19 11:06:01 +00:00
Timo Tijhof 420b336d31 mw.ViewPageTarget.init: Simplify hideLoading and pushState
Follows-up Ica33de675, If505a46f54.

* The setting of 'uri' looked like a redundant local alias before
  passing on to pushState, but is actually important on itself.

* Remove binding for hideLoading. It's a detachable method on
  a singleton, not an instance method.

Change-Id: Ic3536caf3f42ee893124312fd5981b67336bd480
2014-11-19 02:58:17 +00:00
Roan Kattouw bb6e01c488 Fix back button not exiting VE
When you clicked the Back button in the browser, the URL
in the address bar would change (removing veaction=edit),
but we would not go back to read mode. This was broken
by 5c0c11753 almost a month ago but apparently no one noticed.

This is because 5c0c11753 moved the pushState() calls to
be earlier (in init init), making the replaceState() call
in the ViewPageTarget constructor (which is there
specifically for this bug) run too late in those cases.

The simplest way to fix this is to duplicate these replaceState()
calls before the pushState() calls in init init.
I feel a bit bad about copying code, but not very bad
because the code I'm copying already has a FIXME comment
about how there should be a better way :P

Change-Id: I6627a5d1d9377ae815bc58bceeb059ce9f4f19ab
2014-11-19 02:07:41 +00:00
jenkins-bot aa44c8916b Merge "Consistently use location as global, and location.href for full url" 2014-11-19 02:00:35 +00:00
Timo Tijhof c0692af5f7 Use history as global instead of via window
Just like DOM interfaces such as document and location. And JS
constructors like Object.prototype, and libs like jQuery.
No need for the window host object.

Change-Id: Ie39aaea2ca17bdec5fb3afe32a4e6c9f751bd0c6
2014-11-19 01:12:11 +00:00
Timo Tijhof 82657727f9 Consistently use location as global, and location.href for full url
The location object is a global, just like document.

Using it via 'window' needlessly adds complexity and, for example,
makes it harder to catch typos in static analysis.

Standardise on location.href in place of the many different
variants for accessing and assinging the full url:

 location =
 location.href =
 location.assign() =

And each with 'window', 'document' and without host object.

Change-Id: If88515bd88fc5b93ebacd4ec41fce02fec540f18
2014-11-19 00:20:08 +00:00
Alex Monk 94fadaec4a Insert last modified text as HTML
mw.msg can return things with <br />, which we want to be interpreted as HTML
rather than just escaped as text.

Bug: 73571
Change-Id: I7861432d9361e01f9def0578c342e60715c3d764
2014-11-18 23:42:18 +00:00
James D. Forrester 6b61addd06 ViewPageTarget#onSaveErrorSpamBlacklist: Use mw.language.listToText now it exists
Change-Id: I1289c43ea4be1cd9dc1addb7c765d7050b311d8d
2014-11-18 14:22:30 -08:00
Alex Monk ac6f6caeac On save, if there was no 'last modified' text at the bottom of the page, add it
Just hope that wgMaxCredits is 0.

Change-Id: Idf4a7cceb0650eaec4442244066d875a3ff38e06
2014-11-17 01:18:46 +00:00
Alex Monk ff3d76f488 Don't try to get newtimestamp from edit if no change was made
ApiEditPage can give us 'nochange' instead of the
'oldrevid'/'newrevid'/'newtimestamp' keys if we gave it a null edit.

Bug: 73463
Change-Id: Ic22597dfed11de3823471673404090a9bce12928
2014-11-17 01:03:00 +00:00
jenkins-bot ed7cfa1207 Merge "When saving, return the full contentSub to the client" 2014-11-13 20:45:09 +00:00
Alex Monk 581d1350e6 When saving, return the full contentSub to the client
And introduce code to make FlaggedRevs add its notices to contentSub.

Bug: 60718
Change-Id: Ibb91dc563ccf73d3b4bd1994134ccf02634fccb5
2014-11-12 17:36:59 +00:00
Alex Monk ba81c45da9 Restore selection after closing save dialog
Also simplify some weird focus code in MWSaveDialog

Bug: 72911
Change-Id: Ifb8fd9be96a199f86412247211e3920a35dd22bf
2014-11-11 23:55:39 +00:00
Roan Kattouw 0c92ef904c Followup 5c0c117: make the edit tab work with oldid= again
After 5c0c117, clicking the VE edit tab on /wiki/Foo?oldid=123
sent you to /wiki/Foo?veaction=edit , dropping the oldid parameter
and editing the current version rather than the old version.

Fix this by only recomputing veEditUri from scratch when necessary,
and reusing the current URI when possible.

Change-Id: Iee9a745990f1a2bad40f46b8cdaaa727bb7fead8
2014-11-10 18:24:45 -05:00
Roan Kattouw 9533c378ea Remove last usage of ve.bind() in VE-MW
Change-Id: Ia645e3d599da9b65b71dbe67f82b7c0fa3be1683
2014-11-10 15:45:09 -05:00
Alex Monk de73246ee1 Show category items as red if they don't have description pages
Also fix some lies I wrote in related code/docs

Bug: 65517
Change-Id: Iafacee7d8e460913d84808fe38ecc8da4a1817c0
2014-11-08 14:27:27 +00:00
jenkins-bot 613e69b2c8 Merge "Refactor out show/hide loading spinner" 2014-11-06 18:39:06 +00:00
Ed Sanders 841dfda98d Refactor out show/hide loading spinner
Change-Id: If505a46f54921ce4742ecfed598eb07a9ba5e3eb
2014-11-06 16:41:05 +00:00
jenkins-bot 1a6c46f7ee Merge "Use hasOwnProperty instead of 'key in obj'" 2014-11-06 12:37:04 +00:00
Roan Kattouw e144e55972 Followup 31bafa1: forgot to rename 'data' to 'args' for citation commands
Bug: 73001
Change-Id: I8cc436cbe16955130d25b2385e3f561fd2ffb4d5
2014-11-05 13:46:54 -08:00
Ed Sanders 0efbfa7e21 Use hasOwnProperty instead of 'key in obj'
Change-Id: I48f044c547b48a97cdfb31f7b887dca0ed7e341b
2014-11-05 20:54:50 +00:00
Roan Kattouw ccd9142262 Remove the loading spinner at the end, not halfway through loading
We were attaching its removal to the wrong promise in 2 of the 3
places where it was being called.

Also this file is horrible and should be refactored. A lot.

Change-Id: If74b1629266f22e2d110305b139bef4a8e69b13b
2014-11-05 12:50:40 -08:00
Catrope c8396eb65f Revert "Clear selection after tearing down surface to work around Firefox bug"
Superseded by I051ef92eeea9 in VE core.

This reverts commit d68eae6c8d.

Change-Id: Ie5e0a6169cfe3634e20a3b88e8aeb980b4094e10
2014-11-04 17:20:30 -08:00
James D. Forrester 31bafa183d Update VE core submodule to master (a942301)
New changes:
2cc219a Update OOjs UI to v0.1.0-pre (571f26d0ab)
3543cb7 Protect against offset=-1 in insertContent()
7a3d456 [BREAKING CHANGE] Move selection restrictions from tools to commands
3d847bb Disable desktop context on table selections
41282dd Missed function rename from RangeFix change
dd6c8b8 Support toDomElements returning an empty array
9be6464 Placholder -> placeholder
9bdd0a8 Restore basic styling to toolbar in core target (only)

Local changes:
Move selection restrictions from tools to commands

Change-Id: I88f3d04946bd1d03ed001d747475a8b495a0f64c
2014-11-04 14:11:04 -08:00
Alex Monk b2af92870a Update "page was last modified on date, at time" footer line when saving
Bug: 52403
Change-Id: I11e00066000e927f0551691d05fe11fe2ae125b0
2014-10-31 01:00:04 +00:00
Alex Monk b71bb51171 Remove more references to ve.bind
Seems some of them have crept back in since I1a7fc7f2 (and we missed one somehow)

Bug: 72156
Change-Id: I5631fb7d5963d06aeb238c1daa44344b2060ef1a
2014-10-30 20:55:44 +00:00
James D. Forrester 6626450419 Toolbar: Make styling and insert menus collapsible
Also re-synchronise toolbar in MWMediaDialog and MWReferenceDialog.

Change-Id: I8cd5f0d9f7e188fa1a7ab8d34a2796340f5e99b7
2014-10-30 12:22:20 -07:00
jenkins-bot 3806a2838c Merge "Clear selection after tearing down surface to work around Firefox bug" 2014-10-29 23:21:36 +00:00
jenkins-bot dcb14bc9bf Merge "Hide page status indicators even if they aren't :visible" 2014-10-29 20:59:00 +00:00
Bartosz Dziewoński 2a55baaef7 Hide page status indicators even if they aren't :visible
The container is zero-height and zero-width, so jQuery doesn't
consider it :visible, and yet it still takes up visual space.

Bug: 72693
Change-Id: I3bed5394a2a64a9f7f0a331f850aa412b5b11b7d
2014-10-29 21:52:38 +01:00
James D. Forrester cc8f6970a5 Update VE core submodule to master (f4ff1d6)
New changes:
d845991 Data model implementation for tables
a27c148 ContentEditable implementation for tables
3c47428 Actions and context menus for manipulating tables
543ca54 Support annotation tool on table selections
149cf3d Supporting copy paste of single table cells
25c9eee Table header/data format tools
e557e46 Merge cells tool
afcf2d9 Allow custom type and attributes when creating a table

Local changes:
Add the files and messages for table editing

Change-Id: I6e6c33b96d3089049a0fd5385191caa83df5756b
2014-10-29 11:52:09 -07:00
Roan Kattouw d68eae6c8d Clear selection after tearing down surface to work around Firefox bug
Bug: 71852
Change-Id: I3b4f0f755ece5c9e5444f8abadb1950a3f4ef318
2014-10-28 11:23:06 -07:00
Roan Kattouw 5876014c8f Override overflow: hidden; for <h3>s in the command help dialog
When this dialog is not isolated, MediaWiki's overflow: hidden;
rules for headings cut off part of the text in the <h3>s.

Compensates for Id425c56d9d24 in VE core.

Change-Id: Id9f6bd2bdbed0c6fe57e897c2415c3eceff900a6
2014-10-27 17:51:46 -07:00
Ed Sanders ab365ccacc Fix selection check in wikitext warning
Change-Id: I2f084eb4ee29bd166b05163cd2d6e64e0a4f136d
2014-10-27 16:21:24 +00:00
jenkins-bot 5d6ee06b84 Merge "Fix wikitext warning: Get range from selection before trying to find start" 2014-10-24 17:27:44 +00:00
Alex Monk 4639a1c044 Fix wikitext warning: Get range from selection before trying to find start
Bug: 72475
Change-Id: Ib43d9c6b9b46be461354b3b5bbdf9d5de90887a6
2014-10-24 17:18:08 +01:00
suchetag 5c0c117537 Make spinner appear immediately when clicking edit
Moved the spinner code from ViewPageTarget to ViewPageTarget.init to make it appear immediately on clicking edit.
Bonus: also fixes the URL to add the parameter vesection when clicking a section edit link.

Bug: 65453
Change-Id: Ica33de675203cc0f0594b8362731c4e98a644313
2014-10-22 03:20:40 +05:30
jenkins-bot 1d3f875dc4 Merge "Apply link styling logic to transclusion nodes" 2014-10-08 14:30:01 +00:00
Alex Monk 8f7713e796 Apply link styling logic to transclusion nodes
Only template nodes for now. Not sure what we can do about generated content nodes in general...

Bug: 65353
Change-Id: I848f36764b446ed30c74c0e641d0973008f6880b
2014-10-08 15:03:40 +01:00
Ed Sanders 1af18c3c12 Update VE core submodule to master (984b57a)
New changes:
6bbcd6a Localisation updates from https://translatewiki.net.
b8d8a5b [BREAKING CHANGE] The Great Selection Rewrite of 2014

Local changes:
Update to use new selection/range API

Change-Id: I5480d5c77d599c93c2d374fac88bb2fdb68b0024
2014-10-07 21:39:33 +02:00
Bartosz Dziewoński d751d569db mw.Platform: Use 'mediawiki.language' for language fallback chain
Bonus:
* Remove doubled dependency on mediawiki.Uri
* Add missing dependency on mediawiki.language

Change-Id: Ide716aad7b9f08ae9a24f99812f07273d89da33a
2014-10-05 19:00:32 +00:00
Roan Kattouw 005c6fef27 Fix syntax error in mittoHidden selector
Bug: 71521
Change-Id: Id34987e992a7c13cdfcfec85a7c33f7538606fe0
2014-10-01 11:04:31 -07:00
Alex Monk 0c0b545959 Blacklist div[id = kloutify] as well
Followup to I8af9f7ba

Bug: 67006
Change-Id: I84c8902ae8a81f9b62f6817e2f58809f28ca97f7
2014-09-30 23:01:00 +01:00
Alex Monk 0547d8c8ec Remove certain blacklisted elements when getting HTML from document
Hack to try to kill a class of bugs caused by misbehaving browser plugins.

Unable to test whether this fixes them or not.

Bug: 68900
Bug: 51423
Bug: 51521
Bug: 52791
Bug: 52884
Bug: 53252
Bug: 61776
Bug: 63121
Bug: 63229
Change-Id: I8af9f7ba4be45b42f6e2e382ff1a3e1f452058ba
2014-09-30 22:51:06 +01:00
jenkins-bot c8a408e8ce Merge "mw.LinkCache: Clean up" 2014-09-29 23:36:03 +00:00
Timo Tijhof 94c2c6c745 mw.LinkCache: Clean up
Pompidom.

Change-Id: Ia4e05d62845a7bce685cc9926101a238fe4bbce9
2014-09-29 16:33:46 -07:00
Bartosz Dziewoński c81ed82fa8 Add rudimentary support for page status indicators
Just hide them when opening the editor and show again afterwards. Will
need Parsoid for proper support.

Corresponding patch in core: I2389ff9a5332a2b1d033eb75f0946e5241cfaaf4.

Bug: 23796
Change-Id: I3ce5e7869be50dcd189ca24e2b3d7ebc62de4fc4
2014-09-29 13:45:10 +02:00
jenkins-bot 3d0aae0dcd Merge "Stop "Edit pages on double click" from affecting VE" 2014-09-25 22:52:19 +00:00
Alex Monk 77fc7e7d6c Stop "Edit pages on double click" from affecting VE
Relies on I0f6225b2

Bug: 53058
Change-Id: Ibd363dfb9da7d91055c541a83969d23401297603
2014-09-25 21:19:18 +01:00
Roan Kattouw 8517777b9f Update VE core submodule to master (8d5ec7a)
New changes:
8d5ec7a [BREAKING CHANGE] Rename ve.Document.getNodeFromOffset to getBranchNodeFromOffset

Local changes:
* Update calls for rename of getNodeFromOffset to getBranchNodeFromOffset

Change-Id: Ibc69f5a5deeed5698368bb19b30f14497c579e90
2014-09-24 11:34:14 -07:00
jenkins-bot f67989eaa5 Merge "Replace use of ve.isArray with native Array.isArray" 2014-09-24 03:05:57 +00:00
Timo Tijhof 66de06b0fa Replace use of ve.isArray with native Array.isArray
Change-Id: Ibc45e0fd80db7da872f6ef934cef915be9366e06
2014-09-23 17:58:09 -07:00
Alex Monk 93e4c59e4f Use LinkCache instead of an object in MWCategoryWidget to store hidden status (to be shared with the input widget)
Change-Id: Icb62b9b27ea1d61097d059fa268cc4834d46fc9f
2014-09-23 23:56:27 +01:00
jenkins-bot d2bcc9dc05 Merge "Show pending state on action button and keep dialog open when switching to source mode" 2014-09-16 23:44:22 +00:00
Roan Kattouw c4857a1f82 Use ve.parseXhtml() and ve.serializeXhtml()
Introduced in VE core in I0fb47f7c91f61.

In IE, this fixes corruption of style and bgcolor attributes.
In other browsers, the only change is that we now use
XMLSerializer rather than .outerHTML to serialize, but as
far as I can tell this isn't materially different. XMLSerializer
correctly uses HTML semantics when given an HTML document.

Bug: 70856
Change-Id: If48555fa4763e763484bbabfa0bc4ded0d0a5c58
2014-09-16 01:41:53 +00:00
Alex Monk 65b232a35b Show pending state on action button and keep dialog open when switching to source mode
Instead of doing a blocking overlay, we're simply keeping the dialog open,
which is necessary for the pending status of the action buttons anyway.

Requires Ib2c8f336 in OOUI

Bug: 65012
Change-Id: I65b5de4a1666a81b157a71f6fec490007689eb44
2014-09-15 20:44:55 +01:00
Roan Kattouw 7545868bc8 Don't return undefined in ve.init.mw.Platform#getLanguageName
When the language isn't found, return an empty string
instead of undefined.

Bug: 70731
Change-Id: Ia28e0d24e57e3a24414e04bee58ec76459665ad4
2014-09-12 14:43:31 -07:00