Commit graph

227 commits

Author SHA1 Message Date
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
jenkins-bot 57d57cdbbf Merge "ve.init.mw.DesktopArticleTarget: Remove unused code" 2017-03-28 00:50:50 +00:00
Bartosz Dziewoński 0e1bc7309b ve.init.mw.DesktopArticleTarget: Remove unused code
As it happens, #redirectsub is correctly spelled all lowercase,
unlike #contentSub. This line does nothing. We remove #redirectsub
correctly elsewhere; I don't think this was ever meant to be here.

Follows-up 96421b283c.

Change-Id: I3e4c6eb2ff94f363b488477b3ddd248e571e723a
2017-03-28 00:39:38 +00:00
James D. Forrester 79b7d0305a *ArticleTarget: Don't trust oldid in the query string, it lies
Bug: T156998
Change-Id: Iacb94710c8f2f5fbd8d3de9c8a44424aba0c7d02
2017-03-24 00:30:00 +00:00
Ed Sanders 1adedfbd8b Disable clickable categories bar in wikitext mode
Bug: T160733
Change-Id: I79b7c880e63675a322b2ada053819b36a175ccbe
2017-03-20 11:07:52 +00:00
jenkins-bot 85736d5a7b Merge "Follow-up eb8ba26a: Make MWNoticesTool#setNotices() display its own popup" 2017-03-16 20:14:05 +00:00
Ed Sanders 12c73bc01f Update VE core submodule to master (ef5dc965f)
New changes:
4b94f212e Add tool to change directionality of document view

Bug: T153356
Depends-On: I1e3d89e8250b75d0b6992cf4664e84de66d99bc0
Change-Id: Ic832cc661a0899b1668eb650fb09b66ada54d1ef
2017-03-16 12:42:42 -07:00
James D. Forrester ec5590418e Follow-up eb8ba26a: Make MWNoticesTool#setNotices() display its own popup
Running setNotices( [] ) makes MWNoticesTool run this.destroy() to avoid taking
up extra space in the toolbar when not needed.

Also, make setNotices() bail earlier.

Change-Id: I492fd59a1e15e8f296bf7f03d9b0035c40dafa59
2017-03-16 11:29:34 -07:00
David Lynch eb8ba26adf DesktopArticleTarget: Only try to show notices if some exist
This avoids an OOui deprecation warning for trying to toggle a popup which
isn't connected to anything.

Bug: T160161
Change-Id: I9ad97785f0de4ecf81d189985459689644e25923
2017-03-16 11:35:10 -05:00
David Lynch 4864189781 DesktopArticleTarget: Discard edit summary when canceling an edit
Bug: T160130
Change-Id: I2a631b63c3f90bcd60a81312ee031f90dcbf6586
2017-03-14 10:53:21 -05:00
David Lynch 05e2a3119e ArticleTarget: Improve edit summary behavior when switching
Distinguish between the initial summary state, and a value stored from the
summary when switching modes. This lets us avoid overwriting a stored value
when section-editing, or assuming a stored value after a switch was never
edited.

Bug: T159686
Change-Id: Ie7640538140a14bbafd539b3a45928f5c55cf804
2017-03-09 14:23:36 -06:00
David Lynch d6c71632ef Switching modes created an infinite loop onBeforeUnload
Switching from visual to source reruns setupUnloadHandlers, which caused an
infinite loop where it thought it was its own fallback pre-existing handler.

Bug: T153346
Change-Id: I8df55a5395ede02fc34ec47a94f2c780dc08595f
2017-03-08 11:32:03 -06:00
jenkins-bot 5aba0ee22b Merge "Improve NWE new section styles" 2017-03-03 18:06:04 +00:00
Ed Sanders 06fa5166c7 Improve NWE new section styles
* Use <h2> for TextInputWidget to avoid duplicating skin styles
* Fix placeholder colour and font

Change-Id: I36c0b79ec9cbf3fa2ead0541ef5bac4a14a8781b
2017-03-03 11:59:06 +00:00
David Lynch 6cb6933e67 DesktopArticleTarget: Correctly bind section link handler
Since December, the handler now expects to be passed the mode we're switching
to. Since we're filtering for just the edit link and not edit source, we can
hardcode 'visual' here.

Bug: T159374
Change-Id: I160045dd59ff1b4c2d180dbbe37280a1839886df
2017-03-02 11:43:11 -06:00
Ed Sanders 109a136bd6 Use pencil icon for editor switcher dropdown
Pencil is the icon we use for 'edit' elsewhere in the UI.
Use the eye icon for the VE tool to specify 'visual'.

