Commit graph

5476 commits

Author SHA1 Message Date
Roan Kattouw 73edc2a46f Add group to internal list items in test data
Previously we were just omitting the first parameter to
queueItemHtml()

Change-Id: Ib4b6d2877d6cfe6b8469a300f89a4a54cbec6da3
2013-09-05 11:25:49 -07:00
Roan Kattouw 0e51375aa9 Fix ridiculous MetaList test case
Doing retainMetadata followed by a replace (not replaceMetadata)
doesn't make any sense and its behavior is undefined, so don't do that
in the test suite.

Change-Id: Ica032b0a5122d24e40e43e3eb43fea940270aece
2013-09-05 11:25:49 -07:00
jenkins-bot 27dfe83e6f Merge changes I247d1b68,I5a8ca28a
* changes:
  Fix getOffsetFrom(Element|Text)Node for annotated aliens
  Add test for getOffsetFrom(Element|Text)Node
2013-09-05 07:51:16 +00:00
Ed Sanders 3c24c91a46 Fix getOffsetFrom(Element|Text)Node for annotated aliens
* Replace addOuterLength with a recursionDirection as we only
  want to add length when the first recursion was to the left,
  and add nothing if we recursed to the right.
* Use isContentEditable which is the proper calculated boolean.
  contentEditable is often just (string)'inherit' :/
  Mercifully this works in in IE.
* Only check for the IE ce bug if we aren't recursing at all.

Bug: 53766
Change-Id: I247d1b68484cb510335b5f6789269ec254376cfe
2013-09-05 00:35:53 -07:00
Ed Sanders e30c81d5a4 Add test for getOffsetFrom(Element|Text)Node
Assert the result at every offset in the DOM.

Change-Id: I5a8ca28a7ee22c49d23077ad6993499ec726bbb3
2013-09-05 00:25:35 -07:00
jenkins-bot 0333d87fd3 Merge "Exclude tools from catch-all menu in media and reference edit dialogs" 2013-09-05 04:59:38 +00:00
jenkins-bot ae62a0cde8 Merge "Internal lists render nothing in the CE" 2013-09-05 04:56:59 +00:00
jenkins-bot a55b374475 Merge "Reference core bug 53774 in bug 49000 comment" 2013-09-05 04:55:48 +00:00
Trevor Parscal d5e7a7ef95 Exclude tools from catch-all menu in media and reference edit dialogs
Change-Id: Ic3c94099fa1db5b1a40ac2a2dbf17562cb36c73b
2013-09-04 17:32:50 -07:00
Ed Sanders 8f72b083d3 Internal lists render nothing in the CE
Previously they were rendering hidden spans.

Remove hiding from internal items as they have no rendered parent.

Change-Id: Iacc12715900123cd5ab0ddefa713e57e9bea0d1b
2013-09-04 16:49:03 -07:00
Roan Kattouw 2c29dab288 Always deep copy when writing to and reading from the fake clipboard
Otherwise, changes to deeply nested structures like template blobs or
references will leak from the data model into the clipboard data.

Change-Id: I85d8d311f676d45856f30b3747e7383c70c95460
2013-09-04 16:03:56 -07:00
jenkins-bot feff1fbc24 Merge "Improve welcome dialog support for large fonts" 2013-09-04 23:02:05 +00:00
jenkins-bot 9d67f41ca7 Merge "Insert images after selection, not in place of it" 2013-09-04 23:00:03 +00:00
jenkins-bot ee1044d43d Merge "Fix context menu position for small inline nodes" 2013-09-04 22:59:13 +00:00
Trevor Parscal 0c42e51c8f Improve welcome dialog support for large fonts
Objective:

* Make the welcome dialog work with smaller fonts by increasing its
  size a bit, and also making its contents scroll vertically if needed

Changes:

ve.ui.MWBetaWelcomeDialog.js
* Move content into a scrollable and padded panel layout element

ve.ui.MWDialog.css
* Remove padding, now provided by panel layout

ve.ui.Dialog.css
* Remove min-height override, inherited value is fine
* Use max width and height instead of setting them directly

