Commit graph

14002 commits

Author SHA1 Message Date
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 366219e953 Always set sourceMode=true on dm.MWWikitextSurface
Change-Id: Id46d5ef9c8a585784b8fbd55418d012fff96823f
2018-02-27 12:19:06 +00:00
Ed Sanders e12cfc35a3 Update VE core submodule to master (e6b9330)
New changes:
a57bb5b Do less work when building the diff document
0f6a33a Remove IE<=10 fakePaste support
a89c817 Localisation updates from https://translatewiki.net.
39f140b Auto-save: docstate -> dochtml
0df1428 Implement an append-only list data structure in sessionStorage
b7814fc Remove methods for creating obsolete metadata ops
2e68048 Implement auto-save using transactions
9e20e44 Drop IE10: Remove ve.ce.Surface.prototype.supportsPointerEvents
757c96e SessionStorage: Return booleans for setters
d0fd0c9 Make get/removeSession exception safe
fdf8bbf ve.dm.Change: Allow unsafe deserialization
d24ad15 Transactions: Only set insertedDataOffset/Length when meaningful
4b6c0fb ve.dm.IndexValueStore: Serialize empty stores to null
13a3d05 Filter out meaningless properties when comparing elements
e4f7a88 Stop diffing originalHTML for internal items
575f219 Use #cloneWithData in #getInternalListChangedNodeElements
c8cf2ea Set the initial store length to the initial store length
d88669a Emit undoStackChange when the undo stack changes
d985bc6 Autosave: Store and apply transactions by breakpoint

Bug: T187070
Bug: T187613
Bug: T188020
Depends-On: I215c1b060d0758e669b62ba27db96ece56bff2f0
Change-Id: I6a8a6bca041131e175ff4be56f371fd3e7e5171b
2018-02-25 21:00:32 +00:00
libraryupgrader a503c7004a build: Updating mediawiki/mediawiki-codesniffer to 16.0.1
Change-Id: Ifc670629f1dfe9c9ac3880118d4b73ead77393b5
2018-02-25 05:34:34 +00:00
jenkins-bot 72756d5a26 Merge "MWImageNode: getHashObject -> getHashObjectForRendering" 2018-02-24 13:42:15 +00:00
Ed Sanders d17121d1f3 MWImageNode: getHashObject -> getHashObjectForRendering
The latter was introduced for this very purpose: defining
which attributes affect the rendering (in this case the
thumbnail URL). getHashObject should be reserved for making
full semantic comparisons.

Bonus: Don't distinguish between block/inline images
for URL caching purposes.

Change-Id: I6e6d2547a0d110f07c4d18b8179c168d8c251059
2018-02-24 12:44:53 +00:00
Translation updater bot 522dff63c6 Localisation updates from https://translatewiki.net.
Change-Id: I01a77b2a41193eeaa82eae5db5b09d7864db5686
2018-02-23 23:01:57 +01:00
Translation updater bot 22af5d6c17 Localisation updates from https://translatewiki.net.
Change-Id: Ifc9eda6c7b692d56671ef1f46a3741ab350830e7
2018-02-22 23:22:41 +01:00
David Lynch abe3d0a4a5 DiffPage.init: Enforce a valid diff mode
Bug: T173400
Change-Id: I48b97e10fc6c6e2ca84563b58dd0bb8f42fa251f
2018-02-22 11:48:37 -06:00
jenkins-bot 3d93d195c7 Merge "Drop IE10 support" 2018-02-22 00:55:50 +00:00
Ed Sanders 05a504887d Drop IE10 support
Change-Id: Ib1cb8fb32c499ba0bdc87ec55e1e2e95d2eb39ec
Depends-On: I68c882e64fba95d5e1bf41f64658fcef7524dcf5
2018-02-22 00:47:38 +00:00
Jforrester 2e87e03a29 Merge "ve.ce.MWGalleryNode: Ensure we always have a focusable element" 2018-02-22 00:33:23 +00:00
jenkins-bot 35efed480b Merge "Update VE core submodule to master (1a0bc9981)" 2018-02-22 00:31:32 +00:00
jenkins-bot c5cc11079b Merge "ve.ui.MWGalleryDialog: Handle galleries with 0 items" 2018-02-22 00:31:30 +00:00
James D. Forrester f1f9a5f848 Update VE core submodule to master (1a0bc9981)
New changes:
7a0e5e2cc Drop IE10 support
b8bbcb015 Use sessionStorage to auto-save
785698dd4 Increase selector specificity for .ve-ce-focusableNode-invisibleIcon

Bug: T57370
Change-Id: Id21e93b7635864ad82e2f0a3f6aa702a103d66c0
2018-02-21 14:15:08 -08:00
Bartosz Dziewoński 180eb91f3f Increase selector specificity for .ve-ce-focusableNode-invisibleIcon
Otherwise our width/height rules are overridden by OOUI styles.

Change-Id: I2bbf81231615e6fcfd95573f5f590b5101e66bdf
2018-02-21 22:30:45 +01:00
Bartosz Dziewoński a5e2f60d7e ve.ce.MWGalleryNode: Ensure we always have a focusable element
For galleries with 0 items, this would previously return an empty
jQuery collection, which caused funny rendering issues later.

Bug: T75230
Change-Id: Ia68e4f1b74b5ec494fa3d86f0b792f69eadb02fb
2018-02-21 22:22:49 +01:00
Bartosz Dziewoński 3d422bac2a ve.ui.MWGalleryDialog: Handle galleries with 0 items
We still don't allow inserting such galleries, but we can handle them
in existing content.

Bug: T75230
Change-Id: I5d7350f00871ac295b0ebc00a633b44570347d85
2018-02-21 22:11:41 +01:00
jenkins-bot dd94837192 Merge "MWTemplateTitleInputWidget: recover gracefully if TemplateData not present" 2018-02-21 18:14:12 +00:00
David Lynch bd64b58071 MWTemplateTitleInputWidget: recover gracefully if TemplateData not present
Bug: T187917
Change-Id: Ica0c853e1a7bc908651260df115d59d1939a7939
2018-02-21 11:53:56 -06:00
James D. Forrester 59453e3824 Update VE core submodule to master (aa4aa2842)
New changes:
e4d59929c Rebaser: Generate random doc name if none provided
82093a6c2 Show reference moves in visual diff
ebe736495 Use offsetWidth/Height instead of jQuery.width()/height()
87158b496 Pass correct arguments to Node.insertBefore

Bug: T171587
Bug: T187864
Change-Id: I22f2529cd6e5826323e9ad1cafe13c64fe2029fc
2018-02-21 09:16:51 -08:00
jenkins-bot 5de7185687 Merge "Rebaser: Generate random doc name if none provided" 2018-02-21 16:37:36 +00:00
jenkins-bot 8d3e702976 Merge "Disable tempWikitextEditor for section=new on talk pages" 2018-02-21 01:29:58 +00:00
Translation updater bot f2e78128c0 Localisation updates from https://translatewiki.net.
Change-Id: I442f97f06bab9a509600b6fb12a7b6923803a44d
2018-02-20 22:29:14 +01:00
James D. Forrester 53c089973b Update VE core submodule to master (8c5b27028)
New changes:
7ddd588f5 SurfaceSynchronizer: Use palette for author colour
f7f904bfd Localisation updates from https://translatewiki.net.
cb9ff9657 Avoid jQuery.parseHTML
608d9e54a build: Lint JS inside HTML files
52a81146f Account for visually diffed element having to clientRect

