Last active
December 20, 2015 05:29
-
-
Save eirikb/6078683 to your computer and use it in GitHub Desktop.
Komplett-sort 2000
This file contains 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
<p>Lagre som bookmarks/favoritter:</p> | |
<p> | |
<a href="javascript:$('div[class*=prod]').sort(function(a,b){function d(x){var d=$(x).find('.value').text().match(/\d+/);if(!d)return 0;return parseInt(d[0],10)};return d(b)-d(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)});">Komplettsalg - prosent</a> | |
</p> | |
<p> | |
<a href="javascript:$('div[class*=prod]').sort(function(a,b){function d(x,y){var d=$(x).find(y).text().replace(/\./g,'').match(/\d+/);return d?parseInt(d[0]):0}function dd(x){return d(x,'.priceBefore')-d(x,'.price')}return dd(b)-dd(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)});">Komplettsalg - prisforskjell</a> | |
</p> |
This file contains 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
$('div[class*=prod]').sort(function(a,b){function d(x){var d=$(x).find('.value').text().match(/\d+/);if(!d)return 0;return parseInt(d[0],10)};return d(b)-d(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)}); | |
$('div[class*=prod]').sort(function(a,b){function d(x,y){var d=$(x).find(y).text().replace(/\./g,'').match(/\d+/);return d?parseInt(d[0]):0}function dd(x){return d(x,'.priceBefore')-d(x,'.price')}return dd(b)-dd(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment