Commit graph

11742 commits

Author SHA1 Message Date
Bartosz Dziewoński c56b764330 ve.ui.MWTransclusionContextItem: Remove "Generated from" prefix from description (mobile)
It does not provide any additional information, and it is long enough
that it causes the actual template name(s) to not fit on the screen on
small mobile sizes.

Bug: T209610
Change-Id: I47a995905fef5aa2cabb2b3215111de0b506e7f7
2019-02-04 19:48:28 +01:00
James D. Forrester 3ab699f6ed mw.Platform.setUserConfig: Don't try to set for logged-out users, it doesn't
Bug: T214963
Change-Id: Idc61685b6087c0fe0082bd0b039f2f454ca92970
2019-02-01 20:50:58 -08:00
James D. Forrester b74f4db570 MWMediaTransferHandler: Fix new eslint warning from unused global
Change-Id: I729cfb8d6b487ecd5b42af5921ca8f1e18cfd749
2019-02-01 20:07:15 -08:00
Bartosz Dziewoński c91047b129 ve.ui.MWGalleryDialog: Allow normal tools in gallery captions
PHP parser and Parsoid now both allow normal wikitext in gallery captions.

Bug: T187958
Change-Id: I3470ec1f81493c58e4c2bdad00d5d78af8b4a10b
2019-02-01 19:51:35 -08:00
jenkins-bot dae36e4ea1 Merge "MWTemplateTitleInputWidget: Filter out templates named '…/doc'" 2019-01-31 22:29:51 +00:00
David Lynch f7fe245018 trackSubscriber: don't track activity here on mobile
Mobile needs to use a different sessionid

Change-Id: Iffac3d523b4c5774a23ddbe1a2d7ee380ac1b012
2019-01-31 01:22:28 +00:00
James D. Forrester c1d690e53d MWTemplateTitleInputWidget: Filter out templates named '…/doc'
As configured on-wiki via MediaWiki:templatedata-doc-subpage; this will
probably have a few false positives, but that's worth it.

Bug: T54448
Change-Id: Id91f95b5865e151f8007a2421428aeb82b11b3fd
2019-01-26 13:23:38 -08:00
jenkins-bot cd42c60644 Merge "MWLinkAnnotationInspector: check field validation before submitting with enter" 2019-01-25 01:26:44 +00:00
Bartosz Dziewoński 3dbff552dc ve.init.mw.Target: Remove unused property
Unused since 6e64fba2f8.

Change-Id: I223f2346c04573a9e853b49bfc83e542cec47c61
2019-01-24 21:05:48 +01:00
David Lynch 410386d573 MWLinkAnnotationInspector: check field validation before submitting with enter
Bug: T214453
Change-Id: I46adc4578f3827cb9f1fb8b424eb88a49f635fc9
2019-01-24 11:17:04 -06:00
jenkins-bot 2ea2197483 Merge "Fix uncaught jQuery linting errors" 2019-01-22 16:27:45 +00:00
jenkins-bot 26fd8c670e Merge "Re-introduce: Replace deprecated setIndicatorTitle with setTitle" 2019-01-22 00:43:05 +00:00
jenkins-bot 65fd3de442 Merge "Use pixel dimensions for education dots" 2019-01-18 21:26:05 +00:00
Ed Sanders 375edf0182 Fix uncaught jQuery linting errors
Change-Id: I17482ec84c95e88881ab4bee9b9cadb27b2dc472
2019-01-18 21:03:38 +00:00
Ed Sanders ec1a940616 Use pixel dimensions for education dots
Bug: T214203
Change-Id: I02410b09d490c6a6ebd71cafa998f09c8cd1033f
2019-01-18 21:00:56 +00:00
jenkins-bot 1737464653 Merge "Fix fragment links in preview" 2019-01-18 16:54:54 +00:00
Ed Sanders a22b9c8ea3 Fix fragment links in preview
Bug: T212554
Change-Id: Ic9b8f14c377b0dd43aa648983fac27272a64b66f
2019-01-18 14:39:00 +00:00
jenkins-bot ca03c085a2 Merge "Revert "Don't preserveHtmlAttributes on transclusion nodes"" 2019-01-17 12:54:58 +00:00
Volker E 5c5323fc3a Re-introduce: Replace deprecated setIndicatorTitle with setTitle
Patch got reverted in Iffbbd36d0e91, with I3028c4225a42 we should be
good to go now.

Bug: T76638
Change-Id: I016f7db8b2527b3ffe3bd103e6c88ee8e4dd11bc
2019-01-16 22:12:38 -08:00
Bartosz Dziewoński bdfd4b6d8f Revert "Don't preserveHtmlAttributes on transclusion nodes"
This reverts commit 48db45df76.

