mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 06:24:23 +01:00
Add proper syntax highlighting for codemirror and make theme footer & header use codemirror
This commit is contained in:
@@ -1 +1,4 @@
|
||||
@import "~codemirror/lib/codemirror.css";
|
||||
.CodeMirror {
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import CTFd from "core/CTFd";
|
||||
import { default as helpers } from "core/helpers";
|
||||
import $ from "jquery";
|
||||
import { ezQuery, ezProgressBar } from "core/ezq";
|
||||
import CodeMirror from "codemirror";
|
||||
import 'codemirror/mode/htmlmixed/htmlmixed.js';
|
||||
|
||||
function loadTimestamp(place, timestamp) {
|
||||
if (typeof timestamp == "string") {
|
||||
@@ -233,6 +235,26 @@ function insertTimezones(target) {
|
||||
}
|
||||
|
||||
$(() => {
|
||||
CodeMirror.fromTextArea(
|
||||
document.getElementById("theme-header"),
|
||||
{
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
mode: "htmlmixed",
|
||||
htmlMode: true
|
||||
}
|
||||
);
|
||||
|
||||
CodeMirror.fromTextArea(
|
||||
document.getElementById("theme-footer"),
|
||||
{
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
mode: "htmlmixed",
|
||||
htmlMode: true
|
||||
}
|
||||
);
|
||||
|
||||
insertTimezones($("#start-timezone"));
|
||||
insertTimezones($("#end-timezone"));
|
||||
insertTimezones($("#freeze-timezone"));
|
||||
|
||||
@@ -4,6 +4,7 @@ import $ from "jquery";
|
||||
import CTFd from "core/CTFd";
|
||||
import { default as helpers } from "core/helpers";
|
||||
import CodeMirror from "codemirror";
|
||||
import 'codemirror/mode/htmlmixed/htmlmixed.js';
|
||||
import { ezQuery, ezToast } from "core/ezq";
|
||||
|
||||
function get_filetype_icon_class(filename) {
|
||||
@@ -206,7 +207,7 @@ $(() => {
|
||||
{
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
mode: "xml",
|
||||
mode: "htmlmixed",
|
||||
htmlMode: true
|
||||
}
|
||||
);
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
284
CTFd/themes/admin/static/js/vendor.bundle.min.js
vendored
284
CTFd/themes/admin/static/js/vendor.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,9 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('views.themes', theme='admin', path='css/codemirror.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
|
||||
Reference in New Issue
Block a user