Commit graph

335 commits

Author SHA1 Message Date
Ed Sanders a4b250c790 MWImageModel#insertImageNode: Separate out linmod generation
Change-Id: Idee01e2e59f2a68481476f3d784502d3ebdf015b
2015-08-03 01:11:50 +00:00
Ed Sanders 97e0cd28a5 Make missingref references uneditable, not uninspectable
Depends on I1ba8978dd in core.

Bonus: remove not-allowed-cursor & highlight title (which was
broken) now that we can display this information properly.

Bug: T106810
Change-Id: I1800490ba1b8e10ff54b26372a8a78661c1c7d68
2015-07-24 12:03:05 -07:00
jenkins-bot 31e45cf530 Merge "build: Drop last jscs over-ride and make pass" 2015-07-23 18:48:48 +00:00
James D. Forrester 57f8fc5368 build: Drop last jscs over-ride and make pass
Change-Id: I4ff60af79cfc6e09e284d51f9b7ac2afa900f0f5
2015-07-22 15:13:09 -07:00
jenkins-bot 8d467915f7 Merge "Revert "For empty / whitespace-only headings, output <p> instead of <h#>"" 2015-07-22 22:05:34 +00:00
Ed Sanders aeedd808cd Never use original data optimisation when in clipboard mode
In clipboard mode we need the full body regardless of if the reference
has changed since load or not.

Bug: T104230
Change-Id: Ie59e04d381f2fd2680e8af0cf05a80df71052822
2015-07-10 19:45:56 +00:00
Ed Sanders 924c58a893 Revert "For empty / whitespace-only headings, output <p> instead of <h#>"
Functionality is now provided by Parsoid's scrubWikitext.

This reverts commit 884f301aa0.

Change-Id: I19f340a1c2d9718bfa05c6667042488f3a589719
2015-07-09 11:46:50 +01:00
Marc Ordinas i Llopis 7a33613d23 Use Parsoid's new Cite HTML and CSS
Starting with I21fbbd3247bf7801e5ef9bd5312f95777f4dd6ef, Parsoid
will emit a new HTML for its Cite extension, which enables CSS
styling. In I487095df8a7c4241a14f7b4480360f6774130bec the new
module 'ext.cite.style' is added to the Cite extension to style
this new HTML format.

This patch
* Loads the ext.cite.style module if the Cite extension is
  present.
* Uses the new HTML format for the internal structure of
  reference and reference list nodes, so they are correctly
  styled.

Backwards compatibility: Only new HTML is used internally in VE,
so as long as ext.cite.style can be loaded the new styles will be
used. It does not depend on which format Parsoid returns, so this
patch only depends on the Cite extension patch, not on the Parsoid
one.

Note: The only way I've found of adding a ext.cite.style dependency
only if Cite is present is to register the whole
ext.visualEditor.mwreference module in the
onResourceLoaderRegisterModules hook. Maybe someone can point to
a better way?

Bug: T86782
Change-Id: Ibf333a502d64d2ed6e029221458b7c606554e414
2015-07-06 14:23:18 -07:00
Ed Sanders 6822635158 Use new hasContent method on linear data
Change-Id: I430e628a9db30970ecdf6996bc51e7440a474077
2015-06-30 09:45:24 +01:00
jenkins-bot bbd91b0fb9 Merge "Remove redundant match function from block image" 2015-06-25 00:06:40 +00:00
jenkins-bot 2582f951af Merge "Give TranclusionNodes a matchFunction so they beat LanguageAnnotations" 2015-06-24 23:53:32 +00:00
Ed Sanders 6d8bd6f6e8 Remove redundant match function from block image
Functionality now provided by allowedRdfaTypes.

Bug: T98999
Change-Id: Icd933f4456fdc85fe08bdc9edc61040cb5bacd89
2015-06-24 23:45:14 +00:00
jenkins-bot bb9f9f9fb4 Merge "Converting an error image (red link) from block to inline does not lose its error state" 2015-06-17 17:28:03 +00:00
suchetag f7026d5e5b Converting an error image (red link) from block to inline does not lose its error state
Bug: T101085
Change-Id: I521be8fbcbab27d712ec408ea7048dca2eaab198
2015-06-17 22:41:41 +05:30
Ed Sanders 965a5dde89 Give TranclusionNodes a matchFunction so they beat LanguageAnnotations
This is a hacky fix, we should find a better way of telling the
model registry that language annotation loses to certain RDFa types.

Bug: T101977
Change-Id: I8be3aa55cbbc2832b8a02a15de27289b3041967e
2015-06-16 14:12:37 +01:00
Mark A. Hershberger 7d5e5ec9a9 MWMediaResourceProvider: Use exist instead of bool check on API values
In the MediaWiki API, booleans exist or don't exist (with an empty string),
you can't check "if (bool)..." since that will always be false.  The API has
a newer formatversion=2 that fixes this but we're not using that yet.

Also update the defaultSource placeholder to match the API response. If one
would only update defaultSource without the 'if'-fix, one can reproduce T66822
on a local wiki (JSON-P request instead of JSON).

Bug: T66822
Change-Id: I5a8ab1136325c33c62982c0869fa14ca2fb26034
2015-06-11 17:29:36 +01:00
Ed Sanders 425e581613 Unregister core image types
Once MW images are registered, we should remove core image support so
we don't accidentally match to them (e.g. an MW inline image with an
unsupported extra RDFa type).

Change-Id: I1c8567346c371fe338f95b232c9ac53e009c5a46
2015-06-02 14:36:14 +01:00
Timo Tijhof f2875141d8 ve.dm.MWTemplateSpecModel: Account for data.maps being undefined
This new property is optional and should not be assumed to be present.
Follows-up 2ac7959849.

The constructor defaults 'maps' to an empty object, so there's no need
to add a "|| {}" in extend() or getMaps(). We merely need to make sure
we don't accidentally dereference the default in exchange for undefined.

Change-Id: Id2cb93696d12a20ee14f9d59705877dc174e6564
2015-06-02 01:48:21 +00:00
suchetag dc2247460c Representation for the red-linked inline images in VE
The red-linked inline images in VE are now identifited as red links and image errors.
They can be changed and thereby be modified just as any other inline image on the editor.

Change-Id: Idb6f6f2da14379fd7db6ca19613dad32fe40023d
2015-05-25 15:18:15 +01:00
Ed Sanders 2f087d9ae7 Update VE core submodule to master (3c1f698)
New changes:
a6144f3 [BREAKING CHANGE] Allow models to specify which extra RDFa types they support

Local changes:
* Use new allowedTypes property in model registry
* For reference nodes, allow 'dc:references'.
* For transclusion nodes, allow any other types.
* For image nodes, allow 'mw:Error'.

Bug: T98999
Change-Id: I7eb2b61eb9336792535e9fd6d5a8dd2d57065f04
2015-05-18 19:42:43 +01:00
suchetag de12c761a3 Representation of red-linked images in VE
The red-linked images in VE are now identifited as red links and image errors.
They can be changed and thereby be modified just as any other image on the editor.

Bug: T52788
Change-Id: I9cbb992c34d71b7073157fe276fee04e901845b1
2015-05-16 17:15:51 +01:00
jenkins-bot f1a6e87bc5 Merge "Don't show placeholder references in lists" 2015-05-06 23:17:28 +00:00
James D. Forrester 38239707b0 jshint: Kill file-level globals and add "moment" to the list
Change-Id: I923ba3490f5fc9b2aaf52d10a163f75dd6401c71
2015-05-06 19:01:27 +00:00
Ed Sanders 9811bc4fd9 Don't show placeholder references in lists
Allow references to be created as placeholders and exclude
them from ReferenceListNodes and the ReferenceSearchWidget.

Bonus: Fix reference numbering when items are skipped (in
list nodes and search widget).

Change-Id: I8dc5146c21f309e89ff4ddd939f7c65a0c358378
2015-05-06 19:15:20 +01:00
Alex Monk 6f17fde4cd Convert 'external' links to internal pages pasted into the search field
Bug: T94334
Change-Id: I0ed67e6579b9ed0a0565968fd253fdf5c6151683
2015-04-29 16:11:32 +01:00
Ed Sanders fdcd42f73a Split AlienExtensionNode into inline and block
MWExtensionNode:
* Inherit from LeafNode at the top level. Inline and block only
  differ in CE where inline has isContent set.

MWAlienExtensionNode:
* Inhert from MW(Inline|Block)ExtensionNode respectively. Both
  mixin MWAlienExtensionNode.

Bonus:
* Bring in paragraph unwrapping on inline nodes from MWMathNode

Bug: T93712
Change-Id: Ib04234f740cf1f27c861d8b3cfeea5e323b94678
2015-04-09 16:32:02 +01:00
jenkins-bot 5de7b8a461 Merge "Merge MW internal link annotations if they have the same target" 2015-04-06 19:32:05 +00:00
Ed Sanders dfdf7c3f28 Merge MW internal link annotations if they have the same target
Currently we compare some HTML attributes, but as wikitext doesn't
allow you to set arbitrary attributes on a link they can never
represent a meaningful difference (unlike <b style="color:red;"> vs. <b>)

Bug: T95028
Change-Id: I267604e4b2140d3c4fe4f9ab07961c6f17a1f2fa
2015-04-06 12:07:03 +01:00
Roan Kattouw dd5608598f Use .apply() in MWInternalLinkAnnotation.static.toDomElements
Otherwise other parameters (there are 4 in total) get dropped.

