Jump to content

User:JackSchmidt/chick.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JackSchmidt (talk | contribs) at 18:03, 19 December 2007 (step 1 of recentchanges combiner (just drafting)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Lupin/popups.js');
importScript('User:Lupin/recent2.js');

importScript('User:JackSchmidt/JS Ajax.js');
importScript('User:JackSchmidt/JS_UserWatch.js');
importScript('User:JackSchmidt/JS Watchlist.js');
// importScript('User:JackSchmidt/JS CatWatch.js');
importScript('User:JackSchmidt/JS FDG.js');

function ParseXML(xml_as_text) {
  return (new DOMParser()).parseFromString(xml_as_text, "text/xml");
}

function ParseXSLT(xslt_as_txt) {
  var xslt_as_xml = ParseXML(xslt_as_txt);
  var xsltProcessor = new XSLTProcessor();
  xsltProcessor.importStylesheet(xslt_as_xml);
  return { transform: function(xml) { try { return xsltProcessor.transformToDocument(xml); } catch(e) { alert('Failed to transform doc: ' + e ); } } }
}

var JS_XSLT;
function GotRcl( id, rcl_as_txt ) {
  var rcl_as_xml = ParseXML( rcl_as_txt );
  rcl_as_xml = JS_XSLT.transform( rcl_as_xml );
  rcl_as_txt = (new XMLSerializer()).serializeToString(rcl_as_xml);
  alert( rcl_as_txt );
}
function GotXslt( id, xslt ) {
  JS_XSLT = ParseXSLT(xslt);
  JS_INDEX( {title:"Special:Recentchangeslinked/Category:Group_theory"}, "snagrcl", GotRcl );
}

addOnloadHook( function () { 
//  addPortletLink('p-cactions',"javascript:JS_CatWatch.AddThemAll()",
//    "CatWatch", "ca-catwatch", "Add 'Watch By Category' buttons");
  JS_UserWatch.MakeButton("KathrynLybarger","kat");
  JS_UserWatch.MakeButton("Michael_Slone","mps");
  JS_UserWatch.MakeButton("JackSchmidt","jack");
  JS_INDEX( {title:"User:JackSchmidt/ParseRecentChanges.xslt.xml",action:"raw"}, "snagxslt", GotXslt );
});

// importScript('User:ais523/editcount.js'); //[[User:ais523/editcount.js]]