Commit graph

4526 commits

Author SHA1 Message Date
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 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
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
Trevor Parscal 4aa86d0f87 Make dialogs, inspectors windows and window sets generic
Objective:
* Remove surface dependencies in dialogs, inspectors, windows and window sets
* Introduce surface-specific versions of dialogs, inspectors and window sets

Change-Id: I2db59127d2085b02e173a3605e174317e419e213
2013-10-07 10:37:47 -07:00
jenkins-bot ac0f2ba092 Merge "Refactor out data processing from ve.dm.Document constructor" 2013-10-07 16:36:02 +00:00
Ed Sanders a8d84db0e8 Refactor out data processing from ve.dm.Document constructor
Also make collection of metadata and construction of nodes optional.

Change-Id: I02ba6d2199caccaf9fe9dcfba58eefa7b52c52b1
2013-10-07 17:26:21 +01:00
jenkins-bot 00b6de429b Merge "Use FlatLinearData for storing converter results" 2013-10-07 14:47:21 +00:00
jenkins-bot 0a069e6861 Merge "Remove PagedDialog from test files" 2013-10-07 12:47:53 +00:00
jenkins-bot fb18831143 Merge "mw.ViewPageTarget: Fix broken firstHeading transition" 2013-10-07 10:30:17 +00:00
jenkins-bot 0b09b597a1 Merge "mw.ViewPageTarget: Fix incomplete teardown sequence in #deactivate" 2013-10-07 10:28:46 +00:00
Ed Sanders e9a8c62692 Remove PagedDialog from test files
Fix for patch I5efa2f893f4b which only removed one reference to the file.

Change-Id: I89b9f30ee8309e1cba0ed98a74238ba671b76a59
2013-10-07 10:57:42 +01:00
Timo Tijhof b169a01907 Follow-up 6ec34a3de: Fix bug and exception in edit notice button
After 6ec34a3de the edit notice button was no longer hidden by
default if there were no notices. The alert icon was always
visible (when clicked it would show "0 notices").

In addition, on any page (except pages with edit notices) it
would throw a fatal exception at load time because method .hide()
doesn't exist.

As a result, current master shows an incomplete toolbar (e.g. not even
a Save button!)

Change-Id: Ib6e91c4756664c25fbb7403ef54b4fffcc0f9938
2013-10-07 00:28:23 +00:00
Timo Tijhof 66ff702561 mw.ViewPageTarget: Fix broken firstHeading transition
Class ve-init-mw-viewPageTarget-pageTitle added various
transition settings that were never used. Meanwhile, we're doing
fadeTo which sets inline opacity css every X ms until the
animation is finished.

* Changed the inline jQuery animation  to use css transitions
  instead.
* Removed the inexistent and obsolete ms-transition declaration.
* Removed ":visible" from selector query. This makes the selector
  more performant (since :visible is a proprietary Sizzle keyword)
  and it was obsolete anyway. The classes don't affect display none/hide,
  this is handled naturally by the browser now.

