Commit graph

30 commits

Author SHA1 Message Date
Sam Wilson a2cccc57af Add live-preview logging
Log on every click (by any means, including accesskey) of the
main editing preview button.

Bug: T290521
Change-Id: I67d821445c5e39034bcb121beccf17a765a311ed
2021-11-04 10:09:56 +08:00
Ed Sanders 344da9de80 Move var declarations inline
Change-Id: I841ed46dfde9a6e2a5927e49ac3383d6e17bda66
2021-06-15 15:45:13 +01:00
David Lynch cb1c5d49aa Log whether Javascript was supported on saveSuccess
Adds a hidden field to the edit page form, with JS that will set its
value. Server-side then checks for that value and logs whether it was
correctly set.

Bug: T263505
Change-Id: I8be06385aa6d97e5536cfc252d34297e1c000a32
2021-04-30 17:45:40 -05:00
David Lynch e052e46f94 Log the DiscussionTools a/b test bucket for relevant schemas
If someone is enrolled the DT a/b test, we want to know about their
editing here as well.

Bug: T273096
Change-Id: If2bb04011c8ca54e8c7ffd073e21bec45e92460c
2021-01-29 20:56:14 -06:00
Niklas Laxström c10d08d87b Export crude public interface for WikiEditor
Bug: T250862
Change-Id: Iac8778f0d0a0150acc99569d84422bc9817dfcc7
2021-01-21 12:22:52 +00:00
David Lynch fa2b80e22a Edit page normally lacks wgRevisionId, but has form field parentRevId
Bug: T230133
Change-Id: I5e3defe22aee58e36d662ef051ebfb3ff1b64dde
2020-12-21 12:27:46 -06:00
David Lynch 7ab9ac2a73 Update VisualEditorFeatureUse with new fields
Bug: T252925
Change-Id: Id6f3748bfd3865e7bb0e4ef5e882206438063e0f
2020-06-09 15:57:07 -05:00
David Lynch a107382fc5 Implement firstChange logging
Also, clean up the invalid logging of some prefixed schema items.

Depends-On: I79e04dda6323ebb05b129bb96c0323db112bcdd0
Bug: T229079
Change-Id: I73eae25d83b8d3f73128d3b800b267a8288a76e8
2019-09-10 09:38:49 -05:00
Roan Kattouw d23d096281 Convert ext.wikiEditor module to packageFiles
This allows us to bundle the wgWikiEditorMagicWords and
mw.msg.wikiEditor(?!) config vars that were previously exported globally
in the startup module.

This code is old and crufty, so this is a somewhat minimal conversion:
* Use require() for jquery.wikiEditor.{dialogs,toolbar}.config.js,
  and for jquery.wikiEditor.{dialogs,toolbar}.js
* Don't attempt to convert jquery.wikiEditor.js to something
  require-based, instead just run it and let it set the $.wikiEditor and
  $.fn.wikiEditor globals
* Consolidate ext.wikiEditor.{dialogs,toolbars}.js into
   ext.wikiEditor.js

Bug: T222828
Change-Id: Ia75d685cbde786e8fceb6db36f2436b2beea1499
2019-08-05 22:24:56 +00:00
Fomafix 3a306ff7fb Use lightweight mw.util.getParamValue() instead of mw.Uri()
Change-Id: I27eea6544a7dfe503d0cac1e24228eca9834ca95
2019-07-17 17:41:23 +02:00
David Lynch 7bbbf1a886 Log editor switches to visualeditorfeatureuse
Also, avoid distorting the logging of abort when VE is switched to from
WikiEditor. Log it immediately, rather than waiting until the end of the VE
session triggers a page-unload.

Bug: T221191
Change-Id: I3ddccd8df973a289f3bcdc4cdc42df1ab23ce6a4
2019-07-03 23:36:23 -05:00
Dan Andreescu 7d61121793 Remove mentions of schema.* ResourceLoader modules
These modules are deprecated and will be removed, see parent task for
details and deprecation information.

Bug: T223286
Change-Id: I72a1ab68f94842b2fa9bcd84c21ea736a48e0614
2019-05-14 21:19:34 -04:00
Ed Sanders 583ad04b87 build: Update eslint-config-wikimedia to 0.10.0
Change-Id: I5fea8a1d6c91ea69c3490101ea38ce4626bd7e11
2019-01-08 23:32:56 +00:00
Ed Sanders 4fa41179e8 Remove obsolete aliases from closures
Bug: T208951
Change-Id: I0b2993912de221e810414e46708c19be163922f6
2018-11-12 22:28:40 +00:00
Roan Kattouw d700202f85 Update EventLogging code for Edit->EditAttemptStep schema migration
The schema itself is being renamed, and many of the field names are
different.

Bug: T207803
Depends-On: I2949c9782669b75cf17978698c8cef21fdee6dea
Change-Id: I07d9bc1530005914043911b7906c1602522c9162
2018-10-29 11:38:07 -07:00
Roan Kattouw 55b89c1ede Oversample Schema:Edit events when configured to do so
Respect the config var exported by WikimediaEvents that, if set to true,
forces oversampling. When oversampling, all events are logged even if
they would have been sampled out. The isOversample property is set to
true if the event was oversampled and would not otherwise have been
logged.

Bug: T206543
Depends-On: I5fdf5fdd2dc0d99a0a0d7eb7ab2e3dce4798009b
Change-Id: I7e504884a888c4d080cd4762549b72489126ed65
2018-10-18 10:58:45 -07:00
Roan Kattouw e54a4420ca Use Schema:Edit sampling rate config from WikimediaEvents
Instead of hard-coding the 6.25% sampling rate, allow it to be
controlled by the config variable in the WikimediaEvents extension
(which also defines the RL module for the Edit schema).

Also use sampling code from EventLogging so we can configure the
sampling rate as a number, rather than using a hex-digit based strategy.

Bug: T206543
Depends-On: I00383cec62f6c2a0137b329565b0ca84bfbb223f
Depends-On: Ib746fc708e7b752cebc5fd8d080e40819dfa34f3
Change-Id: I2956efc9294768742dd49dcb36770f0509e4090f
2018-10-17 14:30:03 -07:00
David Lynch 046e9b6374 Track time-to-ready/loaded via window.performance
Change-Id: Iadb9c131ca6730c20d4b166e686942f9b404e198
2017-12-11 11:53:14 -06:00
Ed Sanders 0322d628aa Track action=loaded when the editor is *fully* ready
Change-Id: I29ee776bdfe5d89ddffb97175588ed037ef0beee
2017-12-06 16:32:27 +00:00
Ed Sanders 781504057a Make toolbar and dialog part of the core module
Bug: T163793
Change-Id: Ia6d02b51d4e04f148d836827640ff132366c4bee
2017-05-03 11:54:23 -07:00
paladox bdb67f719c build: Test JS code with jshint and jscs via npm
Change-Id: I039bc4c17fbba3c74a5050066b20af05434ca482
2015-11-18 12:06:36 +00:00
Alex Monk 7eba01c398 Finish updates for Schema:Edit
Follows-up Ib5fc6004

Bug: T111421
Change-Id: I3f1148ed7ec424875d73b0eb6571c8f38180685f
2015-09-04 20:46:56 +01:00
James D. Forrester ab9dbac995 Reduce 'Edit' EventLogging schema sampling rate to 6.25% (1/16th)
Bug: T103036
Change-Id: Ib437c2542f9f6ed4d333047383ff66e637b5065e
2015-06-18 16:39:29 -07:00
Roan Kattouw d1270ed4b6 Populate abort.type in Schema:Edit logging
Using document.activeElement at the time of the unload
event as a proxy for whether the user is switching to VE.

Switching to VE is weighed more heavily than whether or not
the user made changes: switching to VE causes abort.type to be
'switchwithout' regardless of whether changes were made; only
if the user isn't switching to VE do we look at whether changes
were made and use 'abort' or 'nochange' as appropriate.

When wgAction === 'submit' (i.e. we're on a preview / show changes
view), it is assumed that the user has made changes.

Bug: T95938
Change-Id: Ic91b87c4fc5b601e1fd98b237100d808e97400bd
2015-05-04 18:15:18 -07:00
Roan Kattouw cc5ca3a2f6 Perform 25% sampling on the client side as well
Needed because session IDs can be generated on the client
from the unload handler (when the back button is used).

Bug: T95919
Change-Id: Iac921bc36806205fc11ac76154ed8b3890f10d31
2015-04-28 14:55:54 -07:00
Roan Kattouw 418baf1efa Regenerate editingStatsId on unload
So that the ID isn't reused when the user uses the back button
to navigate back to an edit page.

It would be more natural to use pageshow for this, but that
event also fires on initial load. There is a .persisted property
that indicates whether the page was recycled, but that
property doesn't work in Chrome:
https://code.google.com/p/chromium/issues/detail?id=344507

Doing this from pagehide doesn't work either, because that
runs before unload (at least in Chrome) and causes the
abort event to be emitted with the new ID. So instead,
regenerate the ID in the unload handler after the
abort event has been sent.

Bug: T95919
Change-Id: I20a602a7896e75ffa116dcd2c137306ca84164b6
2015-04-21 01:01:41 +00:00
Roan Kattouw 1a96528f69 Remove extraneous comma
Change-Id: Ica0bb9f5a266e265647ade4a13e1e1d368c928d2
2015-04-19 15:35:39 -07:00
Alex Monk 596a790d00 Try to unbreak WikiEditor modules
Some very weird issues going on involving multiple wikiEditor instances being
set up on the same textarea element. It's probably a race condition of some
sort and I'm hoping that restoring the modules like this will fix it.

Bug: T93384
Change-Id: I44c9c013993220ab709893d239614552d7b25d46
2015-04-07 19:51:58 +01:00
goibhniu bddd21b300 Peserve jQuery references to avoid conflicts
* Added closures for jQuery where missing.
* Added closures for mediaWiki where missing.
* Using ready( $ ) where possible.
* Removed empty CSS block.

Change-Id: Ifdd4b10063221a4967d812eafd43858623ec5d28
2013-11-06 23:34:46 +01:00
Trevor Parscal 089b73aa5d * Moved ResourceLoader modules into the ext.* space - this is the convention that should be followed in the future
* Moved test resource to the modules folder and registered it
* Fixed tests file to use $ not $j
* Cleaned up syntax in module definitions
2010-09-20 20:06:18 +00:00
Renamed from modules/wikiEditor.js (Browse further)