Commit graph

1559 commits

Author SHA1 Message Date
jenkins-bot f9af257b7e Merge "ve.init.mw.DesktopTarget: Use mw-body-content instead of mw-body to match Vector changes" 2017-03-07 18:32:22 +00:00
Ed Sanders 387f9a5514 ve.init.mw.DesktopTarget: Use mw-body-content instead of mw-body to match Vector changes
This ensures the styles are still applied to surfaces in dialogs.

Change-Id: I30e0cc7dc87dc8c8b6b3be84f821aa22baab457f
2017-03-07 18:17:35 +00:00
Ed Sanders aa8f477dab Apex: Fix target margins
Apex is basically abandonware, so we should consider deleting
this code.

Change-Id: Ie0c21fc21d4c37ab0344978bbd0d071415866397
2017-03-05 18:07:04 +00:00
jenkins-bot 5aba0ee22b Merge "Improve NWE new section styles" 2017-03-03 18:06:04 +00:00
jenkins-bot 8d29d962c5 Merge "Cleanup DesktopTarget styles" 2017-03-03 17:54:43 +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
James D. Forrester e0814210e9 ArticleTarget#getWikitextFragment: Optimise no-op
Change-Id: I6b54ae26e26c5ca697848d2534c128fc9c4bc4aa
2017-03-01 19:17:26 -08:00
Ed Sanders 3c0ddc9c69 Cleanup DesktopTarget styles
* Ensure DAT styles are fully scoped to DAT instances
* Ensure that generic desktop target rules are in the correct file
* Remove old unused rules

Change-Id: I466a0547ff9a0fa1102aac0b1e501a6ba6863ca3
2017-03-01 12:38:51 +00:00
Ed Sanders e163a09105 Use more specific event name for switching editor from the toolbar
As we are in the global toolbar event namespace, 'switch' could
mean anything.

Change-Id: I66751faa249710af634ed0fd0c2f2a0bcd872db3
2017-02-28 23:07:54 +00: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 b3cfca5401 MobileArticleTarget: Don't explicitly set menu indicator
It is now inferred from toolbar position.

Change-Id: I9e3ac28aee74599b4b35ac2f870dca2556efb027
2017-02-28 10:37:30 -08:00
jenkins-bot 2e2a5e452c Merge "Use list tool group for editor switching" 2017-02-28 18:33:44 +00:00
Ed Sanders 5ca02bae09 Use ems for mobile surface font sizes, and add top/bottom spacing
Change-Id: Ida827b54a49c427f2fad2de1f634d8c4e4d28154
2017-02-28 15:07:39 +00: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 a3433e67fd Move modules loaded from DAT.init/TargetLoader to ResourceLoader
This will make it easier for third parties to load the required
modules for an article-like target.

Also cleanup mobileArticleTarget to better match desktopArticleTarget.

Change-Id: Idb75e2bd99d8cf2c298e101cf92e8af4f85f5ad5
2017-02-27 16:48:56 +00:00
David Lynch b1d68872b0 DesktopArticleTarget.init: Don't hardcode single-tab accesskey
Bug: T156141
Change-Id: I1312283437714bf338a8ee3cf63e93ac67db1c45
2017-02-14 11:24:50 -06:00
Ed Sanders 6bd650d50a Check for 'veaction' when clicking section edit links
Such as in the 'add topic' link.

Bug: T157104
Change-Id: Ide2d4cf8c23a5d0db24456d15b4312f7c0a5f922
2017-02-08 17:48:04 +00:00
David Lynch 8a7d44224c ArticleTarget: try to refresh editToken if getWikitextFragment fails
Refactor saveFail's badtoken handling out so it can be reused by
getWikitextFragment.

Bug: T156991
Change-Id: I686cddb5be4484211fa69640044db1bc34eacefc
2017-02-07 11:20:59 -06: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
Bartosz Dziewoński 6f367ea0ec ve.init.mw.ArticleTarget: Don't try to clear non-existent message
This is just dead code. We never call `.showMessage( 'captcha', ... )`
(the CAPTCHA is shown in the 'api-save-error' message).

Change-Id: I48f51e89d5b366384d184e2ed505be9e7b8f3401
2017-01-31 14:40:32 +01:00
WMDE-Fisch a0af0b0529 Disable VisualEditor in the TwoColConflict extension
As for the Translate extension this will read a global set by the
TwoColConflict extension to disable the VisualEditor and its hooks
on the modified edit conflict page there.

