Commit graph

4073 commits

Author SHA1 Message Date
jenkins-bot 2dddb90731 Merge "Fix indent action when acting on multiple list items" 2013-05-13 17:49:00 +00:00
jenkins-bot 0d006f5976 Merge "Use consistent capitalisation of Html" 2013-05-13 17:33:33 +00:00
Ed Sanders a9d0a5c7ef Fix indent action when acting on multiple list items
Same as https://gerrit.wikimedia.org/r/#/c/63394/ but for
indentation, as well as unindentation.

Bug: 48390
Change-Id: I5ce0c385214f30c5e5c66b5b5b755c9937267cd0
2013-05-13 18:27:21 +01:00
jenkins-bot d380186c8f Merge "Optimise code for first/last child detection in fixupInsertion" 2013-05-13 17:26:39 +00:00
jenkins-bot 78bbd60a0c Merge "Fix unindent action when acting on multiple list items" 2013-05-13 16:04:11 +00:00
jenkins-bot 04f73d268f Merge "Don't use VE on non-wikitext pages" 2013-05-13 16:02:36 +00:00
Inez Korczyński 9f8ababfa9 Fix inability to split lists
Fixes change made in I7a8d6c474ecca5af02b72b6453c900ed61acea58 by using
DOM_VK_ENTER instead of DOM_VK_RETURN (which is not defined anymore).

Bug: 48386
Change-Id: I8d7aeffc8166487806e3489b054f508c5e9418ff
2013-05-13 14:59:16 +00:00
Ed Sanders 2c782fba92 Optimise code for first/last child detection in fixupInsertion
The code to record the first/last child stacks was written before
I decided on using a recursive call going only one step when such
a stack was encountered.

As we only ever test the length of the stack most of the code around
calculating the stack can be thrown away, and all we need is a simple
test to see if we are the first/last child of the immediate parent.

Change-Id: Iffb03c649e166c9f89061a4d944fa07633f16aba
2013-05-13 12:37:01 +01:00
Ed Sanders 1261a5f471 Fix unindent action when acting on multiple list items
This is caused by a limitation of surface fragments in that they
always expand to include insertions touching them. In this case
we build surface fragments contain adjacent listItems, so when
the first listItem is de-listed a transaction is first created to
split the list. This insertion of ('/list', 'list') is adjacent
to the second surface fragment and so becomes part of that fragment.

This then causes the wrong node to be passed to unindentListItem.

The workaround is to use the inner range of the listItem, not
the outer range.

Bug: 48390

Change-Id: I7418910412d292ef4953e294a97f66e48d6f776f
2013-05-12 22:15:09 +01:00
Krenair 4f7859895b Don't use VE on non-wikitext pages
Bug: 47456
Change-Id: Iae6510f661feedec181fd8697d799353edb5eac8
2013-05-11 22:26:51 +01:00
Translation updater bot da4ddbc4d9 Localisation updates from http://translatewiki.net.
Change-Id: Ifd9a13e5f4236c55b2313c1df5ec189baca08ec6
2013-05-11 19:43:28 +00:00
Ed Sanders 634947198a Use consistent capitalisation of Html
If the previous commit properInnerHTML was renamed to
properInnerHtml, but its invocations weren't (a bug).
While DOM uses .innerHTML we use Html throughout the
rest of our code so we should be consistent either way.

Change-Id: If46bb256e938a097951c159b7a278667fd8e06a6
2013-05-11 13:04:00 +01:00
jenkins-bot 50e6f052c7 Merge "Add ve.properOuterHtml" 2013-05-11 10:57:02 +00:00
Ed Sanders 375a7fceff Access keys for edit and edit source
Set up 'v' for edit, and 'e' for edit source as access keys.

Bug: 48107
Change-Id: I598177bc75ed84dea35952a3b2b1b2111aac89b2
2013-05-10 17:10:26 -07:00
Catrope 606baacc1b Add ve.properOuterHtml
Like ve.properInnerHtml but for outerHTML. Factored out the shared code
into ve.fixupPreBug.

Change-Id: I5c5b6d017936c6c2e71631fb8859ba1dbd95615a
2013-05-10 17:03:04 -07:00
Catrope 9d99cdbb67 Fix breaking getLength() call
Change-Id: Iaa6cb22bf93a677aff077ce38ee11e606430cee5
2013-05-10 17:02:07 -07:00
jenkins-bot db644e915f Merge "Fieldsets and default sort keys" 2013-05-10 23:58:17 +00:00
jenkins-bot 89aebd5112 Merge "Edit and Edit source tab were reversed in RTL in the Vector integration" 2013-05-10 23:49:30 +00:00
jenkins-bot d2c7e5b136 Merge "Switching back to Rangy 1.2" 2013-05-10 23:47:44 +00:00
Trevor Parscal 8409d16f0f Fieldsets and default sort keys
Objective:
* Add default sort key field to meta dialog
* Replace PagePanelLayout with a generic panel containing one or more FieldsetLayout elements

