User:Writ Keeper/Scripts/teahouseTalkbackLink.js: Difference between revisions

Content deleted Content added
use mw.api
rm span
 
(4 intermediate revisions by the same user not shown)
Line 11:
{
var $link = $($nodeList[i]);
var newLinkString = "<span class='reply-link-wrapper'>|";
var redlink = false;
var newLinkHref = $link[0].title
Line 21:
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 href="#' + newLinkHref + '" style="font-size:x-small; display:inline-block;" title="Send a talkback!" noPopup=1 id="' + newLinkId + '">TB</a>|</span>';
$($link).after(newLinkString)
$("#" + newLinkId).click(function{"page":newLinkHref, (e"redlink":redlink}, talkbackSubmit);
{
talkbackSubmit($(this).attr('href').substr(1), redlink)
});
}
}
}
}
function talkbackSubmit(page, redlinkevent)
{
var page = event.data.page;
var redlink = event.data.redlink;
var questionTitle = prompt("Please enter the title of the question you're replying to (or just leave it blank):", ""),
sectionTitle = "{{Wikipedia:Teahouse/Teahouse talkback|WP:Teahouse|";
Line 64 ⟶ 63:
else
{
alert('There was an error requesting the page editcreate. Code: ' + data);
}
}).fail(function(data) {
alert('There was an error using AJAX to editcreate the page. Error: ' + data);
});
}
Line 92 ⟶ 91:
}
}).fail(function(data) {
alert('There was an error using AJAX to edit the page. Error: ' + data);
});
}