Bug: T116417
Change-Id: I12b6bab2a52758685abde04579b274a32d651174
2017-02-28 22:59:51 +00:00
Ed Sanders b3989e4f07 Move switching methods to ArticleTarget and fix in mobile
Change-Id: I7796dab5d2a24f9719870abf383925442b787612
2017-02-28 11:47:35 -08:00
Ed Sanders cb60db4c7f Use list tool group for editor switching
Bug: T116417
Change-Id: Iadf5a81e2733ab81fe25c686dcd6dad8eac3885c
2017-02-28 15:06:48 +00:00
Ed Sanders 7a058a4de8 Remove explicit toolbar indicator definitions
These are now computed upstream based on position of toolbar.

The menu tool now needs its indicator explicitly hidden.

Change-Id: Id2280f70553e1e45f3a42af45684c5808797925c
2017-02-04 10:25:37 +00:00
Ed Sanders f58d00b110 Move #getWikitextFragment up to ArticleTarget
Change-Id: Ice4b04db4a45c07ccffc3892e6db5d814c2ec37b
2017-01-20 23:15:17 +00:00
Ed Sanders 889ffc0efc DesktopArticleTarget: Prevent infinite while loop if $content is empty
Change-Id: I629b2c3f1a4af3441764db7d1d0a7cec96181396
2017-01-11 18:29:16 +00:00
jenkins-bot 09829ae7b4 Merge "MWMetaDialog: Move categories to the top as they're used most" 2017-01-07 14:56:56 +00:00
jenkins-bot 4d64196fcb Merge "Fix loadFail parameter handling" 2017-01-04 22:46:27 +00:00
Alex Monk 1bcaa9056c Fix loadFail parameter handling
Rename them while we're at it.

Bug: T151278
Bug: T152429
Change-Id: I435ac148007db87da69e8cf48568fafa646abb71
2017-01-04 22:31:08 +00:00
James D. Forrester 6795430831 MWMetaDialog: Move categories to the top as they're used most
Bug: T74399
Change-Id: I696d8484ed00c92340f178d5c9dcfe978998dce0
2017-01-04 11:18:00 -08:00
Ed Sanders 808de2acea Add "templates used" page to meta dialog
Bug: T149009
Depends-On: Id617f9afbddf094140133f9659efc4b4e746148c
Change-Id: I63e663d05aefb47274f1f28bdcafc5317c2fc4f6
2017-01-04 18:30:11 +01:00
jenkins-bot 1ac5ede187 Merge "Don't try to JSON stringify load error messages that are already strings" 2017-01-03 20:22:50 +00:00
jenkins-bot 945d3d4cbc Merge "After saving a specific section, scroll to it" 2017-01-03 18:49:19 +00:00
Alex Monk 5c2773539e After saving a specific section, scroll to it
Bug: T153297
Change-Id: I233e5226abc44d5d0bf8e56957a133d595e7be6f
2017-01-03 18:38:55 +00:00
jenkins-bot f89a6a3880 Merge "build: Bump file copyright notices for 2017" 2017-01-03 17:11:04 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders 9eebfbcac5 Fix NWE-only edit tab
Change-Id: I5d08e30f43fbe08eb8809692728a8ab37f3a1491
2016-12-30 16:42:54 +00:00
Ed Sanders 7de023caee Allow switching between 'edit source' and 'add topic'
Also between section editing and full page editing
by clicking on 'edit source'.

Change-Id: I9165a7ad4ac2a588a09532c7181ba72b6fd2f811
2016-12-29 15:48:38 +00:00
jenkins-bot d5f66e4fe9 Merge "Preserve checkbox data when switching from VE to NWE" 2016-12-22 12:37:37 +00:00
Ed Sanders aee5e665f1 Preserve checkbox data when switching from VE to NWE
Bug: T153889
Change-Id: Ifc41ea9320c9f2627efff6f33d4ad87c59fad496
2016-12-21 22:35:52 +00:00
Alex Monk 101b0ff45c Don't try to JSON stringify load error messages that are already strings
Change-Id: Ib180c3ac7eb62d351e05153defd6330c3397c478
2016-12-21 04:00:05 +01:00
Bartosz Dziewoński 72569159b8 Add comments in some places where we really want to treat messages as HTML
Change-Id: I439338dabd4b031ed1c4cfc9d89af5a6f2971676
2016-12-20 10:50:15 +00:00
jenkins-bot ee2cb3048d Merge "DesktopArticleTarget: Generate the original page title if needed" 2016-12-15 16:50:47 +00:00
Ed Sanders 17a164363b Properly clear this.section when switching from VE
Bug: T153276
Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
2016-12-15 01:34:30 +00:00
David Lynch b1aed096cb DesktopArticleTarget: Generate the original page title if needed
When switching from the old wikitext editor to VE, we stored "editing..." as
the original page title. Then restored that when saving / switching to "read".
Instead, detect if we're on top of the classic editor, and use the pagename
message to make a plausibly-correct title.

Bug: T126077
Change-Id: Ib0289de71c3ae947ca0a3e45fe1e620378689c35
2016-12-13 19:28:15 -06:00