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