Since all transclusion nodes can be interacted with (including the
'hidden' ones,) there is no need for MWTransclusionMetaNodes.
Change-Id: I23d37e3d82029b7475ec68ebb04883c7e05370cc
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
By removing from and re-inserting into the InternalList when the right
attributes change, rather than trying to hack it into the model's
updateInternalItem (which won't get run on undo).
Bug: T71119
Change-Id: Iaf7a3127576b94666e05691902d2782394d24afb
Since Bug T90654 has not been addressed in two weeks, I would
rather make the test pass, assuming that the slightly altered
diff view is a feature not a bug.
Change-Id: Id2ce34b2838cf56a9411173f9b2e9ad8e5320545
This has been failing for a while, for several reasons, originally
because an updated version of Cucumber interpreted an "&"
character in an unexpected way.
Change-Id: Icd79ec9b489557c3259ff7f2c11b2a899c767d0f
It seems to have been intended to allow overriding of which icons
are used, but this isn't used anywhere.
Change-Id: I312f6c8e69d5a4d9c11f4af5f9487d0890a1f4e1
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
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
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
Also appending both the default value and the example value to the
field description. The input placeholder will show the default
value, the example value, or nothing.
Related to TemplateData change I9e2d66a805e25 but works without.
Bug: T53049
Change-Id: I4e5e57546f6d3c22e778ba061a5344ddee085c17
In the case the node is empty and we need an icon, use a separate
icon element that is detached and reattached as needed.
Change-Id: I5bcbe531cb1db1a4ac25ed4a2f462dde08513b7b
When deciding to add an icon to a transclusion (specifically, when
it is hidden) do so only if it is justified. Otherwise the
node becomes the icon even when it has information in it, which,
starting from the latest OOjs UI change, also has specific (small)
sizing.
Change-Id: I521c92fc645a392077e6cc90f55557c4cea3cb11
Since GCN aggressively modifies this.$element, these classes
didn't survive for very long, and they weren't being used
anyway.
Change-Id: I6e9827499374941fbded983956c57cc250d957c8
Changed the message of the update redirect message that is found in the page settings popup to something that is grammatically correct.
Change-Id: I71eaa143274742ebc19720f5a1b72008025d69e3
Also, fix @returns comments (should be @return) and remove unnecessary
@method comments from the documentation.
Change-Id: Icd303626ac745c7ab5bff164f9b8cac276de1523
This function was not returning a jqXHR for a long time. It's usually
a mw.Api promise, but might be something else.
Change-Id: I59975cc9dfbea70e5ae666fcc9915f10bd199e4d
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
When calculating whether to show the 'read more' button on fields
that are configured 'descriptions', use a threshold to check if
the height is enough to be shown.
Bug: T87265
Change-Id: I0601e4fa92cb58903641a146500cf560bc029425
Check if, after being fully rendered, a template is effectively
empty. If it is, add an icon and style to it so it displays for
the user and is clickable.
Bug: T51806
Change-Id: I11b9f0aba3398a3deb3e755051366e174a28e586
Exactly the same change as Ifee722a7f60.
Because we have such excellent code reuse, or something.
Bug: T85622
Change-Id: I18bd5d3923771b6ff149aa589bb2fa23beecf4f5
By adding this tag we were able to delete VisualEditor JJB builder and reuse
browsertest-website builder. See the task in Phabricator (linked below) for
more information.
Bug: T90423
Change-Id: I206d512adcb304b6e8823cc9e05acfcf3880c6c8
New changes:
a65ad7c Move special character inserter to toolbar dialog manager
… and add it to the toolbar as a terminal option.
Change-Id: I35834d866a13c5dea7f5a520c63b8a99451fcf6d
Add the new feature for user agent checkbox for the mw.Feedback
dialog. This bumps our MediaWiki dependency to 1.25wmf20.
Change-Id: I741ded83de4f575777a15cb20735e351039dc81f
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
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
We unconditionally retrieved originalHtml from itemNode,
even if there was no data-mw.body.id, so as long as
the reference itself wasn't edited, we would never overwrite
data-mw. This meant that if the <ref> with the contents
was deleted, the contents wouldn't be transfered to the
first <ref> tag with that name like they're supposed to be.
The solution is to only look at originalHtml from itemNode
if data-mw.body.id is set.
Change-Id: Ib87491b6fa6a77d62384158f8e8f7dcc2a36c23a
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
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
For the masonry view, the result widget resizes itself according to
the rows and other images in the row. Up until now the resize was
a bit buggy, occasionally missing height/width values. This is
mostly due to rounding errors, but also due to a small double
calculation that is now fixed with this code.
Change-Id: If18adc5280e4bdbb9174b7c7e6e4eadf3c1ab26d
Make it clear that this scenario is supposed to test
and take screenshots of the "Edit source" and "Edit" tabs.
Change-Id: Ia480eacb2629553c378ecad52a9b0ed1336cd0f3
Make sure that the validation method accounts for local api
vs remote api when checking for valid variables.
Bug: T90795
Change-Id: Ia6877ca6ccc4e65d1db053f107e7702721e2da3c
Again. Originally done in I5a664f86, the crucial part of which was reversed
in I1500f480.
Bug: T89913
Change-Id: I39b0cdcdb5f76fa75f506c874ef6223d8d8d53e6
The screenshot here is supposed to capture the menu that opens
when the hamburger icon is pressed.
The previous code captured the whole toolbar. This is now fixed.
A sample screenshot is here:
https://commons.wikimedia.org/wiki/File:VisualEditor_More_Settings-en.png
Change-Id: Id9501b8b1b8d41411c2f81bf4d4954a6bb41addc
This screenshot only needs the "Cite" button,
and not the whole dropdown menu.
* The clicking step is removed.
* The element is reconfigured.
Change-Id: If4b863e51db611b96186ca6381d0426a335a9a17
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
It depends on jQuery UI so it pulls in a bunch of things
that we can do without while loading VE.
This does mean there's a network delay while we load
mw.feedback (if it's not in localStorage cache already),
so after the user clicks "Leave feedback", nothing happens
for a little bit until the code arrives and the feedback
dialog appears. There is no spinner or anything during this
time; we may possibly want to add one.
Change-Id: Ie4dd9efcfff238fefad2783e22575ffd3fc648e7
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
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
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
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
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
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
New changes:
0bc7034 Fix unmodifiedness test in showSelection
6e27ea1 Test clipboard mode in converter
5481dc5 Localisation updates from https://translatewiki.net.
f7623bd ve#resolveUrl: stop accepting string values for base
bce9180 ve.ce.FocusableNode: Remove superfluous ve.ce.Surface#appendHighlights call
Local changes:
* Update test case counter for clipboard tests
* Add clipboardBody to tests
Change-Id: Ie0f149b74abf10e740be63e3759416ecc8bed656
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
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
New changes:
159ed9b Add 'width' and 'height' to the list of attributes corrupted by IE
a41b51a ve#track: refactor callback calling convention
4280219 Generate CommentNodes more leniently
bf202b6 Fix old metadata tests to use actual metadata
Change-Id: Ia8515d12f5d443e4e07b2c8291bf127341312e1e
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
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
* 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
* The methods from upload.rb are moved to a newly created gem:
https://rubygems.org/gems/commons_upload
* upload.rb is changed to simply call the method from the Gem.
* Gemfile is updated accordingly.
Bug: T89718
Change-Id: I229fbcd1b8c3cb03885947509aef27f0ae583a1c
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
Otherwise it gets built lazily when building the view tree,
and that makes it difficult to instrument it separately.
Change-Id: Ie8c2027e87a87e59323165f0edbba49c4a66d1b3
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
Generalize MWResourceQueue and MWResourceProvider so they are
extending the general classes from ve-core. This also allows for
tests in ve-core on the resource queue system.
* Depends on ve-core change I5346081317e *
Change-Id: If34cd99334f4ccb93015c3646f68ae3040b9c5d7
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