Sha256: 77ed30345d900f786c691a2ddea3ed8149aa4ac36ae46b74118ceb2c41f61813

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 KB

Contents

(function() {
  var StatusDisplay;

  StatusDisplay = (function() {
    StatusDisplay.prototype.status_history = [];

    StatusDisplay.prototype.waiting_statuses = [];

    StatusDisplay.prototype.max_statuses = 10;

    function StatusDisplay(ws, target) {
      this.ws = ws;
      this.target = target;
      console.log("Setting up status bar at " + this.target);
      this.target.click((function(_this) {
        return function() {
          return _this.show_history();
        };
      })(this));
    }

    StatusDisplay.prototype.show_status = function(data) {
      this.target.html(this.ws.escape(data.text, data));
      this.status_history.push(data);
      return console.log(this.status_history);
    };

    StatusDisplay.prototype.show_history = function() {
      var item, message;
      console.log(this.status_history);
      message = "<ul>" + (((function() {
        var i, len, ref, results;
        ref = this.status_history;
        results = [];
        for (i = 0, len = ref.length; i < len; i++) {
          item = ref[i];
          results.push("<li>" + (this.ws.escape(item.text, item)) + "</li>");
        }
        return results;
      }).call(this)).join("\n")) + "</ul>";
      $('#dialog > #message').html(message);
      $('#dialog').show();
      return $('#dialog > #ok').click(function() {
        return $('#dialog').hide();
      });
    };

    return StatusDisplay;

  })();

  window.StatusDisplay = StatusDisplay;

}).call(this);

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flammarion-0.0.10 lib/html/build/javascripts/status.js
flammarion-0.0.9 lib/html/build/javascripts/status.js
flammarion-0.0.8 lib/html/build/javascripts/status.js
flammarion-0.0.7 lib/html/build/javascripts/status.js
flammarion-0.0.6 lib/html/build/javascripts/status.js