Commit graph

4587 commits

Author SHA1 Message Date
jenkins-bot cb5c1fca93 Merge "Match text selection background colour to node highlight" 2013-10-16 13:00:53 +00:00
jenkins-bot b0931109d1 Merge "Language widget ULS call fix" 2013-10-16 12:59:01 +00:00
jenkins-bot 5d772e1dae Merge "Misc UI fixes" 2013-10-16 12:42:19 +00:00
jenkins-bot 9500801848 Merge "Rename storeDomElements to storeGeneratedContents" 2013-10-16 12:36:27 +00:00
jenkins-bot e4c73c64e8 Merge "Resizable node live preview" 2013-10-16 12:35:37 +00:00
Ed Sanders 79f4755850 Resizable node live preview
Resizes the $resizable element as you drag.
Can be disabled by setting the 'outline' config option.

FocusableNode
* Redraw on resize

ProtectedNode
* Destroy and prevent creation of phantoms on resize

MWInlineImageNode
* Correctly pass this.$image to ResizableNode

Bug: 54298
Change-Id: I7d6d345af8bb4712bbf154072b4704943a5a620d
2013-10-16 14:25:00 +02:00
Timo Tijhof 4ba01f08c3 Regenerate static loaders to include newly added ui.layouts
Follows-up 4efc6ca.

Change-Id: I51f3c861c88f93bf76f6c0f16ab0c3928b30b839
2013-10-16 12:17:50 +00:00
jenkins-bot 6c045e3b6d Merge "Use dimensions cached in resizeInfo for resize calculations" 2013-10-16 11:44:31 +00:00
jenkins-bot fc599dc495 Merge "Split out setResizableHandlesPosition in ResizableNode" 2013-10-16 11:39:04 +00:00
jenkins-bot b74cb1d634 Merge "Add more resize events" 2013-10-16 11:34:08 +00:00
Trevor Parscal bb03e8f17e Misc UI fixes
* Followup 75270e24: use this.surface directly in MWMetaDialog
* Document that MWDialogTools need a SurfaceToolbar
* Namespace CE events and CSS classes with ve-ce- rather than ve-ui-
* Namespace SurfaceToolbar CSS classes correctly and put them in their
  own CSS file

Change-Id: I9e70917d9c220b39e68833f67ed49fae7f7cbe6a
2013-10-16 12:40:40 +02:00
Ed Sanders a1a448b6de Rename storeDomElements to storeGeneratedContents
The default is to store the entire generated DOM node, but in
general classes can store anything that can be held by the store.

Change-Id: Ia761079fadfb5a6cfa2f00e5b5e23d6c6d3468ac
2013-10-16 11:17:01 +01:00
jenkins-bot fdf40f1655 Merge "Convert MWBlockImage dimensions to numbers and update tests" 2013-10-16 09:56:43 +00:00
Rob Moen 87629a99e1 Use existing ve config for pluginModules
Change-Id: I16a50f342e0794a98e648afc7251e8341270e9c9
2013-10-15 11:36:06 -07:00
Ed Sanders c7b3d34017 Convert MWBlockImage dimensions to numbers and update tests
MWInlineImage already does this but it wasn't copied over to
MWBlockImage.

Change-Id: I9f34182b30ae72beb7b5c3d5fde2f08185cba663
2013-10-15 17:59:39 +01:00
jenkins-bot dd567f8b27 Merge "'clearMessage' is a method of MWSaveDialog, not ViewPageTarget" 2013-10-15 10:55:41 +00:00
Ori Livneh b001b2b976 'clearMessage' is a method of MWSaveDialog, not ViewPageTarget
Fixes a small casualty left behind by 972c9a46b7.

Bug: 55726
Change-Id: I8cf8418dede002068fb1090d940b09c3bb91c196
2013-10-15 10:53:44 +00:00
jenkins-bot 577e3b3924 Merge "Enable VisualEditor using Beta Features" 2013-10-14 18:16:22 +00:00
Ed Sanders d539fa1ea0 Use dimensions cached in resizeInfo for resize calculations
The logic requires the size of $resizable when the resizing started.
This is already stored in this.resizeInfo, but for some reason the
code recalculates every time, which is both inefficient and wrong
(but not a problem at the moment as $resizable doesn't change size
until resizeEnd).