Changes:

*.php
* Added/removed file links

ve.dm.MWDefaultSortMetaItem.js
* Added getContent method

ve.dm.MetaItem.js
* Added replaceWith method

ve.dm.MetaList.js
* Allow insertion at the end by omitting offset and index

ve.dm.MWMetaDialog.js
* Added default sort key field
* Put category and default sort fields inside fieldsets
* Added loading/saving default sort key

ve.ui.PagedLayout.js
* Changed class used for pages to generic panel layout

ve.ui.PagePanelLayout
* Moved title/icon stuff to field set

ve.ui.FieldsetLayout.js
* New class, adds fieldset with legend

ve.ui.StackPanelLayout.js
* Moved up to the layouts directory

ve.ui.Dialog.css
* Moved style for paged panel from layout stylesheet

ve.ui.Layout.css
* Added styles for fieldsets

ve.ui.Widget.css
* Adjusted margins of input label widgets

ve.ui.MWCategoryWidget.js, ve.ui.MWCategoryPopupWidget.js
* Added setDefaultSortKey method

Change-Id: I979f5e3f08a688790c9f54086206ed1999af13ea
2013-05-10 16:46:08 -07:00
Christian Williams 741fa76868 Switching back to Rangy 1.2
Rangy files are now 1.2 and I've added 1.3 alpha versions to make
it easier to switch between while testing.

Change-Id: I2f5d86b14bd4f87719d01e3255c28f0ae8764f4f
2013-05-10 16:44:32 -07:00
jenkins-bot d96a17156a Merge "Output a nice message when the diff is empty" 2013-05-10 23:21:09 +00:00
Rob Moen 50c48a1cac Fix check for existing category in article.
Now looking inside existingCategories array for category string vs
item object.  When adding side by side duplicate categories,
category is now in correct section of menu.

Change-Id: I40dd30d80fb8bf818c077512468d630a5cb84120
2013-05-10 16:07:05 -07:00
Catrope 3f9f764949 Output a nice message when the diff is empty
Bug: 43754
Change-Id: I8daae124b060ccf54ce5ca7c1e1a6d18b7265ade
2013-05-10 15:34:18 -07:00
jenkins-bot 5f8db49a9f Merge "(bug 48022) Ignore certain function keys in key press handler" 2013-05-10 21:33:52 +00:00
Inez Korczyński b32b5702d4 (bug 48022) Ignore certain function keys in key press handler
This is a temporary solution that still may some function keys go through.

Change-Id: I7a8d6c474ecca5af02b72b6453c900ed61acea58
2013-05-10 13:51:23 -07:00
jenkins-bot 57b05aa433 Merge "Clean up variable initialization in setupSkinTabs()" 2013-05-10 20:31:03 +00:00
Translation updater bot adf53d8abc Merge "Localisation updates from http://translatewiki.net." 2013-05-10 19:59:06 +00:00
Translation updater bot 5c40ba89c0 Localisation updates from http://translatewiki.net.
Change-Id: I263431ad6d92d3d62497bffcc0abd930f675c9aa
2013-05-10 19:57:31 +00:00
Catrope 2efd4f0061 Edit and Edit source tab were reversed in RTL in the Vector integration
If we're in RTL mode and the skin is Vector-based, we need to reverse
the order of the tabs in the DOM, because that's a weird thing that
Vector does to render tabs in RTL.

See https://bugzilla.wikimedia.org/show_bug.cgi?id=46947 for discussion
about the Vector behavior.

Bug: 48017
Change-Id: Ie1214b08450aefed893739a2b862cb1e9b23a2ef
2013-05-10 11:43:05 -07:00
Catrope b295dc8d99 Clean up variable initialization in setupSkinTabs()
Change-Id: Ic596f1c98162557f33f5ca398d2358e91a3d5cb0
2013-05-10 11:43:01 -07:00
Ed Sanders 634714bab9 Remove hack for old version of Parsoid
Removing check for parsoid returning document fragments.

Change-Id: I5a8729d93907d13c699a1f3cf43ffd3e0c45b003
2013-05-10 19:42:35 +01:00
jenkins-bot 326879b75b Merge "Use pageLanguage rather than pageViewLanguage for the surface's lang&dir" 2013-05-10 18:13:09 +00:00
Catrope a65ff4fdb9 Use pageLanguage rather than pageViewLanguage for the surface's lang&dir
Bug: 33175
Change-Id: Ica006404227dcd286c387de4f637036341b17eae
2013-05-10 11:04:31 -07:00
jenkins-bot fa73dbeca5 Merge "Make reference list nodes render contents again" 2013-05-10 17:49:30 +00:00
Trevor Parscal 8858ed932f Make reference list nodes render contents again
Really Roan? How dare you!

See I3f5116d7dfbaa5889b7c5cac01d7341272749c58