Bug: T213922
Change-Id: I7b0bf081fd5a9ab71db1ede3ce6e149cfb4b675a
2019-01-17 01:42:15 +00:00
jenkins-bot 27a596e4f0 Merge "ve.dm.MWTransclusionModel: Remove workaround for T135127" 2019-01-16 18:39:41 +00:00
Ed Sanders 5461c56380 stylelint: Enforce class name pattern
Change-Id: Ia41a08424f840d353eb7fc213815f7992da4a2ef
2019-01-13 15:14:53 +00:00
Bartosz Dziewoński 18f8697703 ve.dm.MWTransclusionModel: Remove workaround for T135127
The bug this works around seems to be fixed.

Change-Id: I62837ad795ee6bd35663b163f6de76572e1a6594
2019-01-10 21:16:32 +00:00
jenkins-bot 1190ce584d Merge "Add missing mw-content-ltr/rtl class to diffElement" 2019-01-09 16:49:39 +00:00
Ed Sanders 74f6c4899c build: Update eslint-config-wikimedia to 0.10.0
Change-Id: I63a0ebf0b31a0d5d4e680a4e2a5a0be4850be165
2019-01-08 17:00:09 +00:00
jenkins-bot c0c0c3e6c1 Merge "Revert "Replace deprecated setIndicatorTitle with setTitle"" 2019-01-07 21:23:26 +00:00
Bartosz Dziewoński 8a286b06f0 Revert "Replace deprecated setIndicatorTitle with setTitle"
This reverts commit a7c98d88de.

Bug: T212975
Change-Id: Iffbbd36d0e91d02f50ce0407ed556f2a7d91a301
2019-01-07 21:08:35 +00:00
David Chan 0d362040bd Update VE core module to master (469c6340e)
New changes:
6515e03e1 ve.ce.Surface: Rearrange #findBlockSlug test to check other cases
cbfdc8570 Localisation updates from https://translatewiki.net.
708ba0557 Prevent block slugs from overlapping floated elements
3703fd66d Separate the concept of a document node and a root node in CSS

Bug: T211844
Change-Id: Ia86cf9b23e561d3c32601d41c1bc5a9824e9953c
2019-01-06 07:47:17 +08:00
Ed Sanders 3059251b5c Add missing mw-content-ltr/rtl class to diffElement
Change-Id: I9bd4fad6202ea3636256970b12d6c94f408d0bd8
2019-01-04 22:23:23 +00:00
Volker E a7c98d88de Replace deprecated setIndicatorTitle with setTitle
Bug: T76638
Change-Id: I6637cb21f01bd9e6b158d08671c1f29665e601e1
2019-01-03 11:52:31 -08:00
jenkins-bot 3d4fabd3de Merge "Move save error messages above save footer" 2019-01-03 16:55:40 +00:00
Ed Sanders 0f1a8b9eb9 Default originalGalleryGroupItems to empty array
Bug: T212809
Change-Id: I29e95be677d1d7fcc96bbf20efb7d5724d71b0de
2019-01-03 15:13:15 +00:00
jenkins-bot bebbff8bab Merge "Don't preserveHtmlAttributes on transclusion nodes" 2019-01-02 18:58:13 +00:00
Ed Sanders 48db45df76 Don't preserveHtmlAttributes on transclusion nodes
Bug: T207325
Change-Id: I9c92f18c58c044e7f2257aa6993db227896a1468
2019-01-02 17:11:31 +00:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
jenkins-bot ccfcacf1fd Merge "ve.ui.MWGalleryDialog: Improve modification checks" 2018-12-30 22:49:34 +00:00
Bartosz Dziewoński 0bd9270b3f ve.init.mw.MobileArticleTarget: Remove unnecessary override
This is included in OOUI styles since OOUI 0.30.0.

Change-Id: Ic45e507fed5a40cfc3497551d1be396e1b2f3d5b
2018-12-24 10:06:37 +01:00
Ed Sanders cdb238cfde Remove document padding resets, upstreamed
Depends-On: I53307c931ad24b5ba76503c1dedd1109205b73c5
Change-Id: Id8632a3205d284d8091cae4d431be4faf7e6362b
2018-12-17 13:36:47 +00:00
Ed Sanders 2f34c66b4e Remove duplicate qunit env
Change-Id: I8c4cc4a788de838618b18eff5c4c98d74ac97fe0
2018-12-14 17:46:10 +00:00
jenkins-bot 4c44d8b712 Merge "Use ve.targetLinksToNewWindow where possible" 2018-12-13 22:25:31 +00:00
Ed Sanders ad5b8f99ee Replace $( 'body' ) with $( document.body )
Better to use the actual element rather than a string selector.

Change-Id: I7d2c08cf1e3c6f14be5bf65ac040b7cdfdd8c594
2018-12-13 16:44:25 +00:00
Bartosz Dziewoński 22a80e430e Use ve.targetLinksToNewWindow where possible
Also, avoid parsing HTML manually in a few places.

