Commit graph

430 commits

Author SHA1 Message Date
jenkins-bot 50e7fd0653 Merge "Fix MWInternalLinkAnnotation.getTargetDataFromHref's behaviour with URLs containing query parts" 2017-01-05 15:08:33 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Alex Monk 4c061de2e0 Fix MWInternalLinkAnnotation.getTargetDataFromHref's behaviour with URLs containing query parts
ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref(
	'http://mediawiki.krenair.dev/mediawiki_dev/wiki/Main_Page?veaction=editsource',
	ve.init.target.surface.model.documentModel.htmlDocument
)

Wrong, current result:
Object {
	title: "Main Page?veaction=editsource",
	rawTitle: "Main_Page?veaction=editsource",
	hrefPrefix: "",
	isInternal: true
}

New result:
Object {
	title: "http://mediawiki.krenair.dev/mediawiki dev/wiki/Main Page?veaction=editsource",
	rawTitle: "http://mediawiki.krenair.dev/mediawiki_dev/wiki/Main_Page?veaction=editsource",
	hrefPrefix: "",
	isInternal: false
}

Change-Id: I3d6d7fcfeb0d8354623026c831605c7633c3e11a
2016-12-24 20:12:44 +01:00
Ed Sanders 854256bb8e Use deep clone for empty convertFromSource
Bug: T153254
Change-Id: I0dc6be0d20020e3fb385c9d065f9395dbda5a6b6
2016-12-14 22:09:25 +00:00
Alex Monk c843824c97 Batch gallery imageinfo requests via ImageInfoCache subclass
Also get rid of .join( '|' ) for API request parameters per Bartosz

Bug: T147067
Change-Id: If4444cca300d65e28d6fb9003fcac5e076a5129a
2016-12-06 22:10:19 +00:00
Ed Sanders f01d617c53 Bypass API call when wikitext is empty string
Change-Id: Ie0cedfaae286f73e73bcde7bfca3cb2ae6197924
2016-12-03 17:44:04 +00:00
Ed Sanders c97e0b58d4 NWE: Disable progress bar when pre-parsing for WindowAction's
The progress bar dialogs interfere with the life cycle
of the window you are trying to open. Just disable these
progress bars for now to avoid catastrophic behaviour.

Change-Id: I77c8ae67a2d502bbd189836deb320cd55c3cb11a
2016-12-03 17:20:24 +00:00
Ed Sanders 9ceb13ce60 Update VE core submodule to master (5be61ce)
New changes:
860954b [BREAKING CHANGE] Parse selection before applying source tools

Local changes:
Implement convertFromSource/convertToSource in WikitextSurfaceFragment

Depends-On: Iaa41c49e2f8e28af28a8a64cb6915f705fa35e8c
Change-Id: I746619d442fb565cd582cb09de3126526c73c333
2016-12-03 03:43:59 +00:00
James D. Forrester a835f4f9d5 Use canonical ve.dm.TransactionBuilder.static.newFrom* methods
Change-Id: I082048a677baa2699d94e21548373952d52db61b
2016-12-01 10:43:10 -08:00
Ed Sanders 2ee9e62a4d Use upstream media search widget from core
Bug: T140166
Depends-On: If53ef7f4b62c7a5d4da565c14dd2a353778694e5
Change-Id: I28845e9c143e78d3a377f067606c62da212e3bf1
2016-11-29 17:19:14 +00:00
jenkins-bot c62e71f44d Merge "ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP" 2016-11-02 20:07:06 +00:00
Ed Sanders dc0c751100 Ensure max size in not enforced for vectors
Otherwise they can't be scaled up. Also move svgMaxSize code
to comment as it isn't used yet.

Change-Id: I7af2bc91524e832555b66f090a671672cd14f294
2016-11-02 18:12:02 +00:00
Ed Sanders e655880d14 eslint: Remove unused exception and fix documentation errors
Don't enable valid-jsdoc yet though, due to @chainable bug.