Bug: T156251
Change-Id: I164d1546c9d98d8715650e13c63a01d06c76315d
2017-01-30 14:06:59 +01:00
Ed Sanders 1df022a6d6 Ignore section edit links when no action present
BUg: T156282
Change-Id: If3d039da36db946dcbba123d3cdc4e99c45f6a4e
2017-01-25 18:13:56 +00:00
Ed Sanders 171286c120 Fix typo in target config
Change-Id: I5815ce5b0e05ce166e02bfcced520e3770f5453d
2017-01-20 23:15:23 +00:00
Ed Sanders f58d00b110 Move #getWikitextFragment up to ArticleTarget
Change-Id: Ice4b04db4a45c07ccffc3892e6db5d814c2ec37b
2017-01-20 23:15:17 +00:00
Ed Sanders 1ae5c13cb9 Update VE core submodule to master (f0dcedb)
New changes:
5b448fa [BREAKING CHANGE] Merge Mobile/DesktopSurface into Surface
2d8959b Localisation updates from https://translatewiki.net.
7eee772 Follow-up 2d8959b: Fix build for added language 'io'
f0dcedb ve.dm.TableMatrix: Really indent ASCII-art comments

Change-Id: I62708f7caeb03b16cd318aab0b0ee3c674e75a26
2017-01-20 14:35:39 -08:00
Ed Sanders 337614d142 Open preview links in new tab
Bug: T155159
Change-Id: Idddc6b25303c17382ba1bc763b9001b727e1040e
2017-01-12 16:07:00 -08:00
jenkins-bot 7c49a23a33 Merge "ArticleTarget: Give users a specific message when HookAborted errors happen" 2017-01-11 22:21:13 +00:00
jenkins-bot 18ba046361 Merge "ArticleTarget#saveErrorUnknown: Handle the xhr being complete" 2017-01-11 20:37:08 +00:00
James D. Forrester 002b0adef0 ArticleTarget: Give users a specific message when HookAborted errors happen
Change-Id: I7017412dc56200f5bb0adbd901aed15507447846
2017-01-11 10:46:30 -08:00
James D. Forrester 2b502572ec ArticleTarget#saveErrorUnknown: Handle the xhr being complete
Change-Id: I638b5b80c5a404a438ebd357b6e16bbab7871d6e
2017-01-11 10:45:43 -08: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
jenkins-bot e91f8f913e Merge "Allow 'T-' prefixed sections, and redirect if section link title isn't current page" 2017-01-04 22:38:34 +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
Ed Sanders b7dd6077b8 Allow 'T-' prefixed sections, and redirect if section link title isn't current page
Bug: T153176
Change-Id: Ic6fda78d00715777df4a273e7d3e150f20185185
2017-01-04 16:53:03 +00: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 4abdf21413 Merge "Also allow opening in source mode if VE is unavailable on action=edit" 2017-01-03 20:19:09 +00:00
jenkins-bot 2b913fb10c Merge "Add editintro to notices" 2017-01-03 20:19:06 +00:00
jenkins-bot a973528d67 Merge "Don't block VE/NWE from loading if 'editintro' is specified" 2017-01-03 20:13:29 +00:00
jenkins-bot f182d5d223 Merge "When switching check wikitext is a non string, not just empty" 2017-01-03 18:57:48 +00:00
jenkins-bot 78a38ae6ea Merge "Register shortcuts for minoredit/watchlist" 2017-01-03 18:54:26 +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 f439843964 Merge "Factor out preferred editor check" 2017-01-03 17:50:42 +00:00
jenkins-bot f89a6a3880 Merge "build: Bump file copyright notices for 2017" 2017-01-03 17:11:04 +00:00
jenkins-bot 24d26f5e19 Merge "Move translate extension hack up to 'isAvailable'" 2017-01-03 17:04:11 +00:00
jenkins-bot 7c790f8d12 Merge "Use preferred number casting method" 2017-01-03 17:04:10 +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 4628e9e68c When switching check wikitext is a non string, not just empty
Also add documentation.

