codemirror: python, php, javascript support

This commit is contained in:
Usman Nasir
2020-10-19 00:05:47 +05:00
parent e092f5afe6
commit baf17748e4
5 changed files with 140 additions and 1638 deletions

View File

@@ -66,11 +66,12 @@ fileManager.controller('editFileCtrl', function ($scope, $http, $window) {
var cm = new CodeMirror.fromTextArea(document.getElementById("fileContent"), {
lineNumbers: true,
mode: $("#mode").text(),
theme: "dracula",
lineWrapping: false
lineWrapping: false,
theme: $("#theme").text()
});
cm.setValue(response.data.fileContents);
cm.setSize(null, 800);
cm.on("keyup", function (cm, event) {
if (!cm.state.completionActive &&
event.keyCode != 13) {
@@ -91,6 +92,10 @@ fileManager.controller('editFileCtrl', function ($scope, $http, $window) {
};
$scope.getFileContents();
$scope.changeTheme = function () {
$window.location.href = window.location.href + '&theme=' + $scope.theme;
};
$scope.putFileContents = function () {
$scope.htmlEditorLoading = false;