Bug: 52667
Change-Id: Ie35b041e13ef18ffcacef6d9e70439e4e1351e0a
2013-09-04 22:58:52 +00:00
jenkins-bot 8dc93b6a71 Merge "Merge undefineds into undefined rather than []" 2013-09-04 22:40:17 +00:00
Moriel Schottlender 6744af7733 Quickfix Language Tool
Correcting the language span tool so the ve.ui.LanguageInspector has
static name changed from 'language' to 'meta/language'

Change-Id: I66fd3d2558663c9f1304365a11fd1276e204a7e7
2013-09-04 18:32:21 -04:00
Trevor Parscal 416537ecb7 Fix context menu position for small inline nodes
The context menu was being positioned incorrectly for small inline
nodes, such as references or small templates. This fix moves the context
to the bottom, as well as placing it on the right or left in LTR and RTL
directions respectively.

Change-Id: I55de2a6464d0544e32118bf95dbb85c33354f025
2013-09-04 22:22:52 +00:00
Roan Kattouw 247368b902 Merge undefineds into undefined rather than []
ve.dm.MetaLinearData.static.merge( [ undefined, undefined, ... ] )
returned [ [] ], make it return [ undefined ] instead. This allows
us to lazily use the merge function to create metadata without having
to worry about denormalizing undefined to [] all over the place.

Change-Id: I41fe6472c2185a6315119a546a73765966d013d3
2013-09-04 13:09:04 -07:00
jenkins-bot 8dfa827a97 Merge "ve.EventSequencer: Post-event listening" 2013-09-04 20:08:42 +00:00
James D. Forrester 4da68b71d1 Reference core bug 53774 in bug 49000 comment
Bug: 49000
Bug: 53774
Change-Id: I1f26c7ac770daca06ae3c87742c1b3e3d2b17e41
2013-09-04 13:07:27 -07:00
Translation updater bot 41bb537d9d Localisation updates from http://translatewiki.net.
Change-Id: I47b498ccfde188fc872b1d1e549c857b9c5c20a7
2013-09-04 19:49:08 +00:00
David Chan 793172e41e ve.EventSequencer: Post-event listening
modules/ve/ve.EventSequencer.js
* Class to sequence pre-event and post-event listening correctly

demos/ve/eventSequencer.html
* Plain HTML example page for testing EventSequencer and event sequences

Change-Id: I4ddb10a30c2f44015136a7978a185d0b13f0690b
2013-09-04 11:20:46 -07:00
Timo Tijhof 298afbf337 mw.ViewPageTarget.init: Don't add class ve-available when unavailable
In commit e1f8ee7 the return statement was moved into the
userPrefEnabled check, however addClass( 've-available' ) was
still unconditional. This has now been restored.

Change-Id: Ia59bfed93a8849a529cc3b9d1d2e0619d65240d4
2013-09-04 17:58:13 +00:00
jenkins-bot fc5003aa35 Merge "Collapse metadata on any removal." 2013-09-04 02:22:31 +00:00
jenkins-bot ab89d78be2 Merge "Cleanups for ve.dm.Transaction" 2013-09-04 01:42:40 +00:00
C. Scott Ananian 7c1623d915 Cleanups for ve.dm.Transaction
Avoid making a copy of the entire data array by using `doc.data` and
`doc.data.getLength()` instead of `doc.getData()` and
`doc.getData().length`.

Get rid of some unnecessary conditionals in `Transaction.newFromWrap`: the
`tx.pushReplace()` and `tx.pushRetain()` methods will already gracefully
no-op if the replaced/retained region is empty; we don't need to add
extra control flow to handle that case.

Clarify offset math in `Transaction.newFromWrap`.

