Commit graph

201 commits

Author SHA1 Message Date
Ed Sanders 478b0bcbb9 Create getters for localised APIs (getContentApi/getLocalApi)
Pass through the current document when available, otherwise
assume the current surface's document.

Also add a getter for getPageName, so that can vary based
on the target document.

Bug: T193856
Change-Id: Ifdc951fdc6a43b924d102e3fcd7e59e52023757b
2018-05-05 14:32:55 +01:00
hunter be5289689f Add label to Options dialog > Categories input fields
Add label to indicate the function of the input field underneath the
categories label in the options dialog. The <label> element is
preferred for screen readers and users with visual disabilities.

Bug: T146966
Change-Id: Ib300ca7a1fd55d320c1a1a8c8c7fd01ab8b0b9c5
2018-04-17 06:28:32 +00:00
Bartosz Dziewoński 0cf02e0155 ve.ui.MWParameterPage: Pass $overlay to PopupButtonWidget
Also, pass $overlay to all PageLayout subclasses used in ve.ui.MWMetaDialog
and ve.ui.MWTemplateDialog/ve.ui.MWTransclusionDialog, for consistency.

Bug: T191395
Change-Id: Ib7ed2e2c04ff7930be1161bd2b981180ee59557a
2018-04-04 22:45:13 +02:00
Ed Sanders b5be51db7e Use cog icon for options
Bug: T191099
Change-Id: I68638dcfa2531ce01843ae3517d9245deb716769
2018-04-04 13:22:00 +01:00
James D. Forrester b6c18b2d49 Don't try to insertMetas at 0,0, just at 0 now (lest we crash)
Bug: T187112
Change-Id: I56e39276637ea018c1ec742d833d115ee881a5d5
2018-02-12 19:32:23 +00:00
David Chan c7b76329ad Use ve.dm.MetaList without explicitly requiring metadata index
For future compatibility with Ib5174b0dcba1c24f44d889e08140bee31a064011 .

Change-Id: I15f252ce5d36bc0c38c5f5035e5176bf5e6d96e5
2018-01-21 18:33:28 -08:00
David Lynch a52dc16244 Update TitleInput's getTitle to getMWTitle
cb92c72c63274b332dc81edf473b1b3979ab4bdf in MW core changed this.

Bug: T185231
Change-Id: I9084a11bd40e46bddbcd1922ff549703bc90f60f
2018-01-18 11:39:23 -06:00
Ed Sanders 0169701257 getSelectedItem() -> findSelectedItem()
Change-Id: Idf90335d06800b690063c7b2a781e822f0ee7ba9
2018-01-17 13:39:13 +00:00
jenkins-bot 683ac88fcc Merge "doc: Bump copyright year" 2018-01-03 19:20:07 +00:00
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
Bartosz Dziewoński 578c55b7c1 ve.ui.MWSettingsPage: Fix doc comment
Change-Id: Iff4e8854124340a30081009221cde5b2831c81f3
2017-12-30 03:26:13 +00:00
David Lynch 7777f69e7b Use rel="noopener" on links targeted at new windows
Bug: T180932
Change-Id: I93bda6aaebf97727a187774cccbeba4f27fcddd5
2017-11-30 13:15:38 -06:00
Ed Sanders 013d26f0b0 MWParameterPage: Use MultilineTextInputWidget instead of config
Change-Id: Icccd6460452774ae0ff21ce9df36dfe428d935d2
2017-10-12 18:13:06 +01:00
James D. Forrester 2c70792c4f Replace constructive with progressive UI flag
Change-Id: Iae36e978978ed6642f44606a934c540cf5f8537f
2017-09-26 15:14:32 -04:00
Ed Sanders 1b8f8d8908 Replace wg(Relevant)PageName with target#pageName
The default value of target#pageName is wgRelevantPageName
but other targets my override this, or change it dynamically
(e.g. ContentTranslation).

Also remove duplicate setter of pageName in mw.ArticleTarget,
already set in mw.Target.

Change-Id: Iebd1def1d4142978a673afec584a0b663644d176
2017-09-26 13:22:00 +01:00
Ed Sanders 835a775a49 build: Upgrade grunt-eslint from 19.0.0 to 20.0.0
Mostly indent and regex fixes.

Change-Id: Iaf9d02363c78cb71deec5c4cab53a05b67f60600
2017-07-18 12:55:33 +01:00
James D. Forrester 528942c2e1 Drop local 'template' icon, use 'puzzle' from upstream
Now that our template icon has been upstreamed thereto.

Bug: T111041
Change-Id: If101018de284dcc1be086d92427de0d88adb0e02
2017-07-06 09:52:56 -07:00
David Lynch cfe1d6c0c9 TextInputWidgets: update for deprecated multiline behavior
Remove config option `multiline` and change to MultilineTextInputWidget as
appropriate.

Bug: T169272
Change-Id: I45565f01de76a88d64d7b0691d1e7279354f375d
2017-07-03 22:09:58 +01:00
James D. Forrester a7d48228dc MWParameterPage: Fix missed remove -> trash icon name rename
Bug: T167598
Change-Id: I1701bd426ea66a40937bcc69183c697a8e39710d
2017-06-12 11:39:50 -07:00
James D. Forrester 756079d477 Replace uses of the removed 'remove' icon with the 'trash' one
Bug: T166730
Change-Id: I528dcdb390a4488ffac89fc823ff35bc1eda4f24
2017-05-31 16:30:17 -07:00
James D. Forrester c787df90c5 MWTemplatePage: Show a different message if the template doesn't exist
Bug: T162694
Change-Id: Icad5abb240efd10fadbfdb287acb98afe2361719
2017-04-24 20:30:35 +00:00
James D. Forrester 0ca821b321 Follow-up 57a06a6e: .getAttribute might be 'guaranteed', but not from null
Whoops.

Bug: T162939
Change-Id: I5a9315e3cfc8a9e8edfb2ef597daeae09bbf5c5e
2017-04-13 14:38:20 -07:00
David Lynch efc469f2f4 TemplatePlaceholderPage: abort pending template search after adding template
With precise timing, the lookup menu could appear after the add template
button had been pressed and the user had moved on to the next page.

Bug: T162707
Change-Id: I36941dc7288c6031a0fb189c0946aa6d8f8697e8
2017-04-12 11:34:42 -05:00
James D. Forrester 57a06a6e75 dm.metaitems: Turn grouped metas into variadic ones
We're getting rid of meta item grouping, so we need to prepare.

Merged:
* ve.dm.MWIndexMetaItem
  from ve.dm.MWIndexDisableMetaItem and ve.dm.MWIndexForceMetaItem
* ve.dm.MWNewSectionEditMetaItem
  from ve.dm.MWNewSectionEditDisableMetaItem and ve.dm.MWNewSectionEditForceMetaItem
* ve.dm.MWTOCMetaItem
  from ve.dm.MWTOCDisableMetaItem and ve.dm.MWTOCForceMetaItem

These three now inherit from ve.dm.MWFlaggedMetaItem to avoid code duplication.

Change-Id: Ic8a9cdb1226dccac2c27e7f4b965c1590a7387c0
2017-04-11 11:13:18 -07:00
David Lynch 1f1be831c0 Add template: don't try to add invalid templates when enter is pressed
Bug: T161715
Change-Id: I12eabe3588fbcbed0fa18b94de7de7239ba490c2
2017-03-29 10:53:17 -05:00
Bartosz Dziewoński 22df25c108 Pass $overlay to FieldsetLayout and FieldLayout in various places
We now use dialog's overlay in every case where we have a FieldsetLayout
or a FieldLayout with a help popup inside a dialog.

Bug: T100571
Change-Id: I8bd0ed430637feca63ec0f13cb7e1e1c659391a5
2017-02-16 02:56:03 +01:00
Bartosz Dziewoński c3be577216 ve.ui.MWAdvancedSettingsPage: Actually display help for settings about language variants
Follow-up to 712ea472d3.

Change-Id: I2f3617fb4e9a80272e559b35c947052c0d8e534b
2017-02-16 02:19:09 +01:00
David Lynch 00fb8c8e58 Advanced Settings: improve displaytitle field
* Remove the checkbox; an empty field, or a value exactly equal to the page
  title means no displaytitle.
* Automatically fill the field with the current page title
* The field was mispositioned

Bug: T155818
Bug: T156665
Change-Id: I46db6b14616c9a021e757284972537cac00546a1
2017-01-30 19:29:25 +00:00
Ed Sanders 133da969ce Use target=_blank for link in template 'extra description'
We already do this for 'missing description'.

