Commit graph

1764 commits

Author SHA1 Message Date
Ed Sanders 4c759e2587 autosave: Handle switched document with no transactions
Always store immediately if fromEditedState is true. Also
now that we only store if there is state to recover, remove
the check for transactions before deciding to show the notification.

Change-Id: I5357a9098b91e303f5c71881ea03a080d2969fff
2018-03-04 23:40:24 +00:00
Ed Sanders 007bb6fa09 Refactor diffpage init
Avoid re-rendering the diff if it hasn't changed.

Change-Id: Icbc8eb58625cf7c5485d0045e26993a170016309
2018-03-04 14:45:33 +00:00
Ed Sanders c8d0f62095 fetchSpecialCharList: Set directionality
Specifically, set arabic(extended) and hebrew to 'rtl'.

Logically depends on I14abd3e0c0d23f79aa01d96c216eea913024b4c8
to set the dir attribute in UI.

Bug: T56310
Change-Id: I1c7e28d3d2f20ca84115be6d49650cd9a81d78dd
2018-03-01 23:22:45 +00:00
Ed Sanders 11ac2736a1 autosave: Don't store initial document state until first change
1. It wastes valuable time during setup.
2. If a user reloads the page without making changes we
   should give them the latest html from the server to
   minimise the chance of an edit conflict.

Change-Id: I9a1f8cfd65ef2552fe2c3d6d2bbf975851b52003
2018-03-01 18:25:10 +00:00
Ed Sanders 90b6a1b5cf Clarify autosave comment
Change-Id: I0bdaf989886be8537ea45237ceea88a5cca11fc1
2018-02-28 14:36:58 +00:00
Ed Sanders 19d9e9eb98 Tag TODO comments with bug number
Change-Id: I965e8d4bed4fdfa24738ca5cce0ae3f51e7f2b40
2018-02-28 14:36:42 +00:00
jenkins-bot 8727ecd181 Merge "Do not use deprecated jquery.byteLength" 2018-02-27 22:10:23 +00:00
Bartosz Dziewoński 974ea82c50 Do not use deprecated jquery.byteLength
Change-Id: If3f921d60563bd614c269d1d26b745161f8cfc7b
2018-02-27 22:35:29 +01:00
jenkins-bot 12323a022e Merge "autosave: Use upstream methods in ve.dm.Surface" 2018-02-27 21:03:52 +00:00
jenkins-bot b3adaa5fc1 Merge "Show notification when document is recovered (or fails)" 2018-02-27 21:03:51 +00:00
Ed Sanders c670ce76ee autosave: Use upstream methods in ve.dm.Surface
Change-Id: I150b21d7767153d8457b5da658bb8b51b5464aa9
Depends-On: I859b57aef9d591597956f3d942dd2cf1b0aecee0
2018-02-27 20:54:59 +00:00
Ed Sanders a46b30a161 Show notification when document is recovered (or fails)
Change-Id: Id2f6651ba7743c05043bbbe64cd9cb7bd762d74b
2018-02-27 20:54:18 +00:00
jenkins-bot c44390e6f8 Merge "Use session storage to auto-save" 2018-02-27 20:20:31 +00:00
Ed Sanders 76caef6b4b Use session storage to auto-save
Ensure we start with the same HTML (i.e. if an edit has
been made since the crash-recovery):
* Whenever an article target is activated, stash the initial
  document html, other parsoid response data, and the request
  parameters (pageName, mode, section) in session storage.
* Whenever an article is fetched through the target loader,
  recover from session storage if the request parameters match.

Store transactions:
* On document transaction (debounced) append the latest
  changes to session storage.
* If a document state is recovered from session storage,
  attempt to re-apply the stored transactions.

Clear transactions:
* Whenever the target is torn down (i.e. save, deliberately
  closing the editor to go back to read mode)

Other:
* If writing to session storage fails once, disable future
  attempts for that session (assume storage quota exceeded)
* Disable tempWikitextEditor when recovering. We don't have
  the transaction code loaded yet to perform the recovery.

Bug: T57370
Depends-On: I3832243fc347a99641fcb7e39a887a153c9a3b22
Depends-On: I448fb566fe9f7f5b5a76e88b70ca000e3d35b415
Change-Id: Id9d877f903cf4796a52f90991c030417a9f8786f
2018-02-27 12:19:06 +00:00
Ed Sanders 31f7015260 Whitelist style tags from Parsoid, e.g. TemplateStyles
Bug: T188143
Change-Id: I7a30d8a8c40de8b786d59c8bf0ebcb77f2baeb2a
2018-02-26 16:52:01 +00:00
David Lynch abe3d0a4a5 DiffPage.init: Enforce a valid diff mode
Bug: T173400
Change-Id: I48b97e10fc6c6e2ca84563b58dd0bb8f42fa251f
2018-02-22 11:48:37 -06:00
Ed Sanders 05a504887d Drop IE10 support
Change-Id: Ib1cb8fb32c499ba0bdc87ec55e1e2e95d2eb39ec
Depends-On: I68c882e64fba95d5e1bf41f64658fcef7524dcf5
2018-02-22 00:47:38 +00:00
jenkins-bot 8d3e702976 Merge "Disable tempWikitextEditor for section=new on talk pages" 2018-02-21 01:29:58 +00:00
Derk-Jan Hartman 249c52b6a4 Hide historical diff controls when UA doesn't support JS
Bug: T187780
Change-Id: If29974323ef21016edbbb66870914a6dc37e7bbb
2018-02-20 16:54:31 +00:00
jenkins-bot 8f33fc6225 Merge "Add clearfix to diff page's visual diff element" 2018-02-20 16:52:39 +00:00
jenkins-bot d040645244 Merge "Avoid jQuery.parseHTML" 2018-02-20 16:50:06 +00:00
Ed Sanders 7fe496d8ef Avoid hiding generated #toc
Bug: T187636
Change-Id: I713479616feddb01c48c9bb6dda2f9c4aaf182e0
2018-02-20 16:18:27 +00:00
Ed Sanders fcf6ea9e67 Add clearfix to diff page's visual diff element
Bug: T187687
Change-Id: I4de925964fde7b0fffc6540ba821f9a8162cffe7
2018-02-20 15:04:25 +00:00
Ed Sanders ee5b80aeee Avoid jQuery.parseHTML
Bug: T187713
Change-Id: Ic156d6fb670fa2f79cf3c1d5fe0c6272b53b6440
2018-02-19 15:41:20 +00:00
Ed Sanders f2e7361460 Disable tempWikitextEditor for section=new on talk pages
The temp editor doesn't know about the title input
widget yet, so disable for now.

Bug: T185633
Change-Id: I3e44dcc30ee8372080c7cd8c5fc27eb167e24fc6
2018-02-16 18:32:41 +00:00
James D. Forrester dd3dddb98c Follow-up 0a7a845a4: Missed one
Change-Id: I252cb6678df9df503e07b635384a713f052a8abe
2018-02-14 14:25:07 -08:00
Ed Sanders 119e9ef0f6 Remove IE9 workaround
Change-Id: Ifcb1690934ece7d373c764591e00740d6f1238ee
2018-02-13 10:45:16 +00:00
Fomafix 8079d081d0 Remove /* global confirm, alert */
The browser functions alert() and confirm() are not used.

Change-Id: I1b069937fe1548298d55a3e6616e189b72c3e8fa
2018-02-12 10:49:11 +01:00
Ed Sanders cefa0ebf7b Add trailing linebreak to NWE's temporary wikitext editor
Bug: T185632
Change-Id: I8225b08484e535668e8b0bd33eb3b8b09b80ff35
2018-02-02 11:10:18 +00:00
Ed Sanders 9770c80615 Load modules for preview
Bug: T147702
Change-Id: I94f6bdf122d4e2c9fba3103f36c438980ce8228d
2018-01-29 22:35:00 +00:00
jenkins-bot 97fbd5619c Merge "Public API for the tempWikitextEditor" 2018-01-24 00:53:11 +00:00
jenkins-bot a77eea97b3 Merge "Sync tempWikitextEditor just before building target, not on every change" 2018-01-24 00:50:41 +00:00
jenkins-bot 14e557e936 Merge "Use jQuery 3 .catch( fn ) instead of .then( null, fn )" 2018-01-24 00:06:11 +00:00
Ed Sanders 8afe6c5c6d Public API for the tempWikitextEditor
Allows users to know when the widget has been constructed,
and access it (e.g. to set an initial selection)

Bug: T185279
Change-Id: I3678996bcf644cc889dd168ac3ce48b5c3633ec1
2018-01-23 15:30:51 -08:00
Bartosz Dziewoński a0e2afef8e Use jQuery 3 .catch( fn ) instead of .then( null, fn )
Change-Id: I676eec0acf25690c2b2dd0b9a414be5fee887395
2018-01-23 15:25:15 -08:00
Ed Sanders d294006d7b Sync tempWikitextEditor just before building target, not on every change
Also ensure tempWikitextEditor is always torn down, even if
target setup fails.

Change-Id: Idc30a9dc00491b8c85353d73cb9ff70afea1d51c
2018-01-23 15:13:10 -08:00
jenkins-bot f52ee56a02 Merge "Toolbars: Replace $.height with clientHeight/offsetHeight" 2018-01-23 23:01:37 +00:00
Ed Sanders 154f49e964 Toolbars: Replace $.height with clientHeight/offsetHeight
Bug: T185599
Change-Id: I43fbce8f221553e9ae03f8385f39a19de01e8eb7
2018-01-23 12:32:16 -08:00
Ed Sanders 3077bbe51c Remove Firefox support comment
This line isn't solely for supporting FF52, that is the order
in which it is called (move after attach, not before),
but that matches all our other widgets, so not sure
it needs commenting.

Change-Id: I6f3cc5687f1e4b995dff700d0765d14de1927d51
2018-01-22 11:27:46 -08:00
Ed Sanders f2568c8d7d NWE: Don't attempt to set selection on unattached textarea
Prevents an exception being thrown in Firefox <= 52.

Bug: T185304
Change-Id: Ic9a43e3cf12d4cc566cebb328f8e807e464af634
2018-01-22 18:58:26 +00:00
jenkins-bot 140ec5f2ab Merge "NWE: Show temporary wikitext input widget while loading" 2018-01-16 18:13:47 +00:00
Ed Sanders b1ea5d618a Don't pass wikitext to requestPageData if unmodified
Bug: T184875
Change-Id: I41a72a9c7546fafc834bf837e507d9359872ff11
2018-01-14 16:16:47 +00:00
jenkins-bot 2091b8634a Merge "Use section fragment after-save even if the query is empty" 2018-01-10 21:41:59 +00:00
jenkins-bot 2ea64bdd27 Merge "Change save dialog accesskey to be entirely off the trigger" 2018-01-10 21:30:51 +00:00
Ed Sanders 886faf2adc NWE: Show temporary wikitext input widget while loading
Bug: T184614
Change-Id: I2e4964cb6329660957815dcb9a74d2ad24d5256b
2018-01-10 21:34:53 +01:00
David Lynch 64944c119a Use mw.storage instead of localStorage
mw.storage catches errors, so we won't crash horribly when the user has
localStorage disabled / full.

Bug: T181822
Change-Id: I212994eb535b9a8fb5f6c09deaa10b16c3d7f10e
2018-01-10 11:44:24 -06:00
David Lynch a89c79dc79 Change save dialog accesskey to be entirely off the trigger
Accesskeys in this situation are unreliable cross-browser. Firefox won't
trigger the accesskey inside the dialog. We can manually simulate it, via the
existing trigger.

Bug: T121183
Change-Id: Ib919d8b9fcd9324a517037bcc6ef93a26d1488b9
2018-01-08 11:52:06 -06:00
David Lynch 874ba30ce8 Use section fragment after-save even if the query is empty
Bug: T181075
Change-Id: If2d1107982d3f947330c750c635ee221ab71610f
2018-01-05 11:55:38 -06:00
Bartosz Dziewoński 23158de319 Fix context menu for mobile TargetWidgets
Depends on Ica66325a8267d14f25fbc537b956573d1d3cc336 in VE core.

Bug: T157084
Change-Id: I9d9839d7e96eb1ef254e11554acfb955750a2915
2018-01-04 16:53:40 +00:00
jenkins-bot 683ac88fcc Merge "doc: Bump copyright year" 2018-01-03 19:20:07 +00:00