Switch to using FieldLayout for laying out forms.
New changes:
64650c6 Update OOjs UI to v0.1.0-pre (424b40373e)
Change-Id: I757aecf3485673f54aa9e7f38e88c079dda4451d
Also update use of OO.ui.PageLayout to work with changes in OOUI.
See: I58a279dd949a867a4698a791103d5a6f2bd4b67f
New changes:
8b545f4 Update OOjs UI to v0.1.0-pre (3a9a4c1da8)
Change-Id: Ib5063db055a63082d08b2858bffb9f854d76c01b
This escaped the icon -> indicator migration because it was rolling
its own class (!).
Now using IndicatedElement to render the indicator.
Also, cleaned up some incorrectly named CSS classes.
Change-Id: I7f3369f2ffd3c34f0d29c0a235d1a15ddd68d1e3
When a new search is performed in the MWMediaSearchWidget,
image thumbnail details are extracted from the API's imageinfo.
In some cases, this parameter does not exist. MWMediaResultWidget
relies on that parameter to get image details like 'src' and
width/height. Without it the search fails.
This fix makes sure that the thumbnail result is only displayed
if there are 'imageinfo' details at all. Otherwise, the image
result is ignored.
Bug: 61392
Change-Id: I5261059bb42d3a57441514eafaa0bffa3a3c3ba4
I fixed af, am, kaa, ln and szl wikis' Common.js files.
Ptwikiversity's wiki is working fine as far as I can see.
Change-Id: Ia856d0f5be1a7cb988df58e3914116075e9dc98f
mediawiki_selenium 0.2.3 let us specify the destination of screenshots
via SCREENSHOT_FAILURES_PATH env variable.
Change-Id: Ieb6b6803c58760415dc45dc691556be774d4be8f
It can be reused in mw.ViewPageTarget and mw.MobileViewTarget.
Also, check if this.section is undefined instead of not null and update
docs. restoreEditSection() does not accept any arguments.
Change-Id: Ibbcf4cb936a89d3ae77bb61ee97b8ad00a8d8a53
Adds setting and unsetting the #REDIRECT status of the page from the page
settings pane of the meta dialog, and toggle whether this is a static
redirect (i.e., it is not automatically changed when its target is moved).
If the page has a redirect set, the meta dialog will be shown on opening
the page so that users can adjust the redirect more swiftly.
Bug: 47328
Bug: 50878
Bug: 57173
Change-Id: Ibd89cf04486799f292b9fd045dae5bc23fcf6fd4
When an image with default size has a size change, the defaultSize
attribute in the data model must be set to 'false' so the new size
can be updated in parsoid.
Bug: 61270
Change-Id: I84388aec62674a3e3c6773f29bda7156254b5f4a
Update VE core submodule to master (84ced37) and update calling code
for changes in OOUI.
Depends on Ic967b88d55daf48d365487e17f76488b3f02c60f and Ib599b9bd5028e2df084fcc3da657aeb7f1569d2a
New changes:
94f03c3 Undefined variables first in selectNodes
62b5648 Localisation updates from https://translatewiki.net.
10c5a18 Don't descend into handlesOwnChildren nodes in selectNodes
4ed2432 Update jquery.client to MW's master (45192156d7)
d7e24b8 Localisation updates from https://translatewiki.net.
babb9da Localisation updates from https://translatewiki.net.
4639d18 Localisation updates from https://translatewiki.net.
a561537 Localisation updates from https://translatewiki.net.
8f7053a Localisation updates from https://translatewiki.net.
7112cc2 Update OOjs UI to v0.1.0-pre (a290673bbd)
Change-Id: Ie7d58472619509782f23a7dedc1ec27c3dcc7543
Rather than setting the wgPostEdit configuration variable when the
user uses VisualEditor, i.e. communicating via mutable global
state, include whether or not the user edited the page in the
ve.deactivationComplete event.
Bug: 52955
Change-Id: I0f5067550921008f74221d6c92882adfe404b3a5
This is a bit of a workaround for scalable image nodes to update the
current size rather than only the original one. This is done so the
MediaSizeWidget in the media edit dialog is fed the current dimensions
of the image even without the image being saved.
Ideally, the node's 'currentDimensions' property should be constantly
updated to current dimensions. This workaround fixes the given bug, in
which all images show the original wikitext/default size even after
being resized.
Bug: 61052
Change-Id: I902d1f51b1389f2f9b2b5c871b578ee2244a946f
Otherwise they will compare as identical to non-fragmented links, and
the link inspector won't bother creating a replace transaction.
Bug: 53219
Change-Id: Ifb7c9ffc1e952817df524fcf2418e07299a7bda5
Changes in MediaWiki core to the padding of div#content in Vector
(see 9d988924a0350228745375e074420a0e1214f7e3 ) made the toolbar in
VisualEditor's ViewPageTarget integration for Vector render incorrectly.
This adjusts the toolbar margins to match the changes in content padding.
Bug: 61224
Change-Id: Ie6b47f5d1929533669118ba51202c1fccda4a0d6
Paired with Chris McMahon and Jeff Hall. Watir and page-object API
changed so it is now required to specify that a frame is an iframe.
Change-Id: Id269ec5bc9dc9c960fdf1f606cbc635a58659fa7
For wikis that are installed in root directory, the API parameter
'scriptDirUrl' is an empty string. This change makes sure it is not
ignored.
Change-Id: Ib58adf76c184c32c0cdbb9dba31db1e4028fa383
Adding a type change to the media edit dialog. Also changing SelectWidgets
to ButtonSelectWidgets for consistency.
Bug: 38129
Change-Id: I9c855e6381d970b5f08460822366f6333af24f82
.then() removes the .abort() method from the promise, even though
we had return jqxhr; in the then() callback. So store xhr in
a variable and put the abort method back.
This fixes a JS error upon calling this.loading.abort();
Change-Id: I50460782e58399198bacc02d028984682ddbed56
Symptoms:
* When adding a transclusion part that already exists, if the item is
being moved to the right it will inserted at a position one place too
far
Diagnoses:
* When an index is provided with an item in a queue given to
TransclusionModel's process method, the part is automatically removed,
but the index, if given, is never adjusted accordingly
Prognosis:
* Cautiously optimistic
Treatment:
* Decrement the insertion index, if given and after the existing index
Change-Id: If321df8f63dae07c76663e76e14864e2f4518920
* Use correct class name for setUpToolbar() in MobileViewTarget
* Move shared setUpToolbar() code into ve.init.mw.Target
* Fix iconModuleStyles documentation, remove leading space
Change-Id: Icf5ed36fd817837c0434db8202bef8a78e6cb898
The selector is too weak and results in the toolbar being placed
in positions it shouldn't be! Whoopsy!
Change-Id: I63540130e4de01f9326fe110d606985fea70b644
This reverts commit 8e8525dea9.
This change seems to have broken all of the VisualEditor browser tests, similar to our first attempt at solving the same problem - not good :(
Change-Id: I5fa70a1164ebe8de1ecc37f72ba7ceffdc31e7bd
The toolbar in very desktop vector skin specific
In mobile we want to have more control over the toolbar,
and its placement.
* Thus make setUpToolbar abstract
And move the function to ViewPageTarget
* Introduce ve.init.mw.Target.static.iconModuleStyles to
allow the use of different icons
* Update the mobile toolbar to only have B and I tools
Change-Id: I4c72b4b9128b3a74de8b8b5bce7664fbb315216b
* Fix broken @extends (doesn't take value in curly braces, was
being parsed as literal text part of the class description).
Change-Id: I087df6df5e7b81314c90a79087e669c93032e80f
Symptoms:
* When adding a template with required parameters, the last parameter
is initially focused
* Parameters and parts appear out of order, and adding/remove/moving
them shows them in almost random placement
Diagnoses:
* Parameters are auto-focused when added, and parameters are auto-added
in forward order
* TransclusionModel's process method had a bug in which the code to
derive an offset from the item being removed would not be reachable
due to an inverted logic statement
Prognosis:
* Fatal, with a 10% chance of survival
Treatment:
* Set focus on the first parameter after auto-adding required
parameters to a template
* Invert the logic in TransclusionModel's process method, so that if
the index IS undefined we will proceed to define it
Change-Id: I299053b63045ec933747831f1b4aa63493760f8b
The jqXHR parameter is optional, so handle the case where it's null
gracefully.
Also fix the documentation for this method, it was full of lies.
Change-Id: I6ab799846a4d4b0d10cc5fd4d8c47264b1845bdf
wgSVGMaxSize sets the maximum size for the shortest edge of a
vector image. Pass this through to MWImageNodes.
Change-Id: I6410e7cda137cf4828d12280cb1e5cfc27805859
Implement new logic in ve.Scalable from I5b4f0f91b.
Also update VE core submodule to master (57ed8d3).
New changes:
59a0afe The great image scaling rewrite of 2014
Change-Id: I24a2976036310d3814cc7d1853a68745e0499bd5
As other widgets may be interested in the image info, this should
be part of the DM node, which the media edit dialog then fetches
and uses to populate the MediaSizeWidget.
Other fixes:
* Remove spinner, not really necessary as the orignal size button is
disabled if the orignal dimensions aren't set.
* Don't wait until image info call to resolve to initialise size
widget values. These should always be available instantly from the
attributes.
Depends on I9530ed4257e88b in core.
Change-Id: I394f49941b621059bc08c8a8f79471b2fe16c7d8
Parsoid doesn't care about the transclusion contents and it can
cause bugs if not removed properly. Remove the about group attribute
as that was for Parsoid's benefit.
Depends on Ib29972472d in core.
Bug: 60897
Change-Id: I907b2113c257baff5c022ff0749dca9dbb1fba5f
Technically these are possible to render (although there's currently
a Parsoid bug preventing it) but really references should just contain
one single paragraph.
Change-Id: I405d75a0935d3f4610e10b942b48fa0fa2679a20
Extend default paste rules to prevent lists/tables/references/headings
as applicable.
Also update submodule to master (76ff210).
New changes:
f1a927f Internal paste rules and type conversions
Bug: 59603
Change-Id: I952f98477219a55d25a2bd817344bde58a4862d4
When $wgDebugToolbar is enabled, a debuginfo key is always returned from the
API.
Unfortunately that broke the ve.isArray check on the result, breaking the
opensearch calls by the linker.
Change-Id: I907ef6fc2589581cf7333af3968b63b483af65a9
This reverts commit 9a20fc03b7.
This change appears to have completely broken the VisualEditor browser tests :(
Change-Id: Ia2753f0718ccc5ac5ce7b726bd89040171feae7c
The setup method just assumed this.node was of the right type, and
would just crash if it wasn't. You could select an image, open the
gallery inspector, and it would happily try to inspect it until
crashing because there was no .mw.extsrc attribute.
Bug: 60502
Change-Id: Idf0e9cf7ccaa37e607374ced150db732926a19f8
I told James this wasn't needed, but I was wrong. It is null in
the parent class, and DOM throws on document.createElement(null).
Bug: 60307
Change-Id: Iff8fda9acf9f37e537d7d6cf6106a801d6b71338
getAnnotationFromText was renamed to getAnnotationFromFragment,
update MWLinkInspector for this.
Bug: 60374
Bug: 60378
Change-Id: I202a2777f0202dcf42c5968daf8bdf5583b0a11b
In HD mode, the left margin was 0.25em off.
In narrow mode, the margins were completely wrong.
Bug: 51000
Change-Id: I7fd9cbc925b828fd780adb9ab2c71bcf15dc7284
* Remove the this.mediaSize custom store object and replace
with a hash function and the document's IV store.
* Remove this.inputs/this.fieldsets namespaces.
* Calculate this.filename as soon as this.mediaNode is set.
* Rename getMediaSize to getOriginalDimensions
Change-Id: I2030aade5d96555451f6a390d0aa3d44b860841f
* Reduce duplication by calling #removePart (equal, line by line)
* Reset `remove` at the start of each iteration, it was leaking
through to future iterations.
* Minor simplification in property access.
Change-Id: Ie0a83d582804bc50131ca5a8da36b0605dd4a6c3
mw.Uri will just be using window.document, which may have
a different base.
Depends on I86fe6c2f41e549 in core.
Bug: 58136
Change-Id: I320d5d477d97ebf25963ab2dc429931bc871dd17
Adding the ability to edit image size in the media edit dialog.
The size is now a separate widget.
The following changes were made:
* The dialog was changed to a booklet with 'general settings' and
'advanced settings', in preparation for other edit features.
* The original image maximum size is fetched from the API and cached.
* Maximum size is limited to the image's original maximum size.
* Aspect ratio is kept when changing height or width, using original
image size to preserve a sane ratio through the MediaSizeWidget.
* If an error is found in the size, the image will retain its previously
set dimensions.
Depends on MediaSizeWidget: I3d0f9348a52
Bug: 38129
Change-Id: I2946fb21c46ce05583b219f665ef68928188899e
This will make generating live previews possible.
Changes:
* Add change events to template model.
* Set up connect/disconnect.
Also:
* Add missing fallback for getParameterLabel (Param#label is
optional per the TemplateData spec).
* Implement getWikitext, to be used by the UI dialog later
to create a preview from the wikitext.
* Correctly mark ve.dm.MWTransclusionNode#escapeParameter as
being a static method.
Change-Id: Ie306ed03babf11568e954b1813ce5324f57d7f0e
Also update for indicator changes in Iaf7726150
New changes:
f981943 Fix toolbar indicators in demo
e849941 Update OOjs UI to v0.1.0-pre (11632fcada)
Change-Id: I16c38259ccedbfba8260f8a508b572cee6389517
* Add ULS, which was removed from VE core
* Add experimental mwlanguage module which adds ULS integration
* Hook in ULS to the existing language widget
Also update VE core submodule with changes:
* 1e92abe Generic language inspector
Bug: 47759
Change-Id: I325a4dcc316d0334fadfcaa46ad3acd45c6bf84b
New changes:
* e7e2833 - Update uses of Push/IconButtonWidget to ButtonWidget
* d9d9eb5 - Update OOjs UI to v0.1.0-pre (d9bab13)
* d9bab13 - The Great Button Refactor of 2014
* 22b93ef - Update OOjs UI build (88b2871)
* 88b2871 - Fix png transparency on required.png
* 670c468 - Add i18n
Also:
* Update uses of Push/IconButtonWidget to ButtonWidget as there
is a breaking change in new OOjs UI version.
This was separated from commit I325a4dcc316d0.
Change-Id: I82220d15221c52be03feafcfc85c2bd6c12ba462
When running in the context of MediaWiki, VisualEditor should tee its event
stream to MediaWiki's main event bus, mw.track(), so that MediaWiki event
subscribers have a unified interface for subscribing to events. Each
VisualEditor event topic is prefixed with 've.'
To test this patch, you can use this snippet:
mw.trackSubscribe( 've', function ( topic, data ) {
console.log( this, topic, data );
} );
Change-Id: I6b3f10b0dd0aa7fa47c3b35e2fc554622960ce52
For block images, show the bottom left/right anchor if the image
is right/left aligned, and both if it is centred.
For inline images, show the bottom right anchor unless the page is
RTL.
Change-Id: Icb5b74b954493257c517a5fbac5f0a0a457c544c
As URLs from the clipboard are always absolute, we need to detect if these
are from the same wiki as the current document, and if so convert back to
relative for Parsoid.
Bug: 58136
Change-Id: Id251afe65193fc6356628f1deb5ed757f8a6d347
Although marked as data-ve-ignore, it isn't ignored by Parsoid,
so about group it together as well.
Bug: 59002
Change-Id: I263e316fb10f3e6f23fc1d409686cdefbd28fafa
Also update MWConverter.test.js for test util changes.
New changes:
863288b Update OOjs UI to v0.1.0-pre (af97c1caec)
0bb2404 Refactor converter test utils to run single test cases
Change-Id: I90273786ac186df3eec13270f94d655b605bfdc4
Parameters are ordered using 2 consecutive buckets, the intersection of
paramOrder and parameters in use ordered using paramOrder followed by the
remaining parameters in alpha-numeric order.
A patch to TemplateData was needed to make this work, but we won't get a
crash without it, just no order specification:
Ic5b42c4189868412138680654c499b6c8bc8f47e
The paramOrder property needs some help still, as it currently requires
being either omitted or containing an exhaustive list of all known
parameters. It should backfill unmentioned params in JSON specified order
instead.
Bug: 51930
Change-Id: Ic3eb665389380c8e3dd6562b059c2f6655a22588
The down arrow is no longer default, so it needs to be specified
explicitly.
Updates submodule to include indicator changes
(see I0a1faef11a1e7e6ea3e44275c85f2efafae4dc9a)
Change-Id: I32aef3ea2e66fd823aeb07dac06cfefba9954270
It is treated specially which results in it being set to opacity=0 instead
of hidden, and leaves a large space at the top of the document. Removing
special treatment of it results in it being hidden properly.
Bug: 52243
Bug: 54325
Change-Id: I2d6157708bd7b4c3a7c6474b1612862120f963b7
Adds a checkbox to the page settings pane of the meta dialog that lets
users set or unset the __NOEDITSECTION__ flag on the page.
Change-Id: If1eca58e28d214021f5f5582856e595d4d0fbc43
Instead of having a hard-coded array of preference-triggered modules
that we need to maintain in multiple places, manage this data in one
place in a configuration variable, and explicitly declare the preference
and module names rather than interpolating both of them from a name.
This allows extensions to add preference-triggered modules, and it
allows them to have preference names and module names that aren't
prefixed with 'visualeditor-enable-' and 'ext.visualEditor.' respectively.
Change-Id: I9eb14349cd39125d5c11ffb44c962cc5febb6ba0
This creates a new panel in the meta dialog, "Page settings", where page-
level settings will be, err, set. For now, this exposes just the
behavioural switches for the presence/absence of the Table Of Contents –
__NOTOC__ and __FORCETOC__.
As part of this change, the meta dialog is renamed to "Options" to be
less confusing, and the icon for the meta dialog is changed to the
generic one for dialogs, which was previously unused. The page settings
pane is provided first in this list, given that the categories pane
(amongst others) is now directly accessible through the toolbar menu.
Bug: 56866
Bug: 56867
Change-Id: I33ce05c19d2e19b249e1cefd26fd0e3697d0085d
This fixes the issue where parsing HTML that started with
a text node would cause that first text node to be dropped.
Change-Id: I71dafd69e12cab50e6644b4817f0fd6105657216
This commit switches from using hard-coded media source urls to utilizing
MediaWiki's API call for meta=filerepoinfo. The API call is done only if
needed when the media insertion dialog is loading, and is done only once
per session.
Bug: 50673
Change-Id: Ia5ad9a8c00cca6cbbbc890359dc529e29e1a6be7
For some reason, the class-wide /*@noflip*/ on mw-halign-left and
mw-halign-right didn't 'catch' and cssjanus ended up flipping the
float directions in RTL. This fix forces noflip condition on each
of the lines separately, which seems to work.
Bug: 50910
Change-Id: I4cddce80397d821dc3cbf40ee4b4c471890d8d35
Tests run via SauceLabs do not always dismss beta warning
pop-up on the first attempt, so try and try again!
Change-Id: I074824c5f1c99d8e5408dcb1ada7b97a6d20ebe8
Changed URL matching condition to be indifferent
to HTTP vs HTTPS addresses since it's not
relevant for what is under test here.
Change-Id: I3382174d6cd0e05c28fc94e0a2fcbc5d170fed3c
1) Reduce some code duplication.
2) Added bonus: will fix a problem with the failing "links" test.
3) Removed some commented code lines in feature file.
Change-Id: I7ad4ade89c6477fd42eca178bae294f4dfecdf5b
* Add lib/ve.
* Remove modules provided by VisualEditor core.
* Update paths.
* Remove VisualEditor core specific things from Gruntfile.
* Remove entries from external.js already in lib/ve/.docs/external.js.
* Implement build script to compose a jsduck index that includes
all of VisualEditor core. Right now it includes VisualEditor's
index as-is, and because those patterns (e.g. ve.dm.*Node) will
also MW subclasses this means our category page will include
MW classes under "VisualEditor (core)" (before the repo split,
this was intentional).
This is inevitable unless we list every class individually, or
(the plan) until we move the MW subclasses out of the ve.*
namespace and into mw.* somewhere.
Bug: 45342
Change-Id: Iff45cd555430634c9fc341fd3b177c1e0625300b
Changes:
* 04754da (HEAD) Change label of disabled switch to 'disabled' in demo
* 33c379f BookletLayout: Sync outline with panels via focus instead of scroll
* ca53b7e Fix checkboxes so the value can actually be set
* eb77c91 Refactor ToggleWidget, add ToggleButtonWidget, ButtonGroupWidget
----
* 5ffe63d (prev) Spell removable and movable using modern English
Change-Id: I7f1e0cd92c6eb8346da35b59a293759f2c72d7a9
1) Using native page-objects methods for dealing with Javascript alerts.
2) Added tags to feature file per reviewer comment.
Change-Id: I3e9d9ae16f1c880878c8e198c647376a0b9aed37
1) Per reviewer comments, moved some of the verbosity
from feature to steps file in order to make
the feature file a little more readable.
2) Using random strings for the text of each edit
in order to make every edit unique.
3) Removing a commented line that wasn't needed.
Bug: 57654
Change-Id: Ib8b15964436d9c24556fac32977a64e2d5f22044
Move target.surface from mw.Target to Target
* All targets use this, let's standardise it.
Move target.$document from mw.ViewPageTarget to Target
* It was initialised with null in mw.ViewPageTarget, but the
assignment happened in mw.Target. So it should be moved up
at least to mw.Target.
* Since it is useful to have in sa.Target as well, moved it up
to the abstract Target, and implemented in sa.Target and
immediately used in the standalone demo where we were already
duplicating the find( '.ve-ce-documentNode' ).
Add missing target.setupDone = false; in sa.Target
Add missing target.toolbar to Target
* Was used in all subclasses, but never initialised in any of
the constructors. Let's standardise this property name as well
(instead of initialising it in three places).
Move target#event-surfaceReady from mw.Target to Target
* sa.Target uses it as well, and considering Platform#initialize
is already standardised in the abstract class, Target#setup
being deferred is most likely to happen in each target as well
so let's avoid different events being invented for the same
thing and consistently use 'surfaceReady'.
Change-Id: Ia8bde188a4cde7e1615c2ae9c5b758eefc5d9cb7
MWBlockImage
* Remove properties which just cache model properties. We can get
fresh values from the model whenever needed and this just causes
problems keeping them in sync.
* Tidy up DOM documentation indentation
* Merge setupCaption and setCaptionVisible into updateCaption. The
caption's visibility can be calculated inside the method from
model attributes.
* No need to generate figcaption on init, updateCaption will do
this for us
* Storing full view and model in this.caption is unnecessary,
just store this.$caption (view.$element) and this.captionVisible
* Append the caption directly to the figure now there is no container
* Simplify setCaptionVisible
* Add in fix to account for border to figure width
* updateSize can get values from the model if they are not provided
* Remove unnecessary styles being set on this.$element.
MWImageCaption
* Generate as a figcaption instead of a div for direct attachment
MWImage
* Missing docs
CSS
* Cleanup reset styles, remove redundant add in required
* Fix margins for left/right floats to match .tleft/.tright
* Use more specific selector for inner border (thumbimage) to avoid
matching shields.
* Remove unnecessary frameless styles, it has no border by default.
Change-Id: I52e0e10b465bb9761c2e4be28c98bec37b0dd2ca
Following Ruby coding convention[1].
Also fixes "no implicit conversion of nil into String (TypeError)"
error.
1: https://github.com/styleguide/ruby
Change-Id: I3bcf9ba08476117921de7d5a242f3726d8b05efb
Consistently:
* Use <!DOCTYPE html>.
* Use lowercase element tags.
* Indent <head> from <html>.
* Use <meta charset="utf-8">.
* Indent <script> and <style> content from open/close tag.
* Put <link> before <script> when in <head> (in ve/test).
* Use .html instead of .php for indexes where PHP is no
longer used.
* Use the same license header as we use elsewhere (/*! instead
of /** and no @file)
Gruntfile:
* Include the new .js files in jshint (demos/**/*.js).
* Order buildloader keys in the same order as the directories
they go to (alphabetically).
* Add missing jshint patterns:
- .docs/**/*.js
- build/**/*.js
- modules/ve-wmf/**/*.js
* Add missing qunit test:
- qunit.unicodejs
* Add missing watch patterns:
- .jscs.json
- qunit.unicodejs
Also:
* Moved relatively large pieces of script into separate files
so that they are less repeated (though .template) and also
able to be linted properly.
* Fixed jshint warnings in newly-created trigger.js and demo.js.
* Moved <script> elements already in <body> to bottom of <body>
(in ve/test and eg-iframe).
* Moved <script> in eg-iframe from <head> to <body>.
* Fixed buildloader grunt task to use a non-\n whitespace match.
for the start as well, the newline before the placeholder was
being stripped.
* Removed the (now obsolete) index-phantomjs-tmp hack.
Change-Id: I7c5a371b82f69f367a8e1c11673d2f37868bc931
PhantomJS doesn't play nicely with document.execCommand and complex
HTML. For testing the attribute stripping, use the clipboardData
path. Add in a special clipboard key value that allows us to manually
trigger this from the tests ('useClipboardData-0').
Change-Id: I0de842095a6a9a766f0f9a2249064ca7707283c8
'grunt build' builds modules/ve/test/index.php, demos/ve/index.php
and .docs/eg-iframe.html from the associated *.template files.
Got rid of the JS-based SVG/PNG switching logic. Instead, we now
just use SVG unconditionally. We'd already dropped browser support
for browsers that don't support SVG anyway.
Change-Id: Iba2e68f17904687cb13e793a410e095f28f1b13c
I intially thought it was associated with the language inspector, but
it's not, it's the label for the languages pane in the meta dialog.
Change-Id: I478e3951862a25eee056e3df6cc3c9f9f7d9d935
* Split files according to ve / ve-mw paths
* Split messages according to msgs-ve / msgs-ve-mw
* Update dependencies accordingly
* Remove ve-mw/ hack in makeStaticLoader.php, no longer needed
Bug: 45342
Change-Id: I6cb89606c307e27e237a1e9b56b94dfdcd310f41
VisualEditor.php:
* Make jquery.i18n a dependency of ext.visualEditor.standalone
makeStaticLoader.php:
* Remove ve.init.platform.addMessages() call with PHP-generated messages
* Add fake module for jquery.i18n
** Needed because the module might come from MW core
** Also add special treatment for fallbacks.js and language scripts
ve.init.sa.Platform.js:
* Remove basic message system, replace with jquery.i18n
* Add initialize method that loads messages for current language and
fallbacks
ve.init.sa.Target.js:
* Wait for the platform to initialize before actually doing things
* Add .setup() method to allow callers to short-circuit this process
** This is convenient for callers of ve.init.sa.Target in the test suite
ve.ce.test.js:
* Use existing ve.test.utils function for creating a surface
ve.test.utils.js:
* Call .setup() on the target so we can get a surface synchronously
ve.init.Platform.test.js:
* Make these tests async, wait for the platform to initialize
* Allow for missing messages to be output either as <foo> (MW)
or foo (jquery.i18n)
* Get rid of message clearing code, namespace test messages instead
Change-Id: Iac7dfd327eadf9b503a61510574d35d748faac92
Per Bug: 58406, updating search criteria for
tranclusion templates to work with existing
content in beta labs.
Please enter the commit message for your changes. Lines starting
Change-Id: Iac6919d234bd298034cc3c3d90ec62239a3fd0df
Applying same fix that was applied earlier to "bullets_steps.rb"
since that relieved frequent timeout behavior seen with tests
run via SauceLabs.
Change-Id: I0c924a315cd2bf4821a9155a1d1dcd052910e50e
When pasting into a selected paragraph, or emptying a paragraph Chrome
adds a linebreak. Our paste into empty uses a selected paragraph for
context so the converter picks up this extra linebreak.
It is possible that this breaks are intentional but not likely
so better just to trim than to leave the user with a break which
doesn't even render clearly.
Bug: 58347
Change-Id: Ia6b22cdaeedf1a75bb529c9a5312add9c3ce182c
For the benefit of pasting out of VE.
Use data-ve-ignore where necessary to avoid the HTML being
used on the way back in to VE.
Change-Id: Iabe678c4246c1d1f51abb058b6e750811fdf9bea
Also make available as a static method so it can be used by the
converter. We will need this for generated HTML for the external
clipboard.
Change-Id: Ief843ac10cd6c6e4b25e09a007625d363792adff
They conceptually belong in VE-MW, but right now the language
inspector is used in the VE standalone, and not having the
messages breaks it.
Change-Id: I0f84c6ee6c6142581c895515a2bd2a6caf4e511d
The duplication of the toolbar definition is ugly but we don't
have a better system to say "give me the same except demote this
one thing" right now.
Change-Id: Id74ed1a18aee4a947992bdd626702f578bbace14
From f6102aa4fe
Also rename jquery.i18n.messages.js to jquery.i18n.messagestore.js ,
somehow these files are named differently between the version in ULS
and the version in github and I didn't pick up that change when
switching between them.
Change-Id: Icd78c1374969f1ea539938237d405a8aeecd1dd7
getDirectionFromRange returns the direction property of the ce nodes under
that range. That method is mostly useful to recognize the overall block
direction of a selection or fragment.
The method is currently used in the following locations:
* ve.ui.Toolbar onContextChange - as a means to recognize the current context's
block direction for the icon directionality.
* ve.ui.MWExtensionInspector - if the selection is text and not an existing node
the input directionality adjusts to the context direction.
Bug: 57421
Change-Id: Ifc01b8e5dc0a2fe39d221e59e452c5cfad709a2d
1) when_present waits to deal with SauceLabs sluggishness
2) Restore a "sleep" method for running test locally
Change-Id: I692befa5da607cf2468e3a56eb9b634a17f8deb2
This is for HTML we generate for the benefit of the external clipboard
(i.e. pasting into other applications).
Change-Id: I1c5ff4760f17e1981a78a0bc44f8e296454bb065
Hashes weren't using the new [ object, config ] set up so were
never matching the store. Also added a check to see if the
originalDomElements actually exists before trying to use them
(they may have been removed by a clone operation).
Change-Id: I886e369ced9a9d2e0e457ced9c21b2a7a8e55d58
If you've just pasted in a reference and a list the internal list
nodes may not have been rebuilt yet.
Bug: 58242
Change-Id: Ib10b81f4023194791f789f3e7dda393f2e355ea3
With blocks comment out where they're not wanted.
Bonus: Actually make the pasteSpecial command available in these
contexts.
Bug: 58404
Change-Id: Ic77c252ddc9ae54019b2d86ee5f8a6f4febf4292
Adding @noflip to align-left and align-right in the <figure> css styling
rules and removing the need to resize the Branch Node div element on center.
Change-Id: Iec6e589ba9ecdf32c1a0934b9eb05ee3fd42af66
This means we no longer have to inject the store/internalList etc.
state into the converter manually before generating DOM.
Change-Id: I9d1f5f2592a7c5bf4ad404416b79ad65afd83b9c
To match its inverse getDomSubtreeFromData, and to make clear
that the input can be any subtree, not just a full document.
Change-Id: I4853bb6def0059eda43f86f0dcb6dd44309dc35d
* Don't add ext.visualEditor.base to it, and strip of ve-mw stuff
** .base doesn't contain ve-mw stuff any more, so no stripping needed
** Instead of appending .base, just load .base and create a
separate fake module for Standalone init.
* Don't manually register .sa files
** Instead use ext.visualEditor.standalone, it's right there.
** Add missing CSS file to .standalone.
* Documented the purpose of 'Dependencies' and removed scripts
from that fake module that don't fall under that rationale and
instead add them as regular modules (rangy, unicodejs).
* Removed weird 'jquery' dependency in 'ext.visualEditor.core'
module. This is strongly recommended against, and might
actually cause jQuery to be reloaded due to outstanding bugs
in core with the state machine in the startup queue (jquery, mediawiki).
* Unlist unused 'jquery.client' dependency in makeStaticLoader.
As per the module definitions in VisualEditor.php, this is
only used by the .mediawiki module. Grepped modules/ve/ and
found 0 uses.
* Update dependency order to roughly match the dependency tree
as it is specified in ResourceLoader (e.g. rangy is for .core,
not .base).
* Keep fake modules out of ResourceLoader.
Change-Id: I2a31543e5ad2fc39f5980fea855172108eda4428
ve.dm.MWTransclusionNode
* Implement getClonedElement to remove originalDomElements
and originalMw. We don't want to put these in the clipboard
as there is no guarantee they are the rendering of the current
set of parameters (a refresh may be in progress) and they may
confuse the converter on the way back in.
Remove about attribute to prevent about grouping of duplicated
nodes.
* Set an extra attribute to flag that the outputted DOM doesn't
have any generated content attached to it that can be stored
on load.
* Check for said attribute in toDataElement and skip the
storeGeneratedContents step. This will trigger an async update
of the generated contents on paste.
ve.ce.Surface
* Call cloneElements before writing to pasteTarget so data in external
clipboard is stripped of generated contents.
ve.dm.Node
* Only strip data-parsoid as other attributes may be meaningful.
ve.dm.mwExample, ve.dm.Node.test
* Update tests
Bug: 58241
Change-Id: I3e15cc97e94747647078204a0b398e6ac3ec6382
This change is meant to transform the current block image node rendering
in ContentEditable from the nested <div> structure to a <figure> tag more
closely matching Parsoid's output, with CSS to style it the same. This is
mostly so we can work with and display attribute changes, like 'type' and
'alignment', without constantly destroying and rebuilding nested <div>
structures.
This change also includes all the attribute changes that will be called
when the media edit dialog changes image type, alignment, size, etc.
Node: The mw-classes 'thumb', 'thumbinner' and 'thumbcaption' are
preserved in the structure of the <figure> but CSS designers should note
these styles are no longer necessarily attached to <div> elements.
Bug: 53436
Change-Id: I40065acd9fd59d30f94b5336736d4986e8de15aa
Move all text styles, and the remove styles button, into a new 'list' toolbar
group, using the text-styles icon. Less-used text styles (strikethrough, code
and underline) are demoted, with remove styles at the end, and bold and italic
promoted.
Now re-label the "More" catch-all to now be "Insert", which is what's left.
Change-Id: I66a1bba347ea64e540106b1090995b3117a8b1b2
This introduces a small reorginization of how commands are registered so
that they are associated with their corresponding symbolic names.
This change is mainly to aid with event tracking, but it might be
generally useful for other things as well.
Change-Id: I2ccf4522f786a54c1f5395008b7b0333a1fa6072
We already do this for removeHtmlAttributes mode.
Add tests in ElementLinearData and ce.Surface. Get rid of unused
clipboardHtml param in ce.Surface tests as it is unused and replace
with clipboardKey flag which tests the VE->VE paste path.
Change-Id: I0cd82a37d6e765ecab489dc22f642ebbcfbb5387
Make available only as a static method so you don't accidentally
change a node without using a transaction.
Change-Id: If27442b502ec176a58e75ef4f9afa5119d06dcc5
ve.ui.Context#updateDimensions does two things: it updates the position
of the popup by measuring where the selection is, and it updates the
width and height of the popup by measuring the contents of the inspector
or the context menu.
In some cases, measuring where the selection is fails, and
ve.ce.Surface#getSelectionRect returns null. This seems to only happen
1) in phantomjs while running the test suite and 2) when an inspector
is opened and doesn't adjust the selection while opening. I suspect
it has something to do with the selection not having been recently
set or the documentNode not having focus, but I haven't investigated
this in depth yet.
Prior to 5d7673eb, the editor would simply crash of the position
measurement failed. 5d7673eb changed this to just bail completely if
the position couldn't be measured, but that's also wrong. Without a
position measurement, we can't update the position of the popup, but
we can still adjust its width and height, and we should.
The failure to adjust the popup's width and height in this case was
causing a bug where opening the link inspector with the selection
set exactly to what the inspector would expand it to would cause the
popup's width and height to never be adjusted, and most of the inspector
to be invisible.
Bug: 58301
Change-Id: Ia6504e0a7b0cd1affbff2632e9f573684f1d5dcb
Captions were not in the allowed lists of children for tables.
This causes an exception to be thrown if you try to do fixUpInsertion
on a transaction containing captions.
Bug: 58318
Change-Id: I866e015c14e787830c45da93dfed9d2119fb0865
Bonus: give both the language name and page name
lang and dir attributes.
Further bonus: reintroduce message that was deleted
earlier with all of its original translations.
Change-Id: Id137ff9a069799b6c09574b72f450eac6665d144
It appears that if the pasteTarget is given focus too close to the
range being set it may not take effect in time. Moving up to before
any of the selection setting logic seems to fix the issue.
Bug: 58283
Change-Id: I9bfb0ab6952863496fb3548e6804cb347d52cc57