Commit graph

4852 commits

Author SHA1 Message Date
jenkins-bot 3b63e332b5 Merge "Also apply autonumbering CSS to links in generated content" 2013-11-26 20:13:24 +00:00
jenkins-bot 29d33c4528 Merge "Fix moving over an image with the arrow keys in Firefox" 2013-11-26 19:51:27 +00:00
Roan Kattouw 21c72a553a Fix moving over an image with the arrow keys in Firefox
There was a bug when you moved over an image with the arrow keys:
if your selection was on an image and you pressed an arrow key, the
selection would move but focus would remain with the paste target
rather than going back to the document node, which caused strange
symptoms (immobilizing the arrow keys and scrolling horizontally)
in Firefox.

Bug: 57600
Change-Id: Iaf6a49787dd2fd2f3f88abd0d1f5ae512fd3fd68
2013-11-26 17:09:30 +00:00
Roan Kattouw f4bb62b9d7 Also apply autonumbering CSS to links in generated content
We had CSS that applied to our rendering of autonumbered links,
but not for raw <a rel="mw:ExtLink"></a> tags appearing in
generated content like templates.

Bug: 57420
Change-Id: Ic1585ecb1a133d16b7393ce0ce38a11b76cc2239
2013-11-26 16:53:31 +00:00
Rob Moen 07464e20a5 Remove the toolbar tracker
We were using it for the pop-out save dialog, but now that the save
dialog is real dialog, we don't need it any more.

Change-Id: I72697b5502d5f3fd19f2369a754a62d614af715b
2013-11-26 13:37:50 +00:00
jenkins-bot ef7152ff91 Merge "Use InputWidget facilities in byte limit counter" 2013-11-26 13:21:18 +00:00
jenkins-bot bb983c88d4 Merge "Don't build out save dialog when initializing editor" 2013-11-26 12:13:49 +00:00
jenkins-bot 4bfe1885c3 Merge "Share code between conflict resolution and the edit source switch" 2013-11-26 10:42:15 +00:00
jenkins-bot ea5a28e487 Merge "Move setting of minor/watch defaults from MWSaveDialog to Target" 2013-11-25 17:38:20 +00:00
Roan Kattouw 620e0e21ef Use InputWidget facilities in byte limit counter
* Don't use setTimeout() within a change event, because change fires
  after the text has already changed
* Don't use .$input.val(), use .getValue() instead
* Don't use .placeholder()
** Reaching into .$input is bad
** Any use of .placeholder() is TextInputWidget's responsibility
** All browsers we support also support placeholder natively
* Remove .editSummaryByteLimit from ViewPageTarget, unused
* Remove ve.bind() wrapping, we already have var saveDialog = this;

Change-Id: I380575fec8d02d1191bfc1f3f235b94c64cd23b6
2013-11-25 17:23:35 +00:00
Roan Kattouw 080b4380fa Don't build out save dialog when initializing editor
The save dialog DOM is pretty big, so building it on demand
like every other dialog out there seems like a good idea.

Change-Id: I02077c3e45f01d3467d41616eb879bd1d608a82b
2013-11-25 17:23:29 +00:00
Roan Kattouw 35e20d954f Share code between conflict resolution and the edit source switch
Each used their own implementation of building a form and submitting it.
The edit source one wasn't passing in the oldid, which caused edit
conflicts.

Also introduced a separation between form fields (for the action=edit UI)
and API options, building one from the other.

Bug: 56835
Change-Id: I38547b4ba1827f4028a2255109cba2a57cd59e8a
2013-11-25 17:23:20 +00:00
Roan Kattouw 72b0d2a19c Move setting of minor/watch defaults from MWSaveDialog to Target
It looks like it also came from there originally, because it uses
this.pageExists which doesn't even exist in MWSaveDialog. This caused
all pages, even existing pages, to be watched when 'watchcreations'
was set.

This logic really belongs server-side, though.

