Commit graph

8 commits

Author SHA1 Message Date
Trevor Parscal de48c88ee3 Use template data for new templates and fix alias bug
Objectives:

* Use template data for templates added to a transclusion using
  the list controls
* Cache template data between different instances of the dialog
* Allow placeholders to be replaced with templates asynchronously
* Save http request and abort pending requests on close

Also:
* Fix breakage of (unused) method getParameterAliases
  (dont delete aliases)
* Remove unused method getTemplateSpec.

Bug: 49778
Change-Id: I391e51cb900ef5560455d6f3d4d2a8b99ed2b034
2013-06-28 23:34:58 +00:00
Trevor Parscal e60c357cfa ve.dm.MWTemplateSpecModel: Implement getParameterOrigin
Change-Id: I5970cbefd8eba9afcf37dff90d0f2a72b4bd7627
2013-06-28 15:07:15 -07:00
Timo Tijhof 49179c7c31 ve.dm.MWTemplateSpecModel: Expand parameter aliases
We were previously ignoring this data leading to situations
where a template that can be invoked like {{foo|1=bar}} and
{{foo|thing=bar}} (where the template data documents param
thing with alias '1') will show up in the editor with no
parameter information or label for the 1= call, but will show
up for the thing= call.

Now they are properly aliases so both will appear the same
in the editor dialog.

Bug: 49838
Change-Id: I37ec0e152df905844ac58ed1834fca29dccb4eec
2013-06-23 17:25:52 -07:00
Trevor Parscal ece74379de Transclusion editor template naming goodness
"Template" parts should be labeled with a normalized version of what you would actually write inside a set of curly brackets.

Change-Id: I4b9c541a01da86cb078d38012e5a9fead2fa233c
2013-06-18 18:33:58 -07:00
Roan Kattouw c027b43d04 Improve template title normalization logic
Only remove the namespace prefix if it's in the template namespace,
and prepend a colon for main namespace titles.

Change-Id: Ie910bae172274e36c7c9a675a631a0876ff13ed1
2013-06-18 17:09:46 -07:00
Trevor Parscal 1ee10790e9 Don't show Template: in the outline for template items
1. It's redundant and ugly.
2. We already have an icon.
3. It's unnatural for anyone used to working with templates.

Change-Id: I821e124158a14679e411324620dc9d7c40252383
2013-06-18 23:49:14 +00:00
Ed Sanders dcbea2328c Code style fix: @return -> @returns
Change-Id: I26daca6313bf09055af8f980ba0065782257fd54
2013-06-17 11:50:24 +01:00
Trevor Parscal d3a2fab2c4 Transclusion editing
Objectives:

* Rename just about every use of "template" to "transclusion"
* Make a proper data structure for transclusions
* Abstract away template data
* Use more template data in the user interface
* Allow adding parameters
* Allow removing templates, parameters and content

Changes:

ve.ui.Dialog.css
* Add rule to place add param controls on a single line

ve.ui.MWTemplateDialogs.js
* Move template spec loading into transclusion class
* Add remove button for parts and parameters
* Add parameter adding form
* Use template data for labels and descriptions

ve.dm.*
* Add new transclusion data structures

*.php
* Add links to new files

*.*
* Rename all things "template" to "transclusion"

Bug: 39598
Bug: 49403
Change-Id: I3bcf924a3e179cb65f19e833277a39dfd3dad8bd
2013-06-12 16:39:13 -07:00