Commit graph

242 commits

Author SHA1 Message Date
David Lynch 001b945513 ArticleTarget: remember whether we preloaded, so it can affect the save button
Idea being: preload use case is often "load content, maybe with parameters,
immediately save it", so we can treat it as being already-modified for saving
purposes.

Bug: T179063
Change-Id: I35ff04bc9cb5172edf8174832624145973aa1fdb
2017-10-30 16:40:57 -05:00
David Lynch 9878f4ddeb Make sure content is set
Change-Id: I59a5146a1186937a643818d02441563c5cc63319
2017-10-05 00:43:48 -05:00
David Lynch c89a2a9e76 ApiVisualEditor: avoid some unset variable notices
Bug: T176440
Change-Id: I571fbea79bd7f656cd367a5d8a773408fd80c7cf
2017-10-04 09:44:58 -05:00
David Lynch 02c6e9142b Api: Missing preloadparams
* Tiny fix to 33dc60838c for PHP variable name
* Bigger fix to properly pass preloadparams in and split them up

Change-Id: I844db115f2563cb9ee1629c30d5f49d1ce58f5bd
2017-09-25 11:42:09 -05:00
David Lynch 33dc60838c Api: include preload content when section=new
Consistency with former editor behavior. Needed for some cases like
Template:Meetup/signup which use preload + section=new to make as close to a
one-click experience as they can.

Bug: T51622
Change-Id: I0940898b56dbaea536f57560135665df89569232
2017-09-25 10:31:10 -05:00
David Lynch 05bd8c19c8 ApiVisualEditor: Stop an undefined variable error for preload on existing pages
Bug: T176440
Change-Id: I39c8efe6d59948170b848730c4cc20c80cc2d326
2017-09-21 16:21:41 -05:00
Reedy dcbe6d0dd5 Replace $wgUser with $user
Change-Id: I657551567334357b60bfec33e7d44a6d960f4a8e
2017-09-21 20:07:19 +01:00
Bartosz Dziewoński 9c8eded5d9 ApiVisualEditor: Fix checkbox label message handling with Message objects
Follow-up to df9e564b73. Eh, this is
hacky. I did not think this through when making the original change.

Bug: T176249
Change-Id: Ieff2c3174479831797bd37a6b1d0df44ed6ce0df
2017-09-19 21:23:34 +02:00
Ed Sanders 314a34391e Use consistent comment style in PHP files
Change-Id: I0ff8b83c8d36b8d6343715cb1cf39d501c5de408
2017-09-18 20:46:38 +01:00
David Lynch ea274c94cd Enable preload in VisualEditor
This allows the use of the preload and preloadparams query parameters. They
should behave as they do in the old editor, loading substituted content in
visual and source modes.

Bug: T51622
Change-Id: I522fb5b480d17912f6d6116be6aa043ead855b52
2017-09-15 17:17:51 -05:00
jenkins-bot 4740424fa9 Merge "Remove use of deprecated EditPage::getCheckboxes()" 2017-09-14 19:20:21 +00:00
Kunal Mehta 32cfdab410 Avoid using deprecated ParserCache::singleton()
It was deprecated in 1.30.

Change-Id: I5bdb91e4f4fa57369177ffe61d9a8743e1d81346
2017-09-08 17:21:16 -07:00
Bartosz Dziewoński 0341c804b6 Remove use of deprecated EditPage::getCheckboxes()
Follow-up to I5bfca5e116fe790302c3b6ac1357e80237fb1ed2.

Bug: T174613
Change-Id: I5747871065416ca23038b099f128b02b5cbb431b
2017-08-31 17:48:06 +02:00
Bartosz Dziewoński df9e564b73 Stop requiring deprecated EditPage::getCheckboxes()
Instead, use getCheckboxesDefinition(), and build our save form
checkboxes from that rather than extracting them from the HTML.

The ability to have non-checkbox fields there is removed, as that was
never intentional and is now impossible.