Bug: T154437
Change-Id: Icacc0ad522d3e7fa28ecea9876c2c0465c4eb8e6
2017-01-02 18:40:07 +00:00
Ed Sanders 58071f59f1 Add editintro to notices
Bug: T56029
Bug: T51622
Change-Id: Ib43cc66b817ff394b4f1c82fcba4503df825819c
2016-12-31 23:23:17 +00:00
Ed Sanders fe85ee1ba6 Don't block VE/NWE from loading if 'editintro' is specified
Later we should actually show the edit intro, but that is a
separate issue (T56029).

Bug: T153481
Change-Id: I97622a3d86b975866305aaa745bac51f6b55f217
2016-12-31 15:22:11 +00:00
Ed Sanders 9eebfbcac5 Fix NWE-only edit tab
Change-Id: I5d08e30f43fbe08eb8809692728a8ab37f3a1491
2016-12-30 16:42:54 +00:00
Ed Sanders 3f47aec20b Use preferred number casting method
Change-Id: I77215f2bdb6eb055375e5b803d23b6f26df2d8d1
2016-12-29 20:33:15 +00:00
Alex Monk 4af862e6d3 Also allow opening in source mode if VE is unavailable on action=edit
Bug: T153508
Change-Id: I5678d3b417c93707edc90bbb76ce4dafcd2098c6
2016-12-29 20:32:58 +00:00
Ed Sanders c963b73e71 Factor out preferred editor check
Change-Id: Ic2e2e2e1d24dba8854315dff068ea9ce5d409c5a
2016-12-29 20:17:55 +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
Bartosz Dziewoński 90ff82a035 Use mw.Message#parseDom where appropriate
Avoid turning DOM into HTML markup and parsing it back into DOM.

Change-Id: I34f56ee60b836a7e0556130a153fc95adb4f3467
2016-12-27 23:54:12 +00:00
Ed Sanders 827d4185c4 Move translate extension hack up to 'isAvailable'
All modes of VE should be disabled on these pages.

Bug: T153445
Change-Id: I5adfae940ee35c5ee6712e620a0ddda967a542ad
2016-12-27 13:56:10 +00:00
Ed Sanders 7611ee5a2c Register shortcuts for minoredit/watchlist
Bug: T153925
Change-Id: I3f569a75a66e816d0a5c4ad966344100510a4f2b
2016-12-23 13:36:48 +00:00
jenkins-bot d5f66e4fe9 Merge "Preserve checkbox data when switching from VE to NWE" 2016-12-22 12:37:37 +00:00
jenkins-bot 50da8d8ab9 Merge "Add comments in some places where we really want to treat messages as HTML" 2016-12-22 00:32:23 +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
jenkins-bot 8497b06287 Merge "ve.init.MWWelcomeDialog: Don't treat text messages as HTML" 2016-12-21 02:49:09 +00: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
Bartosz Dziewoński dc3bae7d36 ve.init.MWWelcomeDialog: Don't treat text messages as HTML
This appears to be unintentional. The messages don't have any markup.

Change-Id: I6f6570c5ef90e4a06ead1a23f6f851021a77c234
2016-12-20 10:50:10 +00:00
Ed Sanders 46385a557e Ensure document base is always correct, even in source mode
Bug: T153624
Change-Id: I3f74f67ce975f5b371ab42adf5213256ae816f7f
2016-12-19 21:08:58 +00:00
jenkins-bot 2f790bb7a8 Merge "Show HTTP status alongside 'Unknown error' when it's not 200" 2016-12-16 18:51:57 +00:00
jenkins-bot 57d49550a0 Merge "Add shortcut for show preview and resolve access key conflicts" 2016-12-16 18:14:17 +00:00
Ed Sanders 4d134cfefc Add shortcut for show preview and resolve access key conflicts
Refactor save dialog setup so logic for canPreview/canReview
is external and passed in.

'Show preview' will show in the VE command help dialog until
I56c1036e6 is merged in core.

