User:Gabriele Nunzio Tornetta/monobook.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
//var source = document.editform.wpTextbox1.value |
//var source = document.editform.wpTextbox1.value |
||
var client = new XMLHttpRequest(); |
var client = new XMLHttpRequest(); |
||
client.open('GET', 'http://en.wikipedia.org/enwiki/w/index.php?title=' + document.getElementById("firstHeading").innerHTML + '&action=edit', false); |
|||
client.open('GET', 'http://en.wikipedia.org/enwiki/w/index.php?title=' + document.getElementById("firstHeading").innerHTML + '&action=edit'); |
|||
client.send(); |
client.send(); |
||
alert(client.getResponseHeader("Content-Type")); |
|||
var src = client.responseXML |
var src = client.responseXML |
||
var win = document.open() |
var win = document.open() |
||
alert(src); |
|||
win.document.write(src); |
win.document.write(src); |
||
win.document.close(); |
win.document.close(); |
Revision as of 12:31, 9 August 2011
// My scripts.
addOnloadHook(
function () {
addPortletLink('p-coll-print_export', "javascript:doTeXify()", "TeXify", "coll-texify", "Produces a LaTeX document out of the current article");
}
);
function doTeXify() {
//var source = document.editform.wpTextbox1.value
var client = new XMLHttpRequest();
client.open('GET', 'http://en.wikipedia.org/enwiki/w/index.php?title=' + document.getElementById("firstHeading").innerHTML + '&action=edit', false);
client.send();
alert(client.getResponseHeader("Content-Type"));
var src = client.responseXML
var win = document.open()
win.document.write(src);
win.document.close();
}