Sha256: 18f1fc3ed2b15a4d946675f04f7a75bd2f9801796f7e61ebb0d7b8f29aa18b34

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

// Based on http://www.germanforblack.com/javascript-sleeping-keypress-delays-and-bashing-bad-articles
Function.prototype.only_every = function (millisecond_delay) {
  if (!window.only_every_func) {
    var function_object = this;
    window.only_every_func = setTimeout(function() {
      function_object();
      window.only_every_func = null;
    }, millisecond_delay);
  }
};

// http://www.ivanuzunov.net/top-10-javascript-stringprototype-extensions/
String.prototype.endsWith = function(t, i) {
  if (i===false) {
    return (t == this.substring(this.length - t.length));
  } else {
    return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase());
  }
};

// jQuery extensions
jQuery.prototype.any = function(callback) {
  return (this.filter(callback).length > 0);
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enki-engine-0.0.5 app/assets/javascripts/common.js