brandon (owner)

Fork Of

Forks

Revisions

gist: 223062 Download_button fork
public
Public Clone URL: git://gist.github.com/223062.git
Embed All Files: show embed
JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// easy refresh-css keybinding to alt-w
// alt-r was taken in IE, so consider this a CSS Weefresh
 
// original code from http://paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/
$(document).keyup(function(e){
  if (e.which == 87 && e.altKey) {
    $('link').each(function() {
      if((/stylesheet/i).test(this.rel) && this.href) {
        var href = this.href.replace(/(&|\?)forceReload=\d+/,'');
        this.href = href + ((/\?/).test(href) ? '&' : '?' ) + 'forceReload=' + new Date;
      }
    });
  }
});