mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-14 19:31:44 +00:00
PortableInfoboxBuilder: Force "Template:" prefix on publishing (#53)
This commit is contained in:
parent
c934b05a49
commit
5ef16a60b6
|
@ -245,13 +245,15 @@
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
} ).done( ( title ) => {
|
} ).done( ( title ) => {
|
||||||
if ( title === null || title.trim() === "" ) {
|
if ( title === null || title.trim() === '' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let namespace = ( title.substring( 0, 9 ) !== 'Template:' ? 'Template:' : '' );
|
||||||
|
|
||||||
this.api.postWithToken( 'csrf', {
|
this.api.postWithToken( 'csrf', {
|
||||||
action: 'edit',
|
action: 'edit',
|
||||||
title: title,
|
title: namespace + title,
|
||||||
text: this.getInfoboxMarkup(),
|
text: this.getInfoboxMarkup(),
|
||||||
summary: this.msg( 'editsummary' ),
|
summary: this.msg( 'editsummary' ),
|
||||||
notminor: true,
|
notminor: true,
|
||||||
|
|
Loading…
Reference in a new issue