chargify / docs.chargify.com

Chargify Documentation
http://docs.chargify.com
14 stars 13 forks source link

Add list of CSS Classes and IDs on signup pages. #119

Closed wsmoak closed 9 years ago

wsmoak commented 9 years ago

This was generated by the following snippet added to Custom JavaScript on a Public Signup Page.

Inspired by: http://stackoverflow.com/a/19916118

$(document).ready(function(){
   var footer = $("#footer");
   var all = document.getElementsByTagName("*");
   var the_classes = {};
   var the_ids = {};

for (var i = 0, max = all.length; i < max; i++) {
    if (all[i].className !== '') {
        the_classes[all[i].className] = 1;
    }
    if (all[i].id !== '') {
        the_ids[all[i].id] = 1;
    }
}

  footer.append("<br/><h3>Classes</h3><br/>");

  $.each(the_classes, function (key, element) {
    footer.append(key + '<br/>');
  });

  footer.append("<br/><h3>IDs</h3><br/>");

  $.each(the_ids, function (key, element) {
    footer.append(key + '<br/>');
  });
})