Commit graph

80 commits

Author SHA1 Message Date
Ed Sanders 60883bf812 Included aliases in getAllParamNames
They are bound by they same uniqueness constraints as regular
parameter names.

Bug: T111320
Change-Id: Ia9c1593ec69e1aa97a07b769faf8c9f526dd2922
2016-02-24 15:13:20 +00:00
Ed Sanders 9dd781c18b Give drag handle an increased opacity on hover
Change-Id: Ic7f283b4d20cc8ba35924d4f79be6ba7d3414a78
2016-02-22 17:12:08 -08:00
Ed Sanders f11893573a Param list style tweaks
Change-Id: I244b010a4b1a06e33b31d029afaabe9290440e0f
2016-02-23 01:10:49 +00:00
Ed Sanders 4810a7552e Keep JSON data as an object (not a string) until the last possible point
Conversion to wikitext string can all happen in one place, and tests
are cleaner.

Change-Id: I42adc454dad0dcbb33d9395f8ced0b07a6535fed
2016-02-23 01:10:39 +00:00
Ed Sanders 5c7f50de62 Show param label in list if available
It looks like this is how the code was originally intended,
but 'name' and 'key' are the same thing.

Move the key to the 'alias' list where CSS already exists to
colour it differently.

Change-Id: Ieade122633cec14203f7959121e9cd7250bb9f7a
2016-02-21 02:43:54 +00:00
Ed Sanders beaea898c2 Make main template param select widget drag/drop re-orderable
Not having two lists of all the parameters seems like a good idea.

Depends-On: I30d1f7f56230d73eb47ccbf9881c0b952b15bd89
Change-Id: I5b2ba39fb7b98fc50816f63bc4fbfc9fe25e02a5
2016-02-21 02:43:48 +00:00
Ed Sanders 4bb9bb317a Fix splice re-ordering when moving items forward
Bug: T127203
Change-Id: I91824a4dff3faf9fc401e4824e568df3e891ea3f
2016-02-20 17:48:34 +00:00
Ed Sanders 6ac0d165b1 Fix documentation
Change-Id: I8c12afd193679762439ed3b189a8474ccd5b4c03
2016-02-20 17:48:33 +00:00
Bartosz Dziewoński d9e70f4285 Use MenuOptionWidget rather than OptionWidget for MenuSelectWidget items
The current way surprisingly mostly works, but you're supposed to use
the matching class. This fixes some styling inconsistencies.

Change-Id: I3f8ce19b1f96cc051b7ac987fa211d1b5ee9cc71
2016-02-19 18:55:16 +00:00
jenkins-bot 56e191aacb Merge "Fix linting paths and resulting errors" 2016-02-19 18:29:01 +00:00
Ed Sanders 384c9af747 Update language search/result widget
Change-Id: I646d89aa1dddbd31577810f0a8a1d8ddbabe3baa
2016-02-19 10:26:17 -08:00
Ed Sanders ce3ce51558 Fix linting paths and resulting errors
Change-Id: Ib415d306124df53be085e358e7b868aa1ced9fd1
2016-02-19 17:48:51 +00:00
Ed Sanders 2ea0e0e475 Fix case of class names
Change-Id: I74214eac20a52a3fd1f2e520522fbb5527421a2d
2016-02-19 13:16:29 +00:00
jenkins-bot a2eb417304 Merge "Fix mw.TemplateData.SourceHandler.prototype.extractParametersFromTemplateCode return doc" 2016-01-26 03:36:26 +00:00
jenkins-bot ba2565dec3 Merge "Don't show warning about already-known parameters that weren't imported" 2016-01-26 02:27:39 +00:00
jenkins-bot a99d959959 Merge "Try to put TemplateData in an existing noinclude at bottom of the page" 2016-01-25 12:11:58 +00:00
Alex Monk 423bc5c33d Fix mw.TemplateData.SourceHandler.prototype.extractParametersFromTemplateCode return doc
Does not return a promise

