Guest User

Untitled

a guest
Jun 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Groupon.refreshCSS = function() {
  2. var i,a,s;
  3. a=document.getElementsByTagName('link');
  4. for(i=0;i<a.length;i++){
  5. s=a[i];
  6. if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href) {
  7. var h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');
  8. s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf())
  9. }
  10. }
  11. }
  12. //start sass watch command like this
  13. //sass --watch public/stylesheets/sass:public/stylesheets --load-path public/stylesheets/sas- load-path public/stylesheets/sass/base --load-path --load-path public/stylesheets/sass/base --load-path public/stylesheets/sass/app/shared --debug-info --require lib/sass_extensions.rb --require lib/asset_fingerprint_cache.rb
  14.  
  15. $(document).observe('focus', function(e){
  16. Groupon.refreshCSS();
  17. });
  18. //
  19. $(document).observe('keydown', function(e){
  20. // // mapped to ctrl + R, but feel free to change it if you want
  21. if(e.keyCode == 82 && e.ctrlKey)
  22. Groupon.refreshCSS();
  23. });
Add Comment
Please, Sign In to add comment