Change-Id: Ia0ae514fc07752edb7b7100716e09163d3bfacba
2013-05-10 10:47:10 -07:00
jenkins-bot 51388095e2 Merge "Category UI improvements" 2013-05-10 17:32:34 +00:00
jenkins-bot 8bac303893 Merge "When removing an empty list item, also remove the list if it's now empty" 2013-05-10 17:17:36 +00:00
jenkins-bot ff15fbf21b Merge "Whitespace between unwrapped inline nodes assigned to paragraph" 2013-05-10 17:13:15 +00:00
Ed Sanders 328dd8e21f Whitespace between unwrapped inline nodes assigned to paragraph
In stopWrapping we assign any left over whitespace to the paragraph
in position 3, however we weren't clearing this whitespace buffer
if an inline content node followed it.

Change-Id: I8b3ee3915044abd6bafda386430bf7f992ca4aa8
2013-05-10 16:40:11 +01:00
jenkins-bot f966e9c41d Merge "Clone template dom elements being sent to converter" 2013-05-10 15:37:24 +00:00
jenkins-bot d7c3dd8ec6 Merge "Reduction of renderContents calls" 2013-05-10 15:35:37 +00:00
Catrope 811721f1e1 When removing an empty list item, also remove the list if it's now empty
When the user presses Enter in an empty list item, we remove it. But if
the list item was the only child of the list, that leaves an empty list
which then gets a block slug, leading to all sorts of weird things, and
even pawns in Firefox. So check whether the list item was the last child
and if so, remove the list.

Bug: 48287
Change-Id: If22d9b904b8861e24d56944d791545635b2e4254
2013-05-09 17:47:36 -07:00
Inez Korczyński 1e85621bd9 Reduction of renderContents calls
There is no need to call renderContents in ContentBranchNode constructor
because it is going to be called anyways in onSplice

Change-Id: Id1ab983668299658ecd6e89a37667cc34c701689
2013-05-10 00:28:30 +00:00
Catrope 9372ca60ad Kill getOffsetFromNode() with fire
The way it operated was evil. It did a depth-first search from the root,
finding the node using reference equality. For documents with deep
structures, this could take a long time. Inez did some profiling and
found it was called tens of millions of times on a complex document.

Kill getOffsetFromNode() and move its functionality to getOffset().
The logic has been completely rewritten: getOffset() now traverses
up from the node rather than down from the root, and pretty much does
the reverse of what getNodeFromOffset() does. This should be much more
efficient even without offset caching in the node objects (which we may
still implement later).

Change-Id: I125f9fa423c40db6472e2c4a7c94214218ba3bc7
2013-05-09 17:26:22 -07:00
Trevor Parscal e888d7b985 Category UI improvements
Objectives:
* Ensure items don't get moved to the end when their sort-key is edited
* Add placeholder text and pending styling to input
* Auto-expand input to the end of the line
* Make the minimum input width smaller

Changes:

ve.ui.MWMetaDialog.js
* Added calls to fitInput on initialize
* Fixed sort key update and insert handlers to maintain item position when updating

ve.ui.GroupElement.js
* Added index argument to addItems, allowing items to be inserted at a specific location

ve.ui.PagePanelLayout.js
* Fixed CSS class name

ve.ui.StackPanelLayout.js, ve.ui.MenuWidget.js, ve.ui.SelectWidget.js
* Passed index argument through to group element

ve.ui.PanelLayout.js
* Fixed overflow direction for scrolling option

ve.ui.Inspector.css
* Moved border-box properties to text input widget class
* Set input widget within inspectors to be 100% by default

ve.ui.Layout.css
* Updated CSS class name
* Whitespace fixes

ve.ui.Widget.css
* Made text input widgets's wrapper default to 20em wide and the input inside it be 100%, using border-box to ensure proper sizing
* Adjusted category list item and input styles to make input appear more like a category item
* Whitespace fixes

ve.ui.MWCategoryInputWidget.js
* Made category input widget inherit text input widget, rather than just input widget

ve.ui.MWCategoryWidget.js
* Replaced group functionality by mixing in group element
* Added fitInput, which automatically make the input fill the rest of the line or take up the entire next line depending on how much space is left

VisualEditor.i18n.php
* Adjusted placeholder text for category input

Change-Id: I79a18a7b849804027473084a42c36133fdacad57
2013-05-10 00:19:46 +00:00
jenkins-bot 2cbc5045b6 Merge "Move completeHistory from dm.Surface to dm.Document" 2013-05-09 22:19:58 +00:00
jenkins-bot 2e346add46 Merge "Mo' vectors (mo' problems)" 2013-05-09 22:06:50 +00:00
Catrope 3d21609ca9 Move completeHistory from dm.Surface to dm.Document
Per IRL conversation with Trevor, that's where it belongs.

Change-Id: I9eae05380597ed83122f29864b77d2278d3dd863
2013-05-09 14:54:25 -07:00
Translation updater bot d30378013e Localisation updates from http://translatewiki.net.
Change-Id: I333bb2869366ae69ab210bf21f2b7ca78209e7d5
2013-05-09 20:33:25 +00:00