Skip to content

Commit

Permalink
See #56. Work on MessageView UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Sep 8, 2014
1 parent 1130b58 commit 05ee8f2
Showing 1 changed file with 57 additions and 5 deletions.
62 changes: 57 additions & 5 deletions lib/message-view.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{View} = require "atom"
{$, $$, $$$, View} = require "atom"

module.exports =
class MessageView extends View
messages: []
@content: ->
@div
class: 'atom-beautify message-panel', =>
Expand All @@ -13,17 +14,68 @@ class MessageView extends View
@div class: 'btn-toolbar pull-right', =>
@button
class: 'btn'
click: 'close'
'Close'
click: 'clearMessages'
'Clear'
@span
class: 'text-error'
class: ''
outlet: 'title'
'Atom Beautify Message'
@div
class: "panel-body padded"
class: "panel-body padded select-list"
outlet: 'body'
=>
@ol
class: 'list-group',
outlet: 'messageItems'
=>
@li class: 'two-lines', =>
@div class: 'status status-removed icon icon-diff-added', ''
@div class: 'primary-line icon icon-alert', 'This is the title'
@div class: 'secondary-line no-icon', 'Secondary line'
@li class: 'two-lines', =>
@div class: 'status status-removed icon icon-diff-added', ''
@div class: 'primary-line icon icon-alert', 'This is the title Currently there is no way to display a message to the user, such as errors or warnings or deprecation notices (see #40). Let\'s put a little overlay on the top for displaying such information.'
@div class: 'secondary-line no-icon', 'This is the title Currently there is no way to display a message to the user, such as errors or warnings or deprecation notices (see #40). Let\'s put a little overlay on the top for displaying such information.'
@li class: 'two-lines', =>
@div class: 'status status-removed icon icon-diff-added', ''
@div class: 'primary-line icon icon-alert', 'test'
@div class: 'secondary-line no-icon', 'Secondary line'
@li class: 'two-lines', =>
@div class: 'status status-removed icon icon-diff-added', ''
@div class: 'primary-line icon icon-alert', 'This is the title'
@div class: 'secondary-line no-icon', 'Secondary line'
@li class: 'two-lines', =>
@div class: 'status status-removed icon icon-diff-added', ''
@div class: 'primary-line icon icon-alert', 'This is the title'
@div class: 'secondary-line no-icon', 'Secondary line'
@li class: 'two-lines', =>
@div class: 'status status-added icon icon-diff-added', ''
@div class: 'primary-line icon icon-file-text', 'Primary line'
@div class: 'secondary-line no-icon', 'Secondary line'

constructor: ->
super

destroy: ->

addMessage: (message) =>
@messages.push(message);
@refresh()

clearMessages: =>
@messages = []
@refresh()

close: (event, element) =>
@detach()

show: =>
if not @.hasParent()
atom.workspaceView.appendToTop @

refresh: =>
# If the messages list is empty, view should be closed.
if @messages.length is 0
@close()
else
@show()

0 comments on commit 05ee8f2

Please sign in to comment.