Change-Id: Ibdfb442ff6c743ef16b514a7696796ee27821887
2013-10-06 22:59:13 +02:00
Timo Tijhof 7f01c9fadc mw.ViewPageTarget: Fix incomplete teardown sequence in #deactivate
When deactivating before the surface became active (e.g.
this.active is still false, as case is the case when Parsoid
isn't running), the teardown sequence was incomplete.

Most notable, the page title (h1.firstHeading) was still dimmed
after cancelling the alert for Parsoid error, eventhough
everything else was shown and restored.

* Moved call to #showTableOfContents in #deactivate up for
  consistency with #activate.
* Added call to #restorePageTitle in #deactivate so that the
  title is restored even if the surface didn't activate yet.
* Removed calls to various methods in #tearDownSurface that
  were already called by #deactivate.

Now activate/deactivate and setUpSurface/tearDownSurface are
in balance.

Change-Id: Ibb2fbf0e5ab9b6a028d4e139c13aa7ff8c82be82
2013-10-06 21:50:06 +02:00
Ed Sanders 44b1fdebe4 Use FlatLinearData for storing converter results
Previously we returned ElementLinearData from the converter, then
stripped out the MetaLinearData. This meant that before processing
the ElementLinearData from the converter actually contained metadata
which is confusing.

The new document constructor stores the converter results in a
FlatLinearData object and simultaneously populates element and meta
data stores.

Also in this commit I have moved various methods from ElementLinearData
to FlatLinearData, from which ElementLinearData inherits.

Change-Id: I64561bde2c31d8f703c13ac7b0a0c5f7ade9f3d4
2013-10-06 20:27:32 +01:00
Ori Livneh e8aad4d4a7 Track DOM retrieved events
When the editor finishes retrieving the target DOM, fire a 'DOM retrieved'
analytic event with the following properties:

* Response time in millisecond.
* Response size in bytes.
* Whether request was a cache hit.
* Value of X-Parsoid-Performance header (or null if unset).

jQuery.byteLength is now a dependency for ext.visualEditor.mediawiki.

Change-Id: I74d3964238927645e847b6e215991bd6b1ebad59
2013-10-05 23:24:06 -07:00
Ed Sanders 000cc4d6e3 Fixup for IconButtonWidget load order
Was loading out of order in test HTML.

Change-Id: Iac56fac0432ad634a3ce0c636c7b863b9ddc950e
2013-10-05 10:45:03 +01:00
jenkins-bot b4f415ecc4 Merge "Prevent context menu from flickering after FocusableNode redraw" 2013-10-05 00:26:00 +00:00
jenkins-bot b15374751e Merge "Toolbar action widgetization and UI refactoring" 2013-10-05 00:17:28 +00:00
Trevor Parscal 6ec34a3dee Toolbar action widgetization and UI refactoring
Objectives:

* Use widgets to render toolbar actions
* Remove labels next to help notices and edit notices buttons
* Add a close button to the help notices and edit notices

Overview:

* ve.ui.ButtonWidget is now abstract, use ve.ui.PushButtonWidget instead
* ve.ui.IconButtonWidget now inherits from ve.ui.ButtonWidget
* ve.ui.PopupWidget's display method no longer takes x and y arguments
* Fixup naming issues in MWCategoryPopupWidget
* Fixup naming issues with some ve-init-mw CSS classes
* Rename ve-mw/ui/styles/ve.ui.Widget.css to ve.ui.MWWidget.css
* Change uses of "callout" to "tail"
* Add hyperlink functionality to buttons
* Make buttons accessible through focusing, but make unfocusable by
  clicking
* Add head option to popup for rendering a title and close button

Bug: 52386
Change-Id: Iea2c8df1be64d40f9c039873d89ee540cc56e687
2013-10-04 16:26:13 -07:00
Trevor Parscal 4a459e40a8 Remove surface dependencies from lookup widget
Objective:
* Use <body> instead of the closest surface overlay as the default
  overlay (wasn't actually being used anyway)
* Use this.$.offsetParent instead of closest surface when measuring
  parent frame offset to position text input menu

Change-Id: I04fc5ff1da4bafd342093922a5bd3b3a784b327c
2013-10-04 21:16:47 +00:00
jenkins-bot e1c49ace99 Merge "Refactor ve.ui.PagedDialog" 2013-10-04 20:25:43 +00:00
Kyle Florence 4efc6cadb7 Refactor ve.ui.PagedDialog
This commit extracts the page and outline handling logic from
ve.ui.PagedDialog (RIP) and moves it into two layouts: ve.ui.PagedLayout
and ve.ui.PagedOutlineLayout, respectively. These layouts are now implemented
inside the dialogs that used to mixin the ve.ui.PagedDialog class. This
brings a much cleaner separation of concerns between Dialogs and Layouts
and allows the use of page handling logic without the accompanying
outline logic.

Change-Id: I5efa2f893f4b7e962438b3aff34b737573bbd5ca
2013-10-04 12:09:15 -07:00
Zeljko Filipin 45a222a863 The element has different title on a Mac
It is "Edit this page with VisualEditor [ctrl-option-v]".

Change-Id: I54d72c63f07826106e8fbb0de0828dd82b67c766
2013-10-04 17:14:03 +02:00
jenkins-bot b36c401ec7 Merge "Get rid of 'reversed' flag on transactions" 2013-10-04 06:18:06 +00:00
Roan Kattouw 4cb9565f42 Fix name of syntaxHighlight icon file
It's referred to as url(images/syntaxHighlight.svg) in
ve.ui.MWSyntaxHighlight.css

Change-Id: I32391abc895caff9746ea5a4956a54c4c176c573
2013-10-03 17:30:27 -07:00
Roan Kattouw 10bf7b34ca Followup 571d6cac: when the selection changes, undo highlights
Ignoring all bounced change events led to the logic for unhighlighting
the previously selected FocusableNode being skipped. This caused a bug
where if you clicked a FocusableNode, it would stay highlighted even
if you then selected some text, until you highlighted another node
(which would then be highlighted forever, etc.)

Change-Id: Ia8d74ef85eaa47326d49ef6c0f395b44b90da4dc
2013-10-03 15:50:51 -07:00
jenkins-bot 2b46215a2c Merge "Make toolbars, toolgroups and tools toolFactory independent" 2013-10-03 22:42:58 +00:00
jenkins-bot 5ba2dcfe3c Merge "ve.Element: Fallback to body, window is not scrollable" 2013-10-03 22:27:37 +00:00
jenkins-bot c21c8556fc Merge "Make ve.Factory require static name property" 2013-10-03 22:03:26 +00:00
Trevor Parscal 61ddfb76e4 Make ve.Factory require static name property
Objective:
* Make ve.Factory behave like ve.NamedClassFactory
* Remove the only remaining use of ve.Factory (actions)
* Remove ve.NamedClassFactory

Change-Id: Ie302ef5ea31081de7ab0db6091058a59946aef4c
2013-10-03 14:52:19 -07:00
jenkins-bot c98624a7be Merge "When cloning the InternalList, pass through properties that aren't rebuilt" 2013-10-03 21:51:45 +00:00
Trevor Parscal 7297108a48 Make toolbars, toolgroups and tools toolFactory independent
Objectives:
* Pass a specific tool factory into a toolbar, allowing it to be used
  with different collections of tools and not depend on the
  ve.ui.toolFactory global
* Move syntax highlight editor tools to their own factory

Change-Id: I307bf180bd6817bc044bc474a77861e13f431ddb
2013-10-03 21:49:36 +00:00
Roan Kattouw 69ad031bff When cloning the InternalList, pass through properties that aren't rebuilt
InternalList.clone() assumed that all properties are automatically rebuilt
when a new document is built, but that's not true for .nextUniqueNumber
(or for .itemHtmlQueue for that matter). This meant that, in practice,
.nextUniqueNumber was being reset to 0 after auto/N numbers for existing
references had been assigned, but before assigning numbers to newly
created references. This caused all sorts of naming collision fun.

Bug: 54712
Change-Id: I1d087a5f3c23979d7d488e3ab32eb064ebc23e94
2013-10-03 14:43:20 -07:00
Trevor Parscal 1a7a5a9948 Allow menu tool groups to be wider if needed
Using a min-width instead of a width ensures it gets larger only if
needed.

Bug: 54870
Change-Id: I9953d21134d722547efa0cdbe32e1bc0c13d6093
2013-10-03 21:25:46 +00:00
Timo Tijhof f6d409e09b ve.Element: Fallback to body, window is not scrollable
Bug: 54928
Change-Id: Ifec0dae598f7fd99270588bd8ca77777a07e9669
2013-10-03 23:06:47 +02:00
jenkins-bot dd9511f249 Merge "Change ve.dm.DocumentSlice to a mixin to ve.dm.LinearData" 2013-10-03 18:45:55 +00:00
Ed Sanders 5c31d3215b Change ve.dm.DocumentSlice to a mixin to ve.dm.LinearData
Document slice only ever contained linear data, with extra functionality
to preserve the range. It pre-dated LinearData, but now we should
refactor it to reflect its purpose.

Change-Id: Ifc908f7526c83a43a51372c8d2494d7260e7facd
2013-10-03 19:38:59 +01:00
jenkins-bot 1a9f6489d7 Merge "Rename getDocumentSlice to cloneFromRange" 2013-10-03 18:19:13 +00:00