Change-Id: I983a7e1917a3f0728173e9621c709d1c8c04f650
2018-12-12 23:19:11 +00:00
Ed Sanders f2ac575ee2 Move save error messages above save footer
Keeps the more important information higher up the page.

Bug: T72266
Change-Id: Iaf29a5190af5f72c88eb1bfdacce199cd046eee4
2018-12-12 12:53:55 +00:00
Ed Sanders a9aa4d6c15 Fix save dialog error message transition
Element must be hidden for $.slideDown to work.

Also speed up animation to OOUI default 250ms.

Change-Id: I0616c156f1893688abd80f9e47c1a88e9237d085
2018-12-12 12:20:24 +00:00
Volker E 3949712ec0 TransclusionDialog: Fix removeButton position
Change-Id: I886c64f51fe54483d24c6cfa925b698db7bf4e7e
2018-12-11 16:05:33 -08:00
jenkins-bot 7fe951e5e1 Merge "Exclude deprecated params from search list" 2018-12-11 21:01:56 +00:00
jenkins-bot a5be866ba3 Merge "Allow trackdebug to work independently of debug" 2018-12-11 16:44:45 +00:00
jenkins-bot c306244744 Merge "Bring back 'alert' indicator" 2018-12-11 16:29:28 +00:00
Ed Sanders 3e10592ab7 Allow trackdebug to work independently of debug
Bug: T211698
Change-Id: I28f4fa4d516195e5459484c5d3df1b0566357a25
2018-12-11 16:13:06 +00:00
Ed Sanders ec42733225 Rewrite DOM junk filter as array concatenation
Avoids regressions like If399319b2675ac8c.

Change-Id: I43851931e3b9ee461abd0cfce0627bfb6a2bd041
2018-12-11 15:23:37 +00:00
Ed Sanders ae1095d313 Exclude deprecated params from search list
Only show param info if the exact field name/alias is entered

Bug: T207897
Change-Id: Ic5be8b8cd7698b88ab89d771769f2e9ba407dfa9
2018-12-11 14:59:54 +00:00
Ed Sanders 85974b171c Bring back 'alert' indicator
Was removed upstream in OOUI, but we require it to
show that parameters are deprecated.

Resize to fit new 12x12 size for indicators.

Change-Id: I2356de0754a2ccf09b87b152f3023282f2e37f41
2018-12-11 14:25:48 +00:00
Bartosz Dziewoński 27fdbe0581 Fix filtering out .donut-container again
Follow-up to a5c5176333.

Bug: T189148
Bug: T209619
Change-Id: Ibcf3c93e5b1121f8168ab3280a41917e8f7baa7d
2018-12-11 01:12:35 +01:00
jenkins-bot e0edd25855 Merge "Drop EducationProgram hacks, now that it's undeployed" 2018-12-07 19:50:21 +00:00
Bartosz Dziewoński 0f05dafa6f Make SaveErrorHandler receive entire API response
Previously we passed either data.visualeditoredit.edit or data.error,
which was mostly okay since they are mutually exclusive, but it could
still theoretically conflict if both objects had identical properties
(and receiving different things could make debugging errors harder).

Change-Id: I818d916275b8451af6910ddaa7cd4d7c653085ee
2018-12-07 14:17:16 -05:00
James D. Forrester dab9c26c4d Drop EducationProgram hacks, now that it's undeployed
Change-Id: I65030e3e1b5ce006a458cfbe65a97e738a00a4c3
2018-12-06 12:14:03 -08:00
Ed Sanders 278789e27d Remove TitleBlacklist handling code
This has been moved to the TitleBlacklist extension.

Bug: T211242
Change-Id: Ia15c2619e6c642b3ceb567c28f77b50ccf41731a
Depends-On: Ibaf8a37f1aaef510923bde5ed9114f1f00fff461
2018-12-06 15:00:06 -05:00
Ed Sanders be548979fe Pass error data to SaveErrorHandler on error
Change-Id: I9d7efbecfd954acff86f279f75aa80a9fcc10c89
2018-12-06 14:59:30 -05:00
jenkins-bot 1684f2ef0c Merge "ve.init.mw.SaveErrorHandler: Correct code comments" 2018-12-05 22:24:35 +00:00
Bartosz Dziewoński 9177974c28 ve.init.mw.SaveErrorHandler: Correct code comments
Change-Id: I6e3a883b8c2600953da038aa4ad3601258e1d87d
2018-12-05 16:37:13 -05:00
Ed Sanders be9c6800ad Audit target hooks
* Move (de)activationComplete up to ArticleTarget
* Mark (de)activate to be deprecated in the future
* Fix some properties to ensure target.edited is boolean

