MediaWiki:Gadget-friendlytalkback.js: Difference between revisions

v2.0-689-g073eb2e: talkback: Add {{please see}}; protect: Make tag expiry work for PC protection. Update protection templates; warn: Use {{{2}}} parameter for extra message; morebits: use wgRelevantUserName to get user
imported>Amalthea
(v2.0-675-gf30bb99: welcome: Add {{welcometest}}; talkback: Add AFC help desk talkbacks)
imported>Amalthea
(v2.0-689-g073eb2e: talkback: Add {{please see}}; protect: Make tag expiry work for PC protection. Update protection templates; warn: Use {{{2}}} parameter for extra message; morebits: use wgRelevantUserName to get user)
Line 16:
Twinkle.talkback = function() {
 
if ( !mw.config.get('wgRelevantUserName') ) {
if ( Morebits.getPageAssociatedUser() === false ) {
return;
}
Line 24:
 
Twinkle.talkback.callback = function( ) {
if( Morebitsmw.getPageAssociatedUserconfig.get('wgRelevantUserName') === mw.config.get("wgUserName") && !confirm("Is it really so bad that you're talking back to yourself?") ){
return;
}
Line 50:
label: "Talkback: other page",
value: "other"
},
{
label: "\"Please see\"",
value: "see"
},
{
Line 105 ⟶ 109:
 
if ($el.length) {
Twinkle.talkback.optout = Morebitsmw.getPageAssociatedUserconfig.get('wgRelevantUserName') + " prefers not to receive talkbacks";
var url = $el.text();
if (url.indexOf("reason=") > -1) {
Line 287 ⟶ 291:
label:"Subject of email (optional)",
tooltip:"The subject line of the email you sent."
});
break;
case "see":
work_area.append({
type:"input",
name:"page",
label:"Full page name",
tooltip:"The full page name of where the discussion is being held. For example: 'Wikipedia talk:Twinkle'.",
value: prev_page
});
work_area.append({
type:"input",
name:"section",
label:"Linked section (optional)",
tooltip:"The section heading where the discussion is being held. For example: 'Merge proposal'.",
value: prev_section
});
break;
Line 311 ⟶ 331:
var page = null;
var section = e.target.section.value;
var fullUserTalkPageName = mw.config.get("wgFormattedNamespaces")[ mw.config.get("wgNamespaceIds").user_talk ] + ":" + Morebitsmw.getPageAssociatedUserconfig.get('wgRelevantUserName');
 
if( tbtarget === "usertalk" || tbtarget === "other" || tbtarget === "see" ) {
page = e.target.page.value;
Line 402 ⟶ 422:
 
talkpage.setEditSummary("Notification: You've got mail" + Twinkle.getPref("summaryAd"));
 
} else if ( tbtarget === "see" ) {
text = "\n\n{{subst:Please see|location=" + tbPageName;
if (section) {
text += "#" + section;
}
text += "|more=" + message.trim() + "}}";
talkpage.setEditSummary("Please check the discussion at [[" + tbPageName + "#" + section + "]]" + Twinkle.getPref("summaryAd"));
} else {
//clean talkback heading: strip section header markers, were erroneously suggested in the documentation
Anonymous user