Commit graph

3482 commits

Author SHA1 Message Date
Rob Moen 78a99fb0a3 Check for instance of generic LinkAnnotation when querying target.
Resolves (Bug 44686)

Change-Id: I0ff962330e061aea66a25a923f46d6759e5ff6af
2013-02-05 11:55:27 -08:00
Translation updater bot c4ee328edf Localisation updates from http://translatewiki.net.
Change-Id: I637f92daed34ac338e858a0fd151cfae43cc2895
2013-02-04 22:24:09 +00:00
Translation updater bot 269ad2392b Localisation updates from http://translatewiki.net.
Change-Id: I1d4ab6e2e6012124c9ede2bc0ab895d74babb2f0
2013-02-02 21:35:49 +00:00
jenkins-bot 7ea4b94604 Merge "Fix bug where inline nodes didn't trigger wrapping" 2013-02-02 00:28:07 +00:00
jenkins-bot 6c5d83449d Merge "Remove trailing commas" 2013-02-02 00:26:59 +00:00
jenkins-bot 67ad11b163 Merge "Make JSHint ignore the docs/ directory" 2013-02-02 00:24:50 +00:00
jenkins-bot 9a96f894ff Merge "Node cleanup" 2013-02-02 00:23:03 +00:00
Catrope 57ad316988 Fix bug where inline nodes didn't trigger wrapping
When encountering an inline node (i.e. content node that's not a text
node) within a branch node that's not a content branch node, the
converter should start a wrapper. But it doesn't do this, it only opens
wrappers for text nodes and annotations.

Fixed this in the converter, added a test for it, and fixed an existing
test that asserted the broken behavior.

Change-Id: I6e143e21e68b68f0d85b8772e24a2d3a5d465410
2013-02-01 16:06:17 -08:00
Trevor Parscal 363961a9e2 Node cleanup
ve.Node.js
* Removed unused emitUpdate property
* Made traverseUpstream a dynamic method rather than static

ve.ce.Node.js, ve.ce.Surface.js
* Updated calls to traverseUpstream

Change-Id: I28a2dac61aa32668d35854fbdb7712401c42336a
2013-02-01 15:35:48 -08:00
jenkins-bot 7155bcea16 Merge "i18n icons" 2013-02-01 23:34:15 +00:00
Trevor Parscal f49d80d27a i18n icons
Graphics (*.ai, *.png, *.svg)
* Took a pass on all images making them sharper and clearer
* Renamed bold and italic to bold-b and bold-a
* Added bold-f, italic-k, bold-a and italic-a
* Reorganized illustrator file

ve.ui.Icons-raster.css, ve.ui.Icons-vector.css
* Added classes for new icons
* Appended bullet, number, indent and outdent class names with "list"

ve.ui.*ButtonTool.js
* Added definitions for static icon property
* For bold and italic, added i18n style definitions

ve.ui.ButtonTool.js
* Switched from re-using the name property (which is intended to be the symbolic name of the tool used when registering with the tool factory) to using an static icon property for defining the icon

Change-Id: I43e7c35835a1e6dfb06f2a70226fac0d395008e8
2013-02-01 15:29:18 -08:00
Catrope 46957736a4 Remove trailing commas
JSHint doesn't detect this (this is an open bug against jshint), but
Eclipse does

Change-Id: Iebfc0f9c6263f60898739c9d19400357a65da0e9
2013-02-01 14:45:35 -08:00
Catrope 963b5f24e4 Make JSHint ignore the docs/ directory
Change-Id: I1d590b44cf663a024ebb6c09a807f25392625152
2013-02-01 10:19:33 -08:00
jenkins-bot 626257fb39 Merge "Introduce context object in getDataFromDom()" 2013-01-31 23:36:57 +00:00
jenkins-bot 6aefc761e6 Merge changes Ie5f1f94b,I7b7a2d50,Ieda8383c,I36860bee
* changes:
  Use AnnotationSet rather than array in getDataFromDom()
  Hybrid-ify MetaBlock/MetaInline
  Hybrid-ify AlienBlock/AlienInline
  Specify (but do not implement) the context parameter to toDataElement()
2013-01-31 23:36:30 +00:00
Catrope a97f777685 Introduce context object in getDataFromDom()
* Introduce context object as specified for
  ve.dm.Node.static.toDataElement()
* Remove wrapping variable in favor of context.wrapping
* Remove wrappingIsOurs in favor of context.canCloseWrapper
* Introduce originallyExpectingContent and use it to repopulate
  context.expectingContent after closing a wrapper
