MediaWiki:Gadget-FDVEDiagramLink.js: Difference between revisions
Warn loudly if the VE classes are missing instead of failing silently |
Remove the dead "Change which diagram is shown" link: the transclusion dialog is empty for a parser function, so it was a false affordance |
||
| Line 159: | Line 159: | ||
FDDiagramContextItem.prototype.renderBody = function () { | FDDiagramContextItem.prototype.renderBody = function () { | ||
var | var page = diagramPageFromModel( this.model ), | ||
url = this.getDiagramEditUrl(), | url = this.getDiagramEditUrl(), | ||
$edit | $edit; | ||
if ( !page || !url ) { | if ( !page || !url ) { | ||
| Line 178: | Line 177: | ||
ve.setAttributeSafe( $edit[ 0 ], 'href', url, '#' ); | ve.setAttributeSafe( $edit[ 0 ], 'href', url, '#' ); | ||
// | // Deliberately the only control here. There was also a "Change which | ||
// diagram is | // diagram is shown" link that fell through to the stock transclusion | ||
// dialog, but that dialog is empty for this node: #display_diagram is a | |||
// parser function, so the diagram page is part of the target string | |||
// rather than a parameter, and VE sources its parameter list from | |||
// TemplateData, which a parser function has none of. It looked | |||
// actionable and was not. To point an article at a different diagram, | |||
// edit the page source - it is one obvious line of wikitext. | |||
this.$body.empty().append( $( '<div>' ).append( $edit ) ); | |||
this.$body.empty().append( | |||
}; | }; | ||