Change-Id: I790fb92542abca9768d0e55cfe79906e22886c1d
2016-01-20 22:34:00 +00:00
Alex Monk d723905034 Don't show warning about already-known parameters that weren't imported
Bug: T124223
Change-Id: Id102799b925ebaec6a1d819f1d2294982c24e407
2016-01-20 22:29:45 +00:00
Alex Monk 317e9a9e84 Try to put TemplateData in an existing noinclude at bottom of the page
Bug: T96537
Change-Id: I947577179fa05c8f095906d6a36743c94dfc7b78
2016-01-18 21:51:19 +00:00
Alex Monk ebbec6ad1c Show message about related pages (e.g. /doc) as a warning, not an error
Bug: T103753
Change-Id: I31eb0e159aeb5154ce2b507e8dfe19db0c1e2dfd
2016-01-13 18:22:55 +00:00
jenkins-bot 4f081392f2 Merge "Prompt user to confirm closing modified TemplateData edit dialog" 2016-01-12 23:48:31 +00:00
Alex Monk 334b9661b0 Avoid adding an extra blank line before <noinclude>
Bug: T86917
Change-Id: I44209ca4549f6eb40f5ba5d94d81b59f8a75fa79
2016-01-12 18:47:53 +00:00
Alex Monk cc6487498b Prompt user to confirm closing modified TemplateData edit dialog
Depends on Ieaf19fe4485b679e0ee21d16f8f2e0693808f386 to take effect with the
escape key. Otherwise only handles the visible 'Cancel' button.

Bug: T106382
Change-Id: Ibc55727fd6a5becfe10b4e74cae5e573d110575d
2016-01-12 17:43:50 +00:00
jenkins-bot 5d30ef8ecf Merge "Use checkbox widgets instead of toggle widgets" 2015-11-13 22:06:32 +00:00
Ed Sanders c069153411 Display format icon and message inside parameters table caption
Change-Id: Id9d6620ed766645384d31c63aacd7c8167c1ce19
2015-11-13 12:35:07 -08:00
Ed Sanders 12e11515b1 Use checkbox widgets instead of toggle widgets
Change-Id: I3a11d07f4dae71ea5ff567046257e50890f5287c
2015-11-13 12:05:38 -08:00
Ed Sanders dbf9a85aa8 Add block/inline icons
Change-Id: I7d07af249318e4f39d8e4a29d1fa3ccdd216e63b
2015-11-13 19:36:26 +00:00
jenkins-bot 0ca4dc4621 Merge "Introduce new 'format' template property" 2015-11-11 23:56:03 +00:00
eranroz 01821eae64 Introduce new 'format' template property
Adding format data, which defines the preferred source format
to use when using templates.

Possible formats:
* Inline - all parameters in a single line
* Block - each parameter is in its own line

Bug: T64147
Change-Id: Id856c4a38890526060d0619432f06174d66f7792
2015-11-11 23:52:17 +00:00
James D. Forrester 94a3bc44e7 Fix two uses of now-removed OOUI mixin aliases
Change-Id: I84c3f72a05d17f0f404a0beadbea70720494794d
2015-10-28 16:05:27 +01:00
James D. Forrester 98fffb3d78 build: Upgrade various devDependencies to latest and make pass
* grunt-contrib-csslint: 0.4.0 -> 0.5.0
* grunt-banana-checker: 0.2.2 -> 0.4.0
* grunt-jscs: 1.8.0 -> 2.1.0

Change-Id: I3070938723648ef4e320d6abf88112b9c5a2b802
2015-10-06 17:24:40 -07:00
James D. Forrester 017fa53e65 Add a url type for URLs
Bug: T54880
Change-Id: I722fcbc957825c2aaea32d9350480d29a388bb68
2015-09-30 22:15:19 +00:00
James D. Forrester 62d3138216 Add a wiki-template-name type for template names
Bug: T88900
Change-Id: Ia1c87072f453df4b756de6725c4b3ab1dda84497
2015-09-17 12:28:11 -07:00
Ed Sanders 9f96761044 Dialog: Use a 'done' button on edit param page instead of 'back'
'Back' suggests that changes in the form won't be saved.

Change-Id: I0df0887caa6317393a3a891dd292aa4dc54cc32b
2015-09-14 12:25:22 +01:00
Ed Sanders fffb070355 Use ActionFieldLayout for 'Add parameter'
Change-Id: I0d69b689cabfa9bd3a503b39a08ec98028a7eca8
2015-09-13 19:50:58 +01:00
Ed Sanders 49165cc00a Fix language widget
Change-Id: I2fc6984d20863cbe54153fbd83530cbaca585cca
2015-09-13 19:50:57 +01:00
Ed Sanders 10775df785 Remove $ = this.$ from OOJSUI code
This feature was removed a while ago.

Change-Id: I2ae0147f9e605e0f86ea4d26e8c1eaba43db29e2
2015-09-13 16:51:19 +01:00
Ltrlg fdd0514024 Go back to using a configurable link for documentation
The message allows per-wiki configuration. The default target is better
for normal users of TemplateData than the previous hard-coded one and
has already been translated in some languages from when it was used
previously.

