Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2013 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5676378 to your computer and use it in GitHub Desktop.
Save anonymous/5676378 to your computer and use it in GitHub Desktop.
Kodepad Gist Share by gokmen on http://koding.com Author: http://gokmen.koding.com
class Markdown extends JView
constructor:->
super cssClass : 'markdown',
markdown : "Type some *markdown* here!"
@textInput = new KDInputView
bind : "keyup"
type : "textarea"
defaultValue : @data.markdown
keyup : @bound 'updateData'
updateData:->
@data.markdown = @textInput.getValue()
@render()
pistachio:->
"""
<h3>Input</h3>
{{> @textInput}}
<h3>Output</h3>
{{KD.utils.applyMarkdown(#(markdown))}}
"""
appView.addSubView new Markdown
.markdown {
background-color : #eee;
width : auto;
height : auto;
padding : 10px;
margin : 20px;
border : 1px solid #ccc;
}
.markdown h3 {
margin-bottom: 10px;
margin-top: 10px;
}
.markdown textarea {
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment