This commit is contained in:
seaweedchan 2013-05-04 05:04:01 -07:00
parent 2b439207e4
commit ee26f90b63
4 changed files with 18 additions and 24 deletions

View File

@ -111,6 +111,7 @@
__slice = [].slice,
__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; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Config = {
@ -1360,12 +1361,10 @@
})();
Notification = (function() {
var add, close;
function Notification(type, content, timeout) {
this.timeout = timeout;
this.add = add.bind(this);
this.close = close.bind(this);
this.close = __bind(this.close, this);
this.add = __bind(this.add, this);
this.el = $.el('div', {
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
});
@ -1383,7 +1382,7 @@
return this.el.className = "notification " + type;
};
add = function() {
Notification.prototype.add = function() {
if (d.hidden) {
$.on(d, 'visibilitychange', this.add);
return;
@ -1397,7 +1396,7 @@
}
};
close = function() {
Notification.prototype.close = function() {
return $.rm(this.el);
};

View File

@ -111,6 +111,7 @@
__slice = [].slice,
__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; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Config = {
@ -1356,12 +1357,10 @@
})();
Notification = (function() {
var add, close;
function Notification(type, content, timeout) {
this.timeout = timeout;
this.add = add.bind(this);
this.close = close.bind(this);
this.close = __bind(this.close, this);
this.add = __bind(this.add, this);
this.el = $.el('div', {
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
});
@ -1379,7 +1378,7 @@
return this.el.className = "notification " + type;
};
add = function() {
Notification.prototype.add = function() {
if (d.hidden) {
$.on(d, 'visibilitychange', this.add);
return;
@ -1393,7 +1392,7 @@
}
};
close = function() {
Notification.prototype.close = function() {
return $.rm(this.el);
};

View File

@ -92,7 +92,8 @@
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__slice = [].slice,
__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; };
__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; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Config = {
main: {
@ -1358,12 +1359,10 @@
})();
Notification = (function() {
var add, close;
function Notification(type, content, timeout) {
this.timeout = timeout;
this.add = add.bind(this);
this.close = close.bind(this);
this.close = __bind(this.close, this);
this.add = __bind(this.add, this);
this.el = $.el('div', {
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
});
@ -1381,7 +1380,7 @@
return this.el.className = "notification " + type;
};
add = function() {
Notification.prototype.add = function() {
if (d.hidden) {
$.on(d, 'visibilitychange', this.add);
return;
@ -1395,7 +1394,7 @@
}
};
close = function() {
Notification.prototype.close = function() {
return $.rm(this.el);
};

View File

@ -1,8 +1,5 @@
class Notification
constructor: (type, content, @timeout) ->
@add = add.bind @
@close = close.bind @
@el = $.el 'div',
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
@el.style.opacity = 0
@ -17,7 +14,7 @@ class Notification
setType: (type) ->
@el.className = "notification #{type}"
add = ->
add: =>
if d.hidden
$.on d, 'visibilitychange', @add
return
@ -27,5 +24,5 @@ class Notification
@el.style.opacity = 1
setTimeout @close, @timeout * $.SECOND if @timeout
close = ->
close: =>
$.rm @el