* Replace most uses of branchHasContent with context.expectingContent
** Except for two cases where we need originallyExpectingContent

These changes fix a case where a metaBlock was generated in an inline
position. Updated the tests to reflect this.

Change-Id: I6baf6053f8a3a0b7d91487f812b9235a7b2b3db1
2013-01-31 15:00:00 -08:00
Catrope 1927330352 Use AnnotationSet rather than array in getDataFromDom()
Change-Id: Ie5f1f94bd62739ccf74c027dd0ba418fe2d91fa6
2013-01-31 15:00:00 -08:00
Catrope e083afb029 Hybrid-ify MetaBlock/MetaInline
Change-Id: I7b7a2d50637e2009742b290cb1bd0f4fc0395934
2013-01-31 15:00:00 -08:00
Catrope c0690634ee Hybrid-ify AlienBlock/AlienInline
Change-Id: Ieda8383c0c04df208f4c5f2aa7380427467049b7
2013-01-31 14:59:59 -08:00
Catrope ac6c9b2418 Specify (but do not implement) the context parameter to toDataElement()
This allows the converter to provide the node handlers with context
information, which hybrid nodes (such as alien and meta) need to decide
which shape to take.

Change-Id: I36860bee560a38ee39a149109be3706e39258edc
2013-01-31 14:59:59 -08:00
Translation updater bot d894c84ea7 Localisation updates from http://translatewiki.net.
Change-Id: Ia91eccdbac663c4cbcd0a967d98acce893cd9db4
2013-01-31 20:44:48 +00:00
jenkins-bot 48bf0fbaab Merge "Fixed documentation warning" 2013-01-30 21:20:09 +00:00
Trevor Parscal 100e67c128 Fixed documentation warning
Please use backtick (it's to the left of the 1 key) around HTML elements in comments.

Change-Id: I473e88a2cb1f7fb725f21cd0e8b3f659189c15a0
2013-01-30 12:52:03 -08:00
Translation updater bot 186dabf40b Localisation updates from http://translatewiki.net.
Change-Id: I5f90aee8638592987274beb2456b109c85eca5e1
2013-01-30 20:51:45 +00:00
Catrope 36d99ad901 Add Iceweasel to supported browsers list
Depends on https://gerrit.wikimedia.org/r/46666

Change-Id: I1192ce6687ba69504d0c4be484e479ddebedbc87
2013-01-29 17:53:09 -08:00
jenkins-bot 602d01e461 Merge "Added tests and fixed inconsistencies for empty text node handling" 2013-01-29 23:16:30 +00:00
jenkins-bot 9bf5eb5b5b Merge "Added support for passing data into annotation constructors" 2013-01-29 23:15:21 +00:00
Trevor Parscal 16310f7535 Added tests and fixed inconsistencies for empty text node handling
Continues where Ibb682332a6084e357104183641a104e3ae1e253f left off, adding tests and removing inconsistencies between the behavior of the document constructor, which was adding empty text nodes to empty paragraphs, and correcting other tests which expected empty text nodes to be there as well.

Change-Id: I414d061cdd494b8023f14e944eda2910a4dab0d4
2013-01-29 15:13:17 -08:00
jenkins-bot a9b7c5c5e3 Merge "Trigger refactor" 2013-01-29 22:03:53 +00:00
Trevor Parscal ea4b42b2b2 Automatically prune empty text nodes
When there's 2 entities or inline content nodes (like aliens) with text between them, removing that text should remove the node too. If you don't remove the node then CE won't think to make a slug between the two inline nodes.

Change-Id: Ibb682332a6084e357104183641a104e3ae1e253f
2013-01-28 17:09:56 -08:00
Trevor Parscal 294db5e3ef Trigger refactor
Objective: Simplify the registration and use of triggers

Changes:

* Renamed ve.Command to ve.Trigger
* Renamed command demo to trigger demo
* Removed language prefixing of triggers
* Generating trigger tooltips rather than hard-coding them in i18n
* Added documentation to clarify that only 'mac' and 'pc' are supported platforms, and how the default is chosen
* Simplified trigger registry's register command
* Updated trigger registrations

Change-Id: Ibab6ad5b5c86f24707f064967dc2119a81125392
2013-01-28 17:06:13 -08:00
Translation updater bot c9f444b9b1 Localisation updates from http://translatewiki.net.
Change-Id: I5171de253449ce947efe8969518da3a94bb839c6
2013-01-28 22:04:40 +00:00
Trevor Parscal 280c85d8e7 Added support for passing data into annotation constructors
This resolves a TODO

* Added logic to support passing an argument into annotation constructor which is used as the data property (reusing the element argument)
* Updated documentation
* Simplified instantiation of annotations

Change-Id: I142b8fa3883bf70c896a2a568088d833814ef2dc
2013-01-28 11:01:52 -08:00
Translation updater bot f77a02f217 Localisation updates from http://translatewiki.net.
Change-Id: I936572e4e09bf17e23d30b9907cdbdce280fca2a
2013-01-27 17:58:25 +00:00
Translation updater bot 2bec00925e Localisation updates from http://translatewiki.net.
Change-Id: Iede32ba7a624255707727bdf5d9f144aa39b73b3
2013-01-25 20:42:27 +00:00
Translation updater bot 930807c114 Localisation updates from http://translatewiki.net.
Change-Id: I1f79d22cd0f29a4289400306059c0e25e0063479
2013-01-24 21:02:09 +00:00
jenkins-bot a3556bc208 Merge "Add extension-specific types functionality to ModelRegistry" 2013-01-23 19:10:18 +00:00
jenkins-bot 481ce340d0 Merge "Allow matchTagNames = null in ve.dm.Converter" 2013-01-23 19:07:45 +00:00
jenkins-bot 90c594b289 Merge "Added @source links to externals" 2013-01-23 18:23:19 +00:00
Catrope d73d6e9bf0 Add extension-specific types functionality to ModelRegistry
Extension-specific types are RDFa types (or type regexes) that are
registered with the ModelRegistry separately. If an element has a type
that is extension-specific, then that element can only be matched by a
rule that asserts one of its extension-specific types.

For MediaWiki, we would call
ve.dm.modelRegistry.registerExtensionSpecificType(/^mw:/ ) .
So then an element like <span typeof="mw:foobar"> would either match a
rule specifically for mw:foobar, if one exists, or no rule at all; even
the rule for <span> would not match. The consequence of this is that
elements with unrecognized mw:-prefixed RDFa types are alienated.

Change-Id: Ia8ab1fe5dffb9f813689324372a168e8e4a3e0bc
2013-01-22 18:12:35 -08:00
Catrope 99df776543 Allow matchTagNames = null in ve.dm.Converter
This won't usefully register the node with the converter right now, but
we need to allow this because the ModelFactory tests will need to have
stub nodes with tag-only matches.

Change-Id: I023cc8ff647363ab55c73dff39b17ca47e9e6681
2013-01-22 17:45:43 -08:00
Trevor Parscal 63a5d92612 Added @source links to externals
Change-Id: Ib0c97a194e6abac5beec247a70497cc12a43dad4
2013-01-22 16:15:37 -08:00
Catrope 47b728bed9 Add wrapper for Array.prototype.filter
Change-Id: Ie7d8dd4193a81bedbb75258494bd78e8236bd0e8
2013-01-22 15:55:11 -08:00
Catrope aa372b6c16 Actually use this.nodeFactory and this.annotationFactory in ve.dm.Converter
Change-Id: I138a437d2e64577ad905ff70ecedf1eb7e6c8360
2013-01-22 15:55:11 -08:00
Catrope 5a5b4b577a Drop name parameter from ModelRegistry.register(), use .static.name
Change-Id: I74eeab1195455072ae48ac0655582f2bf01806d6
2013-01-22 15:55:11 -08:00
Catrope 819b3ded33 Move matching code from AnnotationFactory to ModelRegistry
ModelRegistry registers both annotations and nodes, and performs
matching on both at the same time. It also registers annotations with
the AnnotationFactory, and nodes with the NodeFactory.

Change-Id: I5e68e506a0e573cc0afe6304ccea058ffc20d1c8
2013-01-22 15:51:37 -08:00
Trevor Parscal bf5ba1ea2b Fixed documentation errors
Many of these problems were introduced in I859b5871a9d2f17d970c002067c8ff24f3513e9f

Change-Id: Ifc2dc4934f782c4ce5107e3a356e357aef754083
2013-01-22 23:38:01 +00:00
jenkins-bot 721e69cd9e Merge changes I8ee4796a,I2629c5fd
* changes:
  Make defaultAttributes a static property as well
  Replace nodeFactory invocations with direct static access
2013-01-22 23:23:13 +00:00
jenkins-bot d15b02a374 Merge "Convert node rules to static properties" 2013-01-22 23:22:33 +00:00
jenkins-bot 12b25cc6e8 Merge "Add annotation-like static properties to nodes" 2013-01-22 23:21:17 +00:00