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