This also moves the messages dependencies from `ext.templateData` to
`ext.templateDataGenerator.ui`, which is the only module that uses
them: the correct strings were displayed only by inheritance.

Bug: T112011
Change-Id: I81ab684bb0ed9b0767df75635284c51129ac7000
2015-09-10 21:56:05 +00:00
James D. Forrester ac2c2f268e build: Switch from grunt-jscs-checker to grunt-jscs
Use the 'wikimedia' preset, and make pass.

Change-Id: I1923b391bf79cc0992eb02ebe64c969e08354b6f
2015-06-05 18:21:18 -07:00
Moriel Schottlender ec0467c65a Add an example property to parameters
The example is optional and can be translated.

Bug: T53049
Change-Id: I9e2d66a805e25409532a742521886233ce3de569
2015-04-09 19:23:42 +01:00
Moriel Schottlender ff77f32e38 [BREAKING CHANGE] Change "default" property to InterfaceText
Default should be InterfaceText and support languages.

Bug: T54966
Change-Id: I7be3a8be72df3e5d80300bd72fcd7197e43155aa
2015-04-02 08:53:51 +01:00
Purodha 4c8673bbdb TemplateData: add PLURAL to message Templatedata-modal-notice-import-numparams
See
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Templatedata-modal-errormsg-import-paramsalreadyexist/en

Change-Id: Ife5e9d0afd9320271c8921162487f8c0338f24cd
2015-03-26 21:39:29 +00:00
Moriel Schottlender 3820295f23 Reorganize api calls and add sourceHandler and error message
Add a sourceHandler that deals with all source-related actions
like fetching template source and validating the existing
TemplateData string.

Also add a MessageDialog warning the user in case the TemplateData
is invalid. In this case, the user will be given the option either
to correct the JSON by hand or to start the editor to replace the
existing TemplateData with a new one.

Bug: T91730
Bug: T91325
Change-Id: I4e6d04f02565a02d8dcf5c70a575ab6433caa27f
2015-03-18 18:21:02 +00:00
Moriel Schottlender 4141bed38b Prevent a dependent property from updating on infinite loops
A dependent and dependee properties should only update one another
once in the model, and the UI should be responsible for resetting
the input when it is toggled.

Bug: T92558
Change-Id: I944aaf9c44d0f305a34458f0b8009a98c9570661
2015-03-12 14:01:38 -07:00
Moriel Schottlender ffbc8e1520 TDG: Support optional text of 'deprecated' property
The deprecated property allows for either a boolean or text, so we
should allow the user to insert guidance text in case that property
is true. To achieve that, the model also defines 'textValue' for
boolean properties with text representation so an internal property can
be set to hold that value and inputs can be automatically built from the
property structure.

Bug: T90734
Change-Id: Iadc6abdcc0cf2721a311cf43847b306cb269b5e8
2015-03-11 17:08:26 +00:00
Bartosz Dziewoński a3ddde4a8f Don't flicker "Manage TemplateData" button's disabledness state
The code would call .setDisabled( true ), fire off an API request, and
then always call .setDisabled( false ) when the request finished,
regardless of the response.

Bug: T91324
Change-Id: Iee440a1fca966e0c66669ee5e78b6f5ab8f7f8d6
2015-03-07 20:20:32 +01:00
Timo Tijhof 3ecbaefef1 Document code with JSDuck
Change-Id: Ieb812a2fb85135f6db18a9a02c94efd83695a19e
2015-03-06 17:56:30 -08:00
Moriel Schottlender 3cc6afaa75 Use wikitext instead of page prop when checking for existing TemplateData
On the edit page, we show the user a message if a related page
(parent of /doc page, or vice versa) already has templatedata.

This check was wrongly detecting that the parent page has templatedata
when editing '/doc'. The check shouldn't use the 'templatedata' API
since that also includes transcluded templatedata.

Look in the wikitext content instead.

Change-Id: I9788e2beb0809ac3e676a90cd0dfe519c005afc9
2015-03-02 22:52:48 +00:00
Moriel Schottlender 9b3cf2b971 Delete boolean values if they are false
For values like 'deprecated', 'suggested' and 'required' make sure
that if they are marked as 'false' they are deleted from the result
string. If the original TemplateData already had either one of
those parameters marked as false don't delete so to avoid dirty
diffs.

Bug: T90283
Change-Id: I34c81d45e3967ce5398691d97d1a15908b8a2e57
2015-02-25 16:26:32 -08:00
Timo Tijhof 796e7b1a76 Correct jsduck documentation tags casing
Change-Id: Ic438492ea4e7060c3c5626ae9b5493f70cfb578e
2015-02-21 17:05:40 +00:00