User:逆襲的天邪鬼/Twinkle-lzh/twinklewarn.js: Difference between revisions
Content added Content deleted
No edit summary |
mNo edit summary |
||
Line 146: | Line 146: | ||
Twinkle.warn.callbacks = { |
Twinkle.warn.callbacks = { |
||
getWarningWikitext: function(templateName, article, reason |
getWarningWikitext: function(templateName, article, reason) { |
||
var text = "{{subst:" + templateName; |
var text = "{{subst:" + templateName; |
||
Line 154: | Line 154: | ||
} |
} |
||
if (reason |
if (reason) { |
||
// we assume that custom warnings lack a {{{2}}} parameter |
// we assume that custom warnings lack a {{{2}}} parameter |
||
text += "|2=" + reason; |
text += "|2=" + reason; |
||
Line 168: | Line 168: | ||
templatetext = Twinkle.warn.callbacks.getWarningWikitext(templatename, linkedarticle, |
templatetext = Twinkle.warn.callbacks.getWarningWikitext(templatename, linkedarticle, |
||
form.reason.value |
form.reason.value); |
||
form.previewer.beginRender(templatetext); |
form.previewer.beginRender(templatetext); |
||
Line 200: | Line 200: | ||
} |
} |
||
text += Twinkle.warn.callbacks.getWarningWikitext(params.sub_group, params.article, |
text += Twinkle.warn.callbacks.getWarningWikitext(params.sub_group, params.article, |
||
params.reason |
params.reason) + "--~~~~"; |
||
if ( Twinkle.getPref('showSharedIPNotice') && Morebits.isIPAddress( mw.config.get('wgTitle') ) ) { |
if ( Twinkle.getPref('showSharedIPNotice') && Morebits.isIPAddress( mw.config.get('wgTitle') ) ) { |