Change-Id: I4d2a6de19c72c6e4c20733446616d8046419d431
2016-10-28 12:02:36 -07:00
James D. Forrester 36befda61c build: Replace jscs and jshint with eslint
It's new, it's fresh, it's amazing, it's here.

Change-Id: I5dc784411f704685ed5cc763a2b2b1c5d3e5a610
2016-10-28 18:33:15 +00:00
Kunal Mehta 090b8ad5c7 Don't hardcode magic link URLs
These are actually configurable via MediaWiki messages, so use those
instead of hardcoding the default URLs.

Change-Id: Ie66a1b53f9c011947fe9e8db198a5904373f3192
2016-10-15 16:02:35 -07:00
Ed Sanders 3d39b80991 Fix detection of headings in NWE format menu
Use regex to include match any character after '='.

Bug: T147585
Change-Id: I22228bedf497613506a676eca465d3bc7bc5fe67
2016-10-08 20:53:58 +00:00
Ed Sanders a9233045c7 Detect format in wikitext
Logically depends on I575d92c4fa.

Should really use a registry, and also doesn't update when
format is changed by deleting text, but is an improvement
for now.

Bug: T147218
Change-Id: I0cb87dbad2ab4269c4f89bdff8a4ccd9b35c8635
2016-10-04 11:04:54 -07:00
jenkins-bot c1cb6edf83 Merge "Don't try to add suggested/required parameters already set under alias names" 2016-10-04 15:49:27 +00:00
Alex Monk e3a387b517 Don't try to add suggested/required parameters already set under alias names
Bug: T143650
Change-Id: I6d5ed2903a468205760f715b9bb36a40bdef926a
2016-10-03 17:57:55 +01:00
Bartosz Dziewoński 107faee6da ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP
Requires MediaWiki core change
Ic93d733cb9e1b1d7301f8975c68ab7ded778845a.

On wikis with CentralAuth installed, also requires
I24c2819ec2adcab468f961c5c46b31c331324567 and
I372e7bdff35400287b3d961da979d6f094d13bd9.

Bug: T143279
Change-Id: Id60bb3cde7e2032846da9606aefb00ea805f2ecd
2016-09-26 18:57:16 +00:00
jenkins-bot 8375c57a6c Merge "Revert "ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP"" 2016-09-26 18:55:13 +00:00
Bartosz Dziewoński 1d8032db1c Revert "ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP"
The change was merged without the necessary dependencies.
This reverts commit 2b1c3914ec.

Bug: T143279
Bug: T146661
Change-Id: I5ce945f6167c9db5d5f03c824dee3d89cd0931a8
2016-09-26 18:49:00 +00:00
jenkins-bot 80618cc629 Merge "dm.MWInternalLinkAnnotation: Fix href normalization for special characters" 2016-09-22 16:19:12 +00:00
Roan Kattouw bb45d984ca dm.MWInternalLinkAnnotation: Fix href normalization for special characters
<a href="Foo%3F"> would dirty-diff to <a href="Foo?"> and also render
as such, pointing to the wrong page.

We also called decodeURIComponent() on the href twice, which can't
have been good.

Move URI decoding and underscore normalization into
getTargetDataFromHref(), and add rawTitle for callers that need it.
Put rawTitle in the origTitle attribute, so that equivalence
comparisons (decode(origTitle) === title) work as intended.

