a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. (function() {
  2. var LessPlugin;
  3. module.exports = LessPlugin = (function() {
  4. LessPlugin.identifier = 'less';
  5. LessPlugin.version = '1.0';
  6. function LessPlugin(window, host) {
  7. this.window = window;
  8. this.host = host;
  9. }
  10. LessPlugin.prototype.reload = function(path, options) {
  11. if (this.window.less && this.window.less.refresh) {
  12. if (path.match(/\.less$/i)) {
  13. return this.reloadLess(path);
  14. }
  15. if (options.originalPath.match(/\.less$/i)) {
  16. return this.reloadLess(options.originalPath);
  17. }
  18. }
  19. return false;
  20. };
  21. LessPlugin.prototype.reloadLess = function(path) {
  22. var link, links, _i, _len;
  23. links = (function() {
  24. var _i, _len, _ref, _results;
  25. _ref = document.getElementsByTagName('link');
  26. _results = [];
  27. for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  28. link = _ref[_i];
  29. if (link.href && link.rel.match(/^stylesheet\/less$/i) || (link.rel.match(/stylesheet/i) && link.type.match(/^text\/(x-)?less$/i))) {
  30. _results.push(link);
  31. }
  32. }
  33. return _results;
  34. })();
  35. if (links.length === 0) {
  36. return false;
  37. }
  38. for (_i = 0, _len = links.length; _i < _len; _i++) {
  39. link = links[_i];
  40. link.href = this.host.generateCacheBustUrl(link.href);
  41. }
  42. this.host.console.log("LiveReload is asking LESS to recompile all stylesheets");
  43. this.window.less.refresh(true);
  44. return true;
  45. };
  46. LessPlugin.prototype.analyze = function() {
  47. return {
  48. disable: !!(this.window.less && this.window.less.refresh)
  49. };
  50. };
  51. return LessPlugin;
  52. })();
  53. }).call(this);