Bug: 56206
Change-Id: Idf500383b27a93136dc0cfdd60a2e7b2607af95c
2013-11-25 17:20:29 +00:00
David Chan b4f4eeb4b6 Event Logger: collect IME functionality info
ve/ce/SurfaceObserver.js
* Do not setTimeout if frequency === null

demos/ve/eventLogger.html
* Standalone event logging script

ve/test/ce/imetests/*.js
* JSON event logs for various tests/browsers/IMEs

ve/test/ce/ve.ce.test.js
* Add an IME test

VisualEditor.hooks.php
* Add test files

Change-Id: I50e89d5a289f3fcb4fe2a6835a2ec96fb497242c
2013-11-25 16:56:09 +00:00
David Chan addd1d7b23 Test Surface with IME-like event sequences
* modules/ve/test/ce/ve.ce.TestRunner.js
Class to interact with the CE Surface and document in tests

* modules/ve/ve.EventSequencer.js
Wrap setTimeout/clearTimeout calls (for easy replacement in tests)

Change-Id: I2e2407e2b169ae77237c87bf8857b3026cc7efce
2013-11-25 16:49:49 +00:00
jenkins-bot 95358bb7a3 Merge "Consolidate edit section handling code in ViewPageTarget" 2013-11-25 13:47:20 +00:00
Roan Kattouw cf486e011a Consolidate edit section handling code in ViewPageTarget
Move generation of initial edit summary from setupSaveDialog() to
restoreEditSection().

This allows us to get rid of the properties tracking whether both
halves of the edit section handling had happened, because they're
now in the same method.

Moving setupSaveDialog() down so it runs after restoreEditSection();
this is needed for the communication via this.initialEditSummary
to work correctly.

Change-Id: I06a9c5cf5c752acea8a2ac25d0ffb6ac61cfe986
2013-11-25 13:40:05 +00:00
Roan Kattouw 9724bf939d Fix 1919fffc: forgot to add getInnerWhitespace() in one place
Change-Id: Ia90d671100ae445ef414c6aff7b27d078ba82ffc
2013-11-25 13:39:54 +00:00
Roan Kattouw 68426a948a Update OOJS UI to v0.1.0-pre (e5ef1e5b28)
Change-Id: I07c911756b6247d9d541841fb4bab3ac09b2d8d3
2013-11-25 10:47:49 +00:00
Roan Kattouw 1919fffc74 Use serialization cache in MW integration
Add prepareCacheKey() which submits HTML for serialization and saves
the resulting cache key, and tryWithPreparedCacheKey() which uses that
cache key (if available; if pending, it waits for it) for API requests.
Implemented save(), serialize() and showChanges() in terms of
tryWithPreparedCacheKey().

When opening the save dialog, run the conversion, cache it, and fire
off a prepareCacheKey(). Then use the cached conversion for save/diff/
serialize. This means we don't convert multiple times, and it causes
the prepared wikitext to be used.

Bug: 55979
Bug: 56011
Change-Id: I1d56fe88d312e9810a57d56a285ccdf4f1facf42
2013-11-22 16:50:16 +00:00
jenkins-bot 10702d9fa0 Merge "Fix crash in MWExtensionNode creation mode" 2013-11-22 15:05:42 +00:00
jenkins-bot ecfa59ae4a Merge "Fix icon opacities" 2013-11-22 13:50:06 +00:00
Ed Sanders 6f984ea98a Fix icon opacities
* parameter.svg had no opacity set
* replace.svg had a document opacity of 80% in addition to the normal 75%
* re-rendered parameter.png (syntaxhighlight doesn't have png's yet)

Change-Id: I9c990fefaf4f5a7536b884b92523408146d7b2c7
2013-11-22 13:47:20 +00:00
Roan Kattouw 1b7fa1cf74 Make save dialog ready for async initialization
initialize() is currently called synchronously, but once the CSS
transplantation code is fixed and it goes back to being async, that'll
cause problems.

* Add this.setupDeferred and use it to defer setupCheckboxes() until
  after initialization
* Move code populating the edit summary from ViewPageTarget into
  MWSaveDialog and use .setValue() rather than manipulating the
  TextInputWidget's DOM. Defer this until after init as well
* Move clearing of the diff from ViewPageTarget into MWSaveDialog,
  and don't connect it to the transact event at startup, only when
  we've actually shown a diff
* Remove swapPanel( 'save' ) from ViewPageTarget, instead do this
  on setup in the dialog itself

Bonus:
* Document events
* Get rid of onFooButtonClick handlers in favor of array syntax

Change-Id: Idcdae5e013340f4519db4387bab507e714d47941
2013-11-22 13:17:53 +00:00
jenkins-bot edc1146eaa Merge "ce.MWTransclusionNode: Don't pass token to parsefragment API" 2013-11-22 13:14:42 +00:00
Roan Kattouw 1f8d01b72e Fix crash in MWExtensionNode creation mode
We can't get the directionality from the focused node if there isn't one.

This doesn't add any logic to determine the directionality in creation
mode, filed https://bugzilla.wikimedia.org/show_bug.cgi?id=57421 for that.

Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
2013-11-22 13:03:02 +00:00
jenkins-bot 4f573a3ea2 Merge "Recompute auto-numbered reference listKeys when merging internalLists" 2013-11-20 11:33:15 +00:00
jenkins-bot 9093eff614 Merge "Fix reference to insertItem() in MetaList, was renamed to insertMeta()" 2013-11-20 11:31:37 +00:00
Roan Kattouw cde3304864 Recompute auto-numbered reference listKeys when merging internalLists
This fixes some of the problems with pasting references.

It's a bit overzealous in that references get renumbered even when
replacing, which is unnecessary but doesn't actually have any
noticeable effect.

Unfortunately, the internal list state depends so much on the converter
having run that we now need to add yet another hack, to set the counter
to the appropriate value.

Change-Id: I3c6514ce600af4f4c037f419554d34b5a5c86a63
2013-11-20 16:50:48 +05:30
Roan Kattouw fd4495e2df Pass the mw.user directly into {{GENDER:}}
Apparently we can do that ^^

Change-Id: I646bc7df29ad2ae605148089a53f1b5b238dca22
2013-11-20 10:51:32 +00:00
jenkins-bot 137ca9d2d6 Merge "Store inner whitespace of the body and compare it on conversion" 2013-11-20 10:45:04 +00:00
Roan Kattouw 59f5ec86ae Clean up uses of 'this' in mw.ViewPageTarget
* Use 'this' instead of 'viewPage' in setupSaveDialog()
* Unwrap unnecessary .each() in restoreEditSection()

Change-Id: I45d0c9714d59e195d0c4413ed3dbe9cbabe45e9d
2013-11-20 05:33:38 +00:00
Timo Tijhof de979ff293 Replace raw oojs-ui files with v0.1.0-pre (0267100ab3)
Change-Id: I792bc0335269976ff29433227b6fa562a1026aeb
2013-11-20 10:27:48 +05:30
Jeff Hall c027af9e12 [Browser test] Expanding test with additional text markup types
Change-Id: I3141993f1527dfdeea66ac2a52ee7c8be384f198
2013-11-19 13:42:07 -08:00
jenkins-bot 457cbfdbe8 Merge "Prevent link-annotating MWReferences" 2013-11-19 11:01:40 +00:00
Ed Sanders f9d7129465 Prevent link-annotating MWReferences
As it isn't sensible wikitext.

Bug: 56250
Change-Id: I7ec03f87ad69645c2877ee7a399950f3967a1362
2013-11-19 10:58:20 +00:00
Timo Tijhof 8f9d184758 doc: Fix existing violations detected by JSDuck 5
* Fix invalid @param name (mixup of type and param name).
* Fix incorrect reliance on inferred name for ve.Range.
  @class uses the below function to guess its name, however
  if @property is encountered, the @class block ends. Thus
  it was indexed as a nameless class.
* Separate @property definitions because combining them like
  that doesn't work (it silently ignored everything after the
  first "from" property).

Also:
* Add some missing @static to static methods in ve.Range.
* Remove a few redundant @method while at it.

Change-Id: I8357c30711a4830af0b68b18350352c457a607f3
2013-11-19 16:10:25 +05:30
jenkins-bot f0982adf3b Merge "doc: Get rid of 'static' property container in jsduck index" 2013-11-19 10:28:23 +00:00
Timo Tijhof 4854d644ee doc: Get rid of 'static' property container in jsduck index
Us grouping the inheritable static properties that way is an
implementation detail that is polluting the index and makes
it harder to refer to individual identifiers.

It also causes problems under JSDuck 5 because that version is
more strict about defining properties (Foo.static.bar) of which
the parent is not defined in the index (Foo.static), we'd have
to add a sea of `@static @property {Object} this.static` all
over the place. Might as well hide this implementation detail
and just consider them static properties (just like we already
do for "private" properties).

Change-Id: Ibf2ebf7752aabc2b75b6ac6fa00e2284a181a600
2013-11-19 10:21:39 +00:00
Jeff Hall 583936f82f [Browser test] Add Review Changes workflow per reviewer comment
Change-Id: I50d0defb3c4f51f317a497d0f805859e961b8f7f
2013-11-19 10:28:26 +01:00
Rob Moen b1694c6535 Add inputFilter function to InputWidget
Change-Id: I6abc5281c70f01c26cfa181c37ed3240bda3eb3e
2013-11-19 13:41:03 +05:30
Rob Moen f496085017 Account for sanitization changes properly in InputWidget
setValue() doesn't do anything if this.value === value, but with
sanitization it's possible for that to be true while the value in
the DOM is out of sync and needs to be changed.

The fix is to check for this.value changing and the DOM changing
separately.

Change-Id: I5f571445f5729f5477902c155a4ee9588b7194a8
2013-11-19 08:06:05 +00:00
Roan Kattouw ef5f3ec054 Combine all the saveError.* track events
Instead just use saveError, and indicate the type of error in the data.

Change-Id: Ibc33b108c1f8f3aa0841ab7f0886a35d99525195
2013-11-19 11:02:52 +05:30
jenkins-bot 93164ba3b7 Merge "Only replace meta-data from dialog if it has changed" 2013-11-18 08:45:30 +00:00
James D. Forrester 74332f7a21 Only replace meta-data from dialog if it has changed
Previously we had a defaultSortKeyChanged value that lied - it was
possible for the value to be changed A -> B -> A by the user mid-
edit. However, the meta dialog assumed that defaultSortKeyChanged
wasn't lying, so blindly changed the meta item to the new value,
causing an unnecessary meta change if the user had done a no-op.

Now the value is renamed to defaultSortKeyTouched, and we actually
detect for content changes, and only change the meta item if a
change is actually needed (be that a removal, a replacement, or an
insertion).

Change-Id: I13022090bd7561a460a1151013e2b7d2a029f4dd
2013-11-18 14:13:15 +05:30
jenkins-bot 8fc7c8d336 Merge "Document the fact that ve.dm.MetaItem#replaceWith takes a plain object" 2013-11-18 08:42:21 +00:00
Roan Kattouw a60bdb8003 Document the fact that ve.dm.MetaItem#replaceWith takes a plain object
Also encourage callers to pass plain objects unless they know what
they're doing; it's almost always wrong to pass in a MetaItem.

Change-Id: I8e8ef8ac7f77ec9f929d797e467b9c9d1140d721
2013-11-18 14:07:05 +05:30
jenkins-bot 31496bac82 Merge "Fix whitespace issue that eluded me in c4b349db4" 2013-11-18 08:36:24 +00:00
Roan Kattouw e5e47afbba Fix whitespace issue that eluded me in c4b349db4
Change-Id: I5159a70929ac52fdc78b873f10853fa4420b992b
2013-11-18 13:58:44 +05:30
jenkins-bot 1fdf5f829c Merge "Guard against undefined listener arrays in EventSequencer" 2013-11-18 08:22:39 +00:00