User:Frenchwhale/monobook.js

/* from Gracenotes */

/* code's in messy state, TODO pull it all together */

/* $( addTabForCheck ); function addTabForCheck { if (wgNamespaceNumber >= 0) { addPortletLink('p-cactions', "javascript:checkChange", "check changes", 'ca-checkchange', 'Check if this page has been modified since you loaded it'); } else if (wgPageName == 'Special:Contributions') { addPortletLink('p-cactions', "javascript:checkContribChange", "check changes", 'ca-checkchange', 'Check if the user has edited another page since this page loaded'); } } var infoXML, goodRev; function checkChange { if ( wgIsArticle ) var query = { 'action': 'query', 'prop': 'revisions', 'titles': wgPageName, 'rvlimit': 1, 'rvprop': 'content', 'rvstartid': goodRev.getAttribute( 'revid' ), 'format': 'xml' }	Status.debug( 'query:' + query.toSource ); infoXML = sajax_init_object; infoXML.overrideMimeType('text/xml'); infoXML.onreadystatechange = tehXMLPage; infoXML.open('GET',wgServer+wgScriptPath+ '/api.php?action=query&prop=revisions&rvprop=timestamp|user|content&rvlimit=1'); infoXML.send(null); } function tehXMLPage { if (infoXML.readyState != 4 ) { return; }  if (infoXML.status != 200 ) { return; } if(!(goodRev= revertXML.responseXML.documentElement)) { return; } var name = goodRev.getElementsByTagName('rev').user; var tstamp = goodRev.getElementsByTagName('rev').timestamp; } //regex used to determine presence of query string, from Lupin's pop ups function query_get(paramName) { var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)'); var h=document.location; var m; if (m=cmdRe.exec(h)) { try { return unescape(m[1]); } catch (someError) {} } return null; };