Change-Id: Ie34139cb68f90f34eb243f1bb964ef578e90dfb2
2018-12-05 15:45:19 -05:00
jenkins-bot d8cbff898b Merge "Guard against Target#teardown being called twice" 2018-12-05 17:49:26 +00:00
Ed Sanders a89908d58a Guard against Target#teardown being called twice
Change-Id: Ifa8328ee865fadd6ddaf6b35b5ee34284068b620
Depends-On: Icef5b34abd40bfd21aac71a705ef21f6277d21a5
2018-12-05 11:11:09 -05:00
jenkins-bot f583a0fb6a Merge "Move ve.init.mw.saveErrorHandlerFactory and fix documentation" 2018-12-04 23:34:05 +00:00
jenkins-bot a6b64b6b46 Merge "Remove AbuseFilter & SpamBlacklist code" 2018-12-04 23:03:29 +00:00
Ed Sanders 1ee9a739a1 Move ve.init.mw.saveErrorHandlerFactory and fix documentation
Change-Id: Icc8a4d1daf17a1a4cd0d7b2ad97f61916f2a222e
2018-12-04 17:55:35 -05:00
jenkins-bot 710aaced4b Merge "build: Upgrade stylelint-config-wikimedia to 0.5.0 and make pass" 2018-12-04 14:59:06 +00:00
jenkins-bot df125c3303 Merge "trackSubscriber: Set timing property to a number, not an object" 2018-12-04 00:07:53 +00:00
Roan Kattouw 611d9ca6c5 trackSubscriber: Set timing property to a number, not an object
The timing variable is a private closure variable containing an object
that tracks the timestamps of different events in the current cycle. The
duration variable is the result of using that information to compute the
difference between the current timestamp and the relevant anchor
timestamp. For the '_timing' property in the EventLogging data, duration
is the correct value, not timing.

(This is confusing and we should probably rename the timing variable.)

Change-Id: Iff78eb0ab83c84b73ad5c8f3eb85b1c7f120ebef
Follows-Up: Ifc2135d99f4bec917dac60992098958b72c37fc6
2018-12-03 15:33:18 -08:00
James D. Forrester 309d05cb38 build: Upgrade stylelint-config-wikimedia to 0.5.0 and make pass
Change-Id: I4c547757ed5a32ff98b1cf2670010db302bd8467
2018-12-03 13:06:59 -08:00
Ed Sanders 103a34bb75 Remove AbuseFilter & SpamBlacklist code
Moved to their respective extensions

Change-Id: If463068a862cfde15ab4d250a1424c88a5229176
Depends-On: Ib1354f0404209a15194895026ff9d179d16b1900
Depends-On: I1807a5d3d99ecab2bf4545a1bab3aa3f2ae64da8
2018-12-01 14:03:11 +00:00
jenkins-bot 7927a8e395 Merge "Create SaveErrorHandler class to better define structure" 2018-11-30 23:06:11 +00:00
jenkins-bot 685533c86f Merge "ve.ui.MWTransclusionDialog: Remove unneeded code re-setting insert label" 2018-11-30 17:12:40 +00:00
Bartosz Dziewoński a659c4eaea ve.ui.MWTransclusionDialog: Remove unneeded code re-setting insert label
This sets the label to be the same as the default value inherited from
ve.ui.MWTemplateDialog. Looks like it's no longer needed since change
Ia8fb88d3501ffa2c26add4419da5463a926f45d1 (2014).

Change-Id: I1dd40d2428c0221dfdc79e5f34e411b127624eb6
2018-11-29 23:10:56 +01:00
jenkins-bot 98955dfafd Merge "ve.init.mw.ArticleTarget: Stop when we fail to load metadata" 2018-11-29 19:54:36 +00:00
Ed Sanders 041e7b77a1 Create SaveErrorHandler class to better define structure
Change-Id: I036ee32847cc3b25a1cc478247cfe54599781098
2018-11-29 15:47:03 +00:00
jenkins-bot 3878db588d Merge "Remove captcha handler, moved to ConfirmEdit extension" 2018-11-29 03:33:54 +00:00
Bartosz Dziewoński 32f5256736 ve.init.mw.ArticleTarget: Stop when we fail to load metadata
This early return in loadSuccess() has been incorrectly removed in
b2718b186a.

As a very unexpected result of loading the editor twice in case
loading metadata is retried, the "Publish" button was staying
disabled. See the task for investigation.

Bug: T209542
Change-Id: If528afe1ca052062005937f03fe822c5c8d0958b
2018-11-29 04:23:42 +01:00
jenkins-bot fc126c1260 Merge "Rename configs for tracking block notices on visual editor" 2018-11-29 00:43:31 +00:00
Ed Sanders f0295ee01c Remove captcha handler, moved to ConfirmEdit extension
Change-Id: I6938d10d10be80e780294e4d4a32152827ccb5f9
2018-11-29 00:29:09 +00:00
Thalia 2516753c53 Rename configs for tracking block notices on visual editor
* Also make sure block notices have type 'block'.
* Remove old flag for tracking since we'll be using one
  from core

