Skip to content

Instantly share code, notes, and snippets.

@markjames
Created April 19, 2013 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markjames/96a7f6c272fa32a31e44 to your computer and use it in GitHub Desktop.
Save markjames/96a7f6c272fa32a31e44 to your computer and use it in GitHub Desktop.
if(!(window.jQuery)) {
var s = document.createElement('script');s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');s.setAttribute('type', 'text/javascript');
s.onload = function() {
var s = document.createElement('script');s.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.0.0/moment.min.js');s.setAttribute('type', 'text/javascript');
s.onload = function() {
var s = document.createElement('script');s.setAttribute('src', 'https://raw.github.com/padolsey/jQuery-Plugins/master/sortElements/jquery.sortElements.js');s.setAttribute('type', 'text/javascript');
s.onload = function() {
jQuery('tr td.achievements .additional').each(function(){jQuery(this).parents('tr').append('<td data-time="'+moment(jQuery(this).text().replace(/[\S\s]*?Since/g,'').trim(),'M/D/YY h:mmA').unix()+'">'+moment(jQuery(this).text().replace(/[\S\s]*?Since/g,'').trim(),'M/D/YY h:mmA').format('YYYY-MMM-DD HH:mm')+'</td>');});
jQuery('table.real.achievements td[data-time]').sortElements(function(a, b){return jQuery(a).data('time') - jQuery(b).data('time');},function(){return this.parentNode;});
};
document.getElementsByTagName('head')[0].appendChild(s);
}
document.getElementsByTagName('head')[0].appendChild(s);
}
document.getElementsByTagName('head')[0].appendChild(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment