Commit graph

5373 commits

Author SHA1 Message Date
jenkins-bot 27c0866d8a Merge "Check for past/future state in undo/redo before setting breakpoint" 2013-08-16 02:44:45 +00:00
Ed Sanders 5bff162bff Check for past/future state in undo/redo before setting breakpoint
This isn't a problem when using the UI buttons as they get disabled
but the command keys can still trigger these methods.

Also fix hasPastState to include check for small stack. This fixes
an existing bug where the undo button doesn't become active until
~1s after the first change is commited (i.e. after the small stack
is committed to the big stack).

Bug: 52113
Change-Id: Idbd34953c805620881a609409290256462af80a5
2013-08-15 19:37:36 -07:00
jenkins-bot 916d1c2b69 Merge "Create a subscript tool" 2013-08-16 02:16:25 +00:00
jenkins-bot c01499fb66 Merge "Create a superscript tool" 2013-08-16 02:15:42 +00:00
jenkins-bot ffc513fcf3 Merge "Create an underline tool" 2013-08-16 02:13:02 +00:00
jenkins-bot db16e7ce72 Merge "Fix traversal for images with link=''" 2013-08-16 01:24:51 +00:00
jenkins-bot 103bd6e499 Merge "LanguageInputWidget Generalization" 2013-08-16 01:18:24 +00:00
Moriel Schottlender 0fd2b619c9 LanguageInputWidget Generalization
This commit prepares the LanguageInputWidget to handle both annotation
and node, so it can be used as the GUI for both the LanguageInspector
and the LanguageBlockInspector that's coming up.

Cleaned up the way annotations are read into LanguageInspector and
AnnotationInspector. The attributes are kept in the Widget (without regard
to what datamodel they will serve) and are then read from the inspector.
The LinkInspector had to be adjusted slightly to accomodate a small change
in the AnnotationInspector too.

Change-Id: I17954707c00ffc4c32fbb44a6807a61760ad573c
2013-08-15 20:48:17 -04:00
Roan Kattouw c772431927 Fix issue in 7673a398
The update event passes in a transaction object, which was interpreted
as a config object and fragmented the cache. Explicitly wrap the
update() call in an event handler to make sure the config parameter is
undefined.

Change-Id: I641c68230b92d23626fb8b12aeab6a8904a35bcc
2013-08-15 16:32:41 -07:00
Ori Livneh 825322d4ac Use internal ve.track to log events
This patch rounds off change I29740fa7a by replacing calls to EventLogging's
eventLog.logEvent with calls to VisualEditor's ve.track. ve.track publishes
events by providing an interface, ve.trackRegisterHandler, which event handlers
use to subscribe to VisualEditor events. By making it the responsibility of the
web analytics framework to register itself as a handler, VisualEditor can
remain decoupled from (and indeed ignorant of) any particular event logging
implementation. This allows VisualEditor to be integrated with many different
web analytics platforms with nothing more than a bit of glue code for mapping
ve's event semantics to those of the target platform.

The practical difference that this makes is that it frees VisualEditor from
having to know about EventLogging or from having to load EventLogging
components, which means we can remove quite a lot of gnarly code. My current
plan is to migrate the code for registering and loading the 'Edit'
schema module to Extension:CoreEvents, which is also where I'll commit the
handler for VE events. (CoreEvents exists precisely to provide an organized
place for persistent but WMF-particular instrumentation.)

Once this patch is merged and deployed, the following two configuration
variables may be removed from mediawiki-config:

- $wgVisualEditorEnableSplitTest
- $wgVisualEditorEnableEventLogging

Change-Id: Idfdf692668d2adfbe029e8f0c4ff9e96c60ff741
2013-08-15 19:43:36 +00:00
James D. Forrester 23af88edc3 Create a subscript tool
Bug: 51612
Change-Id: Ia05e09a411213cbc035ad9dd3d3156d57f8e102c
2013-08-15 19:40:15 +00:00
Translation updater bot 60114e066d Merge "Localisation updates from http://translatewiki.net." 2013-08-15 19:40:09 +00:00
jenkins-bot cec28fe287 Merge "Add ve.track, a generic dispatch of analytic events" 2013-08-15 19:39:24 +00:00
Translation updater bot 858e6a0aca Localisation updates from http://translatewiki.net.
Change-Id: Icef4cb792f89c5c36c3fc3b79ed0a5008fe0bd1d
2013-08-15 19:38:56 +00:00
Ed Sanders 67f09a0318 Fix traversal for images with link=''
We were assuming images were wrapped in <a> tags. Images with
link='' are only <span> wrapped.

Bug: 51963
Change-Id: I6d496f719cfbbc7556c55f0a660cb192040f29de
2013-08-15 20:36:49 +01:00
James D. Forrester 34a37471c6 Create a superscript tool
Bug: 51611
Change-Id: I74b6418542927eeeb7e80d664a30fcaf07b93a13
2013-08-15 12:36:35 -07:00
Steven Zhang 3c65d830f2 Create an underline tool
Bug: 51609
Change-Id: I65246d7eeb154950c35a1cb70909a113080c2323
2013-08-15 12:16:01 -07:00
Ed Sanders 37b461fe56 Reposition context menu after rerender
Add rerender event to all image loads in MWExtensioNode.
MWHieroNode's implementation of onParseSuccess is now the same as
its parent so can be deleted.

Change-Id: Iaa4999372f1ba88a7bdf1490fc3f8640af77ceae
2013-08-15 10:43:31 +01:00
Ed Sanders 6fb65ec3a1 Fix MWAlienExtensionNode's extensionName in ce update
Create getter for extensionsName which is overriden by
MWAlienExtensionNode.

Also removed angle brackets around Alien title as the inspector
already has an angle bracket icon, and a '<' close button.

Change-Id: Ice8c5d73ed621f8e585b5f372788666f8c5aeb50
2013-08-15 10:40:58 +01:00
Ed Sanders 9582432c4c Fix logical conflict from I8feefd9e8
onUpdate was renamed to update. Also neither event was
actually implemented so have just removed them.

Change-Id: Iaae1661a99f97272fa42c71223fc2cb832d50c66
2013-08-15 10:18:22 +01:00
jenkins-bot 71f4472d34 Merge "mw.Target: Removed unreachable badtoken recovery code" 2013-08-15 08:40:08 +00:00
jenkins-bot 2c4e9d8323 Merge "Support previews and concurrent updates in ce.GeneratedContentNode" 2013-08-14 22:00:12 +00:00
jenkins-bot c84c47aeba Merge "Prevent the creation of invalid MWInternalLinks" 2013-08-14 21:58:27 +00:00
jenkins-bot dc22dd3599 Merge "Fix rendering of inspector for embedded buttons" 2013-08-14 19:45:21 +00:00
jenkins-bot a692a64372 Merge "Allow inspectors to not show the delete button" 2013-08-14 19:39:08 +00:00
Translation updater bot 344d97d89c Localisation updates from http://translatewiki.net.
Change-Id: I09f393358ff404728e856712f51d7bffbb8efb7b
2013-08-14 19:28:53 +00:00
Ed Sanders 79b3dbf386 Fix rendering of inspector for embedded buttons
Previously we assumed that embedded icons mean we weren't
dealing with an inspector, but that is not always the case
(e.g. MWExtensionInspector).

Bug: 52845
Change-Id: Ifc5b054568661cb9badf6d7991f512b81e649b36
2013-08-14 18:50:54 +00:00
Ed Sanders 599ad772ed Allow inspectors to not show the delete button
This functionality makes sense for annotations, but not for extensions.

Change-Id: I64fea941f8e01d0464eb9a045257f4810d789d60
2013-08-14 18:50:39 +00:00
Translation updater bot 86359bdd1e Localisation updates from http://translatewiki.net.
Change-Id: I40e6390e0088541e4e1da0b4eb136bc9ff732446
2013-08-13 19:30:14 +00:00
Translation updater bot 26eb55d014 Localisation updates from http://translatewiki.net.
Change-Id: I464c61ff1e48b40f5c2c22169f44c5b985541990
2013-08-12 19:23:27 +00:00
Translation updater bot 0e76b1b521 Localisation updates from http://translatewiki.net.
Change-Id: I007bc086ebb70124cca68d24eabc2e3f7acec62a
2013-08-11 20:01:31 +00:00
Translation updater bot 4cc904ea2f Localisation updates from http://translatewiki.net.
Change-Id: I354e3f30e3a905384793f0c819ebd99882894e16
2013-08-10 19:39:53 +00:00
Translation updater bot 6e413de883 Localisation updates from http://translatewiki.net.
Change-Id: I31170014c38dd3f8afddeca9799a5ef30113a357
2013-08-09 19:49:20 +00:00
jenkins-bot ddf748e53b Merge "Generic support for multiple tags in TextStyleAnnotation" 2013-08-09 04:42:32 +00:00
Ed Sanders 00c681f0d9 Generic support for multiple tags in TextStyleAnnotation
Bug: 52477
Change-Id: If8e2f541adb045f9b84a913829a5b7430ca83299
2013-08-09 04:15:45 +00:00
Translation updater bot 9bb4812934 Localisation updates from http://translatewiki.net.
Change-Id: Iec31684111c51604cff49e1d20cbf7912ff57576
2013-08-08 20:02:36 +00:00
jenkins-bot 49748bd23a Merge "Darker toolbar group border" 2013-08-08 15:37:27 +00:00
jenkins-bot ba8e2231f8 Merge "Alien extensions" 2013-08-08 08:57:18 +00:00
Ed Sanders ad3a7c95c8 Alien extensions
VisualEditor.i18n.php, VisualEditor.php
* Button title
* New experimental files

