diff --git a/templates/repo_edit_file.html b/templates/repo_edit_file.html index ebb05bd923..9ca49c0f94 100644 --- a/templates/repo_edit_file.html +++ b/templates/repo_edit_file.html @@ -2,7 +2,7 @@ {% load seahub_tags %} {% block main_panel %} -

{{ u_filename }}

+

编辑 {{ u_filename }}

当前路径: @@ -24,10 +24,10 @@

文件内容读取中...

-
+
-
+


@@ -57,6 +57,7 @@ $.ajax({ $('#docu-view').css({'position': 'relative', 'height': editor.session.getScreenLength() * parseInt($('#docu-view').css('line-height'))}); editor.session.setScrollLeft(0); // make bottom scrollbar start from the left-most editor.resize(); // fix some problem for showing some file in ie8 + $('#file-edit-form').removeClass('hide'); }, error: function(xhr, ajaxOptions, thrownError) { var jsonVal = jQuery.parseJSON(xhr.responseText); @@ -64,6 +65,10 @@ $.ajax({ } }); +$('#file-edit-commit-msg').css('color', '#666').click(function() { + $(this).val('').css('color', '#000'); + }); + $('#file-edit-form').submit(function() { $(this).find('[name="modified-file"]').val(editor.session.getValue()); }); diff --git a/views.py b/views.py index ad18722469..3f2a2f1bd4 100644 --- a/views.py +++ b/views.py @@ -883,15 +883,12 @@ def repo_file_get(request, repo_id): data = json.dumps({'error': err}) return HttpResponse(data, status=400, content_type=content_type) else: - # l, d = [], {} try: u_content = content.decode('utf-8') except: # XXX: file in windows is encoded in gbk u_content = content.decode('gbk') from django.utils.html import escape - # d['content'] = escape(u_content) - # l.append(d) data = json.dumps({'content': u_content}) return HttpResponse(data, status=200, content_type=content_type) @@ -934,7 +931,6 @@ def repo_file_edit(request, repo_id): token = '' if access_to_repo(request, repo_id, ''): - # Get a token to visit file token = gen_token() seafserv_rpc.web_save_access_token(token, repo_id, obj_id, 'view', request.user.username)