Commit graph

266 commits

Author SHA1 Message Date
Ed Sanders 307e6c2922 Move some deactivation code from DesktopArticle to ArticleTarget
Also rename tryDeactive to tryTeardown.

Change-Id: Ie89d59a62826bcfe3d30ad04f89d3c4211cc34f4
2018-03-26 15:32:55 +01:00
jenkins-bot ff21c17c37 Merge "Remove unnecessary attachToolbarSaveButton override" 2018-03-20 17:25:11 +00:00
jenkins-bot 3c861d7ed1 Merge "Clear auto-save when switching to fallback wikitext editor" 2018-03-14 17:55:44 +00:00
Ed Sanders e78379a395 Attach deactivate code to namespace tab ('Main'/'Article')
Bug: T189380
Change-Id: I9f05722b9a1c740f9f982d9c5690d48046f19fdd
2018-03-10 19:07:11 +00:00
Ed Sanders ec6d9b235a Clear auto-save when switching to fallback wikitext editor
Bug: T189381
Change-Id: Id89fa2a673ad8aef3826c0ef862770bf522bbdcf
2018-03-10 18:04:44 +00:00
Ed Sanders 8b208c80d5 Remove unnecessary attachToolbarSaveButton override
It's identical to the code inherited form ArticleTarget.

Change-Id: I7fe7a48b0614f2ac2665ece042bb95a6f77303ad
2018-03-10 16:20:30 +00:00
Ed Sanders 05a504887d Drop IE10 support
Change-Id: Ib1cb8fb32c499ba0bdc87ec55e1e2e95d2eb39ec
Depends-On: I68c882e64fba95d5e1bf41f64658fcef7524dcf5
2018-02-22 00:47:38 +00:00
Ed Sanders ee5b80aeee Avoid jQuery.parseHTML
Bug: T187713
Change-Id: Ic156d6fb670fa2f79cf3c1d5fe0c6272b53b6440
2018-02-19 15:41:20 +00: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
jenkins-bot a77eea97b3 Merge "Sync tempWikitextEditor just before building target, not on every change" 2018-01-24 00:50:41 +00: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
Ed Sanders 154f49e964 Toolbars: Replace $.height with clientHeight/offsetHeight
Bug: T185599
Change-Id: I43fbce8f221553e9ae03f8385f39a19de01e8eb7
2018-01-23 12:32:16 -08:00
jenkins-bot 140ec5f2ab Merge "NWE: Show temporary wikitext input widget while loading" 2018-01-16 18:13: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
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 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
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
David Lynch 6f2c829bd9 Add section id to URI fragment on save
Bug: T181075
Change-Id: Iea63112301bfa0860c3d68efc35648a5af7e4ae6
2017-12-15 00:03:52 +00:00
Ed Sanders 8f612fbe64 Pass editor mode (visual/source) to tracking code
Change-Id: Iba5d3c66ecbd2872d76ea12f795ef3bebaae9d81
2017-12-07 11:14:00 +00:00
David Lynch 396ce6eb6b DesktopArticleTarget: enable spellcheck on sectionTitle
Tell browsers we explicitly want spellchecking on the section title. If
unspecified this is browser-dependent, so it was inconsistent.

This won't actually have an effect until the next OOjs-UI release (v0.24.3),
as this was a new feature added to TextInputWidget.

Bug: T179654
Depends-On: Ifdd44ead7d782288aaef0979322f0943f7304835
Change-Id: I588874efcff91c5be03da2fc03c268f883b718e2
2017-11-29 00:06:20 +00:00
Ed Sanders 6761a3619a Use more common 250ms transition for toolbar instead of 400ms
Change-Id: I8ad1a20753b7bd4a17db605d31502e57149b5348
2017-10-18 19:17:05 +01:00
David Lynch 80c813e08c init.mw.DesktopArticleTarget: properly set up section links
We were reimplementing (incompletely) the setup from the .init version. Just
call the original, modified slightly so it doesn't over-setup on repeated
calls.

Bug: T151021
Change-Id: I65bd7c5ecf75c478d6babeb13e7fb2a76a9842c8
2017-10-17 10:14:50 -05:00
Ed Sanders 169ce28c44 Remove duplication from browser whitelist
The whitelist isn't checked for blacklisted browsers,
so if all non-blacklisted browsers are whitelisted,
set the whitelist definition to all (null).

