From 4579e4c95b626b82b322ab5886f81bdc7278312e Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 20 Oct 2020 18:46:21 +0500 Subject: [PATCH] codemirror: html support --- filemanager/filemanager.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index dd8db3256..c6ef1c0ff 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -10,7 +10,7 @@ from filemanager.models import Trash class FileManager: - modes = {'php': 'application/x-httpd-php', 'javascript': 'javascript', 'python': 'text/x-python'} + modes = {'php': 'application/x-httpd-php', 'javascript': 'javascript', 'python': 'text/x-python', 'html': 'text/html'} def __init__(self, request, data): self.request = request @@ -18,13 +18,14 @@ class FileManager: @staticmethod def findMode(fileName): - if fileName.endswith('.php'): return FileManager.modes['php'] elif fileName.endswith('js'): return FileManager.modes['javascript'] elif fileName.endswith('.py'): return FileManager.modes['python'] + elif fileName.endswith('.html'): + return FileManager.modes['html'] @staticmethod def findModeFiles(mode): @@ -73,6 +74,29 @@ class FileManager: return """ """ + elif mode == 'text/html': + return """ + + + + + + + + + + +""" @staticmethod def findThemeFile(theme):