Change-Id: I91cbb8391218cb7e9179b6b655bbfe22d21ade26
2015-04-03 08:54:45 +00:00
Roan Kattouw f3b7ccdefb Use ve.safeDecodeURIComponent()
Depends on Iacc50230a in VE core.

Change-Id: I7fc505c261726f8d83c86a9cc352a0bf9fcb455a
2015-03-31 22:08:46 +00:00
Roan Kattouw 5026e9b4f5 MWInternalLinkAnnotation: Remove useless .toString() call
ve.resolveUrl() always returns a string, so .toString() is not needed.

Change-Id: Ia699821148687ca16ef642bf94740384779ecb5a
2015-03-30 21:14:27 -07:00
Ed Sanders 8f012e76ce Use new createFromElement method from ModelFactory
Depends on Ia23e5d25 in core.

Change-Id: Iac6f0aaacb8404a28a41e33088fc7f519c227317
2015-03-25 18:26:56 +00:00
Roan Kattouw 884f301aa0 For empty / whitespace-only headings, output <p> instead of <h#>
Because sending HTML like <h2>  </h2> or <h2></h2> to Parsoid
produces undesirable output like ==  == or ==<nowiki />==

Bug: T51452
Bug: T52100
Bug: T57769
Bug: T61647
Change-Id: If15a1b4b31d4f08c23ecdf2ecf61a8a14a77259a
2015-03-20 23:05:37 +00:00
Roan Kattouw 8470e2c272 Update VE core submodule to master (f8f9728)
New changes:
68e20d4 Create AlignableContextItem to quickly adjust AlignableNodes
0150df2 Update OOjs UI to v0.9.3
b333fd3 FragmentInspector: Execute action on enter, rather than closing with data
2d14f7a Fix webkit column hack
be780eb Don't drop whitespace when removing empty slug paragraphs
cc19787 Split handlesOwnChildren and ignoreChildren
7f1c9a7 Localisation updates from https://translatewiki.net.

Local changes:
Add ignoreChildren to handlesOwnChildren nodes

Change-Id: Id3dc7efae8d30b6551b2fc3104ed00bc86339176
2015-03-20 16:04:15 -07:00
jenkins-bot 82dc89dc3e Merge "Remove MWTransclusionMetaNode" 2015-03-12 20:16:42 +00:00
Moriel Schottlender bbb5c84149 Remove MWTransclusionMetaNode
Since all transclusion nodes can be interacted with (including the
'hidden' ones,) there is no need for MWTransclusionMetaNodes.

Change-Id: I23d37e3d82029b7475ec68ebb04883c7e05370cc
2015-03-12 13:12:32 -07:00
Alex Monk 9a0b76ac26 Handle undoing of reference group changes
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
2015-03-11 19:15:47 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
jenkins-bot ba7db69583 Merge "MWParameterPage: Show the field's example if it exists" 2015-03-09 21:34:27 +00:00
Moriel Schottlender 530f5c05f5 MWParameterPage: Show the field's example if it exists
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
2015-03-09 14:25:18 -07:00
Timo Tijhof 9fd753e7a7 build: Enforce disallowMixedSpacesAndTabs jscs rule
Also, fix @returns comments (should be @return) and remove unnecessary
@method comments from the documentation.

Change-Id: Icd303626ac745c7ab5bff164f9b8cac276de1523
2015-03-07 16:49:30 +00:00
Roan Kattouw f24dbb3435 Fix transfer of reference contents from removed reference
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
2015-03-02 22:26:05 +01:00
Moriel Schottlender f0f8f52080 Refactor MWMediaResultWidget to resize better
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
2015-02-26 16:42:14 -08:00
Moriel Schottlender b85b81c501 Correctly validate a provider for local api
Make sure that the validation method accounts for local api
vs remote api when checking for valid variables.

Bug: T90795
Change-Id: Ia6877ca6ccc4e65d1db053f107e7702721e2da3c
2015-02-25 15:59:05 -08: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 bd4289241a Merge "Adjust Queue and Provider to work with generalized parents" 2015-02-24 18:42:40 +00:00
Ed Sanders 65d26891ae Fix transclusion clipboard logic
Run isForClipboard path in MWTransclusion node
even if we have originalDomElements.

Change-Id: Ib5c77888ef41d26e827dbb9a20925e251527a99a
2015-02-22 19:24:41 -08:00
Ori Livneh 4cf393da54 Update VE core submodule to master (032c9a4)
New changes:
dc3b1f8 Replace ve.dm.Model#matchesAttributeSpec

Local changes:
Replace ve.dm.Model#matchesAttributeSpec

Change-Id: I2a107999974309304b59697dad0f7374110b9ab5
2015-02-18 16:32:19 -08: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
Moriel Schottlender 093cf012ea Adjust Queue and Provider to work with generalized parents
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
2015-02-17 17:22:21 -08:00