Bug: T145978
Change-Id: I29331a4ab0f8f7ef059c109f6813fa670a2c7390
2016-09-22 09:10:41 -07:00
Bartosz Dziewoński 2b1c3914ec ve.dm.MWMediaResourceProvider: Use mw.ForeignApi rather than JSONP
Bug: T143279
Depends-On: Ic93d733cb9e1b1d7301f8975c68ab7ded778845a
Depends-On: I24c2819ec2adcab468f961c5c46b31c331324567 (for CA wikis)
Depends-On: I372e7bdff35400287b3d961da979d6f094d13bd9 (for CA wikis)
Change-Id: I14a1e5c9956d1b425eaacdf358db384df3be8115
2016-09-12 18:38:58 +00:00
Ed Sanders adaa47804f Search all RDFa attributes when looking for type
Bug: T144561
Change-Id: Ib42daa52796cd72babbd8a317bae948cff779c99
2016-09-02 16:43:30 -07:00
jenkins-bot b656f3d5f1 Merge "Use super property to call parent methods" 2016-09-01 17:04:39 +00:00
Ed Sanders 5788340b49 Update VE core submodule to master (632f0a9)
New changes:
14b5fbc [BREAKING CHANGE] Move originalDomElements to the IV store and use MD5
c5d21f0 Provide methods to (de)serialize transactions

Local changes to move originalDomElements to IV store

Depends-On: I8a71c1a40ec35108d0a9a388da6f75632f8dc53c
Depends-On: I32c9b5f984fcf96e3354841ecfcd444149e8f159
Change-Id: I0fbb6324eede94558426178cbdad6b5daf0f8318
2016-08-24 18:14:14 +00:00
Ed Sanders 62bdaac13b Use super property to call parent methods
Change-Id: I76982b844cf2871d7583463def4393e5bdc33aa2
2016-08-23 11:56:47 -07:00
Alex Monk 166588c726 Fix insertion of templates, media, and various other things into wikitext surface
Pretty much fix everything on the insert menu... RB doesn't like it when you
try to specify both title and revision ID, but don't provide an ETag.

Change-Id: Ib25d023309d984ed8848f67b349b23231f27a957
2016-08-17 21:12:00 -07:00
Ed Sanders c452e134cc Wikitext surface alpha feature
Edit wikitext with the VE interace.

Bug: T104479
Bug: T142138
Change-Id: Ic95b47e0dd378578555c4a2342ca9c87064ed1d5
2016-08-12 18:37:29 +00:00
Alex Monk 818c6e4928 Take link fragments into account
TODO: Do we need to do anything special here to handle multiple hash symbols in a URL?

Bug: T112898
Change-Id: I4773cb04ae2533e8125bc55d9ebb606d63b3bf48
2016-08-06 01:20:24 +01:00
jenkins-bot cf4c2d41b3 Merge "Rewrite TOCWidget based on Linker::generateTOC" 2016-08-05 22:18:22 +00:00
Ed Sanders bb7b38575f Rewrite TOCWidget based on Linker::generateTOC
Use the new node cache to find headings.

Change-Id: I5eb75c5db5ca466fd6f16a57c693c2a4458cff7c
2016-08-05 14:11:15 -07:00
Alex Monk 8855ebf586 Fix check for non-template-namespace transclusions
These are not just titles beginning with ':'

Change-Id: I9d7063c221561a0e582deb6944eaab6d9ab4e3f7
2016-08-05 03:25:31 +01:00
James D. Forrester d9d6a567d8 Follow-up e2f6d798: Make MWTemplateModel#addPromptedParameters work
Change-Id: I27e82aed207e1352ccb5f5a177fd53d5c1868c42
2016-06-30 16:46:38 +01:00
jenkins-bot 750078ab63 Merge "MWTemplateDialog: When opening the dialog, add in any unset suggested and required parameters" 2016-06-29 22:42:25 +00:00
jenkins-bot 913d3c0cf4 Merge "New decodeURIComponentIntoArticleTitle method" 2016-06-29 16:15:41 +00:00
Ed Sanders aeca19c9ea Ensure text version of counter is written to external links when copying
Bug: T137503
Change-Id: Iae791253ea272847984fee5d0586dc302027f1bd
2016-06-27 22:17:58 +01:00
David Chan 367bc2437f New decodeURIComponentIntoArticleTitle method
This replaces ve.safeDecodeURIComponent(...).replace( /_/g, ' ' ) . This action
is really specific to the quirks of mediawiki title processing.