Bug: T155879
Change-Id: Iccf48070ab2b5890d6891856be4ee5cce5308d0d
2017-01-23 13:07:53 +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 9cc4736708 Merge "ve.ui.MWParameterPage: Restructure constructor to reduce needless work" 2017-01-03 18:44:56 +00:00
jenkins-bot ec6509e86b Merge "ve.ui.MWParameterPage: Hide the "Fall back to plain wikitext" button when in wikitext" 2017-01-03 18:44:54 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Bartosz Dziewoński a811168c2a ve.ui.MWParameterPage: Restructure constructor to reduce needless work
We were constructing a lot of widgets, and never using them all
(they were forever hidden or not even appended to DOM). For large
transclusions this was causing a noticeable performance hit.

I don't think this quite resolves T134814, but it should improve the
situation.

* this.rawFallbackButton is now constructed and appended only when needed.
* this.removeButton is now constructed and appended only when needed.
* this.infoButton can now be a PopupButtonWidget or a disabled ButtonWidget.

Bug: T134814
Change-Id: I2ea00a88a1ea22b73b0c6d10334a94f45734ec3b
2016-12-27 23:54:49 +00:00
Bartosz Dziewoński e0c97ab2f0 ve.ui.MWParameterPage: Hide the "Fall back to plain wikitext" button when in wikitext
We were trying to hide it by detaching, which did not work because it
was getting attached again in later code. Clicking the button just did
nothing.

Change-Id: I027550eb723c43dc85453959159b93e6e802e099
2016-12-27 23:54:42 +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
James D. Forrester d576fac49f MWTemplatePage: Show a link to the template even when there's a description
Bug: T51772
Change-Id: Ia7084dc7dd4e4c092c0d24b123da19721dca54a9
2016-12-18 21:56:12 +00:00
James D. Forrester f494067dea Follow-up ae8a2750: Stop passing long-dead second parameter
Change-Id: Ifc43d9009c2057b5a189d3cc161b62dc4ca83a2c
2016-12-02 14:31:26 -08:00
Ed Sanders 55fcded32e Replace non-standard whitespace in comments
This is required to pass eslint:recommended.

Change-Id: If8c4876a366e5c021c414e54328ed1913b679969
2016-11-08 14:15:12 +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
Ed Sanders 7a80fa57bc Fix parent constructor call
Got broken in switch to using 'super'.

Change-Id: Icea95b49ad48849af857bfa3b301d3bcf6039036
2016-09-06 19:16:24 -07:00
Ed Sanders 62bdaac13b Use super property to call parent methods
Change-Id: I76982b844cf2871d7583463def4393e5bdc33aa2
2016-08-23 11:56:47 -07:00
Ed Sanders 12e1de2a76 Use transition timing from OOUI theme config
Depends-On: I00eaa2b815d7c76b6315a3993a9a7921ae503c00
Change-Id: I37098e085c4ee49050d448bed8821d3c0f6ec449
2016-07-12 13:28:33 +01:00
jenkins-bot f1bb251814 Merge "Ensure widgets are always torn down when categories page is closed" 2016-07-04 07:11:08 +00:00
Ed Sanders 34135c7643 Ensure widgets are always torn down when categories page is closed
Previously a return statement meant they weren't.

Bug: T139196
Change-Id: Ic7bc14a929430ac6e9d2546fc9e1a1a02635ca77
2016-07-02 17:38:53 +01:00
Alex Monk 134a35ad1a Hack to not show menu immediately upon meta dialog opening for redirect change
Bug: T137309
Change-Id: Iba22b909e8208d2a314de8313db9d910410c9a1d
2016-06-30 20:49:23 +01:00
Bartosz Dziewoński 13a7a4c5f9 ve.ui.MWParameterPage: Remove non-working 'focus' handler
This element is a plain `<div>` with no tabindex, and therefore can't
be focussed. jQuery 'focus' events don't bubble, either, which would
otherwise allow focus events on children to fire this handler.

Change-Id: I68cb7d3bac143565c0a1bdb988312233b2d13ccd
2016-05-10 19:27:52 +02: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
Ed Sanders 5b17cbca67 MWTemplatePage: Don't assume template is the template namespace
Content can be transcluded from any namespace using '{{:'.

Bug: T128333
Change-Id: Ifa076960958d1e72f302c5bfd5d896427a0e721f
2016-03-01 13:40:38 -08:00
Ed Sanders 8f028813e5 CategoryWidget: Update to work with new DraggableGroupElement
Change-Id: Iefac99dba0e6b8ed3eaaa1d5f1d92e402e3cf2db
2016-02-25 16:07:50 -08:00