Bug: T149914
Change-Id: Id718ad622be43c03df61d12b8688d53462c59f36
2016-12-16 13:33:57 +00:00
Alex Monk a9feb8869c Show HTTP status alongside 'Unknown error' when it's not 200
Change-Id: If14dc14f2cc43a1f12c1314342d5028ec524c31e
2016-12-16 11:28:38 +00:00
Alex Monk 96b8d35bff Wrap localStorage.getItem calls in try { ... } catch () {}
Bug: T153291
Change-Id: Ic4f8c390bfe6936bd182b28b1f2c6d19bf459eba
2016-12-15 23:08:30 +00:00
jenkins-bot ee2cb3048d Merge "DesktopArticleTarget: Generate the original page title if needed" 2016-12-15 16:50:47 +00:00
jenkins-bot 552e21b74b Merge "Properly clear this.section when switching from VE" 2016-12-15 04:18:37 +00:00
Ed Sanders 9728d78126 Resolve URLs in show preview against correct base
Bug: T153277
Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
2016-12-15 03:19:16 +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
Ed Sanders 61c7cc4a95 Extra section title for edit summary in source mode
Bug: T153245
Change-Id: I3b3465f269831152fd7a820027f44bfaada067a8
2016-12-14 21:22:10 +00:00
Ed Sanders 856d480f7d Follow-up Ic1f1de26: Fix typo in edit tab selector
Change-Id: I0ac685f1d942a7d40c6926b8ae8d751db04e1474
2016-12-14 17:35:09 +00:00
jenkins-bot 593474912f Merge "Fix logic for create accesskey=v, and bind to onEditTabClick" 2016-12-14 01:30:17 +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
jenkins-bot dc897662bf Merge "Resize save dialog after showing captcha" 2016-12-13 17:19:20 +00:00
jenkins-bot 16c5d489fc Merge "Don't restore scroll position when doing real section editing (NWE)" 2016-12-13 16:33:16 +00:00
Ed Sanders db447733b0 Fix logic for create accesskey=v, and bind to onEditTabClick
Change-Id: I69020652f2946626c443ef5b724cf92e7905f247
2016-12-13 16:06:57 +00:00
Ed Sanders d2ea716902 Don't restore scroll position when doing real section editing (NWE)
Bug: T152946
Change-Id: I969a8edd4f23bbe6c73855aac059df732102c560
2016-12-13 15:44:54 +00:00
Ed Sanders 69c0fb189a Fix action=editsource URL rewriting
Always look for links unless the only tab is VE.

Bug: T153054
Change-Id: Ic1f1de26fb77098fe62f6263a25c8a40de0e09a7
2016-12-13 15:36:34 +00:00
Ed Sanders 1f3bb5c9e5 Add section= param to URL after loading target
This wasn't such a big deal in VE because we load the full
page anyway, but in NWE it is more annoying if you reload the
page and are dumped in a different edit area.

Change-Id: If49569cbe1a2759d8cbbd7ee42dd1b88da39a946
2016-12-13 15:31:57 +00:00
Ed Sanders 56c34fbf79 Follow-up I6eda4a7c: Fix typos in #updateTabs
Change-Id: Ib80dec3fb199ea03609d5d0f242ac606052f24cc
2016-12-13 15:19:05 +00:00
jenkins-bot a962e7de3b Merge "Support section=new in NWE" 2016-12-13 13:55:33 +00:00
Ed Sanders 5a8106773c Support section=new in NWE
Bug: T150709
Change-Id: I1002b97060d642df0988da15860a36c13712bade
2016-12-13 12:20:55 +00:00
Ed Sanders 37190c3e8d Resize save dialog after showing captcha
Change-Id: I219a1eae442bd580760235f22eee15a836d5ebae
2016-12-13 12:05:42 +00:00
Ed Sanders 2d645d1631 Use Surface#setDisabled instead of deprecated #disable
Change-Id: Idf998ddc0b95efbf6befbcfa493c42b4c3ba1bfc
2016-12-10 20:03:07 +00:00
Ed Sanders d555b5ba33 Cleanup handling of 'section' param
Provide a common function to parsing, and always pass
section to the target, instead of having the target
re-compute it itself.

Change-Id: If9fc24ffa51507cd969fa1b4dfc1519a0b50a572
2016-12-08 20:24:19 +00:00
jenkins-bot 397eb403cc Merge "Simplify #updateTabs" 2016-12-08 19:59:29 +00:00
Ed Sanders cd87e7483b Expand dummy surface to be at least valid
Change-Id: I3888dd2f72858bbe79c61fa4a6f7967f21c5cb7c
2016-12-08 19:36:57 +00:00
Ed Sanders 66e4a5cbe8 Simplify #updateTabs
Change-Id: I6eda4a7c27f0b7590aae5505b0459ced07d2cc48
2016-12-08 19:22:11 +00:00