Change-Id: I4b66e73c8a4c4dd7bffd7c0239b1d5ec06eed12f
Depends-On: I6bd1c95548616677e1f72ba6bcfc6f2b551c1ca6
2018-11-28 15:26:15 -05:00
jenkins-bot 4de0e1a04c Merge "MWSaveDialog: Use ve.targetLinksToNewWindow" 2018-11-28 17:05:05 +00:00
Ed Sanders b76e40b2f3 MWSaveDialog: Use ve.targetLinksToNewWindow
Change-Id: I1515901f05de1a7b1ef2aa3cb34f3043ab02acce
2018-11-28 15:44:52 +00:00
Ed Sanders 41bb0a5fd2 Show timings of mwedit events in trackdebug
Change-Id: Ifc2135d99f4bec917dac60992098958b72c37fc6
2018-11-28 12:50:01 +00:00
Ed Sanders 1df0564690 Don't require editSchema to be setup to use trackdebug
Change-Id: I030f5e903d152b1e663f9155ee5235cb611ad63b
2018-11-28 12:49:27 +00:00
jenkins-bot 11f73e89da Merge "Debug flag for tracking" 2018-11-27 21:50:16 +00:00
David Lynch bff72c679d Debug flag for tracking
Change-Id: Ie21c9e3a7bbbf4c3575af50acedf0f002d11cfcc
2018-11-27 14:10:55 -06:00
Derk-Jan Hartman 71ceb51c81 Blacklist javascript links
These aren't supported by VE-MW, so must just be
garbage from a browser plugin, possibly Citavi.

Bug: T200971
Change-Id: I9f34e9890e7f59d76cd464778481c415cc3c5dbd
2018-11-27 21:10:09 +01:00
jenkins-bot 23c6c3b6e0 Merge "Use mw.Title.wantSignaturesNamespace" 2018-11-27 19:31:13 +00:00
Ed Sanders 0d54a62858 Use mw.Title.wantSignaturesNamespace
Change-Id: I60187f0a3eb9cf5d56a4fdaa3401b107758bd8e3
Depends-On: Ib2faa22c429096d545ddb829a6b4025427ad6071
2018-11-27 18:42:44 +00:00
Bartosz Dziewoński b983538038 ve.ui.MWSaveDialog: Improve handling of links in edit summary preview
* Pass the page title, so that links to section point to the current
  page rather than "API"
* Make all links open in a new window, instead of producing a warning
  about losing your changes

Bug: T208978
Change-Id: Ia1924e1af644ee41ebcaa1da40ca004cb72dcdaf
2018-11-27 02:39:47 +01:00
Bartosz Dziewoński c3dcdbe5f0 ve.init.mw.ArticleTarget: Fix typo
Change-Id: Ic4e886ca37c41e9c488b960c06a8de1d2fd1bb07
2018-11-27 00:45:24 +01:00
jenkins-bot 827e3661ec Merge "Track when block notices are shown on visual editor" 2018-11-26 12:35:21 +00:00
Ed Sanders 7bd58c52a5 Move extension save error handlers into a registry
These can now be moved to their respective extensions.

