UNPKG

atom-message-panel

Version:

An easy way to display your messages in Atom

44 lines (34 loc) 837 B
"use strict"; var View = require('atom-space-pen-views').View, inherits = require('./utils').inherits; var PlainMessageView = function (params) { this.message = params.message; this.raw = params.raw || false; this.className = params.className || undefined; View.apply(this, arguments); }; inherits(PlainMessageView, View); PlainMessageView.content = function () { this.div({ class: 'plain-message' }); }; PlainMessageView.prototype.initialize = function () { if (this.raw) { this.html(this.message); } else { this.text(this.message); } if (this.className) { this.addClass(this.className); } }; PlainMessageView.prototype.getSummary = function () { return { summary: this.message, className: this.className, rawSummary: this.raw, }; }; module.exports = PlainMessageView;