1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

modified 'Text' file view/edit

This commit is contained in:
llj
2012-12-03 11:34:32 +08:00
parent 5131879f57
commit a40e947d5c
6 changed files with 68 additions and 31 deletions

View File

@@ -2,7 +2,6 @@
{% load i18n %}
{% if filetype == 'Text' %}
{% ifnotequal file_content None %}
$('#file-view').css('background', '#fff');
var editor = CodeMirror.fromTextArea($('#docu-view')[0], {
{% include 'snippets/editor_set_mode.html' %}
theme: 'default',
@@ -10,12 +9,13 @@
{% if fileext != 'txt' and fileext != 'text' %}
lineNumbers: true,
{% endif %}
lineWrapping: true,
readOnly: true
});
{% endifnotequal %}
{% if err %}
$('#file-view').html('<p class="error">{{ err }}</p>').addClass('file-view-tip');
$('#file-view').html('<div class="CodeMirror"><p class="error file-view-tip">{{ err }}</p></div>');
{% endif %}
{% endif %}