Skip to content

Instantly share code, notes, and snippets.

@tlxue
Created May 16, 2012 13:39
Show Gist options
  • Save tlxue/2710397 to your computer and use it in GitHub Desktop.
Save tlxue/2710397 to your computer and use it in GitHub Desktop.
reverse ClassName
javascript:(function(){function fuckThemAll(a){var b;for(var c in a){b=document.querySelectorAll("."+a[c]);if(!!b){for(var d=0;d<b.length;d++){b[d].className+=" "+c;b[d].setAttribute("data-map",!b[d].getAttribute("data-map")?classMapping[c]+":"+c:b[d].getAttribute("data-map")+" "+classMapping[c]+":"+c)}}}}function request(){var a=new XMLHttpRequest;a.open("GET",mappingURL,false);a.send(null);return a.responseText}var mappingURL="http://"+window.location.hostname+"/static/js/v2/c/sybols.js?2",mapping;mapping=request();mapping="window.classMapping ="+mapping.slice(mapping.indexOf("{"),mapping.lastIndexOf("}")+1);eval(mapping);fuckThemAll(classMapping)})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment