Commit graph

4950 commits

Author SHA1 Message Date
Trevor Parscal 9b91bb1cf3 Disconnect bound reference list events on teardown
Reference lists would never disconnect, and some transactions would cause them to be "updated" even though they don't have a document anymore.

A way to test this is to insert an image in a document with some references. When you click apply, it crashes.

The solution was to make sure we actually disconnect from the internalList and listNode on teardown.

Change-Id: Ieb0354938b68fe5e7965f61f9ccce07cd6fb1120
2013-07-02 12:08:02 -07:00
jenkins-bot b1859a2f19 Merge "Search widget key commands" 2013-07-02 17:25:42 +00:00
jenkins-bot 07891660c9 Merge "Avoid self-references, and refer instead to "source mode"" 2013-07-02 16:29:46 +00:00
Erik Moeller f73b520ddb Avoid self-references, and refer instead to "source mode"
Messages like "This element cannot yet be edited in VisualEditor"
presuppose an awareness on the user's part what VisualEditor is,
but ideally, we want the software to be invisible. Where we want
to refer to behavior of the software, we should characterize it
using language that is discoverable by the user.

Change-Id: Ia4ef7aca1501cf9cf0f772f82ac2b0a99ca53a63
2013-07-02 16:28:17 +00:00
jenkins-bot 7ab2b003a0 Merge "Simplify UI text from Caption content to Caption" 2013-07-02 16:18:44 +00:00
Siebrand Mazeland af9c7089a7 Simplify UI text from Caption content to Caption
Suggested in
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Visualeditor-dialog-media-content-section/he

Change-Id: I2cc48aa710bfc1ce302ef02a12aa2679a3cf0dc3
2013-07-02 15:06:52 +02:00
Moriel Schottlender e30c346d1c Fix for edit links, RTL wikis with LTR interface
Added both bidi-isolation and directionality. Since the directionality
has to come from the user interface (and not the wiki dir itself) I had
to read the $('body') direction. The other option could be adding a
mw.config.get().userLanguageDir that picks up the interface directionality
on top of the wiki directionality.

Bug: 50543
Change-Id: I9a00e9545a46f13750ab0d118b23d05573ee1a2e
2013-07-01 21:18:42 -04:00
Trevor Parscal 9a7913daa2 Search widget key commands
Objective:

* Enable navigating search results using keyboard up and down keys
* Bubble up query input enter events

Changes:

ve.ui.SearchWidget.js
* Route query input events to emit
* Add handler for keydown events
* Support navigating through the list of results using vertical arrow keys

Change-Id: Ia2e4b27075a8ab2e29a69294e9f7847e8f5a3f83
2013-07-01 17:06:27 -07:00
jenkins-bot d57fd0d259 Merge "Fix display of 'please check this edit' tag" 2013-07-02 00:00:02 +00:00
jenkins-bot 96f8b772cf Merge "Blacklist Firefox <= 10 per reports that it's broken" 2013-07-01 23:59:23 +00:00
James D. Forrester a24c40ac3b Fix display of 'please check this edit' tag
Change-Id: I09f8926f7f65f092cf37eb661d90602677d04924
2013-07-01 23:57:57 +00:00
James D. Forrester 88a88df370 Blacklist Firefox <= 10 per reports that it's broken
Bug: 50534
Change-Id: I732a6cceb0790bf22488e4db292b62c43276783f
2013-07-01 16:52:50 -07:00
Trevor Parscal cdc342362c Emit select null on selected item removal
Issues:

* Selected item is removed, but no select even was emitted

Changes:

ve.ui.SelectWidget.js
* On remove, emit select null when removing a selected item
* On clear, emit select null always

Change-Id: I1a94b0f8a841611b20e09f6c02f37fb9589e85c3
2013-07-01 16:19:51 -07:00
jenkins-bot 4049e35151 Merge "Per its own documentation, make showMessage()'s wrap default to 'warning'" 2013-07-01 23:18:41 +00:00
Trevor Parscal 4fb94d9586 Select widget relative item fixes
Changes:

ve.ui.SelectWidget.js
* Make getRelativeSelectableItem properly loop around
* Replace confusing and broken getClosestSelectableItem with getFirstSelectableItem since that's the only use case we had for it anyway

ve.ui.PagedDialog.js, ve.ui.LookupInputWidget.js
* Update calls to getClosestSelectableItem to use new method

Change-Id: I2399d01a45c43d1ad663ed6c6de156e796065306
2013-07-01 16:05:08 -07:00
Matthew Flaschen d86c425e10 Make GenderSurvey a number, not string.
Change-Id: I86f528070be66ae617337bb5df64951aad9b5f58
2013-07-01 16:01:38 -07:00
Trevor Parscal ea78f2309c Category moving improvements
Changes:

ve.dm.MetaList.js
* Auto-initialize index to the end of the list (like the docs claim) even when not providing an offset

ve.ui.MWCategoryInputWidget.js
* Cleanup fix for not offering to move the last category to the end

ve.ui.MWCategoryWidget.js
* Allow pressing cancel on the meta dialog after moving a category to the end without crashing

