Commit graph

4725 commits

Author SHA1 Message Date
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
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
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
Trevor Parscal 30b56e7597 Improve async template data loading
Objective:

* Fix issue where async behavior of addTemplate caused templates to be added in the wrong order

Bonus:

* Get rid of special adders for transclusion parts, just construct objects outside and use addPart

Change-Id: Ibe579f033873446376d72d3bd1b9f92d9f361de5
2013-06-29 20:51:09 -07:00
jenkins-bot fb3a146abf Merge "mw: Implement support for ConfirmEdit and FancyCaptcha" 2013-06-30 03:44:14 +00:00
Timo Tijhof 4e546796aa mw: Implement support for ConfirmEdit and FancyCaptcha
* 'captcha' property from ConfirmEdit API is already exposed
  in ApiEdit and ApiVisualEditor through the 'edit' property
  in our response data.
* Add parameters 'captchaid' and 'captchaword' to ApiVisualEditor
  and mw.ViewPageTarget#getSaveOptions. ApiVisualEditor will
  forward these to ApiEdit which forwards them to FancyCaptcha.
* We display the captcha through a saveDialog warning.

Bug: 50356
Change-Id: Ia7d2102cba89d00ec8508e846061023b330ece4f
2013-06-29 20:42:23 -07:00
jenkins-bot dbb11046d0 Merge "mw.ViewPageTarget: Support for non-paragraphs in #showWarning" 2013-06-30 03:15:53 +00:00
Timo Tijhof 656fd2ffd4 mw.ViewPageTarget: Support for non-paragraphs in #showWarning
We need this for captcha's. They'll be added and displayed as
a warning, and cleared like all others. But they shouldn't be
wrapped in a paragraph and aren't delivered as html text but
as a jQuery object (can't serialise to static html since we'll
have to keep a reference to the TextInputWidget and what not).

Change-Id: I3734fbd3c6f0270094db014bbc76d065a73ab918
2013-06-29 19:44:15 -07:00
jenkins-bot b6f6f1407f Merge "mw.Target: Use saveError's third parameter for response data" 2013-06-30 02:03:06 +00:00
Timo Tijhof 32b6729ce6 mw.Target: Use saveError's third parameter for response data
This parameter was documented as "HTTP status text" but this
was incorrectly copied from other events. The actual code
never passed anything other than null.

Now documenting it as API response data (if available, else null)

Change-Id: I88c8c525f3ca53fd47de634aec469be372884cfc
2013-06-30 02:01:35 +00:00
jenkins-bot c3b8dc5185 Merge "ve.ui.TextInputWidget: Fix TypeError when config is undefined" 2013-06-30 01:58:59 +00:00
jenkins-bot a917605096 Merge "Make loading VE work on Opera again, attempt two" 2013-06-30 01:47:29 +00:00
jenkins-bot e486307976 Merge "Move colon to make it bold too" 2013-06-30 01:41:45 +00:00
Translation updater bot f8d2f14953 Localisation updates from http://translatewiki.net.
Change-Id: I4112ca869980947884249f7af5e3cc08bb749b06
2013-06-29 19:39:23 +00:00
MatmaRex 3b10f9516c Make loading VE work on Opera again, attempt two
Once more, with feeling. Expanding the solution implemented in I1ab60665.

Bug: 50417
Change-Id: Ie0f552a0598068abc3f00bdc09cfb67230525a72
2013-06-29 15:02:00 +02:00
Timo Tijhof 7b8eed957f ve.ui.TextInputWidget: Fix TypeError when config is undefined
Parameter config is optional (both in the parent class and here),
this subclass forgot to add the fallback.

Though in a plain subclass the local fallback isn't needed
(parent class takes cares of it), in this case it is needed
since the constructor directly accesses config.multiline etc.

Change-Id: I3f9b73efb6c40a29efa221e1654b1247baaca281
2013-06-28 19:06:43 -07:00
Yuki Shira 808c60efdd Move colon to make it bold too
For consistency with other MediaWiki extensions

Change-Id: I023cea932775e6d089942ff0c52f8aee99bfe2a3
2013-06-29 01:06:13 +00:00
jenkins-bot 7fbc4e8add Merge "Firefox misplaces cursor when moving between lines" 2013-06-29 00:25:17 +00:00
jenkins-bot 52bc0c9fa2 Merge "ApiVisualEditor: Rename editResult to result" 2013-06-29 00:24:22 +00:00
jenkins-bot b126989fc8 Merge "ApiVisualEditor: Separate save/diff switch case" 2013-06-28 23:47:37 +00:00
jenkins-bot f8fd236a05 Merge "Stop floated transclusions floating out of themselves" 2013-06-28 23:46:00 +00:00
Inez Korczyński 887255500a Stop floated transclusions floating out of themselves
This is done by setting renderHtmlAttributes to false, for both block
and inline transclusions.

Bug: 49925
Change-Id: I975cf1de3b273a5189e6edf7db937c4388fa4fbe
2013-06-28 16:44:00 -07:00
Trevor Parscal de48c88ee3 Use template data for new templates and fix alias bug
Objectives:

* Use template data for templates added to a transclusion using
  the list controls
* Cache template data between different instances of the dialog
* Allow placeholders to be replaced with templates asynchronously
* Save http request and abort pending requests on close

Also:
* Fix breakage of (unused) method getParameterAliases
  (dont delete aliases)
* Remove unused method getTemplateSpec.

Bug: 49778
Change-Id: I391e51cb900ef5560455d6f3d4d2a8b99ed2b034
2013-06-28 23:34:58 +00:00
Timo Tijhof a800509cd0 ApiVisualEditor: Rename editResult to result
$editResult is confusing as it is the same as ['edit']['result']
as one would expect.

Change-Id: I8cf39359307f39450f53331ce885d2ad420168ce
2013-06-28 16:08:15 -07:00
Timo Tijhof f1ab7c1b09 ApiVisualEditor: Separate save/diff switch case
They no longer overlap (except for 3 lines of code). The
double switch case for save/diff 90% of the body being if-save
and elseif-diff doesn't make sense.

Change-Id: Ic6f014393e72901bb5ab4449d946d94b87429e52
2013-06-28 15:54:55 -07:00
jenkins-bot 6e447ce45c Merge "ve.dm.MWTemplateSpecModel: Implement getParameterOrigin" 2013-06-28 22:47:26 +00:00
Christian Williams ca0d79f340 Firefox misplaces cursor when moving between lines
When the cursor is programmatically moved, as we need to do
from time to time, Firefox's internal reference for the appropriate
cursor location on nearby lines is maintained, creating an
unexpected experience.

The fix is to wiggle the selection. This tricks Firefox into thinking
that it adjusted the selection natively.

Bug: 48289
Change-Id: I75e7e4467ec1c3faf344709886b9be5b1423cd3e
2013-06-28 15:37:26 -07:00
Rob Moen 57673643a2 Don't draw highlights over hidden elements.
Rational is that you wouldn't want to highlight something that is not
visible.  And, obtaining offsets for hidden slugs in this case does not
return correct values.

Bug: 49818
Change-Id: Ic2818423c26f5bbb2c056c3c94740d822be4f1b8
2013-06-28 15:30:17 -07:00