Bug: T187713
Bug: T187726
Change-Id: Ie83ac5dbb156b16a6d42e44678b819e4fd14b577
2018-02-20 09:11:16 -08: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
Translation updater bot 5563816992 Localisation updates from https://translatewiki.net.
Change-Id: Ia5bcc5f6e3fbd86d79e8e59926b0191fb71c0e3b
2018-02-19 22:26:08 +01:00
Ed Sanders ee5b80aeee Avoid jQuery.parseHTML
Bug: T187713
Change-Id: Ic156d6fb670fa2f79cf3c1d5fe0c6272b53b6440
2018-02-19 15:41:20 +00:00
Translation updater bot 2c606b2918 Localisation updates from https://translatewiki.net.
Change-Id: Ib9d4a1c8ebcf64a0abc129c0e10cf99d2442ac11
2018-02-18 22:41:16 +01:00
libraryupgrader 8e3ce5a6b5 build: Updating mediawiki/minus-x to 0.3.1
Change-Id: Ib4c0df799ab4c61e66d6512ef6a658977a254916
2018-02-18 11:30:36 +00:00
Translation updater bot aa090f29e3 Localisation updates from https://translatewiki.net.
Change-Id: I3cfd52cba44047aac0fd1baa965b0d3389d53ce5
2018-02-16 22:29:36 +01: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
Ed Sanders 1bef5a03ce Rebaser: Generate random doc name if none provided
Change-Id: Ib790fa5d61df7f2318cd014d5ffa60a3ab3861d3
2018-02-16 18:09:19 +00:00
jenkins-bot d21626e7bf Merge "MWSaveDialog: Another check to see if visual diff is still visible" 2018-02-16 17:15:28 +00:00
Ed Sanders 33858c6818 MWSaveDialog: Another check to see if visual diff is still visible
Bug: T187282
Change-Id: Ia29a335bf6b1bad0eeb55b54094475c7fcc18dfe
2018-02-16 15:21:12 +00:00
Translation updater bot e34c085758 Localisation updates from https://translatewiki.net.
Change-Id: Ia7cb5ce5637cbe40df90e0d0b7c0a22c67687ed9
2018-02-15 22:47:25 +01:00
James D. Forrester 037f666985 Update VE core submodule to master (31c54c36b)
New changes:
2dafbbc21 Update UnicodeJS to v0.2.1
9955059a5 Use OO.deleteProp for its intended purpose
fd41859e3 Follow-up 21a5d55b85: It's still 2018
9cbe6ea43 build: Bump devDependencies to latest
3bf97e171 Localisation updates from https://translatewiki.net.
9f5fc6a9d tests: Only call deleteProp on element objects

Change-Id: Id710f96ec5f5828c0a095cdce271b04fd307faca
2018-02-15 09:26:22 -08:00
libraryupgrader f65cb469ca build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: I0fd950b5a64b6e4f928027e36f26eca552b93213
2018-02-15 06:41:37 +00:00
James D. Forrester dd3dddb98c Follow-up 0a7a845a4: Missed one
Change-Id: I252cb6678df9df503e07b635384a713f052a8abe
2018-02-14 14:25:07 -08:00
Translation updater bot 7391fa64c6 Localisation updates from https://translatewiki.net.
Change-Id: I6f4279284d90de49a7142e992f088bf28fa20523
2018-02-14 22:30:48 +01:00
Translation updater bot 833bbe318c Localisation updates from https://translatewiki.net.
Change-Id: I8c81d65acc27d8936b8381fddf985025336ae2f0
2018-02-13 22:25:55 +01:00
James D. Forrester 9c02554903 Update VE core submodule to master (0cc5806c7)
New changes:
b2ee8a5ca Move DiffElement test runner to utils

Change-Id: Ic70bd3e8ba090c2d174164fd1ecebdf6f2225254
2018-02-13 11:21:29 -08:00
jenkins-bot 0c05b46bff Merge "Remove IE9 workaround" 2018-02-13 17:37:29 +00:00
Ed Sanders e0b7fbe6f8 NWE preview: Avoid skin style clash
Bug: T187075
Change-Id: I6ac6eebca3bd89ce19fb64f6e95809c4d595bc8b
2018-02-13 16:22:56 +00:00
Ed Sanders 119e9ef0f6 Remove IE9 workaround
Change-Id: Ifcb1690934ece7d373c764591e00740d6f1238ee
2018-02-13 10:45:16 +00:00
Ed Sanders ec8208d125 Follow-up Idbcb76f: Only apply /includes folder fix to local path
Also use dirname(__DIR__) instead of appending ../

Change-Id: Ie88fb03617b25a675e1f4af97f8cb7c29c2fb8b3
2018-02-12 21:59:22 +00:00