273:85331fa82c74
Anton Shestakov <av6@dwimlabs.net>, Sat, 31 Dec 2016 00:42:13 +0800
calls: add hangup button to video element itself

next change 291:923afdc60aaf
previous change 271:a015d1dba5cd

js/favicon.js

Permissions: -rw-r--r--

Other formats: Feeds:
// Generated by CoffeeScript 1.12.2
(function() {
var extend = 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; },
hasProp = {}.hasOwnProperty;
window.Tram.FaviconApp = (function(superClass) {
extend(FaviconApp, superClass);
function FaviconApp() {
return FaviconApp.__super__.constructor.apply(this, arguments);
}
FaviconApp.prototype.tagName = 'link';
FaviconApp.prototype.attributes = {
rel: 'icon',
type: 'image/x-icon'
};
FaviconApp.prototype.pipColors = Tram.colors.show;
FaviconApp.prototype.initialize = function() {
this.canvas = document.createElement('canvas');
this.canvas.height = 16;
this.canvas.width = 16;
this.listenTo(this.model, 'change', this.updateFavicon);
this.updateFavicon();
return this.render();
};
FaviconApp.prototype.updateFavicon = function() {
var color, ref;
color = (ref = this.pipColors[this.model.get('show')]) != null ? ref : this.pipColors['default'];
return this.renderFavicon(color);
};
FaviconApp.prototype.renderFavicon = function(color) {
var ctx;
ctx = this.canvas.getContext('2d');
ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
ctx.fillStyle = color;
ctx.beginPath();
ctx.arc(8, 8, 5.5, 0, Math.PI * 2);
ctx.fill();
return this.el.href = this.canvas.toDataURL();
};
FaviconApp.prototype.render = function() {
$('head').append(this.el);
return this;
};
return FaviconApp;
})(Backbone.View);
}).call(this);
//# sourceMappingURL=favicon.js.map