var Annotator, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; }; Annotator = Annotator || {}; Annotator.Notification = (function(_super) { __extends(Notification, _super); Notification.prototype.events = { "click": "hide" }; Notification.prototype.options = { html: "
", classes: { show: "annotator-notice-show", info: "annotator-notice-info", success: "annotator-notice-success", error: "annotator-notice-error" } }; function Notification(options) { this.hide = __bind(this.hide, this); this.show = __bind(this.show, this); Notification.__super__.constructor.call(this, $(this.options.html).appendTo(document.body)[0], options); } Notification.prototype.show = function(message, status) { if (status == null) status = Annotator.Notification.INFO; $(this.element).addClass(this.options.classes.show).addClass(this.options.classes[status]).escape(message || ""); setTimeout(this.hide, 5000); return this; }; Notification.prototype.hide = function() { $(this.element).removeClass(this.options.classes.show); return this; }; return Notification; })(Delegator); Annotator.Notification.INFO = 'show'; Annotator.Notification.SUCCESS = 'success'; Annotator.Notification.ERROR = 'error'; $(function() { var notification; notification = new Annotator.Notification; Annotator.showNotification = notification.show; return Annotator.hideNotification = notification.hide; });