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

Content deleted Content added
m aaaahhhhh
m test
Line 16:
{
var link = nodeList[i];
if((link.href.substring(28,39)var targetNameStart == "/User_talk:" && link.href.lastIndexOfsearch("/User_talk") == 28));
var targetNameEnd = link.href.search(/[#&]/);
var targetName;
if(targetNameStart < 0)
{
i++continue;
var newLink = document.createElement("form");
newLink.style.display = "inline-block";
newLink.method = "post";
newLink.action = link.href + "?action=submit&section=new";
newLink.id = "TBSubmit" + i;
newLink.innerHTML = '|<a href="#" onclick="talkbackSubmit(' + i + '); return;" style="font-size:x-small;" title="Send a talkback!">TB</a>|';
addAfter(newLink, link);
i++;
}
if(targetNameEnd > 0)
else if(link.href.substring(42,52) == "User_talk:" && link.href.lastIndexOf("/") == 25)
{
targetName = link.href.substring(targetNameStart, targetNameEnd);
}
else
{
targetName = link.href.substring(targetNameStart);
}
if(targetName.search("/") > 0)
{
continue;
}
var newLink = document.createElement("form");
newLink.style.display = "inline-block";
newLink.method = "post";
newLink.action = wgServer link.href.substring(0,+ link.href.search("&/wiki/")) + targetName + "&?action=submit&section=new";
newLink.id = "TBSubmit" + i;
newLink.innerHTML = '|<a href="#" onclick="talkbackSubmit(' + i + '); return;" style="font-size:x-small;" title="Send a talkback!">TB</a>|';