User:Casper2k3/Javascript/userwelcomebutton.js

// addOnloadHook(function { //Add the links  if (location.href.indexOf("&action=edit&issuewelcome=") == -1) return; //Are we here to issue a welcome?  //Get new welcome  welcomeRegExp = /&action=edit&issuewelcome=(.*)/;  welcome = welcomeRegExp.exec(location.href)[1];  //Modify the form document.getElementById('wpSummary').value = "Welcome message:  by Casper2k3 (WP:RCP)"; document.getElementById('wpTextbox1').value +=  "\n --~" + "~" + "~" + "~"; document.getElementById('editform').submit;

});

addOnloadHook(function { //Add the links  if (location.href.indexOf("&action=edit&issuewelcomenosign=") == -1) return; //Are we here to issue a welcome?  //Get new welcome  welcomeRegExp = /&action=edit&issuewelcomenosign=(.*)/;  welcome = welcomeRegExp.exec(location.href)[1];  //Modify the form document.getElementById('wpSummary').value = "Welcome message:  by Casper2k3 (WP:RCP)"; document.getElementById('wpTextbox1').value +=  "\n"; document.getElementById('editform').submit;

});

addOnloadHook(function { //Add the links  if (location.href.indexOf("&action=edit&issuewelcomenamed=") == -1) return; //Are we here to issue a welcome?  //Get new welcome  welcomeRegExp = /&action=edit&issuewelcomenamed=(.*)/; var urlArticle = prompt("What is article name?"); if(urlArticle == "" || urlArticle == null){ alert ("You didn't enter the name of the page! Warning cancelled.") return; }  welcome = welcomeRegExp.exec(location.href)[1];  //Modify the form document.getElementById('wpSummary').value = "Welcome message:  by Casper2k3 (WP:RCP)"; document.getElementById('wpTextbox1').value +=  "\n --~" + "~" + "~" + "~"; document.getElementById('editform').submit;

});

var welcomeUrl = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issuewelcome="; var welcomeUrlNoSign = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issuewelcomenosign="; var welcomeUrlNamed = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issuewelcomenamed=";

function userWelcomeButton{ document.getElementById('jsArticleMessageBox').innerHTML = ' [General]: Anon (+ ) - Standard (+ ) '; }; //