Change-Id: I45059bda022639f7942f1799a42ecf8a4d962df0
2013-07-01 16:01:34 -07:00
Roan Kattouw 701ebd5b9c Per its own documentation, make showMessage()'s wrap default to 'warning'
This was producing some lovely <visualeditor-savedialog-label-undefined>
garbage.

Change-Id: I0852fea9088738d9a93e25bd3b104b9aa07c256d
2013-07-01 16:00:43 -07:00
jenkins-bot 518dd6247c Merge "Add GuidedTour survey about user gender" 2013-07-01 22:46:52 +00:00
Matthew Flaschen 3b4b0c3c89 Add GuidedTour survey about user gender
Disabled by default, enabled with $wgVisualEditorEnableGenderSurvey.

Change-Id: I2b4aba6a95a33474c3e68423d478aa78e57d86ad
2013-07-02 00:13:38 +02:00
jenkins-bot 680e0e5ec0 Merge "Some basic async code in the initialization" 2013-07-01 20:30:33 +00:00
Roan Kattouw c41f96cf6b Some basic async code in the initialization
Break setUpSurface into a bunch of parts that setTimeout() each other.
This breaks the initialization of the editor as a whole up into the
following phases:
0) Receive AJAX response, parse HTML
1) Build linear model data
2) Build DM tree
3) Build CE tree, CE DOM, create surface
4) Initialize surface, some UI initialization
5) Launch sanity check, remaining setup, unlock editor

This is a bit hacky right now, we'll probably want to refactor later.

ve.dm.InternalList.js:
* Allow construction without a dm.Document

ve.ui.Surface.js:
* Allow construction based on a dm.Document

Change-Id: Ibf48a7e85cd7376c8f6205ed165ff57e71e34c35
2013-07-01 13:02:10 -07:00
Translation updater bot 1283441e94 Localisation updates from http://translatewiki.net.
Change-Id: Ifec1fe1b5e20f43dc9adf05a42c36f910db0bee7
2013-07-01 20:01:04 +00:00
jenkins-bot 8b24c9779a Merge "Restore focus to documentNode on convert" 2013-07-01 19:25:02 +00:00
Rob Moen beadbba79b Restore focus to documentNode on convert
Since format dropdown tool is the only tool where we actually lose
focus to the documentNode, we must restore focus so that firefox
and chrome will display a cursor after converting content branches.

Bug: 50338
Change-Id: I4059b2688565570e0efc21078035775b7aed49e1
2013-07-01 12:22:22 -07:00
jenkins-bot 770dbaef8f Merge "Don't underline the 'user guide' link when hovering the tool menu" 2013-07-01 18:54:29 +00:00
James D. Forrester f06ab8b263 Don't underline the 'user guide' link when hovering the tool menu
There are wider issues about sub-tools here, but this fixes the most glaring issue
for now.

