User:Qwerfjkl/scripts/talkback.js: Difference between revisions

Content deleted Content added
No edit summary
remove titles with / [Factotum]
 
(5 intermediate revisions by the same user not shown)
Line 2:
function talkbackLink() {
if ($("#mw-content-text").length > 0) {
var $nodeList = $('a[title^="User talk:"]').filter("a:not([title*='\/'])"),
pdne = ' (page does not exist)';
if ($nodeList !== null) {
Line 17:
var newLinkId = "TBsubmit" + i;
newLinkString += '<a href=' + (($link[0].href).replace("User_talk:", "Special:Contributions/")) + ' style="font-size:x-small; display:inline-block;">C</a>|';
newLinkString += '<a style="font-size:x-small; display:inline-block;" title="Send a talkback!" noPopup=1 id="' + newLinkId + '" href= "'+($link[0].href)+'">TB</a>'; // add href so there is a link to the userpage just before the timestamp
$($link).after(newLinkString);
$("#" + newLinkId).click({
"page": newLinkHref,
"redlink": redlink
}, talkbackSubmitfunction (event); {
event.preventDefault(); // prevent href being followed
talkbackSubmit(event)
});
}
}
Line 31 ⟶ 34:
var page = event.data.page;
var redlink = event.data.redlink;
var questionTitle = prompt("Please enter the title of the section you're replying to (or just leave it blank):", "").trim().replace(/^(Wikipedia|User|Template|Draft|Help|Module|MediaWiki).+?#/, ''),
sectionTitle = "{{Talkback|" + mw.config.get('wgPageName').replace(/_/g, ' ') + "|";