Skip to content

Instantly share code, notes, and snippets.

@jackjennings
Created September 15, 2014 23:15
Show Gist options
  • Save jackjennings/0c2f4677bf7c76fb9ff3 to your computer and use it in GitHub Desktop.
Save jackjennings/0c2f4677bf7c76fb9ff3 to your computer and use it in GitHub Desktop.
ST Code Block
SirTrevor.Blocks.Code = SirTrevor.Blocks.Text.extend
type: 'code'
title: 'HTML'
formattable: false
hasTextBlock: false
editorHTML: '<div class="st-required st-text-block st-code-block" contenteditable="true"></div>'
toData: ->
@setData
html: @$el.find('.st-code-block').html()
loadData: (data) ->
@$el.find('.st-code-block').html data?.html
onContentPasted: ->
# Do nothing...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment