Commit graph

2702 commits

Author SHA1 Message Date
jenkins-bot 67be7db1eb Merge "Fix off-by-one error with metadata-mutating transactions." 2013-09-11 17:09:07 +00:00
C. Scott Ananian 1f5b78ab94 Fix off-by-one error with metadata-mutating transactions.
Add some test cases for documents with trailing metadata, and fix an
off-by-one error in the metadata-mutating transactions (since the
document metadata array is one larger than the document data array).

Change-Id: I8f049466e03ed55010dfcf0a35702536edfa7b0a
2013-09-11 10:07:20 -07:00
Moriel Schottlender 63056eaa6d Allowing for config data when instantiating dialogs
Currently, WindowSet open method uses the Window factory to call up
the instantiation of a new dialog or inspector class. This commit will
also allow sending further config options to these classes if needed.

Specifically, this will also allow the use of ve.ui.Context.js for
block inspectors that are not dependent on current selection or current
location of the cursor.

It will also let us generalize the dialog/inspector window instantiations
by adding in any needed config settings on call.

Change-Id: If14384d74ab91ef01b1c7641ff84f327f2a12112
2013-09-11 08:36:05 -07:00
David Chan 23921df6dc Refactor CE Surface to reduce event feedback
Restructure SurfaceObserver methods so that the method calls are more precise.

modules/ve/ce/ve.ce.SurfaceObserver.js
* Move timing code into startTimerLoop / stopTimerLoop / timerLoop
* Move poll logic into pollOnce

modules/ve/ce/ve.ce.Surface.js
modules/ve/ui/ve.ui.Surface.js
* Change all surfaceObserver calls to use new API

Change-Id: I0085e4a53c5a776733dce6944b867b8d2228ba4b
2013-09-10 11:54:57 -07:00
Ed Sanders 06c86b3881 The Great [...] Rewrite of 2013: Clipboard edition
Firefox:
* Doesn't fire events without a selection, so when all we have is a
  focusable node, create a dummy selection in the paste target so the
  browser triggers an event on command+C.

Clipboard keys:
* Instead of just creating a text hash which may or may not match up
  with the plain text in the clipboard data, just convert the clipboard
  store into an array and use the index as the key. Also prepend a
  random number (clipboardId) so on paste we can verify the copy came
  from the same CE document.
  The text hash is now used for validation if only HTML is written
  to the clipboard.

HTML:
* Instead letting the browser grab CE HTML, always get DM HTML from
  the converter as it is cleaner (no phantoms, linefeed markers, extra
  class names etc.), and will make cross-ve-instance pasting easier
  in the future.

Clipboard overriding:
* Always override the clipboard with the above HTML, either using
  clipboardData.setData if it is available (webkit) or by throwing
  the HTML into the pasteTarget and selecting it during pre-copy.

Bug: 53375
Bug: 49396
Bug: 52096
Change-Id: Id0f39c10818047bb4b8922e97cead153a770757f
2013-09-10 10:38:34 -07:00
jenkins-bot cba2935173 Merge "Add alt attribute to core image nodes" 2013-09-10 01:43:40 +00:00
jenkins-bot 272b27a959 Merge "Use EventSequencer for CE Surface events" 2013-09-10 01:29:52 +00:00
jenkins-bot 6a81acb44a Merge "Always deep copy when writing to and reading from the fake clipboard" 2013-09-08 03:46:03 +00:00
Ed Sanders dd73b873a8 Add alt attribute to core image nodes
Also update and refactor tests.

Change-Id: I96d08faed42118b713af8011c5d6befb760e65c9
2013-09-07 12:56:17 -07:00
jenkins-bot 78cba8cc24 Merge "doc: Fix incorrect syntax" 2013-09-07 02:10:57 +00:00
David Chan 79a1bdd691 Use EventSequencer for CE Surface events
Change-Id: I662b164b7bff16ec957f3e06004e477be27282b0
2013-09-06 18:13:44 -07:00
David Chan 8e77752deb Timoize the EventSequencer into a sleek, purring monster
Change-Id: Ia925d76d9a41b777861621724ced4db8371786b8
2013-09-06 17:30:50 -07:00
jenkins-bot 0c327d4f73 Merge "Replace renderingEnabled toggle with lock counter" 2013-09-06 23:15:49 +00:00
David Chan 495e83cf2b Replace renderingEnabled toggle with lock counter
modules/ve/ce/ve.ce.Surface.js
* remove methods enableRendering/disableRendering/isRenderingEnabled
* add methods incRenderLock/decRenderLock/isRenderingLocked
* Consequential method call changes
* try-finally blocks around incRenderLock/decRenderLock pairs

modules/ve/ce/ve.ce.ContentBranchNode.js
* Consequential method call changes

Change-Id: Icb71bf536c7bad3a6c0c6512a2efb9565b5bd086
2013-09-06 16:02:51 -07:00
Timo Tijhof 6843f15962 doc: Fix incorrect syntax
These are not considered errors in jsduck 4.x but are in 5.x.

Though we don't specifically want to support 5.x yet, these are
actually genuine errors that were already causing incorrect
documentation to be generated, even under 4.x (it just doesn't
warn for these under 4.x).

Not from 5.x warnings, but fixed while at it:
* Removed more redundant @method
* Added a missing @returns for ve.Range#flip
* Added newline at EOF

Change-Id: Idc22b46b082a813e8e1761403e1ebf908bf690c4
2013-09-06 20:29:18 +00:00
C. Scott Ananian 47545a5d6f Remove no-insertion metadata corner case from ve.dm.Transaction.pushReplace().
This version pushes a `replaceMetadata` operation after a `replace` to
fixup trailing metadata if there is no inserted region and the removed
region includes metadata.  This avoids a corner case where the
size of the metadata arrays inserted/removed in `Transaction.pushReplace()`
do not match the size of the data arrays inserted/removed.

We remove the now-unused `Document.getMetadataReplace()` method.

We also adjust `MetaList.onTransact()` so that it continues to work
properly when the number of metadata entries in `replace.insert` is
not the same as the number of metadata entries in `replace.remove`.

Change-Id: I1d600405b855ca1cb569853bb885b0752df47173
2013-09-06 01:07:37 +00:00
C. Scott Ananian 5830bce72c Correctly preserve metadata in Transaction.newFromUnwrap.
The `Transaction.pushReplace` method has a corner case if the removed
region has metadata and the inserted region is empty.  This works fine
unless there are two adjacent `pushReplace` operations, which can occur
in `Transaction.newFromUnwrap`.  Fix this by having `pushReplace` look
at a preceding replace and correctly merge the two operations if
possible (in particular in the tricky case where the previous case has
a zero-length insertion).  Pleasantly, this can be done without a lot of
special-casing code in `pushReplace` or `newFromUnwrap`.

Add test cases verifying the `newFromUnwrap` works correctly (both
in commit and in rollback) when there is metadata present.

Change-Id: I6cfec0d2b1823dad724422f018a3c73dc0c7f186
2013-09-06 01:06:59 +00:00
David Chan 8a2b55321c docs: Minor improvements
CODING.md
* Document the procedure for adding a new javascript class

ve.dm.MWExternalLinkAnnotation.js
ve.dm.MWInternalLinkAnnotation.js
ve.dm.ElementLinearData.js
ve.dm.LinearData.js
* Add whitespace line before preformatted code to fix a
  rendering bug

Change-Id: I54443ea3d4799328655d279f379d4ddc176c50a0
2013-09-05 23:56:59 +00:00
Rob Moen f7b6b1e99c Add abstract method for getMediaSources.
Change-Id: I8c51d91a1f8ad1a8c688a6dd3de8ac53d4f8d3f9
2013-09-05 16:39:13 -07:00
jenkins-bot c0fe8b877c Merge "Apply DOM changes in onProtectedSetup and onProtectedTeardown instead of constructor" 2013-09-05 22:57:53 +00:00
Inez Korczyński 301b287515 Apply DOM changes in onProtectedSetup and onProtectedTeardown instead of constructor
It's important in case of replacing root element ($) of a node, so new element
does have CSS class and contenteditable property set.




