-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #22. Add interface for User to select (force) Renderer.
See #47. Start implementing SpacePen support.
- Loading branch information
Showing
9 changed files
with
271 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{View} = require 'atom' | ||
|
||
module.exports = | ||
class OptionsView extends View | ||
@content: -> | ||
@div => | ||
@div | ||
class: 'overlay from-top' | ||
=> | ||
@div class: "tool-panel panel-bottom", => | ||
@div class: "inset-panel", => | ||
@div class: "panel-heading", => | ||
@div class: 'btn-toolbar pull-right', => | ||
@button | ||
class: 'btn' | ||
click: 'close' | ||
'Close' | ||
@span 'Preview Options' | ||
@div | ||
class: "panel-body padded" | ||
=> | ||
@div "HAWT BODYYYY" | ||
@button | ||
class: 'btn btn-primary inline-block-tight' | ||
click: 'selectRenderer' | ||
'Select Renderer' | ||
|
||
|
||
initialize: (@previewView) -> | ||
|
||
attach: => | ||
@previewView.editorContents.append @ | ||
@previewView.hideMessage() | ||
toggle: => | ||
if @hasParent() | ||
@detach() | ||
else | ||
@attach() | ||
close: (event, element) => | ||
@detach() | ||
|
||
selectRenderer: => | ||
console.log 'Select Renderer!' | ||
@previewView.selectRenderer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{SelectListView} = require 'atom' | ||
renderers = require './renderer' | ||
|
||
module.exports = | ||
class SelectRendererView extends SelectListView | ||
initialize: (@previewView)-> | ||
super | ||
@addClass('overlay from-top') | ||
grammars = Object.keys renderers.grammars | ||
@setItems(grammars) | ||
@focusFilterEditor() | ||
|
||
viewForItem: (item) -> | ||
"<li>#{item}</li>" | ||
|
||
confirmed: (item) -> | ||
console.log("#{item} was selected") | ||
@previewView.renderPreviewWithRenderer item | ||
# Close | ||
@detach() | ||
|
||
attach: => | ||
@previewView.editorContents.append @ | ||
@previewView.hideMessage() | ||
toggle: => | ||
if @hasParent() | ||
@detach() | ||
else | ||
@attach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.