Sha256: 185bb8b2f28d0ccbf253f780b49c25a25adc6b419cc57ed5a2a524ecf7d6d629

Contents?: true

Size: 1.97 KB

Versions: 2

Compression:

Stored size: 1.97 KB

Contents

o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1388436950.021667:@value"{{I"
class:EFI"BundledAsset;FI"logical_path;FI"mercury/history_buffer.js;FI"
pathname;FI"˜/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/mercury-6daffeeb487e/app/assets/javascripts/mercury/history_buffer.js.coffee;FI"content_type;FI"application/javascript;FI"
mtime;FI"2013-11-20T08:09:45-05:00;FI"length;FiSI"digest;F"%bab9d6fb9d1c99a7e9d04494ee7ad79aI"source;FI"S(function() {

  this.Mercury.HistoryBuffer = (function() {

    function HistoryBuffer(maxLength) {
      this.maxLength = maxLength != null ? maxLength : 200;
      this.index = 0;
      this.stack = [];
      this.markerRegExp = /<em class="mercury-marker"><\/em>/g;
    }

    HistoryBuffer.prototype.push = function(item) {
      if (jQuery.type(item) === 'string') {
        if (this.stack[this.index] && this.stack[this.index].replace(this.markerRegExp, '') === item.replace(this.markerRegExp, '')) {
          return;
        }
      } else if (jQuery.type(item) === 'object' && item.html) {
        if (this.stack[this.index] && this.stack[this.index].html === item.html) {
          return;
        }
      }
      this.stack = this.stack.slice(0, this.index + 1);
      this.stack.push(item);
      if (this.stack.length > this.maxLength) {
        this.stack.shift();
      }
      return this.index = this.stack.length - 1;
    };

    HistoryBuffer.prototype.undo = function() {
      if (this.index < 1) {
        return null;
      }
      this.index -= 1;
      return this.stack[this.index];
    };

    HistoryBuffer.prototype.redo = function() {
      if (this.index >= this.stack.length - 1) {
        return null;
      }
      this.index += 1;
      return this.stack[this.index];
    };

    return HistoryBuffer;

  })();

}).call(this);
;FI"required_assets_digest;F"%98a42a54e0510269974fe8c825f73cb5I"
_version;F"%6776f581a4329e299531e1d52aa59832

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wafflemix-0.0.6 test/dummy/tmp/cache/assets/D6C/C20/sprockets%2F05f40d5981e1a80f6a8029c2a5b8ffea
wafflemix-0.0.5 test/dummy/tmp/cache/assets/D6C/C20/sprockets%2F05f40d5981e1a80f6a8029c2a5b8ffea