Change-Id: I8ee3569d9d5be2eda9153f1b087c1be385f93d9c
2017-10-12 16:54:46 +01:00
James D. Forrester bd2deb3ac4 DesktopArticleTarget.init: Load 'mediawiki.action.view.postEdit' via loader
Bug: T164148
Change-Id: I537144bfd52ff84499f5d086f5d05efe2ba0493b
2017-10-05 15:54:20 -07:00
Ed Sanders 43763f0a75 Target teardown refactor
* Rename 'deactivate' to 'tryDeactivate' as it may prompts
  the user to deactivate.
* Merge 'cancel' and 'teardownSurface' in to 'teardown',
  extending the parent method.
* Rename elementsThatHadOurAccessKey to $saveAccessKeyElements
  and move teardown to parent class where it is setup.
* Move toolbarSaveButton teardown to parent class where it is setup.
* Cleanup changeDocumentTitle

Depends-On: I9d97614695272dca6936ef6f3461178fcf0368a8
Change-Id: Ie998a04c21f6615b4415edf471310db5edca3b5a
2017-10-05 10:26:46 -07:00
Ed Sanders 1256b19d72 Use destroy event to teardown new section inputs
Change-Id: I4990a162b62b7195016efba47cc5926b9e3a0f21
2017-10-05 16:20:48 +01:00
Ed Sanders e0f7f30bbd Use parent #clearSurfaces method to clear surfaces
Move mwTocWidget teardown to a destroy event listener.

Change-Id: If96be96aa67da55d3b17dd2565f5e954786ff3ff
2017-10-05 16:03:55 +01:00
Ed Sanders 90a9fdb6aa Ensure mw-notification-area doesn't get disabled
Bug: T176874
Change-Id: I43af13a0fcb5c19fdea53cfaeb941ac100579945
2017-09-27 14:50:59 +01:00
Ed Sanders 1b8f8d8908 Replace wg(Relevant)PageName with target#pageName
The default value of target#pageName is wgRelevantPageName
but other targets my override this, or change it dynamically
(e.g. ContentTranslation).

Also remove duplicate setter of pageName in mw.ArticleTarget,
already set in mw.Target.

Change-Id: Iebd1def1d4142978a673afec584a0b663644d176
2017-09-26 13:22:00 +01:00
David Lynch c440a3576f DesktopArticleTarget: Support preloadtitle in source mode
Can't support it in visual mode, since there's no new-section handling at all.

Bug: T51622
Change-Id: I763d5fff156e9ef3893bd882fab1dc2d47121728
2017-09-18 10:18:37 -05:00
Ed Sanders d515d418c1 Use lowerCamelCase for javascript var oldId
Change-Id: Idd04578a0035320f85dc911a2f4ddbc6f378887f
2017-09-13 12:57:37 +01:00
Ed Sanders ebce67b6ab Remove pageName/revision from ArticleTarget constructor
Other page state is read directly, rather than passed in.
If we come up with a use case for passing this in at a later
date we can reconsider the best way to do this.

Change-Id: Iee7e608c969776b89dbb38b3b56a5177e48344af
2017-09-13 12:57:37 +01:00
David Lynch 5f6e186ed4 ArticleTarget: set local config to hide welcome dialog
This stops the welcome dialog from being displayed repeatedly if the user
edits the article multiple times in the same pageload.

Bug: T170983
Change-Id: I8cc5990e9acb1ac09a2d6dd95eef8042c70088c7
2017-07-19 14:29:49 -05:00
Ed Sanders af25311201 DesktopArticleTarget: Regenerate title in all non-view page scenarios
Bug: T168236
Change-Id: I15f2aeb42b98855512970e2f07396fd7a7c97354
2017-07-01 17:27:07 +00:00
Ed Sanders fd1adfb3b5 Keep TOC in correct place in document
Change-Id: I6ad8cd8cbd7ef902204408673eb096b7405abd24
2017-06-22 15:16:15 -07:00
Bartosz Dziewoński 4f55d8066e Update for deprecation of OOjs UI openWindow/closeWindow promise
Bug: T166729
Change-Id: I95b85a8c0d488993c11da74e1d856fef6cf0ebb4
2017-06-02 00:21:58 +02:00
Timo Tijhof a9ce695f75 mw.DesktopArticleTarget: Use require() for mw.page.watch
Add 'require' to eslint global whitelist for this extension,
since ResourceLoader provides this in all contexts now.

Bug: T166254
Depends-On: I0e6a95bd4fbaba06eae5137ac7af84f62bebf6f0
Change-Id: I6b2fe57317dcff18ec6d9ea0cd9e4eb9c894c169
2017-05-24 21:17:02 +00:00
David Lynch e1e89e8b14 DesktopArticleTarget: only destroy notices tool if it exists
Bug: T163813
Change-Id: Ib957eac2d3d407f8e683082938ec51d882c2d041
2017-04-26 18:03:39 +00:00
Ed Sanders c02c529537 Load notices when switching, just don't show them
Previously we completely disabled the loading of notices
when switching, instead of just not showing them (so they
don't clash with the "switched" popup).

Bug: T162812
Change-Id: I3f8e787630e196cee1dbb1aa449b3558b74fcd04
2017-04-20 21:20:10 +01:00
Esanders eeab63d2c7 Revert "Dropping IE9: Remove disableUneditableContent from DesktopArticleTarget"
IE10 also lacks pointer events support.

This reverts commit 5266776953.

Change-Id: I42c9530c45ad98657b403bdb266188368085716b
2017-04-14 13:53:56 +00:00
Ed Sanders 5266776953 Dropping IE9: Remove disableUneditableContent from DesktopArticleTarget
Bug: T162277
Change-Id: Ibb38284573078098c2173232239e9836a8161f56
2017-04-10 08:37:03 -07:00
jenkins-bot 11f562c4e2 Merge "Don't use '#content #firstHeading', unnecessarily specific" 2017-03-29 18:02:22 +00:00
Bartosz Dziewoński 645eb8e543 Don't use '#content #firstHeading', unnecessarily specific
Simply '#firstHeading' does fine.

Change-Id: I7c72496f0d58b86582bd33c018b618e1b75f2c7a
2017-03-29 17:37:29 +00:00
Bartosz Dziewoński 38db8bbe0e Consistently use #catlinks to refer to category links container
The element has both the class and the id set to 'catlinks'. This is
just for consistency, I have no preference on which to use.

Change-Id: Ic96b0f21fe790d0aa03bfd6366ba246e8493a038
2017-03-29 17:36:58 +00:00
jenkins-bot d3df69ee99 Merge "ve.init.mw.DesktopArticleTarget: Refactor redirect interface handling" 2017-03-28 16:41:40 +00:00
jenkins-bot 0dfe429a1e Merge "ve.init.mw.DesktopArticleTarget: Hide redirect subtitle if we cancel editing" 2017-03-28 15:43:09 +00:00
Bartosz Dziewoński 0462b6ed8f ve.init.mw.DesktopArticleTarget: Refactor redirect interface handling
Redirect pages have two extra things not present on normal pages:
* Redirect subtitle: the "Redirect page" shown under the page heading.
* Redirect page content header: the "↳ Foo" at the beginning of content.

Our handling was pretty messy and had some bugs (T161614).

Notable behavior changes:
* Update 'wgIsRedirect' in mw.config after saving the page.
* Use #mw-content-text rather than .mw-jump for inserting the fake .redirectMsg.
  .mw-jump is not guaranteed to exist on the page (it's a skin feature).
* Never replace the real .redirectMsg existing on the page, except by the
  new HTML after a page is saved. Our fake is separate now.

Bug: T161614
Change-Id: I96a5e45a71bf10bf6a2b501dc0cf81e6c37060ec
2017-03-28 17:40:23 +02:00
Bartosz Dziewoński d905d705ce ve.init.mw.DesktopArticleTarget: Hide redirect subtitle if we cancel editing
To reproduce: start editing a page, turn it into a redirect,
cancel editing and go back to view mode. The "Redirect page"
subtitle under the page title should disappear.

Note that #redirectsub is correctly spelled all lowercase,
unlike #contentSub.

This reverts commit 0e1bc7309b
and fixes the code instead.

Change-Id: Ibacd73122dfec63268a77794bc77c4b88876d3ee
2017-03-28 01:31:29 +00:00