Fix a minor bug in `Transaction.newFromInsertion`: the final retain didn't
account for the length of the removed region, if `doc.fixupInsertion`
creates one.  (This usually doesn't happen.)

Remove an inaccurate TODO in `Transaction.pushReplaceMetadata()` -- it is
no longer a straight copy/paste of `Transaction.pushReplace`, so a refactor
isn't really called for.

Change-Id: I7d86a2449978365d69d4a5ed43116c2e9945475d
2013-09-04 01:41:07 +00:00
jenkins-bot b777ff74e3 Merge "Offer the typed text as a link suggestion if the page is valid" 2013-09-04 00:32:30 +00:00
jenkins-bot 630edd049c Merge "Kill domAttributeWhitelist in favor or renderHtmlAttributes" 2013-09-04 00:28:14 +00:00
Trevor Parscal c457d8afcc Add keyboard shortcuts for formatting tools
Objective:
* Add keyboard shortcuts for paragraph, heading 1-6 and pre-formatted

Testing:
* Using [control+num] triggers appears to work well on Chrome, Safari, Firefox and Opera on Mac

Changes:
ve.init.Target.js, ve.init.mw.ViewPageTarget.js
* Add formatting commands to targets
ve.ui.MWFormatTool.js
* Add mediawiki specific format tools and commands
ve.ui.CommandRegistry.js
* Add commands for all formatting tools
ve.ui.TriggerRegistry.js
* Add triggers for formatting tools

Bug: 33512
Change-Id: I5d6176eff50aa3cea72aed226ca06512629412d4
2013-09-03 17:17:03 -07:00
jenkins-bot 2f55aaaeb7 Merge "Make tools generic and add fancy tool groups" 2013-09-03 23:31:53 +00:00
Translation updater bot 7274552a2b Localisation updates from http://translatewiki.net.
Change-Id: Iaac510e2649c4d6344d9d55fec3cd4261ee4a593
2013-09-03 20:59:43 +00:00
Trevor Parscal d377f3e495 Insert images after selection, not in place of it
Bug: 52460
Change-Id: I69ce4c2473d57fd585df0c602359c1d0f60a58f7
2013-09-03 13:37:43 -07:00
Trevor Parscal 8dfbc5baa5 Make tools generic and add fancy tool groups
Objectives:

* Got rid of mw prefixing in tools, inspectors and dialogs
* Simplify tool classes so they can be generically used as items in bars, lists and menus
* Add support for a catch-all toolbar group
* Simplify tool registration, leaning on tool classes' static name property
* Move default commands to command registry
* Move default triggers to trigger registry
* Get language tool working in standalone

Change-Id: Ic97a636f9a193374728629931b6702bee1b3416a
2013-09-03 11:27:39 -07:00
Translation updater bot e106aef166 Localisation updates from http://translatewiki.net.
Change-Id: Ia8fdac964f88f6903c8c075b8b39eee61a3c6495
2013-09-02 19:26:30 +00:00
Translation updater bot 9cc961e573 Localisation updates from http://translatewiki.net.
Change-Id: Ia19233cf6f01ca3673385164675ffebbd0197756
2013-09-01 19:29:12 +00:00
C. Scott Ananian 5095e27925 Collapse metadata on any removal.
In ve.dm.Document.getMetadataReplace(), we used to only merge metadata
if the amount removed is larger than the amount inserted.  But this
could end up putting metadata in odd positions, for example if you
have Foo[[Category:Bar]]Baz and you delete 'ooBa' and replace it with
{image}xxx{/image}, then the category ends up inside the image.

We should always merge metadata when a segment is deleted, so that it
appears outside any new structure added.

There's a weird corner case here when a segment is removed but no
insertion is made: the removed metadata then needs to get glommed onto
the next element.  We extend the insert/replace metadata array
when this happens.

Bug: 53444
Bug: 53445
Change-Id: I51d55fb370b473273f9cf152fdd0f356377d4109
2013-09-01 11:00:51 -04:00
jenkins-bot 9ff8080e59 Merge "ce: Use a better transparent pixel image" 2013-08-31 06:38:57 +00:00
Timo Tijhof 8cea089f3b ce: Use a better transparent pixel image
See also http://stackoverflow.com/a/13139830/319266:

> Some are unstable and cause CSS glitches. [If] you have an
> <img> and you use the tiniest transparent GIF possible, it
> works fine[. if] you then want your transparent GIF to have a
> background-image, then this is impossible. For some reason,
> some GIFs such as the following prevent CSS backgrounds (in
> some browsers).
>
> == Shortest (but unstable) ==
> data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
>
> == Stable (but slightly longer) *use this one* ==
>
> data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
>
> Also: don't ommit image/gif. This will break in several browsers.

For the record, this is not limited to rare browsers.
It also affects latest Chrome in some cases as confirmed by
Christian (it'd be white instead of transparent in some cases
when uses as a css background-image without border).

Change-Id: If9ff8a0820c217b6c23e3335944907939a37bef7
2013-08-30 17:51:20 -07:00
jenkins-bot a8879e1c47 Merge "Include param label in search index" 2013-08-31 00:48:35 +00:00
jenkins-bot 6f65dd63dd Merge "Round trip alien extensions correctly when edited" 2013-08-31 00:44:02 +00:00
Ed Sanders 9ab79330c7 Round trip alien extensions correctly when edited
ce.MWExtensionNode
* Build up the wikitext for round-tripping using jQuery, and pass
  through the attributes from data-mw

dm.MWExtensionNode
* Use a static getExtensionName to correctly get the extension
  name from the dataElement (as the getMatchRdfaTypes hack won't
  work for MWAlienExtensionNode's)

dm.MWAlienExtensionNode
* Implement new static getExtensionName function

Bug: 53543
Change-Id: Id4e83c14ec68c3b3970d05317477f19aaf31abe4
2013-08-30 16:43:50 -07:00
Trevor Parscal a365166948 Include param label in search index
Bug: 51670
Change-Id: I7f398bf26bf69d81b19fd258fddd490a6a81176c
2013-08-30 15:20:21 -07:00
Ed Sanders 176320a483 Offer the typed text as a link suggestion if the page is valid
Currently we only offer the normalised page title from the server
so 'iPhone' only suggests 'IPhone'. With this fix we offer the typed
text as the first suggestion if it matches via mw.Title, so 'iPhone'
suggests ['iPhone', 'IPhone', ...]

Bug: 50452
Change-Id: I05cc0cd19537cbfa682d7aac0f9640decea282b5
2013-08-30 15:08:37 -07:00
jenkins-bot 343f989c7a Merge "Allow phantoms and focus areas to be overridden" 2013-08-30 21:42:22 +00:00
Ed Sanders 2d720bd6d9 Allow phantoms and focus areas to be overridden
And actually use this functionality on MWBlockImage to
highlight centred images correctly.

FocusableNode
* Actually use $focusable to render the highlight correctly

ProtectedNode
* Allow a $phantomable element to define which element to
  highlight on mouseenter
* As phatoms are built off shields, make sure a shield is
  given to $phantomable

RelocatableNode
* Allow a $relocatable element to define which element the
  relocatable marker is measured against

ui.Context
* Use $focusable (when available) for positioning the popup

Plus some documentation fixes

Change-Id: I370337239af4fc935cd86757b3ce03011bae5ba8
2013-08-30 14:04:17 -07:00
Translation updater bot bb44c8dc4b Localisation updates from http://translatewiki.net.
Change-Id: Ib9e3550d805b70a970426ce867d5bb23211fc6c5
2013-08-30 19:26:01 +00:00
jenkins-bot 3d2a33855c Merge "Re-build reference search index so they can be used mid-edit" 2013-08-30 19:12:23 +00:00
Trevor Parscal ac77d33c9e Re-build reference search index so they can be used mid-edit
The search index was only being built on initialization, rather than at
the time the list was being shown. By moving it to be built on open
the list will always be fresh. Also, just after building the index, we can
enable/disable the select existing button based on the number of
results.

Bug: 51689
Bug: 51848
Bug: 52000
Change-Id: Ib38b1b227edc3d61dc49fa58999358e7adf11b08
2013-08-30 19:09:47 +00:00
jenkins-bot 651ce4a55b Merge "Expose version information in the client" 2013-08-30 18:53:19 +00:00