initial coffeescript support. No proper highlighting of executing parts and errors are not displayed inline

This commit is contained in:
Dominik Kundel 2014-03-28 14:42:08 +01:00
parent 35a16b47ff
commit 267d033997
4 changed files with 8 additions and 8 deletions

View file

@ -62,7 +62,7 @@ module.exports = class EditorConfigModal extends View
@aceConfig.behaviors = @$el.find('#tome-behaviors').prop('checked') @aceConfig.behaviors = @$el.find('#tome-behaviors').prop('checked')
me.set 'aceConfig', @aceConfig me.set 'aceConfig', @aceConfig
Backbone.Mediator.publish 'tome:change-config' Backbone.Mediator.publish 'tome:change-config'
Backbone.Mediator.publish 'tome:change-language' unless @aceConfig.language is oldLanguage Backbone.Mediator.publish 'tome:change-language' unless @aceConfig.language isnt oldLanguage
me.save() me.save()
destroy: -> destroy: ->

View file

@ -85,7 +85,7 @@ module.exports = class Spell
aether.hasChangedSignificantly (newSource ? @originalSource), (currentSource ? @source), true, true aether.hasChangedSignificantly (newSource ? @originalSource), (currentSource ? @source), true, true
createAether: (thang) -> createAether: (thang) ->
aceConfig = me.get 'aceConfig' ? {} aceConfig = me.get('aceConfig') ? {}
aetherOptions = aetherOptions =
problems: problems:
jshint_W040: {level: "ignore"} jshint_W040: {level: "ignore"}
@ -110,7 +110,7 @@ module.exports = class Spell
aether aether
updateLanguageAether: -> updateLanguageAether: ->
aceConfig = me.get 'aceConfig' ? {} aceConfig = me.get('aceConfig') ? {}
for thangId, spellThang of @thangs for thangId, spellThang of @thangs
spellThang.aether?.setLanguage (aceConfig.language ? 'javascript') spellThang.aether?.setLanguage (aceConfig.language ? 'javascript')
spellThang.castAether = null spellThang.castAether = null

View file

@ -17,7 +17,7 @@ module.exports = class SpellView extends View
editModes: editModes:
'javascript': 'ace/mode/javascript' 'javascript': 'ace/mode/javascript'
'coffeescript': 'ace/mode/coffeescript' 'coffeescript': 'ace/mode/coffee'
keyBindings: keyBindings:
'default': null 'default': null
@ -567,14 +567,14 @@ module.exports = class SpellView extends View
@ace.setValue pretty @ace.setValue pretty
onChangeEditorConfig: (e) -> onChangeEditorConfig: (e) ->
aceConfig = me.get 'aceConfig' aceConfig = me.get('aceConfig') ? {}
@ace.setDisplayIndentGuides aceConfig.indentGuides # default false @ace.setDisplayIndentGuides aceConfig.indentGuides # default false
@ace.setShowInvisibles aceConfig.invisibles # default false @ace.setShowInvisibles aceConfig.invisibles # default false
@ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default'] @ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default']
@aceSession.setMode @editModes[aceConfig.language ? 'javascript'] # @aceSession.setMode @editModes[aceConfig.language ? 'javascript']
onChangeLanguage: (e) -> onChangeLanguage: (e) ->
aceConfig = me.get 'aceConfig' aceConfig = me.get('aceConfig') ? {}
@aceSession.setMode @editModes[aceConfig.language ? 'javascript'] @aceSession.setMode @editModes[aceConfig.language ? 'javascript']
dismiss: -> dismiss: ->

View file

@ -218,7 +218,7 @@ module.exports = class TomeView extends View
Backbone.Mediator.publish 'tome:cast-spells', spells: @spells Backbone.Mediator.publish 'tome:cast-spells', spells: @spells
updateLanguageForAllSpells: -> updateLanguageForAllSpells: ->
spell.updateLanguageAether for spellKey, spell of @spells spell.updateLanguageAether() for spellKey, spell of @spells
destroy: -> destroy: ->
spell.destroy() for spellKey, spell of @spells spell.destroy() for spellKey, spell of @spells