{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"2teaspoon/base/reporters/html/progress_view.js; FI"
pathname; FI"p/Users/jejacks0n/Projects/teaspoon/app/assets/javascripts/teaspoon/base/reporters/html/progress_view.coffee; FI"content_type; FI"application/javascript; FI"
mtime; Fl+Qú½QI"length; FiîI"digest; F"%3c14485eff65c9756e1e21664f7c1769I"source; FI"î(function() {
var _ref, _ref1, _ref2,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Teaspoon.Reporters.HTML.ProgressView = (function(_super) {
__extends(ProgressView, _super);
function ProgressView() {
_ref = ProgressView.__super__.constructor.apply(this, arguments);
return _ref;
}
ProgressView.create = function(displayProgress) {
if (displayProgress == null) {
displayProgress = true;
}
if (!displayProgress) {
return new Teaspoon.Reporters.HTML.ProgressView();
}
if (Teaspoon.Reporters.HTML.RadialProgressView.supported) {
return new Teaspoon.Reporters.HTML.RadialProgressView();
} else {
return new Teaspoon.Reporters.HTML.SimpleProgressView();
}
};
ProgressView.prototype.build = function() {
return this.el = this.createEl("div", "teaspoon-indicator modeset-logo");
};
ProgressView.prototype.update = function() {};
return ProgressView;
})(Teaspoon.Reporters.BaseView);
Teaspoon.Reporters.HTML.SimpleProgressView = (function(_super) {
__extends(SimpleProgressView, _super);
function SimpleProgressView() {
_ref1 = SimpleProgressView.__super__.constructor.apply(this, arguments);
return _ref1;
}
SimpleProgressView.prototype.build = function() {
this.el = this.createEl("div", "simple-progress");
return this.el.innerHTML = "0%\n";
};
SimpleProgressView.prototype.update = function(total, run) {
var percent;
percent = total ? Math.ceil((run * 100) / total) : 0;
return this.setHtml("progress-percent", "" + percent + "%");
};
return SimpleProgressView;
})(Teaspoon.Reporters.HTML.ProgressView);
Teaspoon.Reporters.HTML.RadialProgressView = (function(_super) {
__extends(RadialProgressView, _super);
function RadialProgressView() {
_ref2 = RadialProgressView.__super__.constructor.apply(this, arguments);
return _ref2;
}
RadialProgressView.supported = !!document.createElement("canvas").getContext;
RadialProgressView.prototype.build = function() {
this.el = this.createEl("div", "teaspoon-indicator radial-progress");
return this.el.innerHTML = "\n0%";
};
RadialProgressView.prototype.appendTo = function() {
var canvas, e;
RadialProgressView.__super__.appendTo.apply(this, arguments);
this.size = 80;
try {
canvas = this.findEl("progress-canvas");
canvas.width = canvas.height = canvas.style.width = canvas.style.height = this.size;
this.ctx = canvas.getContext("2d");
this.ctx.strokeStyle = "#fff";
return this.ctx.lineWidth = 1.5;
} catch (_error) {
e = _error;
}
};
RadialProgressView.prototype.update = function(total, run) {
var half, percent;
percent = total ? Math.ceil((run * 100) / total) : 0;
this.setHtml("progress-percent", "" + percent + "%");
if (!this.ctx) {
return;
}
half = this.size / 2;
this.ctx.clearRect(0, 0, this.size, this.size);
this.ctx.beginPath();
this.ctx.arc(half, half, half - 1, 0, Math.PI * 2 * (percent / 100), false);
return this.ctx.stroke();
};
return RadialProgressView;
})(Teaspoon.Reporters.HTML.ProgressView);
}).call(this);
; TI"dependency_digest; F"%e77c03159e9d7cac8153ba772aff2d41I"required_paths; F[I"p/Users/jejacks0n/Projects/teaspoon/app/assets/javascripts/teaspoon/base/reporters/html/progress_view.coffee; FI"dependency_paths; F[{I" path; FI"p/Users/jejacks0n/Projects/teaspoon/app/assets/javascripts/teaspoon/base/reporters/html/progress_view.coffee; FI"
mtime; FI"2013-06-16T11:48:01-06:00; FI"digest; F"%53c443ced8da34a4cb607f9378d7729cI"
_version; F"%7097359102b3db973d6242ce2db779ef