代码生成预览支持高亮显示

This commit is contained in:
RuoYi
2020-11-04 12:02:51 +08:00
parent 057a390bff
commit 4b265bb193
4 changed files with 1209 additions and 4 deletions

View File

@ -0,0 +1,79 @@
/**
* GitHub Gist Theme
* Author : Anthony Attard - https://github.com/AnthonyAttard
* Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
*/
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #d73a49;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #6f42c1;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
.hljs-number {
color: #005cc5;
}
.hljs-string {
color: #032f62;
}

File diff suppressed because one or more lines are too long

View File

@ -441,6 +441,25 @@ var sub = {
}
};
// 动态加载css文件
function loadCss(file, headElem) {
var link = document.createElement('link');
link.href = file;
link.rel = 'stylesheet';
link.type = 'text/css';
if (headElem) headElem.appendChild(link);
else document.getElementsByTagName('head')[0].appendChild(link);
}
// 动态加载js文件
function loadJs(file, headElem) {
var script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
if (headElem) headElem.appendChild(script);
else document.getElementsByTagName('head')[0].appendChild(script);
}
/** 设置全局ajax处理 */
$.ajaxSetup({
complete: function(XMLHttpRequest, textStatus) {