Show More
Commit Description:
merge with algo and add brython files that were missing
Commit Description:
merge with algo and add brython files that were missing
References:
File last commit:
Show/Diff file:
Action:
app/assets/javascripts/sources.js.coffee
| 32 lines
| 938 B
| text/coffeescript
| CoffeeScriptLexer
|
r564 | # Place all the behaviors and hooks related to the matching controller here. | |||
# All this logic will automatically be available in application.js. | ||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||||
$ -> | ||||
$("#live_submit").on "click", (event) -> | ||||
h = $("#editor_text") | ||||
e = ace.edit("editor") | ||||
h.val(e.getValue()) | ||||
r565 | ||||
$("#language_id").on "change", (event) -> | ||||
text = $("#language_id option:selected").text() | ||||
mode = 'ace/mode/c_cpp' | ||||
switch text | ||||
when 'Pascal' then mode = 'ace/mode/pascal' | ||||
when 'C++','C' then mode = 'ace/mode/c_cpp' | ||||
when 'Ruby' then mode = 'ace/mode/ruby' | ||||
when 'Python' then mode = 'ace/mode/python' | ||||
when 'Java' then mode = 'ace/mode/java' | ||||
editor = ace.edit('editor') | ||||
editor.getSession().setMode(mode) | ||||
e = ace.edit("editor") | ||||
e.setValue($("#text_haha").val()) | ||||
e.gotoLine(1) | ||||
$("#language_id").trigger('change') | ||||
return | ||||