comparison annotator_files/lib/notification.js @ 4:6979313586cf

new version of annotator.
author casties
date Mon, 27 Aug 2012 19:05:38 +0200
parents 6356e78ccf5c
children
comparison
equal deleted inserted replaced
3:6356e78ccf5c 4:6979313586cf
1 // Generated by CoffeeScript 1.3.3
1 var Annotator, 2 var Annotator,
2 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, 3 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
3 __hasProp = Object.prototype.hasOwnProperty, 4 __hasProp = {}.hasOwnProperty,
4 __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; }; 5 __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; };
5 6
6 Annotator = Annotator || {}; 7 Annotator = Annotator || {};
7 8
8 Annotator.Notification = (function(_super) { 9 Annotator.Notification = (function(_super) {
9 10
23 } 24 }
24 }; 25 };
25 26
26 function Notification(options) { 27 function Notification(options) {
27 this.hide = __bind(this.hide, this); 28 this.hide = __bind(this.hide, this);
28 this.show = __bind(this.show, this); Notification.__super__.constructor.call(this, $(this.options.html).appendTo(document.body)[0], options); 29
30 this.show = __bind(this.show, this);
31 Notification.__super__.constructor.call(this, $(this.options.html).appendTo(document.body)[0], options);
29 } 32 }
30 33
31 Notification.prototype.show = function(message, status) { 34 Notification.prototype.show = function(message, status) {
32 if (status == null) status = Annotator.Notification.INFO; 35 if (status == null) {
36 status = Annotator.Notification.INFO;
37 }
33 $(this.element).addClass(this.options.classes.show).addClass(this.options.classes[status]).escape(message || ""); 38 $(this.element).addClass(this.options.classes.show).addClass(this.options.classes[status]).escape(message || "");
34 setTimeout(this.hide, 5000); 39 setTimeout(this.hide, 5000);
35 return this; 40 return this;
36 }; 41 };
37 42