Bug: T136859
Change-Id: I2c35b9443208928db43bcfd515864641b10cc602
2018-11-23 17:19:36 +00:00
Ed Sanders 70253d450a Cleanup save-error handling
* Use ve.getProp
* Use .abusefilter key instead of string search (the key
  didn't exist when we first implemented AF support)
* Move AF handler next to captcha handler, and comment
  both as should-be-moved-to-plugin.

Change-Id: I171d63844b84b5a12396b6d6746f92110fc06c6c
2018-11-23 15:42:39 +00:00
Thalia a5c5bc5116 ve.dm.MWExtensionNode: check for body in describeChanges
Bug: T210257
Change-Id: Iffda3dc0b5b9dc84d294240546193e4b55c45bb7
2018-11-23 12:27:13 +00:00
Ed Sanders f2a9ccd5bd Avoid HTML string parsing
Identified using https://github.com/wikimedia/eslint-plugin-jquery/pull/12

Change-Id: I138e018fdc037d688e055eacddfdc5bfc2cc5abe
2018-11-21 18:47:19 +00:00
Ed Sanders 1a3e8a958c build: Use eslint-config-wikimedia v0.9.0 and make pass
Change-Id: Idb57fc12e7822cf17e10dbb726480fc7de0ae199
2018-11-21 16:51:20 +00:00
Thalia 883e0c23a5 Track when block notices are shown on visual editor
When an edit notice is passed through from the API, allow
a type to be specified, and specify type 'block' if the
notice is a block notice.

If VisualEditorTrackBlockNotices config is true, track
when a message with type 'block' is shown.

Bug: T209633
Change-Id: If5fecc2c2c1c39f4b7245b9a215e1120c93b2b22
2018-11-21 11:22:50 +00:00
jenkins-bot cf32ca44d9 Merge "ve.ui.MWTransclusionContentPage: Fix missing icon" 2018-11-20 16:58:14 +00:00
jenkins-bot 71b127b48c Merge "Filter out junk from the HON browser plug-in" 2018-11-20 15:51:18 +00:00
Bartosz Dziewoński 120788db59 ve.ui.MWTransclusionContentPage: Fix missing icon
It's missing here: https://phabricator.wikimedia.org/F27262533
We forgot this in 09800aa249 (in 2015).
Oops.

Change-Id: I0f1cda43c6566accf45c82a858158f15c2229f47
2018-11-20 04:04:25 +01:00
James D. Forrester a5c5176333 Filter out junk from the HON browser plug-in
Bug: T209619
Change-Id: If399319b2675ac8ca6d3d17acbf96634ab5f6395
2018-11-19 15:25:12 -08:00
Thalia ceb02d3296 Remove needless function call in DesktopArticleTarget
Change-Id: I6e691e97fe7330496cdf45a2439d8fd373cf221f
2018-11-19 18:58:38 +00:00
Bartosz Dziewoński 914e6905ed ve.ui.MWTemplateDialog: Unbreak the logic to enable/disable "Apply" button
I have moved this block of code to the wrong place in change
13675e4a81. As a result,
`this.loaded` was being set early, so the dialog was treating
all of the pre-existing transclusion parts as newly inserted,
and the "Apply" button was therefore always enabled.

Bug: T209661
Change-Id: I3c1b45f91738ab6fc4a6f6d61ae5bf925c9a1bb5
2018-11-16 01:08:29 +01:00
Bartosz Dziewoński 79e16e218f ve.ui.MWGalleryDialog: Improve modification checks
Undoing the changes to an image caption or alt text, or to the gallery
caption, or to the order of images, or removing a previously added
image, will now disable the "Apply" button again.

The following cases will *not* disable the button again, and it is not
feasible to implement them:
* Re-adding a previously removed image with identical options
* Changing any caption to the old value by other means than "Undo"
* Changing image caption or alt text to the old value after switching
  to a different image and then back

Bug: T206534
Change-Id: I7c19600e741211a6ba61837513497facbafc5cef
2018-11-15 22:16:26 +01:00
Bartosz Dziewoński a66f57643c ve.ui.MWGalleryDialog: Update "Apply" button when image added
Use 'change' event instead of 'reorder' to respond to this event.
This also covers removing images now, so delete that code.

Bug: T206534
Bug: T209451
Change-Id: I9eda383be2ca7f02b42814d43e6b42961b9b96e7
2018-11-15 20:56:39 +01:00
Thalia 70c3bc65d9 ve.ui.MWGalleryDialog: Improve how dialog actions are enabled
Enable the Apply changes/Done action if (i) the current contents
of the dialog inputs would change the gallery node or (ii) if the
user has interacted with inputs that alter the gallery caption or
images (including dragging/dropping or removing an image).

Bug: T206534
Change-Id: Ia6c1cc60d4f32ac66778e6973e2d400491f74128
2018-11-13 19:14:33 +00:00
Ed Sanders b2718b186a Separate handling of document HTML and edit metadata
For now this is just moving code. In the future we will
be able to make the handling of edit metadata async.

Change-Id: I7b442dfbdd890154de0e7faab1f6b0346caa8de0
2018-11-08 18:30:33 +00:00
Ed Sanders 3564006e91 $.extend -> ve.extendObject
Change-Id: I1def4d63c231da153a52a649e7bab584e789b6d1
2018-11-07 16:51:39 +00:00
jenkins-bot 89ba8d0ba8 Merge "Fix margin/padding on save dialog enter prompt" 2018-11-07 16:21:45 +00:00
Ed Sanders 2149de7bb0 Fix margin/padding on save dialog enter prompt
Non integer px values were resulting in scrollbars.

Bug: T208947
Change-Id: Ifeefbcc6068b086a3b351706827b34129b7d0227
2018-11-07 13:50:18 +00:00
jenkins-bot 73deda8f66 Merge "ve.init.mw.DesktopArticleTarget.init: Move Vector styles to separate file" 2018-11-07 13:18:47 +00:00
jenkins-bot 07856d2a16 Merge "ve.init.mw.DesktopArticleTarget: Edit surface padding and gutter for Minerva" 2018-11-07 13:18:42 +00:00
jenkins-bot 4d0de7744d Merge "MWTempWikitextEditorWidget: Don't rely on skin to set width for textareas" 2018-11-07 13:18:39 +00:00
jenkins-bot 45c9ff5e21 Merge "ve.init.mw.DesktopArticleTarget.init: Make multi-tab mode compatible with Minerva" 2018-11-07 12:26:38 +00:00
jenkins-bot 6016cad43f Merge "ve.dm.MWImageModel: Drop back-compatibility with old versions of VE selections" 2018-11-07 11:23:27 +00:00
Bartosz Dziewoński b0c0553dc2 ve.init.mw.DesktopArticleTarget.init: Move Vector styles to separate file
Change-Id: Iecf25bf71c1e4fca8964d608082e42ef0c929044
2018-11-06 16:47:31 +00:00
Bartosz Dziewoński c87b010da0 ve.init.mw.DesktopArticleTarget: Edit surface padding and gutter for Minerva
Bug: T208102
Change-Id: I0a43550c938144f79f04dc91c2c742229f939177
2018-11-06 16:47:23 +00:00
Bartosz Dziewoński 1ffdee226c MWTempWikitextEditorWidget: Don't rely on skin to set width for textareas
Bug: T208102
Change-Id: Ic14105556996a74e2ba656cd88571fb94cf4e49b
2018-11-06 16:47:08 +00:00
Bartosz Dziewoński 5996cf15e9 ve.init.mw.DesktopArticleTarget.init: Make multi-tab mode compatible with Minerva
* Make inserting secondary tab work with Minerva's non-standard structure
  of navigation menus
* Distinguish primary and secondary tabs with tiny icons, since Minerva
  hides their text
* Hide section edit link dividers (unnecessary when we use icons)

Bug: T208102
Change-Id: Ieaec60165617e3b423ec58857d6f0a0406e22b1d
2018-11-06 17:45:48 +01:00
jenkins-bot 458b6e87a4 Merge "MWTransclusionNode: Change HTML messages to plain DOM" 2018-11-05 22:45:35 +00:00
jenkins-bot 678d59fb92 Merge "Revert "Disable VE on Special:Undelete"" 2018-11-05 21:08:46 +00:00
jenkins-bot ef5ad0052a Merge "SaveDialog: Remove scrollable property from nested panels" 2018-11-05 20:46:22 +00:00
James D. Forrester 17377ce65c ve.dm.MWImageModel: Drop back-compatibility with old versions of VE selections
Change-Id: I38b309ca240b8305a0b29e11f822e1ad6e1ed3da
2018-11-05 12:44:57 -08:00
jenkins-bot 6ce7ac63d7 Merge "Fix padding around .ve-ui-mwParameterResultWidget-name(s)" 2018-11-05 18:27:43 +00:00
jenkins-bot 3f97176f7c Merge "Use upstream AbandonEditDialog" 2018-11-05 18:19:23 +00:00
Bartosz Dziewoński 259aadaf12 Revert "Disable VE on Special:Undelete"
No longer needed. The underlying problem was fixed in
1aae17c7a5.

Bug: T173154
Bug: T174748
Change-Id: If10301ee78ba031238a11a9f9b2130a2b47a567c
2018-11-05 18:41:05 +01:00
Ed Sanders 66972356cf MWTransclusionNode: Change HTML messages to plain DOM
Bug: T208732
Change-Id: I61a958292984586dc90262989ebb6c181f28a605
2018-11-05 16:28:11 +00:00
Ed Sanders 381bc46130 Fix padding around .ve-ui-mwParameterResultWidget-name(s)
Bug: T208720
Change-Id: Iff8bbb702fdceab86d423a9f74aaebac8b41ebc3
2018-11-05 11:50:12 +00:00
Ed Sanders 956c28bf56 SaveDialog: Remove scrollable property from nested panels
Scrolling is handled by oo-ui-window-body.

Change-Id: If074b5de859b5a9dbad76d6715739e4d37e68c90
2018-11-02 20:32:23 +00:00
Bartosz Dziewoński 1aae17c7a5 DesktopArticleTarget.init: Don't load on special pages with action=submit in the URL
Bug: T168533
Bug: T176022
Change-Id: Ifb7b9cca21423684a901dccabab23fb64e576102
2018-11-02 17:54:01 +01:00
jenkins-bot 74a744327e Merge "ve.ui.MWMetaDialog: Wait for each page to set up (especially 'category')" 2018-11-01 23:02:59 +00:00
jenkins-bot 9ac196777a Merge "Blocked apply if redirect address is invalid" 2018-11-01 22:17:03 +00:00
jenkins-bot 490b1171e3 Merge "Update the styles for VisualEditor's "Format" dropdown" 2018-11-01 21:20:10 +00:00
flutters f847880292 Blocked apply if redirect address is invalid
Extracted extractValue to a separate method
Added checkValidRedirect method to MWSettingsPage
Added errors when redirect address is invalid
Added 1 error message to localisation strings
Added 1 TODO (more precise error messages)

Bug: T74971
Change-Id: I8bcf16e97e5211671759acdf0846243df2c03fc2
2018-11-01 21:20:01 +01:00
Bjornskjald 9490ff370c
Update the styles for VisualEditor's "Format" dropdown
Now when using the MonoBook skin, the text size for headings inside the dropdown is the same as their size on the page.

Bug: T72559
Change-Id: Ie0c30369021f8022b788730a6de90e44a288b13b
2018-11-01 20:40:56 +01:00
jenkins-bot 62c81905e6 Merge "Use changed ve.dm.Selection interface, if present" 2018-11-01 13:39:18 +00:00
jenkins-bot c1871d0216 Merge "ve.ui.MWMediaDialog: Open to the "Upload" tab when dropping/pasting file" 2018-11-01 11:48:46 +00:00
Ed Sanders 1f7b239fbb Reset scroll and tab state when closing dialogs
Bug: T205948
Depends-On: I993455b648b62b97164f55146c75a53da70c322b
Change-Id: I30336caf76e8ff4de4c4dbd3728211c9a58d724e
2018-11-01 04:11:28 +00:00
Bjornskjald daa1f6eb1e
Add using the article title as the default value for sorting in categories
This way users can rearrange/edit current name without exiting VE and/or copying it from somewhere else

Bug: T145339
Change-Id: I80690cdf344c2ccbdd8be486642afcf841f36c10
2018-10-31 19:01:02 +01:00
Ed Sanders eab2b728e9 Use upstream AbandonEditDialog
Bug: T192333
Depends-On: Ib581528363a3fe5461529515835bd7fb1ce66e56
Change-Id: I206366e096aafc02102357648b9f85f879479500
2018-10-31 13:38:31 +00:00
David Chan 2c3e33b759 Use changed ve.dm.Selection interface, if present
Bug: T208228
Change-Id: Ie2027c4d16e0ac591512e90dbdeea012f11ff875
2018-10-31 12:07:14 +08:00
James D. Forrester c36f3d2214 Revert "Update VE core submodule to master (02f5f0ca4)"
This reverts commit be628a5b7e.

87b20f9b Revert "[BREAKING CHANGE] Do not cache document model data in DM selections"

Change-Id: I47bbf757a4ad227346d3734f6e50d928a2de1409
2018-10-30 15:12:30 -07:00
Bartosz Dziewoński b5e430a3fc ve.ui.MWMetaDialog: Wait for each page to set up (especially 'category')
The initial value for the categories field is set asynchronously
(after potentially querying the MediaWiki API about the categories).

This caused the existing categories to "pop in" after the dialog was
opened (if you were on a slow network and it took more than 250ms to
query their information).

Additionally, it caused the "Apply" button to always be enabled if the 
page had any categories on it (since the categories field was still
empty when extractSettings() was executed).

Bug: T207719
Change-Id: I46475a1eead91707edb8efe8cb7221a734818e16
2018-10-30 20:55:43 +01:00
Bartosz Dziewoński f0d30ad59f ve.ui.MWMetaDialog: Consider category sortkeys when checking for changes
I forgot about them when reviewing 79253bb0c8.
Oops.

Bug: T207719
Change-Id: I11fd396883132a2dfb79ded6f04983fd5b7fbf61
2018-10-30 20:55:43 +01:00
Bartosz Dziewoński 52e54864b5 ve.ui.MWCategoryPopupWidget: Clear state after closing the popup
After removing a category, it would forever stay in the "removing" mode.

Bug: T208346
Change-Id: I8e8c00e16ea8d03cef5872d969e80e9dfaa84035
2018-10-30 20:55:43 +01:00
jenkins-bot afb49f7f1f Merge "ve.ui.MWMetaDialog: "Apply changes" is now only enabled after making changes" 2018-10-30 19:29:05 +00:00
flutters 79253bb0c8 ve.ui.MWMetaDialog: "Apply changes" is now only enabled after making changes
Added 5 methods for MetaDialog (documented in code comments)
extractSettings
compareSettings
getAllWidgets
assignEvents
updateActions

Added 2 fields to MetaDialog
oldSettings
widgetList

Apply changes button now is only enabled when there are new changes

Added getFieldsets method to all subpages

Bug: T207719
Change-Id: Id51acf6c754d9a2572811775d83983e6ab9395b7
2018-10-30 19:12:52 +00:00
jenkins-bot b2c529e499 Merge ".eslintrc: Enable and fix "max-statements-per-line": 1" 2018-10-30 15:46:05 +00:00