ve.*.MWAlienExtensionNode.js
* Very basic extension of ve.*.MWExtensionNode

ve.ui.MWAlienExtensionInspector.js
* Default to inline-block for wrapper. Should probably
  get rid of styled wrappers for GeneratedContent eventually.

ve.ui.MWAlienExtensionInspector.js
* Basic extension of MWExtensionInspector. Override title to
  use tag name e.g. '<easytimeline>'. Could be changed in future
  to 'Extension: easytimeline' or similar.

*.png, *.svg, *Icons*.css, ve.ui.MWAlienExtensionButtonTool.js
* Angle bracket icon for button (open to suggestions)

ve.ui.MWInspector.css
* Make extension inspector text input tall by default.

Change-Id: I07f0686839192cad3cd8dfd3233ae907fe5cdf6a
2013-08-08 14:27:49 +08:00
Ed Sanders c89495d014 Darker toolbar group border
Roan and I think this is way too light. The only way
I can tell it's a group is by mousing over all of
the icons back and forth really quickly :)

Increasing to 10% alpha.

Change-Id: Iab55bf64921de5247d10d611318e545efe74fe4a
2013-08-08 14:12:33 +08:00
jenkins-bot 3a83811701 Merge "Handle <tt> as textStyle/code" 2013-08-08 03:45:34 +00:00
Roan Kattouw 7673a39878 Support previews and concurrent updates in ce.GeneratedContentNode
GeneratedContentNode didn't track concurrent updates at all, so a
race condition was possible: if the node was updated a second time
before the first update had been rendered, the second update might
render first and then be overwritten by the other one.

To prevent this, we track the promise associated with the current
render. If a new update is launched while a previous one is still
pending we attempt to abort the old one by calling .abort() on it,
and ignore any future resolution or rejection from it.

Also allow rerenders based on non-model data by calling
.update( { config object } );

Change-Id: I8feefd9e8fb6c41d06b8b20131e3be5e37954e83
2013-08-08 11:34:50 +08:00
Roan Kattouw cbadaa8d8b Fix deprioritization of regex matches in ModelRegistry
If you had an HTML element that was matched by two models, one with
a direct string match and one with a regex match, then the string
match would beat the regex match (which is correct) if they both
specified a tag name, but the regex match would win (which is wrong)
if they both didn't specify a tag name.

The fix is to only check for tagName === null if we're in tag-agnostic
mode (tag === '').

Change-Id: I9943611111e4c4ff498cdd95b7b3e72f95fb413b
2013-08-08 02:52:45 +00:00
Ed Sanders 1428ea9c27 Allow customisation of ui.Window titles
Provide getTitle() so subclasses can do something fancier than just
set a message.

Change-Id: I5eb82f70e39a991fa577aae4b0e7344908134d89
2013-08-08 02:49:18 +00:00
Translation updater bot 29a89143de Localisation updates from http://translatewiki.net.
Change-Id: I70cce8923d59e78b6461b89d2ee3e51030d076d6
2013-08-07 19:46:59 +00:00
jenkins-bot 32734767fc Merge "clean up: Consistently use MW instead of Mw in constructor names" 2013-08-07 10:29:03 +00:00
Roan Kattouw 8f2c897c11 Don't set a group for VE ResourceLoader modules
The grouping behavior is unnecessary for the main payload, and
actively hurting us for the init-init module.

Change-Id: I111e28e5c759bf43412c5b1432ec9c8a2102d7dc
2013-08-07 18:20:01 +08:00
Timo Tijhof eb0eeb240a clean up: Consistently use MW instead of Mw in constructor names
Most of 'em already do. Fixed the remaining ones.

Change-Id: I1a7ccb27dd66a33265dcaddaa7d34953d328ff87
2013-08-07 17:46:01 +08:00
Ed Sanders 0d1617a627 Hieroglyphics support
Mostly as a demonstration of how easy this is with MWExtensionNode.

The icon was chosen with the following criteria:
1. Recognisable (the ankh is quite common in popular culture, right?)
2. Doesn't look idiotic to academics (I've consulted an Egyptology
   PhD and they can confirm it's not the glyph for penis)
3. Renders well at <16x16

That said it does look a little like a stick man...

Bug: 43118

Change-Id: I9f9e8af501401866bfeecf0eec3690a705fbd4db
2013-08-07 09:43:04 +00:00
Ed Sanders 671c7d3b25 Create base MWExtensionNode for simple extension support
MWMath and other simple extensions all behave in a similar way, e.g.
<tagname>Foreign syntax</tagname>.

This creates a base class that should make supporting such extensions,
and editing their contents in a plain text box, very simple.

Change-Id: Icc0acb33fe32704f71dacb552d9dfa3142eaef2b
2013-08-07 17:39:31 +08:00