This commit is contained in:
parent
a80eeeb5ab
commit
7888cc1101
|
@ -0,0 +1,53 @@
|
|||
<%= javascript_include_tag 'baiduTemplate', 'jquery.datetimepicker.js' %>
|
||||
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
||||
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
||||
|
||||
<form action="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/file_update?path=<%= @path %>" method="post" id="file_update_id" data-remote="true">
|
||||
<li class="clearfix" xmlns="http://www.w3.org/1999/html" style="height: 700px">
|
||||
<textarea class = "" id="challenge-answer" name="content">
|
||||
<%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %>
|
||||
</textarea>
|
||||
<script>
|
||||
var text = document.getElementById("challenge-answer");
|
||||
</script>
|
||||
</li>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-answer"), {
|
||||
mode: {name: 'text/x-java',
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#challenge-answer').val(cMirror.getValue());
|
||||
});
|
||||
var web_h = window.innerHeight;
|
||||
$(document).ready(function(){
|
||||
if($.browser.msie) {
|
||||
$(".CodeMirror").css("height", web_h * 0.825 + "px");
|
||||
}
|
||||
else if($.browser.safari)
|
||||
{
|
||||
$(".CodeMirror").css("height", web_h * 0.825 + "px");
|
||||
}
|
||||
else if($.browser.mozilla)
|
||||
{
|
||||
$(".CodeMirror").css("height", web_h * 0.825 + "px");
|
||||
}
|
||||
else if($.browser.opera) {
|
||||
$(".CodeMirror").css("height", web_h * 0.825 + "px");
|
||||
}else if($.browser.chrome){
|
||||
if(window.navigator.userAgent.indexOf("MetaSr") == -1){
|
||||
$(".CodeMirror").css("height", web_h * 0.835 + "px");
|
||||
}else{
|
||||
$(".CodeMirror").css("height", web_h * 0.825 + "px");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -1,4 +1,4 @@
|
|||
$("#file_entry_content").html('<%= escape_javascript(render :partial => 'games/file_edit_form') %>');
|
||||
$("#file_entry_content_inner").html('<%= escape_javascript(render :partial => 'games/file_edit_form') %>');
|
||||
$("#file_entry_content_inner").html('<%= escape_javascript(render :partial => 'games/extend_file_edit_form') %>');
|
||||
$("#sava_edit_btn1").show();
|
||||
$("#sava_edit_btn").show();
|
Loading…
Reference in New Issue