Change-Id: I5ff2d67642daea2f84ccc56fe391eee9ca01d099
2013-07-01 11:48:21 -07:00
jenkins-bot 8159566141 Merge "Allow creating lists in block slugs" 2013-07-01 18:41:48 +00:00
jenkins-bot 3b6b29c1a5 Merge "mw.ViewPageTarget: Show save errors in save dialog instead of alert" 2013-07-01 18:38:23 +00:00
jenkins-bot 21a61a0557 Merge "Add user guide link to beta icon drop down" 2013-07-01 18:33:39 +00:00
James D. Forrester 662d35178f Add user guide link to beta icon drop down
As part of this, put the 'help' icon next to the beta icon, make the
text not greyed-out (now that it's an actual action) and provide the
link.

On hover, all three items get underlined, which is irritating, however.

Bug: 50476
Change-Id: Id65968072b7134f5864bbd96acf34fd0c23fe17c
2013-07-01 11:07:08 -07:00
jenkins-bot 13612910a0 Merge "Preserve the contents of secondary reference definitions" 2013-07-01 17:42:02 +00:00
jenkins-bot c75e379086 Merge "Fix bug where whitespace in an empty node was doubled" 2013-07-01 17:15:58 +00:00
jenkins-bot 74ec334a30 Merge "Fix reordering of metadata bug" 2013-07-01 17:09:30 +00:00
Inez Korczyński e02e9e8c82 Allow creating lists in block slugs
Previous when the selection was collapsed and the cursor was in a block
slug we'd get a JS error thrown. This fixes that, though it could do with
a refactor in time.

Bug: 47947
Change-Id: I596ea9bc553f563e3dc7689c518c7d1319ac1dc3
2013-07-01 19:04:54 +02:00
Timo Tijhof 1f1a1970be mw.ViewPageTarget: Show save errors in save dialog instead of alert
To trigger a save rejection from the api, set:
 $wgSpamRegex = '/spam/i';
and making an edit adding the word "spam" to a page.

Class changes:
* Rename message system in the save dialog from "warning" to
  "message" as it will now contain both warnings and errors.
  (css class, class property, method names, ..)

Localisation:
* Remove ugly hardcoded and wikitext-requiring "'''Warning:'''"
  prefix from the warning message, instead have a message for the
  word "Warning" and re-use this in #showMessage for each message
  of type "warning" (bolding applied in code instead of in i18n).
* Rename visualeditor-savedialog-dirtywarning to
  visualeditor-savedialog-warning-dirty and remove from
  VisualEditorMessagesModule.php as it no longer requires pre-
  processing from the server.

Clean up:
* Re-alphabetise the order of some messages.
* Clean up duplication and redundant logic in mw.Target#onSaveError
  and mw.ViewPageTarget#onSaveError.

Bug: 50350
Change-Id: I3daf631fb0d62ba88e05aa50c77c9940d61395a0
2013-07-01 16:41:12 +02:00
jenkins-bot c331c1980e Merge "Minor performance optimization and cleanup in FocusableNode" 2013-06-30 20:05:16 +00:00
Inez Korczyński daa83d2cfa Minor performance optimization and cleanup in FocusableNode
Change-Id: I4385b07c35e330a43827c891b94460424986526d
2013-06-30 13:01:47 -07:00
Inez Korczyński a08da9ffe4 Make node resizing happen inside onAttributeChange
This change fixed not yet reported bug that undo/redo for resizable nodes wasn't working.

Change-Id: Id61389bc6dcfffdd6df1d22cdb5c85e58513fb8c
2013-06-30 12:59:42 -07:00
jenkins-bot f8d7314636 Merge "Simplify ve.ce.ResizableNode by removing code for 'transition' which is not used anyway" 2013-06-30 19:57:42 +00:00
jenkins-bot 87667bd42e Merge "Make toolbar look correct with non-standard browser font size settings" 2013-06-30 19:51:50 +00:00
Inez Korczyński b0b832a796 Make toolbar look correct with non-standard browser font size settings
Assumption about toolbar height never exceeding 88px is not correct. At
least in Chrome, after setting in advanced configuration font size to
"Large" instead of "Medium", the toolbar's height is 110px and part of it
is transparent. Because it is transparent user can see content behind it
when scrolled down, which makes for a not really good experience.

Change-Id: Ibdc2410cc4ab29bfe774961fc062d172386975d4
2013-06-30 19:46:00 +00:00
Roan Kattouw 78b402545b Preserve the contents of secondary reference definitions
We currently change <ref name="foo">Foo</ref> ... <ref name="foo">Foo</ref>
to <ref name="foo">Foo</ref> ... <ref name="foo" /> , because know
that the second ref tag isn't canonical and so we blank it.

Instead, we now preserve the contents of all ref tags that come after
the canonical one.

Change-Id: I45a51a879271890fe46c4184f1029f12d27af678
2013-06-30 02:01:04 -07:00
Roan Kattouw f93b051acf Fix bug where whitespace in an empty node was doubled
<table>\n\n</table> round-tripped to <table>\n\n\n\n</table> because
we would store '\n\n' in both the innerPre and innerPost fields.
Fixed by not setting innerPost if the element is empty.

Change-Id: I0393bfaf9793fdebc8fff72c8760113fa69bb2bd
2013-06-30 00:29:38 -07:00
Roan Kattouw 46c3d48ba7 Also annotate empty annotations
The converter wasn't setting .annotations on meta items created to
represent empty annotations, which meant that HTML like
<i>Foo<b></b></i> would end up as <i>Foo</i><b></b> in the linmod.

Change-Id: I13d7d9820beeee1e8c3673e08051361d6c6ac4cd
2013-06-29 23:51:34 -07:00
Roan Kattouw 414709c5cb Fix reordering of metadata bug
If you had <meta /><b>Annotated text</b> in a wrapper paragraph,
the converter would swap them and output the linear model equivalent
of <p wrapper><b>Annotated text</b></p><meta />.

This happened because the meta item was queued, and annotations didn't
trigger metadata queue flushes. The fix is to trigger a metadata queue
flush whenever we're about to write something that isn't itself queued.

Change-Id: I168abc0392fbec5503271d1653ee5c38518f857d
2013-06-29 22:35:21 -07:00
Inez Korczyński 59e7a7bdcf Simplify ve.ce.ResizableNode by removing code for 'transition' which is not used anyway
Change-Id: I561395cab3271a93f43d14d17db0c2dcee74ae4a
2013-06-29 21:47:58 -07:00
jenkins-bot f9b8a85662 Merge "Improve async template data loading" 2013-06-30 04:11:01 +00:00
jenkins-bot 20cfc02e6b Merge "Add ability to disable for anonymous users" 2013-06-30 03:57:23 +00:00
James D. Forrester 778b8d3f9e Add ability to disable for anonymous users
This adds a new config variable, $wgVisualEditorDisableForAnons,
defaulting to 'false', which disables VisualEditor for not-logged-in
users. This only makes sense where the visualeditor-enable setting is
set to 'on' for all users; it will be used but briefly.

Bug: 50000
Change-Id: I7418c7d96a79b17e717abfba1af8c5df3141e591
2013-06-29 20:55:47 -07:00