mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 23:29:49 +00:00
added func: source file edit
This commit is contained in:
36
templates/snippets/editor_set_mode.html
Normal file
36
templates/snippets/editor_set_mode.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{% if fileext = 'html' or fileext == 'xhtml' or fileext == 'htm' %}
|
||||
editor.session.setMode('ace/mode/html');
|
||||
{% endif %}
|
||||
{% if fileext = 'css' %}
|
||||
editor.session.setMode('ace/mode/css');
|
||||
{% endif %}
|
||||
{% if fileext = 'java' %}
|
||||
editor.session.setMode('ace/mode/java');
|
||||
{% endif %}
|
||||
{% if fileext = 'js' %}
|
||||
editor.session.setMode('ace/mode/javascript');
|
||||
{% endif %}
|
||||
{% if fileext = 'c' or fileext == 'cpp' or fileext == 'cc' %}
|
||||
editor.session.setMode('ace/mode/c_cpp');
|
||||
{% endif %}
|
||||
{% if fileext = 'tex' %}
|
||||
editor.session.setMode('ace/mode/latex');
|
||||
{% endif %}
|
||||
{% if fileext = 'pl' %}
|
||||
editor.session.setMode('ace/mode/perl');
|
||||
{% endif %}
|
||||
{% if fileext = 'php' %}
|
||||
editor.session.setMode('ace/mode/php');
|
||||
{% endif %}
|
||||
{% if fileext = 'py' %}
|
||||
editor.session.setMode('ace/mode/python');
|
||||
{% endif %}
|
||||
{% if fileext = 'rb' %}
|
||||
editor.session.setMode('ace/mode/ruby');
|
||||
{% endif %}
|
||||
{% if fileext = 'sh' %}
|
||||
editor.session.setMode('ace/mode/sh');
|
||||
{% endif %}
|
||||
{% if fileext = 'xml' %}
|
||||
editor.session.setMode('ace/mode/xml');
|
||||
{% endif %}
|
Reference in New Issue
Block a user