mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-13 01:01:34 -05:00
16 lines
483 B
CoffeeScript
16 lines
483 B
CoffeeScript
|
RootView = require 'views/core/RootView'
|
||
|
|
||
|
module.exports = class MarkdownResourceView extends RootView
|
||
|
id: 'markdown-resource-view'
|
||
|
template: require 'templates/teachers/markdown-resource-view'
|
||
|
initialize: (options, @name) ->
|
||
|
super(options)
|
||
|
@content = ''
|
||
|
$.get '/markdown/' + @name + '.md', (data) =>
|
||
|
if data.indexOf('<!doctype html>') is -1
|
||
|
@content = marked(data, sanitize: false)
|
||
|
else
|
||
|
@content = "<h1>Not Found</h1>"
|
||
|
|
||
|
@render()
|