tinyib/js/tinyib.js
2014-08-22 23:10:10 -07:00

21 lines
500 B
JavaScript

function quotePost(postID){
var message_element = document.getElementById("message");
if (message_element){
message_element.focus();
message_element.value += '>>' + postID + "\n";
}
return false;
}
document.addEventListener('DOMContentLoaded', function() {
if(window.location.hash){
if(window.location.hash.match(/^#q[0-9]+$/i) !== null){
var quotePostID = window.location.hash.match(/^#q[0-9]+$/i)[0].substr(2);
if (quotePostID != ''){
quotePost(quotePostID);
}
}
}
});