Change-Id: I37a3c98e24b9e7d5e1970212975cef5ce9ef8a99
2013-10-14 12:21:59 +01:00
Ed Sanders 600110b9c5 Split out setResizableHandlesPosition in ResizableNode
Change-Id: I254fc1851abdc7477e2067d1a6b5406f286e8668
2013-10-14 12:19:17 +01:00
Ed Sanders e73c97154d Add more resize events
'resize' is actually 'resizeEnd'. Added 'resizeStart' and 'resizing'
which is triggered on mouse move.

Change-Id: I13c6e426cbcc965b3db50082c5294ca76979fe57
2013-10-14 12:18:57 +01:00
Trevor Parscal 395d5f563c Remove ve.isMixedIn(), it's unused and it's evil
Change-Id: I5a5fc4c8eb56530dbac3bc32122faf20b8c92aa5
2013-10-11 21:51:01 +00:00
jenkins-bot d826bc702e Merge changes I160e55ad,Idd0592d6,I4d403f1b
* changes:
  Remove ve.ce.Node.prototype.onAttributeChange
  Remove ve.ce.ImageNode.prototype.onUpdate
  Remove .tagName from ce.MWInlineImageNode
2013-10-11 17:30:18 +00:00
jenkins-bot 391057bcec Merge "[browser test] icons appear hovering when cursor is on object" 2013-10-11 15:21:55 +00:00
cmcmahon 22f409070b [browser test] icons appear hovering when cursor is on object
Change-Id: I296445d0ec11f375ddb30f293ec3542ccc6332d6
2013-10-11 17:19:01 +02:00
Roan Kattouw 1d7d19ff33 Remove ve.ce.Node.prototype.onAttributeChange
There was code in there once, but it's now empty. Removed it in favor
of adding explicit listeners in the handful of subclasses that
override it.

Change-Id: I160e55ad3c7d85c9f830a4bd7d42ec5dc18ad04f
2013-10-11 15:02:19 +00:00
jenkins-bot 7e399a6202 Merge "Fix empty document length check in MWReferenceDialog" 2013-10-11 14:35:38 +00:00
jenkins-bot 66615efc1f Merge "ve.ce.Surface.getSelectionRect() can return null" 2013-10-11 14:24:10 +00:00
jenkins-bot 873b190804 Merge "Add .isFocusable() to ve.ce.Node as a shortcut" 2013-10-11 14:22:46 +00:00
jenkins-bot 19c1e00446 Merge "Stop using ve.isMixedIn() to check if a node is focusable" 2013-10-11 14:21:55 +00:00
Roan Kattouw 7959ce9ca4 Add .isFocusable() to ve.ce.Node as a shortcut
Change-Id: Ia2d3023100859e94f25bf50ed7298370b8d57c42
2013-10-11 16:09:00 +02:00
Trevor Parscal d602724e83 Stop using ve.isMixedIn() to check if a node is focusable
* Moved isNodeFocusable to ve.ce.NodeFactory
* Added isFocusable static property to ve.ce.Node
* Set isFocusable to true on ve.ce.FocusableNode

Change-Id: I3cf666280abdfce55bf9b0710827bb25c40bfd51
2013-10-11 16:00:34 +02:00
Ed Sanders 9cba9910c6 Enable VisualEditor using Beta Features
Change-Id: I76ba788751dacc24cdbc667b4d24f1656f0ade44
2013-10-11 14:50:24 +01:00
Ed Sanders 64a9449513 Match text selection background colour to node highlight
This was probably correct by default on OSX but Ubuntu's
default theme uses an orange highlight, and Windows uses
dark blue.

Change-Id: I601c2d27f6d928b38799f3a6502de5be1dccc199
2013-10-11 14:35:52 +01:00
jenkins-bot 4c9d22c7ca Merge "Generalise the way extra modules are loaded" 2013-10-11 13:33:30 +00:00
Roan Kattouw 1999ece918 Remove ve.ce.ImageNode.prototype.onUpdate
Was empty.

Bonus: consistently use object style for .attr(), was already
used for .css()

Change-Id: Idd0592d6f30388c9952e110ff6fff008bb465877
2013-10-11 15:09:21 +02:00
Roan Kattouw 0c6dadb605 Remove .tagName from ce.MWInlineImageNode
Was unused, because this.$ is always overwritten in the constructor

Change-Id: I4d403f1b89351fb7d23131f944406d5a088fdeef
2013-10-11 15:09:21 +02:00
Roan Kattouw 0901c0328a Generalise the way extra modules are loaded
Change-Id: Icd453421b022a6450d1358edbe2132e49ca0b3bf
2013-10-11 14:07:00 +01:00
jenkins-bot 8c44a53d3a Merge "Make MWInlineImages resizable" 2013-10-11 09:26:55 +00:00
jenkins-bot 06ee5b8e96 Merge "Resizeable node updates context after mouse up" 2013-10-11 09:11:16 +00:00
cmcmahon 50ffa7c40c [browser tests] remove cruft and order page.rb file
Change-Id: I7d7cba0256e1d2631cdc4b73026c89cb5c85e0f5
2013-10-10 07:35:50 -06:00
Ed Sanders a2b667c8f7 Make MWInlineImages resizable
Because they are.

Change-Id: Ib2ff3ac6e9c5ed896486c93c48697d232b892493
2013-10-10 13:35:59 +01:00
Ed Sanders 98230889ab Resizeable node updates context after mouse up
Was previously calling show(), which showed the context regardless
of whether one was required or not. Changed this to update().

Change-Id: I2c6c37b6b988cca60f3f3f2429476ab4b429184b
2013-10-10 13:34:54 +01:00
jenkins-bot 2183c35cf7 Merge "Use ve.ui.PushButton instead of ve.ui.Button in ve.ui.SyntaxHighlightDialog" 2013-10-09 23:28:43 +00:00
Trevor Parscal f1ab1f8119 Use ve.ui.PushButton instead of ve.ui.Button in ve.ui.SyntaxHighlightDialog
Change-Id: I1b30e300492e682a477615a70fc7319c1b6d794e
2013-10-09 23:25:46 +00:00
jenkins-bot e3a0ee5b6a Merge "Snap resizables to a grid when the shift key is held" 2013-10-09 23:24:06 +00:00
Ed Sanders 6445a77cec Snap resizables to a grid when the shift key is held
Defaults to 10px.

Change-Id: Idf760c446778b437edbc3cb209b04cbee1d96fb7
2013-10-10 01:10:28 +02:00
Moriel Schottlender 017699556b Language widget ULS call fix
Because of the change to ButtonWidget, the button returned false after
onClick and as a result, ULS dialog didn't open.

This fix adds a fake 'href' value to the PushButtonWidget instance
in ve.ui.LanguageInputWidget so clicking the 'change language' button
continues to evoke ULS.

(Notice, this widget will soon be split into ve-MW with a smaller fallback
widget in core, but for now, this fixes the fact ULS doesn't appear when it
should)

Change-Id: I32eabdc5ee1b3681c20c756f45a3257c7a0b5681
2013-10-09 15:45:37 -07:00
Timo Tijhof d9153a2f1d ui.MWLinkTargetInputWidget: Fix crash on invalid input
Though the initialisation works since core has been fixed, there
are still plently of cases where we take real user input that can
genuinely be invalid.

Most notably, you couldn't make a link to [[.com]] because the
link input widget would crash on an exception from mw.Title.

Even after core was fixed (and ".com" is now valid), one still
couldn't make that link. This time because '.' is an invalid title,
and we create a Title object for that while typing ".com".

ve.ui.MWLinkTargetInputWidget#getLookupMenuItemsFromData:
* Guarded against mw.Title throwing by using newFromText
  and checking it first.

ve.ui.MWLinkInspector#static.legalTitle:
* Removed in favour of checking whether newFromText returns a
  truthy value.

Change-Id: I580bfccb83f86be3ad7e83d31f0834e1cde7df9c
2013-10-09 21:29:48 +00:00
Timo Tijhof eb515188ec Convert try/catch uses of mw.Title to newFromText
`new mw.Title` throws on invalid input. Converting uses to
mw.Title.newFromText instead and converting try/catch to if/else.

mw.Title in general (regardless of which constructor) has been
improved in core. It will no longer crash on pages where the page
title was a false hit for invalid (e.g. we couldn't load VE on
[[.com]] because the js parser thought it was invalid).

However, though the initialisation works since core has been
fixed, there are still plently of cases where we take real user
input that can genuinely be invalid.

In cases where the code did not catch exceptions and there was
no obvious way to handle it, I left it as is (let's revisit them
in a separate commit). It would be an exception either way, and
I'd rather see "mw.Title: Parser error" than
"TypeError: null does not have method getNamespaceId".

Change-Id: I5b1b23d56d39cdb7ecb0809e3d721992e0c30f54
2013-10-09 21:21:25 +00:00