mirror of https://github.com/JohnHammond/CTFd.git
Add proper syntax highlighting for codemirror and make theme footer & header use codemirror
parent
c9d31b67aa
commit
6099abf1a1
|
@ -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
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">
|
||||
|
|
Loading…
Reference in New Issue