This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var NUMBER_GROUPS = /(-?\d*\.?\d+)/g; | |
var naturalSort = function (a, b) { | |
var aa = String(a).split(NUMBER_GROUPS), | |
bb = String(b).split(NUMBER_GROUPS), | |
min = Math.min(aa.length, bb.length); | |
for (var i = 0; i < min; i++) { | |
var x = parseFloat(aa[i]) || aa[i].toLowerCase(), | |
y = parseFloat(bb[i]) || bb[i].toLowerCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: remove spaces and newlines | |
javascript:(function(){ | |
s=document.createElement('script'); | |
s.type='text/javascript'; | |
s.src='http://example.com/bookmarklet.js'; | |
document.body.appendChild(s); | |
})(); | |
// TODO: bookmarklet code needs to be in an anchor tag | |
// <a href="javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='http://example.com/bookmarklet.js';document.body.appendChild(s);})();">My Bookmarklet</a> |
NewerOlder