Commit graph

4562 commits

Author SHA1 Message Date
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
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
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
jenkins-bot 3d55c6a081 Merge "Fixes for Trevor's crazy half-baked commit" 2013-10-09 20:16:51 +00:00
Roan Kattouw 75270e24d5 Fixes for Trevor's crazy half-baked commit
Fix things that 4aa86d0f8 broke:
* Update surface parameter to windowSet in all ve.ui.SurfaceDialog subclasses
* Do the same for ve.ui.SurfaceInspector subclasses
* Fix @extends documentation for SurfaceDialog
* Fix documentation for ve.ui.SurfaceInspector, copypasta from SurfaceDialog

Bonus:
* Add .getMetaList() getter to dm.Surface

Change-Id: I843e99e45e9b013cb9cb559f050384d39bbbddf2
2013-10-09 22:08:13 +02:00
cmcmahon bd2b828555 [browser test] update references for proper iframes, new workflow
Change-Id: Icafbbcac9a70401bd87ea87e6dbb94ea9a6c3726
2013-10-09 13:29:58 -06:00
cmcmahon 46aed9debd [browser test] up arrow no longer exists, use X instead
Change-Id: I79684633b69ad48b4ce291e2bd6e12d14564cca6
2013-10-09 12:51:03 -06:00
cmcmahon 6c299ff2b3 [Browser tests] Sort all the elements for Links tests to proper iframes
Change-Id: I873cfaccf7211f379eadc6574edbe8de8c2e15f1
2013-10-09 18:26:48 +00:00
cmcmahon d3a75d0501 [browser tests] editing controls to proper iframe
Change-Id: Ifc24e4fcc0fe4688ee8e8b277f54fe2582dcadaf
2013-10-09 17:24:19 +00:00
jenkins-bot 39d5a1a9c4 Merge "Prevent deletion of FocusableNodes from a collapsed selection" 2013-10-09 17:22:45 +00:00
cmcmahon f8d4f10de7 [Browser tests] transclusion elements to new 3rd iframe
Change-Id: Ia1a02ece54c44d3bfb0dd985fec97e9c8d5b9d59
2013-10-09 16:55:03 +00:00
Ed Sanders bffa0df53f Prevent deletion of FocusableNodes from a collapsed selection
Instead select the node and require the user to press delete
again if they really meant to delete the node.

Also test cases!

Bug: 55336
Change-Id: I66520e18740e78ce6313f9b31bb575d06b91bea8
2013-10-09 17:41:31 +02:00
cmcmahon 46d14ca163 iframe
Change-Id: Id771991a89e1cf836c7f19083df22edb38ffc6c8
2013-10-08 16:38:44 -06:00
Roan Kattouw 74f9fe13ea Fix empty document length check in MWReferenceDialog
We now initialize the surface in the dialog with a 4-element linmod
(paragraph, /paragraph, internalList, /internalList) rather than a
2-element linmod. This broke the code that disables the Insert button
in the reference dialog when the surface is empty.

Change-Id: Id733e654a628b1294e697ad4ef3f2f6fe1a9c869
2013-10-08 21:39:25 +02:00
cmcmahon ad1a579197 dismiss latest warning iframe
Change-Id: Ic1c5099f1531174140c2033212da35632a6188cc
2013-10-08 11:17:14 -06:00
cmcmahon 971b026786 id for ip warning changed
Change-Id: I6623751228be1aa550ec8c7e1e3071a38563ada0
2013-10-08 06:00:43 -07:00
Roan Kattouw 5d7673ebc2 ve.ce.Surface.getSelectionRect() can return null
Document this fact and update callers to check for a null return value

Change-Id: I095041157cc0e24e48662f40690b4928bb8d829a
2013-10-08 11:35:17 +02:00
jenkins-bot 846414f215 Merge "Destroy test surfaces" 2013-10-08 09:19:03 +00:00
Ed Sanders c752215896 Destroy test surfaces
Also make sure surface observers are detached so they don't try to
poll the CE when it has been destroyed. This was causing exceptions
to be thrown in test runners.

Change-Id: Ic8864a73f3ee04da6018f552b1aa68748d7ffba7
2013-10-08 11:16:10 +02:00
jenkins-bot 3a9ca9260f Merge "Fix initialisation errors in EventSequencer" 2013-10-07 23:48:19 +00:00
David Chan 9004a66274 Fix initialisation errors in EventSequencer
ve.EventSequencer.js:
* Initialise listener lists to []
* Call afterLoop listeners even if there are no after listeners

Change-Id: I63a0bafa74f2c3135bd3ca75adc91a57c19319ed
2013-10-08 00:24:45 +01:00
Ed Sanders 972c9a46b7 Make the save dialog an actual dialog
Major changes:
* Create a MW specific save dialog class
* Widgetize save dialog elements
* Simplification of viewPageTarget

Minor changes:
* Added getWindow method to windowSet and setTitle methods to window class
* Add transition css properties to dialog styles

Bug: 48566
Bug: 50722
Bug: 51918
Bug: 52175
Bug: 53313
Change-Id: I8c0db01fb8477a9b3d3dfe2a6073ac67869ce40e
2013-10-07 15:59:00 -07:00
jenkins-bot 5a1a960b19 Merge "EventSequencer: New hooks for useful moments" 2013-10-07 22:24:13 +00:00
David Chan e515017827 EventSequencer: New hooks for useful moments
ve.EventSequencer.js - Implement new types of event listener:
* onLoop( f ) to set a listener for the start of the event loop
* afterLoop( f ) to set a listener for the end of the event loop
* afterOne( f ) to set a one-time listener for after an event
* afterLoopOne( f ) to set a one-time listener for the end of the event loop

Change-Id: Ie388e0e9edcfccaa20e04c649a8b85d028ddde9c
2013-10-07 22:21:21 +00:00
jenkins-bot bcbefc63cc Merge "Track DOM retrieved events" 2013-10-07 22:15:07 +00:00
jenkins-bot 574264d2d5 Merge "The amazing mystery of scrollTop and onscroll" 2013-10-07 20:37:44 +00:00
Trevor Parscal 9303648406 The amazing mystery of scrollTop and onscroll
What I learned today:
* Window doesn't have a scrollTop property, body does (that's why animate
  doesn't work on window)
* jQuery.scrollTop() doesn't work on body (in firefox) but works on
  window everywhere
* jQuery.scrollTop() uses scroll offset, not the scrollTop property
* Body doesn't have an onscroll event, window does

What I really learned today:
* Browsers are very poorly designed

Objective:
* Make clippable elements properly resize in Firefox when scrolled

Diagnosis:
* Scroll events were not being emitted from the scrollable container
  after the merge of Ifec0dae598f7fd99270588bd8ca77777a07e9669 because
  such events are not emitted from body tags, only scrollable divs and
  windows
* jQuery.scrollTop was giving incorrect values when called on the body
  instead of the window, so also due to the aforementioned change, the
  clipping was being calculated incorrectly

Treatment:
* Add $clippableScroller property, which is either a scrollable div or
  the window (could this have side-effects if someone did something
  ridiculous like made the body absolutely positioned and overflow:auto?
  Yes, but I have no other option and that's a strange edge case don't
  you think?)
* Use $clippableScroller for listening to scroll events and getting the
  scrollTop value from jQuery

Bug: 55343
Change-Id: I819aba60b200059886b347115fda437b3dc9cb7a
2013-10-07 13:25:02 -07:00
jenkins-bot 1e0c24da49 Merge "Make dialogs, inspectors windows and window sets generic" 2013-10-07 18:55:07 +00:00