Change-Id: Icf14e2164e89114e6b7c10672b782d02f4c5daac
2013-09-05 22:05:23 +00:00
Roan Kattouw fce7b0e4e7 Fix doc comment in ve.ui.Surface.js
Change-Id: I3784ff22bde13440ad63b042337ae38e07661995
2013-09-05 11:25:49 -07:00
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 ae62a0cde8 Merge "Internal lists render nothing in the CE" 2013-09-05 04:56:59 +00: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 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
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
jenkins-bot fc5003aa35 Merge "Collapse metadata on any removal." 2013-09-04 02:22:31 +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 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
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
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
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
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
Timo Tijhof bdd1a73eaa data: Rename MessagesModule to DataModule
Also..
* removed an incorrrect comment referring to the old module
  name (standalone didn't use the VisualEditorMessagesModule).
* made it use debug mode to determine whether to minify or
  prettify the js code.

Change-Id: I493007649fba27e7faab0cf743eded5f68714c50
2013-08-29 18:07:35 -07:00
Moriel Schottlender 84cca4f472 Cursor fix after link insertion
When a link was inserted, the cursor position was backwards (at the
beginning of the word rather than its end) - this commit fixes that
problem.

Also, thanks for the help Ed!

Bug: 53560
Change-Id: I04fe1ca4c9126898e7bf85cdf519794d66b4f38b
2013-08-29 21:46:28 +00:00
jenkins-bot 4291b2a308 Merge "When pasting, try to use original range" 2013-08-29 18:26:53 +00:00
jenkins-bot 0cdcf2d155 Merge "Always give references names. Ignore if used once." 2013-08-29 18:26:04 +00:00
jenkins-bot 0ae19ffa40 Merge "Set contentEditable using jQuery#prop" 2013-08-29 17:54:56 +00:00
Ed Sanders 98cad0f410 Set contentEditable using jQuery#prop
Also always use strings 'true'/'false' for the value, because
it is a string property (spellcheck, however, is a boolean)
and always use a capital second 'E' in the name.

Change-Id: Ia4e1f9edfd8f236fe81df190e6a68729d7b52243
2013-08-29 09:59:55 -07:00
jenkins-bot 467ddf5ab8 Merge "Followup 41a4b3fb: use .not()" 2013-08-29 01:55:19 +00:00
jenkins-bot b41d3bee07 Merge "Add ULS to the standalone" 2013-08-29 00:44:02 +00:00
Roan Kattouw c68e550bb3 Add ULS to the standalone
Also rerun makeStaticLoader

Change-Id: If9fae5dc5ea37567c50ab5d462308ff05e053c8c
2013-08-28 17:35:37 -07:00
Moriel Schottlender d4c2374515 Fixing inspector popup position
The inspector popup should appear relative to the position of the related
calling method - either relative to the cursor (like in links and language)
or relative to the focusableNode (like in templates/transclusion).

Bug: 50905
Change-Id: I07f58d0c6561adecbec560fc24bcb6e590f2cd9f
2013-08-28 23:59:36 +00:00
jenkins-bot ae4fee0883 Merge "AnnotationInspector insertion over blank selection" 2013-08-28 23:44:07 +00:00
Ed Sanders 458f8d1a82 Move contentEditable=false to protected node
Because that's where it should be.

Bug: 53507
Change-Id: I9afffea238a774b884d4d2434d3523e4c4e445b2
2013-08-28 16:18:55 -07:00
Ed Sanders e0018e8e94 Rename 'DOM Changes' => 'DOM changes'
Because we don't use title case in comments

Change-Id: I5cdd3241aba0727a3cd5d0ded972ae54abf1efd0
2013-08-28 15:55:35 -07:00
Ed Sanders 52de8b76ec Always give references names. Ignore if used once.
This avoids problems when unnamed references were copy-pasted.

Knowing that key is always non-null simplifies a lot of logic
elsewhere.

Bug: 53365
Change-Id: I3a23123ae732d9583814d38dd880a0cdf691fd5d
2013-08-28 12:47:33 -07:00
Ed Sanders 182d9bbeea Check clipboardData exists before accessing it
Bug fix for browsers which don't have an event.clipboardData
property. The check is done correctly in onCopy but not onPaste.

Change-Id: I3cdf4c0358aa145dcb70c2c103d08a0002001fd4
2013-08-28 11:47:13 -07:00
Moriel Schottlender ba7e0ff273 AnnotationInspector insertion over blank selection
This commit fixes two issues with insertion of annotations in blank space:
* LanguageInspector issue with inserting an language annotation inside any
  whitespace (selection of space between words or collapsed selection in
  blank line)
* AnnotationInspector issue with collapsed selection inside slugs. If
  the marker was in a slug collapsed selection, activating
  AnnotationInspector would expand the range to the closest word (on the
  next paragraph). This commit makes sure the expansion for the next word
  only happens if the selection is outside a slug.

Change-Id: I144eccefba16131a3d2ec6a3181adf47a15d6cc0
2013-08-27 20:34:57 -04:00
Ed Sanders f50102f521 Disable inserting/changing references when surface widget is empty
This listens to change events on the surface and checks to see if
there is more than just an empty paragraph node.

Bug: 53345
Change-Id: Ic8fa84d7cdcbffd154178939d0ec8c2c4f86c415
2013-08-27 17:18:52 -07:00
Ed Sanders ddb608e6bc When pasting, try to use original range
This functionality was (accidentally?) removed by I8f8a240a. It
stops us from over-zealously balancing data when we can get away
with just pasting the original selected range (e.g. it always wraps
collections of text and content nodes in another paragraph).

Bug: 53364
Change-Id: I93fa56c4e43083993c310e0050087e9d1de1e08b
2013-08-27 15:40:59 -07:00
jenkins-bot 92c7be9b31 Merge "Detect outdated pending post KeyPress handler" 2013-08-27 22:31:07 +00:00
David Chan d867ef8fc0 Detect outdated pending post KeyPress handler
modules/ve/ce/ve.ce.Surface.js
* Schedule the post-keypress async handler in a way that can be cancelled.
* Cancel it and run the handler immediately if another key event happens.

Bug: 53079
Change-Id: If139ff3230c10caa616743f71659c4606d290310
2013-08-27 13:55:02 -07:00
Roan Kattouw 10393b8773 Followup 41a4b3fb: use .not()
I claimed that it didn't preserve text nodes, but it does. It's just
that there's a bug where it doesn't preserve text nodes if the selector
passed to it is too simple, but 'link, meta, style' is complex enough
to avoid triggering this bug.

Change-Id: Id4a60dc87b8d4c613bc7013641b116dd7c331ac1
2013-08-27 13:53:17 -07:00
Roan Kattouw 051867c3ab Actually use GeneratedContentNode in AlienNode
ce.AlienNode was mixing in GeneratedContentNode, but wasn't actually using
it properly. This commit fixes this so that AlienNode can benefit from
the <meta>/<link>/<style> stripping code in GeneratedContentNode.

Also added a getHashObject() function to dm.AlienNode to summarize the
domElements attribute because ve.getHash() chokes on it otherwise.

Change-Id: Ief3be94f9730297abe0e3c57506b81a8ff1d136d
2013-08-27 13:53:17 -07:00
jenkins-bot 0ef918b6f0 Merge "Language Inspector Default Fix" 2013-08-27 20:36:42 +00:00
jenkins-bot 8b773cf9a4 Merge "Give document real focus after cut" 2013-08-27 20:21:42 +00:00
jenkins-bot 80ded50c8b Merge "Copy-paste data fixes" 2013-08-27 20:21:00 +00:00
jenkins-bot 78141a6f33 Merge "Don't render <meta>/<link>/<style> tags in GeneratedContentNode" 2013-08-27 18:28:34 +00:00
Roan Kattouw 41a4b3fb51 Don't render <meta>/<link>/<style> tags in GeneratedContentNode
There is no good reason why we'd render these tags, and their presence
causes Chrome to crash while cutting across them.

Bug: 50043
Change-Id: I611e3907cf20fa27dbef89ea941d0b787a44ba4f
2013-08-27 11:26:37 -07:00
jenkins-bot d7702819e8 Merge "Make ve.dm.Surface.{start,stop}HistoryTracking idempotent." 2013-08-27 16:27:41 +00:00
C. Scott Ananian 4fee78227d Make ve.dm.Surface.{start,stop}HistoryTracking idempotent.
Add a little robustness, guaranteeing that we don't end up with multiple
history tracking tasks running, leaking one, or try to clear a non-running
interval.

Change-Id: I41db2d6fefc7f45f150aa14ecefc648760ad6200
2013-08-27 09:25:54 -07:00
C. Scott Ananian 7fb7665608 Avoid crash after ve.dm.Surface.purgeHistory().
The selection property is never null; it is initialized to Range(0,0).
If it is set to null in purgeHistory(), the next call to
ve.dm.Surface.change() will crash.

Change-Id: Ia45c0ba26291e8ad09c445fdf2323710b5ab409f
2013-08-27 09:37:37 -04:00
Roan Kattouw ce138adbdb Kill domAttributeWhitelist in favor or renderHtmlAttributes
domAttributeWhitelist wasn't actually being observed. Instead, we
already had the code in place to treat renderHtmlAttributes as a
boolean/whitelist/blacklist hybrid, it just wasn't used that way
yet.

This makes the interface nicer and fixes the bug where all attributes
(including data-parsoid and even things like onmouseover) were
rendered by CE.

Change-Id: I02e266c7c7dc197ed845164b7a705d786846a33b
2013-08-26 18:37:50 -07:00
Ed Sanders fd410c03a7 Give document real focus after cut
If only a FocusableNode is selected the document doesn't have
real focus, so we must do it manually.

Bug: 53362
Change-Id: I781f59dda7f2884ff02f6688c2c8c037ac7ed1a6
2013-08-26 23:06:13 +00:00
Ed Sanders 99692230b1 Copy-paste data fixes
* Assign cut/copy/paste events to the document so that
  they are triggered when the CE doesn't have real focus
  e.g. only a FocusableNode is selected
* Use clipboardData.setData when available. The key can
  be stored and retrieved perfectly in text/xcustom but
  this technique doesn't work in FF or IE
* Just use text content for key as this is what is written
  to the clipboard, so this can be used directly without
  having to get the content from the pasteTarget.

Bug: 48604
Bug: 49396
Change-Id: Ib3702f9441f6ee3fa34ec071f00994dd7e591d99
2013-08-26 15:25:15 -07:00
Timo Tijhof d0d0e156b8 doc: Restore and clean up documentation for Platform subclasses
- Added missing @inheritdoc so that generated documentation is
  not empty.
- Fixed type of mw.Platform#getMessage from (implied) @property
  back to @method.
- Removed notes from mw methods. They are prepended instead of
  appended, thus overriding the useful single-line summary
  of the method with this random note. Description should either
  be replaced entirely (e.g. no @inheritdoc) or inherited.
- Rephrased a few description to be consistent with the others
  (e.g. "Get .." and "Add .." instead of "Gets .." or "Adds..").

Follows-up cbe35632f1.

Change-Id: Ie55bb9e18f1524b706f0e195300170e4d552bf73
2013-08-26 12:47:28 -07:00
Moriel Schottlender 47f9c66798 Language Inspector Default Fix
Fixes the situation where there's a language set but not a direction.

Change-Id: If353b36ff0700717f1b8fd917b39c230de5ec272
2013-08-26 03:17:45 -04:00
jenkins-bot 56ff25cb7c Merge "Fix copy and paste of backwards selction" 2013-08-22 18:14:17 +00:00
jenkins-bot 9a7b7e9176 Merge "getAnnotationsFromRange should only ignore non-content data" 2013-08-22 18:12:03 +00:00
Ed Sanders f9b92e8909 Fix copy and paste of backwards selction
Was previously broken as getSlice was using ve.Range#equals to
compare ranges which is direction-sensitive.

Bug: 51538
Change-Id: Ib58d1d8fd11b62388c111a5da66171d13a9db9c2
2013-08-22 18:10:34 +00:00
jenkins-bot 97c03da395 Merge "Don't emit Surface changes back to the Surface" 2013-08-22 09:48:23 +00:00
Ed Sanders 380b368986 getAnnotationsFromRange should only ignore non-content data
Currently ignores all non-element data, but element content (e.g.
images) can be annotated.

Added test cases and updated the test runner to only compare
store indexes for a more readable output.

Bug: 50127
Change-Id: I234586a28072811c8288aab56f6abaaa0da0c88d
2013-08-21 22:32:34 +01:00
David Chan 24dae99065 Don't emit Surface changes back to the Surface
modules/ve/ce/ve.ce.SurfaceObserver.js
* add emitContentChanges argument to poll (and start and stop)

modules/ve/ce/ve.ce.Surface.js
* Pass emitContentChanges=false to calls to start/stop in certain places
* Explicitly pass emitContentChanges=true elsewhere, to preserve prior
  behaviour

modules/ve/ui/ve.ui.Surface.js
* Explicitly pass emitContentChanges=true to poll

modules/ve/test/ve.test.js
* Escape non-BMP unicode text literals (to prevent potential editor
  problems)

Bug: 50105
Bug: 50346
Bug: 50631
Bug: 51477
Bug: 52716
Change-Id: I19ec7eaa0e3224cbfc7e7188e964183d7393c9a7
2013-08-21 17:26:32 +00:00
jenkins-bot ffdbc92a41 Merge "Toolbar API" 2013-08-20 23:17:42 +00:00
Trevor Parscal 332e31fb00 Toolbar API
Objectives:

* Make it possible to add items to toolbars without having to have all
  toolbars know about the items in advance
* Make it possible to specialize an existing tool and have it be used
  instead of the base implementation

Approach:

* Tools are named using a path-style category/id/ext system, making them
  selectable, the latter component being used to differentiate extended
  tools from their base classes, but is ignored during selection
* Toolbars have ToolGroups, which include or exclude tools by category or
  category/id, and order them by promoting and demoting selections of
  tools by category or category/id

Future:

* Add a way to place available but not yet placed tools in an "overflow"
  group
* Add a mode to ToolGroup to make the tools a multi-column drop-down style
  list with labels so tools with less obvious icons are easier to identify
  - and probably use this as the overflow group

Change-Id: I7625f861435a99ce3d7a2b1ece9731aaab1776f8
2013-08-20 16:08:26 -07:00
jenkins-bot 841a414c31 Merge changes Id2328d6e,I840b689d
* changes:
  Remove language variants from bold/italic now we have fallbacks
  Implement fallback langauges
2013-08-20 21:38:33 +00:00
jenkins-bot cd5ee730ab Merge "Remove duplicate comments from platform code" 2013-08-20 21:25:48 +00:00
jenkins-bot 4f6e42b699 Merge "Subscript is one word (and so is superscript for that matter)" 2013-08-20 20:37:49 +00:00
Trevor Parscal 4e6694c75e Subscript is one word (and so is superscript for that matter)
Objective:

* Unify the capitalization of subscript and superscript

Change-Id: I5a7fbc2d864c896ebb26177cf05c7adddacd8829
2013-08-20 13:34:50 -07:00
Ed Sanders 433f1eebcb Remove language variants from bold/italic now we have fallbacks
Bug: 53094

Change-Id: Id2328d6e7f89cd9deddde67b57cd7e3fc55683e6
2013-08-20 20:18:37 +00:00
Ed Sanders 069b757afc Implement fallback langauges
Return an array of languages instead of a single language. Languages
containing hyphens return themselves along with the root code e.g.
'en-GB' => ['en-GB', 'en']

Change-Id: I840b689d0021d865f93d16d075473a2ed0a9f0d8
2013-08-20 20:12:46 +00:00
Ed Sanders cbe35632f1 Remove duplicate comments from platform code
Inherited methods don't need to repeat documentation.

Change-Id: I05c4efe8e4a394411922add5f11259d47d44e3bb
2013-08-20 21:12:33 +01:00
jenkins-bot b2c65f2f87 Merge "Fix issue in 7673a398" 2013-08-20 19:15:38 +00:00
jenkins-bot e38bb7714f Merge "Change be-tarask to use Te instead of Te-El for bold" 2013-08-20 18:13:31 +00:00
jenkins-bot 34b143eb36 Merge "Increase line height in beta warning" 2013-08-20 17:30:42 +00:00
jenkins-bot bfc87b6d08 Merge "Don't change config during toolbar setup" 2013-08-20 17:20:44 +00:00
Ed Sanders f0c99b9c1e Change be-tarask to use Te instead of Te-El for bold
Bug: 53094
Change-Id: Ia442285e0d3f868fdda0bf06b8bb8f034c6c039f
2013-08-20 17:49:31 +01:00
Trevor Parscal a51fbbb300 Don't change config during toolbar setup
Problem: When the toolbar is created twice with the same config object,
the second time around the tools are still bound to the old surface

Reason: The tool config is overwritten such that symbolic names of tools
are replaced with instances of tools, bound to a specific surface. The
second time around, the creation fails (silently in a try-catch) and then
the already translated list of tools is used to create a new toolbar
filled with old tools still bound to the wrong surface.

Solution: Leave the config object alone, and instead build a new list of
tool instances while iterating through tool names.

Bonus: Don't fail silently. Using a try-catch to detect whether a
requested tool is supported masks other errors, and is evil. Instead,
just do a lookup and skip tools in which the lookup's result is falsey.

Change-Id: Ic43ec29173e556592bb3db9399ff83787e0a6857
2013-08-19 23:41:22 +00:00
Jforrester 40fc1b1bed Revert "Don't emit Surface changes back to the Surface"
This reverts commit 1987d3aa2b.

Change-Id: I5aaa6b0c743fbf6292030f566b6f7d993de740a7
2013-08-19 22:27:32 +00:00
Ed Sanders 4a3cc06ac5 Increase line height in beta warning
See bug for screenshots.

Bug: 53045
Change-Id: Ia4e97f42786cb8ced9ab1c94b1cce9f4abd17750
2013-08-19 20:22:18 +01:00
David Chan 1987d3aa2b Don't emit Surface changes back to the Surface
modules/ve/ce/ve.ce.SurfaceObserver.js
* add emitChangeEvents argument to poll (and start and stop)

modules/ve/ce/ve.ce.Surface.js
* Pass emitChangeEvents=false to calls to start/stop in certain places
* Pass async=false in the onDocumentKeyDown call to stop
* Explicitly pass emitChangeEvents=true elsewhere, to preserve prior behaviour

modules/ve/ui/ve.ui.Surface.js
* Explicitly pass emitChangeEvents=true to poll

modules/ve/test/ve.test.js
* Escape non-BMP unicode text literal (to prevent potential editor problems)

Change-Id: Ia96efad0c808b9a02e508bbfda65fdf4f5cedeff
2013-08-19 14:20:08 +00:00
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 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
James D. Forrester 23af88edc3 Create a subscript tool
Bug: 51612
Change-Id: Ia05e09a411213cbc035ad9dd3d3156d57f8e102c
2013-08-15 19:40:15 +00:00
jenkins-bot cec28fe287 Merge "Add ve.track, a generic dispatch of analytic events" 2013-08-15 19:39:24 +00: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
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
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
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
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
Ed Sanders b0ae68dd99 Add .static.getMatchRdfaTypes() wrapper
This allows abstract classes to specify RDFa types based on a static
property overridden by a child class. The default implementation is to
just use .static.matchRdfaTypes.

Change-Id: Ic71fc552a6a1626d94f998e9517af971e8198e79
2013-08-07 17:39:24 +08:00
peter-coti 5014e122e3 Create strikethrough text style button
Experimental to avoid making toolbar too long

Bug: 51610
Change-Id: I1eb5b1361d6058a6e1533ab62c0aa7e21c9fc090
2013-08-07 16:14:19 +08:00
jenkins-bot aeace0be29 Merge changes Ic3a64363,Ib5ae8f70,I738209d1
* changes:
  Add ve.ui.ToolGroup and use within toolbar setup
  Cleanup tool styles
  Make drop down tool work with generic toolbars
2013-08-07 05:11:57 +00:00
Trevor Parscal 2717ea1645 Add ve.ui.ToolGroup and use within toolbar setup
Objectives:

* Use a class for toolbar groups to add more functionality later
* Rename addTools method to setup

Changes:

*.php
* Add link to new file
* Move ui element classes up for more general use

ve.init.mw.ViewPageTarget.js, ve.init.sa.Target.js, ve.ui.Context.js,
ve.ui.SurfaceWidget.js
* Update use of addTools method

ve.ui.Tool.css, ve.ui.Toolbar.css
* Move styles between sheets

ve.ui.Toolbar.js
* Rename addTools to setup
* Use ve.ui.ToolGroup objects when building tools

ve.ui.ToolGroup.js
* New class, encapsulates tools

Change-Id: Ic3a643634a80a8ac7d6f6f47f031d001c7efaee7
2013-08-07 05:08:20 +00:00
Trevor Parscal 9426dfd54b Cleanup tool styles
Objectives:

* Make drop down tools look more like buttons and less like inputs, since they aren't text input and are buttons
* Make context toolbars inside surface widgets render correctly
* Show outlines of groups on hover to hint tool relationships
* Make neighboring active tools look cleaner

Changes:

ve.ui.Tool.css
* Merge ButtonTool and DropdownTool styles as much as possible
* Add styles for DropdownTool active states
* Only round the corners of the first and last tool in a group
* Soften the borders between consecutive active tools

ve.ui.Toolbar.css
* Add border to groups on hover

ve.ui.Widget.css
* Isolate surface widget toolbar styles by using stricter selector

ve.ui.Tool.js
* Fix incorrect capitalization of class name

ve.ui.SurfaceWidget.js
* Add classes to toolbar and surface for better style targeting

Change-Id: Ib5ae8f705ef1e9c481e5bdf8c8dcef9c1eb22c4d
2013-08-07 05:08:08 +00:00
Trevor Parscal 5a0faf5389 Make drop down tool work with generic toolbars
Objective:

* Remove ve.ui.DropdownTool's dependency on ve.ui.SurfaceToolbar so it
  can be used with any ve.ui.Toolbar

Changes:

ve.ui.DropdownTool.js
* Bind onBlur to document mousedown in capture mode instead of trying to
  add more and more things we are listening to which is a losing battle
* Refactor activate/deactivate mode changes
* Get rid of isEnabled check - surface should disable toolbar, the tools
  shouldn't be checking if the surface is enabled after the fact (also,
  this is harmless and doesn't change any actual interactions)

Change-Id: I738209d17649358c2f9812f9abac576960af867b
2013-08-07 03:27:30 +00:00
MatmaRex 487197278a Actually fix bug 47793 for Opera for real this time
I trusted you guys when you told me to use DOM .focus() instead of
jQuery's .focus() and didn't test well enough :( The former doesn't
work, the latter does.

Follow-up to I7962f59b.

Bug: 47793
Change-Id: Iddfb8d7c99325b6c7a5d151948b57cfa5f0a6a62
2013-08-04 23:09:56 +02:00
Ori Livneh 246c655b28 Add ve.track, a generic dispatch of analytic events
This patch adds ve.track; it provides a means for VisualEditor code to log
various changes of state that are of potential analytic interest. This is done
without coupling VisualEditor to a particular analytics framework by providing
a method, ve.hook.registerHandler, by which event data may be routed to a
particular analytic framework for processing and dispatch.

ve.track uses a $.Callbacks-like object for tracking analytic events which can
remember an arbitrary number of past events. This is done by maintaining an
array containing the arguments of past calls and maintaining a counter for each
callback indicating its position in the queue (i.e., how many events it has
already received.) This ensures handlers are called for each event, including
events which were fired before the handler was registered. This allows the
load-order of VE and analytics components to remain unspecified.

Change-Id: I29740fa7a0ac403e484e0acee6dfcadaf6fc4566
2013-08-03 02:51:07 +00:00
Ed Sanders d47cfe7d02 Handle <tt> as textStyle/code
Also store the node name so we round-trip correctly.

Bug: 52352
Change-Id: Id1fc85540804f5724ac7ded649a2d3ed0eb26770
2013-08-02 23:07:40 +01:00
Trevor Parscal a226716d70 Split ve.ui.Toolbar and ve.ui.SurfaceToolbar
Objective:

* Make it possible to make a toolbar without a surface

Changes:

*.php
* Links to new file

ve.ui.Toolbar.js, ve.ui.SurfaceToolbar.js
* Split toolbar into generic and surface specific classes

*.js
* Update symbol names

Change-Id: Ice063a2fb67b5ce5155cdc96a0d47af49eee48cb
2013-08-02 14:33:25 -07:00
jenkins-bot cd9c38aa9a Merge "Remove inserted leading whitespace" 2013-08-02 19:03:52 +00:00
Ed Sanders f153f932a2 Remove inserted leading whitespace
This is bit of a hack, as leading whitespace could be
significant if styled with white-space:pre.

Long term VE shouldn't be editing the user's HTML, and
should just highlight potential formatting issues.

We avoid the stripping in preformatted elements as we
expect they will have that styling.

Bug: 51462
Change-Id: I654d98e17dd604cb2a192831ff3f3597f95b9962
2013-08-02 19:01:22 +00:00
jenkins-bot ed0203f6d0 Merge "Include element HTML in QUnit summary for diff" 2013-08-02 18:53:37 +00:00
jenkins-bot b85fc12b7c Merge "doc: Add missing @static to static ve.Element methods" 2013-08-02 18:44:48 +00:00
Ed Sanders 42f82cf15f Include element HTML in QUnit summary for diff
Because trying to work out how broken your test case is
by looking at two (potentially multi-page) serialisations
of the DOM summary is a pain in the arse. Diffing two
HTML strings may highlight the problem much more clearly.

TODO: Is it possible to defer the calculation of the HTML
infused summary object until we have determined the assertion
has failed. Otherwise we're slowing down our tests for no
reason.

Change-Id: I873bf2479ab81d15389792bd59d15580da63941a
2013-08-02 16:10:05 +01:00
Timo Tijhof 19a705de87 ve.ui.Toolbar: Use closure instead of ve.bind for event handlers
Code speaks for itself, see also bug 52441.
Though not introduced by 14343c7bf7, that made the bug worse.

Bug: 52441
Change-Id: Ie2b80b22df03eb563de8812a47fb25152527e786
2013-08-02 09:36:43 +02:00
Timo Tijhof d3b0d94d27 doc: Add missing @static to static ve.Element methods
They were incorrectly showing up in generated documentation
as instance methods.

Change-Id: I3668311d9e6bc25d63a1f49cc7a1abe4f6f350aa
2013-08-02 08:49:53 +02:00
Eloquence 8ab81cfe4c Expand beta message a bit.
Change-Id: I6a49da57540d1702d4477619fb002f9fa0a314de
2013-08-01 21:45:53 -07:00
Rob Moen 5231d05bbe Beta welcome dialog
For configured wikis, show a dialog that welcomes the user to the
amazing and fantabulous world of VisualEditing, which is not only full of
wonderment and joy but also may lead to increased popularity and love.

The dialog only shows up once (uses a cookie).

Change-Id: I8e7c4dc2c63b36594378a543b9d66291395eebcf
2013-08-01 21:08:15 -07:00
Ed Sanders 04c0a0d2ee Prevent the creation of invalid MWInternalLinks
By testing against a regex of legal title characters we can determine
if the entered text is a valid internal link. If it isn't we should
prevent the link inpsector from creating/changing the annotation.

Bug: 33094
Change-Id: Ia1df602601e4e82fc351279e432c28c425f5157a
2013-08-01 17:38:55 +01:00