Commits

offbyone committed d0c32ef

Admins differ by subsite

Comments (0)

Files changed (2)

    "description": "Navigate users' comments in Metafilter threads.",
    "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrDGYnlMRmIXKM/pXltEIVm5u+uToRY4TkPeZ5NUTO7EWMVhAQPnSOeRS22xZ5ueR06QDNIMZcNrqok16Bf4J/3k7rTWaGSOXzCHjEBB+Qft2pdu2senVSmFPRtb+b+NFolO1O9IPGDQF+Ip0SFc1oNUIak82Gzv450iUEylcopQIDAQAB",
    "name": "MeFi Navigator",
-   "version": "1.0.1"
+   "version": "1.0.2"
 }
 // @include       http://metafilter.com/*
 // ==/UserScript==
 if (/.*metafilter\.com\/(\d{1,7}\/|mefi\/|comments\.mefi).*/.test(window.location)) {
-	var mfn_admins = ["mathowie", "jessamyn", "cortex", "pb"]; // no vacapinta: http://metatalk.metafilter.com/17990/#665968
+        var mfn_admins = {
+            'metatalk' : ["mathowie", "jessamyn", "cortex", "pb"],
+            'ALL' : ["mathowie", "jessamyn", "cortex", "pb", "restless_nomad", "vacapinta"]
+        }
 	var mfn_poster;
 	var mfn_all = [];
 	var mfn_div = document.createElement("div");
 		return false;
 	} else {
 		var j = cookie.indexOf(';',i);
-		if (j == -1) j=cookie.length; 
+		if (j == -1) j=cookie.length;
 		return unescape(cookie.substring(i+10,j));
 	}
 }
+
+function mfn_get_admins() {
+    if (mfn_metatalk)
+        return mfn_admins['metatalk'];
+
+    return mfn_admins['ALL'];
+}
+
 function mfn_main() {
 	var elements = document.evaluate('//div[@class="comments" or @class="copy"]/span[@class="smallcopy"]',document.body,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
 	mfn_poster = elements.snapshotItem(0).getElementsByTagName('a').item(0).textContent.toString();
 			if (author == mfn_poster && i > 0) {
 				mfn_all[author][i].getElementsByTagName('a').item(0).appendChild(mfn_posterNode.cloneNode(true));
 			}
-			if (mfn_admins.indexOf(author) != -1) {
+			if (mfn_get_admins().indexOf(author) != -1) {
 				mfn_all[author][i].getElementsByTagName('a').item(0).appendChild(mfn_adminNode.cloneNode(true));
 			}
 			if (lim==1) {