To avoid transient problems during deployment (old JS code cached in
the user's browser receiving the new format of API responses), the old
property is kept in the API response. We should remove it next week.

Bug: T174613
Bug: T174686
Change-Id: I5bfca5e116fe790302c3b6ac1357e80237fb1ed2
2017-08-31 17:47:15 +02:00
Ed Sanders cedf3758d2 Update mediawiki-codesniffer 0.10.0 -> 0.10.1
Change-Id: I40707991ff2931593ae44046369f2d7955ff324e
2017-07-25 15:49:56 +01:00
jenkins-bot 71fb85fab3 Merge "[BREAKING CHANGE] Drop support for contacting Parsoid without VirtualRestConfig" 2017-05-23 19:04:37 +00:00
Ed Sanders 574baf2e8e Provide VE-rebaser in MediaWiki as Special:CollabPad
Change-Id: I3ffe0e2b6af43d4018dcd79877f4f27ed7d6a7e7
2017-05-20 19:51:09 +00:00
James D. Forrester 89e043452d [BREAKING CHANGE] Drop support for contacting Parsoid without VirtualRestConfig
Change-Id: I3f7c3f8326c6fa76bd49e53c9fd2a24de9568f13
2017-05-14 07:18:19 +01:00
James D. Forrester 307a8f0ed7 build: Enable MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: Id11360a266b5a5269856a9adbf3cd27cda52f178
2017-05-11 08:19:44 -07:00
James D. Forrester 56bfb7828c build: Bump mediawiki-codesniffer to 0.8.0 and make pass
Change-Id: If509e5ba639bcda497fe7898f6eb79265967139d
2017-05-11 08:19:44 -07:00
James D. Forrester 40d115c806 Follow-up fa2efb9e5 part II: Don't try to call a private function
Change-Id: Icd7c15830c524b4492d0acc0528694cbc9a4f424
2017-05-08 16:42:20 -07:00
James D. Forrester fa2efb9e50 ApiVisualEditor: Move RESTbase initiation from construct() to execute()
There's no need e.g. in API documention queries to actually create the
RESTbase service connection, and it's quite an expensive operation to
do there.

Change-Id: I114fe0718338db7233ed94e4ffa90861b4e9ff50
2017-05-02 11:42:31 -07:00
Ed Sanders 3577035825 Bypass warming red link cache for wikitext requests
Wikitext editor doesn't need to know about redlinks
on the page, so this is a waste of time. If the user
switches to VE, they will do a fresh metadata request
at that point.

Change-Id: I57f3fe3fca47dde03bba7905f763abc8a43d0653
2017-01-14 13:42:27 -08:00
David Lynch 0a972795e9 API/getLangLinks: Use isset when looking up $langnames
This should just result in an empty `td` for the language name, rather than
any more-severe breakage.

Bug: T154962
Change-Id: I59d429777ab790e922f08e01a1c262fa2b082292
2017-01-10 14:27:25 -08:00
Alex Monk 8fe5bbe39b More error handling fixes
See T154565

Change-Id: I073aae149497342157503ad3f465b7d57aaad4fa
2017-01-05 15:13:02 +00: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 2b913fb10c Merge "Add editintro to notices" 2017-01-03 20:19:06 +00:00
jenkins-bot 8723481005 Merge "Don't allow $section to be unset" 2017-01-03 18:57:46 +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 58071f59f1 Add editintro to notices
Bug: T56029
Bug: T51622
Change-Id: Ib43cc66b817ff394b4f1c82fcba4503df825819c
2016-12-31 23:23:17 +00:00
jo12bar 0533c329fb
Replace all usages of Linker::link() with LinkRenderer
Linker::link was deprected in 1.28. This replaces all usages of
Linker::link with an instance of LinkRenderer in ApiVisualEditor.php, as
this seems to be the only file generating links with Linker::link.

Bug: T149346
Change-Id: Ib395f137787e7dd7c5cfe91905f5feb88ce9f604
2016-12-30 21:27:17 -08:00
Ed Sanders ab78f52fa9 Don't allow $section to be unset
Change-Id: I46a36a08fc2e98aeb35774af8b26ebee313965f3
2016-12-18 11:30:18 +00:00
Alex Monk 5d5645565f Fix I0e802a47: Don't try to send dieWithError error codes as integers
Bug: T152429
Change-Id: If882b14adc945ca49e51a912a676aee0be9c9fec
2016-12-16 11:10:31 +00:00
jenkins-bot 8861ec2d35 Merge "Get content format from EditPage, instead of guessing 'text/x-wiki'" 2016-12-14 01:14:04 +00:00
jenkins-bot b857300853 Merge "getlanglinks: Get rid of backwards-compat stuff" 2016-12-13 19:29:52 +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 ec56a700f1 Get content format from EditPage, instead of guessing 'text/x-wiki'
Change-Id: I45918fab0f3bbac07d86d79f9539c3041b6f119e
2016-12-10 20:03:07 +00:00
jenkins-bot a04cef294e Merge "Update for API error i18n" 2016-12-06 20:04:24 +00:00
Alex Monk b51720e165 Respect oldid parameter in NWE
Change-Id: I5a6388f50cc432421343974eb9f721f5e5a94d93
2016-11-23 00:47:42 +00:00
Brad Jorsch 26e24c2d09 Update for API error i18n
See Iae0e2ce3. Since VisualEditor master requires core master, this just
depends on the master patch instead of trying to maintain BC.

Depends-On: Iae0e2ce3bd42dd4776a9779664086119ac188412
Change-Id: I0e802a47302725f062334a437bff84e3b2b8b9a6
2016-11-14 12:47:01 -05:00
jenkins-bot eabd56618b Merge "Set Api-User-Agent in requests to RESTBase/Parsoid" 2016-10-27 23:24:09 +00:00
Kunal Mehta b393ff7e83 API: Use ::class PHP feature
Change-Id: Ic57cde6098b2a04e76186c75d621ade75de04180
2016-10-27 12:33:17 -07:00
James D. Forrester 7eeb66f63e Set Api-User-Agent in requests to RESTBase/Parsoid
Bug: T149050
Change-Id: I7670450724f18865a7d9c7c7eb182449964f32b0
2016-10-27 08:56:19 -07:00
Roan Kattouw 13801bb6d3 ApiVisualEditor: Move diffing and serializing to ApiVisualEditorEdit
These require POST, especially paction=serializeforcachekey because
it calls ApiStashEdit::parseAndStash() which needs a master DB connection.
Move them to the edit module so we can require POST for that one and keep
allowing GET for the main module. This fixes the warnings we currently get
for using parseAndStash() in a module that does not require POST.

Change-Id: I64a8ed7305105fa4c46902b99984306a7ff468cc
2016-10-21 15:24:13 -07:00
Ed Sanders 4040442ad8 Section editing in NWE
Bug: T144654
Change-Id: Ida6e721e0d980b47e3fda6a1f0744cbce1b2235a
2016-10-12 12:55:11 -07:00
Alex Monk 995ea38466 getlanglinks: Get rid of backwards-compat stuff
We can handle the new structure etc.

Change-Id: If8613f66b00f4fffe3936baec7d13214b9a676d0
2016-10-08 20:44:59 +00:00
Alex Monk 5e25cda633 Fix getlanglinks response to deal with no links
When no langlinks are returned by the API, it just doesn't set the langlinks
property.

Also, get rid of indexpageids while we're here.

Change-Id: Icfb8c0abb02aeb3e9cdbefe0df7bb6b5476b78a4
2016-10-08 19:06:19 +00:00
Alex Monk fba850f6e8 Don't call ApiBase::getResultData anymore, it's broken on core master and is deprecated anyway
Change-Id: I64066a77611a51bae777588820608cc9fa63b02e
2016-09-29 23:36:00 +01:00
Alex Monk 8a80b5bbc3 Split isAvailable from visual-specific checks
Not fully tested

Bug: T146182
Change-Id: I5d7ae6e49991660ecdc2daf46b319947f83a1018
2016-09-20 23:53:53 +01:00
Brad Jorsch d7247efc90 Remove pre-1.25 API compatibility code
Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: Iff2eeb2bbfba15c84a4fcec85b6647c28886e9aa
2016-09-20 15:32:23 -04:00