Change-Id: Ia9e525c9340e6de9e485355899996c97867ccb48
2016-06-14 23:31:23 +01:00
David Lynch cc78cb2d06 Decode encoded link titles when generating them from text
Percent-encoded characters are forbidden in titles. Copying URLs around will
tend to wind up when them percent-encoded when you paste. Therefore, when
trying to build a title from a pasted link, decode it first.

Change-Id: Ia0abcb2d903b04d99c7db16eb0a5962480b138d5
2016-06-13 08:58:54 -05:00
James D. Forrester 832118e051 MWTemplateDialog: When opening the dialog, add in any unset suggested and required parameters
Bug: T97482
Change-Id: Iaf280355f442240aba4e1f74d3ee402fc5d329b0
2016-06-08 14:19:09 +00:00
Ed Sanders 35c0a0dc69 Use cloneWithData
Change-Id: I7ffe3c7ab20d5f785a6642c8293f271f4dc08ff8
2016-05-30 21:40:07 +01:00
Ed Sanders bc3edc7712 Use insertContent with templates when range is collapsed
We may be trying to insert a block into a paragraph. fixUpInsertion
handles this, but not if use a replace transactions.

Bug: T136279
Change-Id: I1401da52676e79f38ef835a32d2c76004b75fb4e
2016-05-26 17:10:52 +01:00
Ed Sanders 61d592bab1 Workaround for T135127: Generate replace transactions in MWTransclusionModel
Change-Id: I1d202c3b2e980f1ea52ef90d028886135b0cb748
2016-05-20 10:54:56 +01:00
Ed Sanders 236e3d1241 [BREAKING CHANGE] Evalute block/inline state when inserting a transclusion node
Make some of the methods we currently use to render the node
static so we can re-use them before inserting. We do the evaluation
without inserting the node so as not to dirty the document and
transcation history.

In the unlikely case the request fails, just fallback to inline.

This only handles insertions for now as type changes on edit will be
very rare.

This changes the signature of insertTransclusionNode, which is used
in Cite and Citoid extensions.

Bug: T51784
Change-Id: Ibc2fc66e6866084b0a4deeb082c8a1ca412febb2
2016-05-16 09:19:13 +01:00
Ed Sanders b25fbd3b7b Remove redundant about attribute stripping code
Change-Id: I2d330c074075734d50d6bf3e0f67e55bade6c072
Depends-On: I8be0a362338ba12d5569e315725386142a66da24
2016-05-04 12:55:36 -04:00
Alex Monk 978224f2ec Use widgets for wiki-page-name, wiki-user-name, wiki-template-name, boolean, URL and line template fields
* Use TitleInputWidget for wiki-page-name and wiki-template-name parameters
* Use UserInputWidget for wiki-user-name parameters
* Use a custom hacky CheckboxInputWidget child class for boolean parameters
* Borrow some ve.ui.MWExternalLinkAnnotationWidget.prototype.createInputWidget code for url parameters
* Use a TextInputWidget with multiline disabled for line parameters

Not dealt with in this commit, so fallback to existing behaviour:
* string
* number
* unknown
* content
* unbalanced-wikitext
* date
* wiki-file-name

Bug: T55613
Bug: T124734
Bug: T124736
Change-Id: If04944d64303d959e8dd605e75a175895932b788
Depends-On: I87699a93ca1b34c6d248456fcc060f584623d158
Depends-On: I5e97604f0fc24176d5e89899bf0505dc442a1a7e
2016-04-06 22:07:19 +01:00
jenkins-bot 65ee77da50 Merge "MWExternalLinkAnnotation: Only match plain external <a>s with hrefs" 2016-04-02 16:05:36 +00:00
Ed Sanders 6fad9ecdee MWExternalLinkAnnotation: Only match plain external <a>s with hrefs
We now accept non-Parsoid generated external links from paste,
so make sure they have href attributes otherwise they aren't
really external links and will throw exceptions later on.

Bug: T131430
Change-Id: Ifb565b1ce30cfe80ae72b17f6a9551ea40b36453
2016-04-02 18:51:56 +03:00