feat: 初始化纳海川官网代码仓

这个提交包含在:
wikiboss
2026-10-08 16:23:22 +08:00
当前提交 90f3b4e21f
共有 5518 个文件被更改,包括 1019947 次插入 和 0 次删除

查看文件

@@ -0,0 +1,13 @@
.tab-pane ul {
margin: 0px;
padding: 0px;
}
.tab-pane .formula-latex-item {
display: inline-block;
margin: 0px 3px 3px 0px;
width: 30px;
height: 30px;
border:1px solid #cccccc;
background-image: url("./images/formula.png");
cursor: pointer;
}

查看文件

@@ -0,0 +1,222 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>数学公式</title>
<link rel="stylesheet" href="./mathquill/mathquill.css"/>
<link rel="stylesheet" href="./formula.css"/>
<style>
html, body, .main {
margin: 0;
padding: 0;
/*font-size: 12px;*/
}
.container {
width: 100%;
margin: 0 auto;
font-size: 13px;
}
ul.tabs {
margin: 0px 0 5px 0;
padding: 0px;
list-style: none;
}
ul.tabs li {
background: none;
color: #222;
display: inline-block;
padding: 5px 10px;
cursor: pointer;
font-weight: 600;
}
ul.tabs li.current {
color: #222;
border: 1px solid #ccc;
border-radius: 2px;
}
.tab-content {
display: none;
padding: 0px;
}
.tab-content.current {
display: inherit;
}
.mathquill-rendered-math {
border: 1px solid #ccc;
padding: 3px;
width: 215px;
font-size: 16px;
}
h3 {
font-size: 14px;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="main">
<div class="container">
<div>
<ul class="tabs">
<li class="tab-link current" data-tab="common">常用公式</li>
<li class="tab-link" data-tab="symbol">符号</li>
<li class="tab-link" data-tab="letter">字母</li>
</ul>
<div id="common" class="tab-content current">
</div>
<div id="symbol" class="tab-content">
</div>
<div id="letter" class="tab-content">
</div>
</div>
<div style="width:100%;display:block;clear:both;">
<div id="editor" style="width:50%;display:inline-block;float:left;">
<h3>编辑</h3>
<div>
<span id="editable-math" class="mathquill-editable"></span>
</div>
</div>
<div id="preview" style="width:50%;display:inline-block;float:right;">
<h3>预览</h3>
<div id="preview-body">
<a id="codecogslink" target="_blank"><img id="codecogsimg"></a>
</div>
</div>
<div style="clear:both;width:100%;display:block;content:' '"></div>
</div>
<div id="text">
<h3>公式</h3>
<div>
<textarea id="latex-source" style="width:98%;vertical-align:top;border:1px solid #ccc;padding:3px;"></textarea>
</div>
</div>
</div><!-- container -->
</div>
<script src="./jquery.min.js"></script>
<script src="./mathquill/mathquill.js"></script>
<script>
$(function () {
var getQueryParam = function (name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&/]" + name + "([=/]([^&#/?]*)|&|#|$)"),
results = regex.exec(url);
if (!results)
return null;
if (!results[2])
return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
};
var previewUrl = getQueryParam('previewUrl') || "https://math.now.sh?from={latex}";
var formula = {
'common': [
"{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }",
"{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }"
],
'symbol': [
"+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup",
"=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty",
"{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq",
"{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow",
"{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow"
],
'letter': [
"{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu",
"{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi",
"{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega"
]
};
var xMax = 0, yMax = 0;
$.each(formula, function (k, v) {
var contentHtml = [];
$.each(v, function (i, f) {
contentHtml.push('<li class="formula-latex-item" data-latex="' + f + '" style="background-position:-' + (xMax * 30) + 'px -' + (yMax * 30) + 'px"></li>');
if (++xMax >= 8) {
++yMax;
xMax = 0;
}
});
yMax++;
xMax = 0;
$("#" + k).append('<div class="tab-pane"><ul>' + contentHtml.join('') + '</ul>');
});
$('ul.tabs li').click(function () {
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#" + tab_id).addClass('current');
});
var latexMath = $('#editable-math'), latexSource = $('#latex-source'), htmlSource = $('#html-source'), codecogsimg = $('#codecogsimg'), codecogslink = $('#codecogslink');
var buildImgLink = function () {
var latex = latexSource.val();
var url = previewUrl.replace(/\{latex\}/ig, latex);
codecogslink.attr('href', url);
codecogsimg.attr('src', url);
};
latexMath.on('keydown keypress', function () {
setTimeout(function () {
var latex = latexMath.mathquill('latex');
latexSource.val(latex);
buildImgLink();
});
});
latexSource.on('keydown keypress', function () {
var oldtext = latexSource.val();
setTimeout(function () {
var newtext = latexSource.val();
if (newtext !== oldtext) {
latexMath.mathquill('latex', newtext);
buildImgLink();
}
});
});
$(document).on("click", ".formula-latex-item", function () {
var latex = $(this).data("latex");
latex = latex.replace("{/}", "\\");
latexMath.mathquill('write', latex);
latex = latexMath.mathquill('latex');
latexSource.val(latex);
buildImgLink();
});
var latex = getQueryParam("latex");
if (latex) {
latexSource.val(latex);
latexMath.mathquill('latex', latexSource.val());
buildImgLink();
}
});
</script>
</body>
</html>

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 19 KiB

文件差异因一行或多行过长而隐藏

查看文件

@@ -0,0 +1,47 @@
KindEditor.plugin('math', function (K) {
var self = this, name = 'math', lang = self.lang(name + '.');
self.clickToolbar(name, function () {
var img = self.plugin.getSelectedImage();
var latex = $(img).data("latex") || '';
var html = [
'<div class="ke-dialog-content-inner">',
'<div class="tabs"></div>',
'<div class="ke-formula" style="width:510px;height:380px;"></div>',
'</div>'
].join('');
var iframe = K('<iframe class="" frameborder="0" src="' + self.pluginsPath + 'math/formula.html?latex=' + encodeURIComponent(latex) + '&previewUrl=' + encodeURIComponent(self.options.formulaPreviewUrl) + '" style="width:100%;height:300px;"></iframe>');
var dialog = self.createDialog({
name: name,
width: Math.min(document.body.clientWidth, 500),
height: 380,
title: "插入公式",
body: html,
yesBtn: {
name: '插入',
click: function (e) {
var win = iframe[0].contentWindow;
var url = win.$("#codecogslink").attr("href");
var latex = win.$("#latex-source").val();
if (latex == '') {
Layer.msg("请选择或输入公式");
return false;
}
self.insertHtml("<img src='" + url + "' data-latex='" + latex + "'>");
self.hideDialog().focus();
}
},
noBtn: {
name: self.lang('no'),
click: function (e) {
self.hideDialog().focus();
}
}
}),
div = dialog.div;
K('.ke-formula', div).replaceWith(iframe);
return;
});
});

二进制文件未显示。

二进制文件未显示。

文件差异因一行或多行过长而隐藏

之后

宽度:  |  高度:  |  大小: 2.1 MiB

二进制文件未显示。

查看文件

@@ -0,0 +1,357 @@
/*
* LaTeX Math in pure HTML and CSS -- No images whatsoever
* v0.xa
* by Jay and Han
* Lesser GPL Licensed: http: //www.gnu.org/licenses/lgpl.html
*
* This file is automatically included by mathquill.js
*
*/
@font-face {
font-family: Symbola;
src: url(font/Symbola.eot);
src: local("Symbola Regular"), local("Symbola"), url(font/Symbola.ttf) format("truetype"), url(font/Symbola.otf) format("opentype"), url(font/Symbola.svg#Symbola) format("svg");
}
.mathquill-editable {
display: -moz-inline-box;
display: inline-block;
white-space: pre-wrap;
}
.mathquill-editable .cursor {
border-left: 1px solid black;
margin-right: -1px;
position: relative;
z-index: 1;
padding: 0;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-editable .cursor.blink {
visibility: hidden;
}
.mathquill-editable,
.mathquill-embedded-latex .mathquill-editable {
border: 1px solid gray;
padding: 2px;
}
.mathquill-embedded-latex .mathquill-editable {
margin: 1px;
}
.mathquill-editable.hasCursor,
.mathquill-editable .hasCursor {
-webkit-box-shadow: #68b4df 0 0 3px 2px;
-moz-box-shadow: #68b4df 0 0 3px 2px;
box-shadow: #68b4df 0 0 3px 2px;
}
.mathquill-editable .latex-command-input {
color: inherit;
font-family: "Courier New", monospace;
border: 1px solid gray;
padding-right: 1px;
margin-right: 1px;
margin-left: 2px;
}
.mathquill-editable .latex-command-input.empty {
background: transparent;
}
.mathquill-editable .latex-command-input.hasCursor {
border-color: ActiveBorder;
}
.mathquill-editable.empty:after,
.mathquill-textbox:after,
.mathquill-rendered-math .empty:after {
visibility: hidden;
content: 'c';
}
.mathquill-editable .cursor:only-child:after,
.mathquill-editable .textarea + .cursor:last-child:after {
visibility: hidden;
content: 'c';
}
.mathquill-textbox {
overflow-x: auto;
overflow-y: hidden;
}
.mathquill-rendered-math {
font-variant: normal;
font-weight: normal;
font-style: normal;
font-size: 115%;
line-height: 1;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .non-leaf,
.mathquill-rendered-math .scaled {
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math var,
.mathquill-rendered-math .text,
.mathquill-rendered-math .nonSymbola {
font-family: "Times New Roman", Symbola, serif;
line-height: .9;
}
.mathquill-rendered-math * {
font-size: inherit;
line-height: inherit;
margin: 0;
padding: 0;
border-color: black;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.mathquill-rendered-math .empty {
background: #ccc;
}
.mathquill-rendered-math.empty {
background: transparent;
}
.mathquill-rendered-math .text {
font-size: 87%;
}
.mathquill-rendered-math .font {
font: 1em "Times New Roman", Symbola, serif;
}
.mathquill-rendered-math .font * {
font-family: inherit;
font-style: inherit;
}
.mathquill-rendered-math b,
.mathquill-rendered-math b.font {
font-weight: bolder;
}
.mathquill-rendered-math var,
.mathquill-rendered-math i,
.mathquill-rendered-math i.font {
font-syle: italic;
}
.mathquill-rendered-math var.florin {
margin: 0 -0.1em;
}
.mathquill-rendered-math big {
font-size: 125%;
}
.mathquill-rendered-math .roman {
font-style: normal;
}
.mathquill-rendered-math .sans-serif {
font-family: sans-serif, Symbola, serif;
}
.mathquill-rendered-math .monospace {
font-family: monospace, Symbola, serif;
}
.mathquill-rendered-math .overline {
border-top: 1px solid black;
margin-top: 1px;
}
.mathquill-rendered-math .underline {
border-bottom: 1px solid black;
margin-bottom: 1px;
}
.mathquill-rendered-math .binary-operator {
padding: 0 0.2em;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .unary-operator {
padding-left: 0.2em;
}
.mathquill-rendered-math sup,
.mathquill-rendered-math sub {
position: relative;
font-size: 90%;
}
.mathquill-rendered-math sup .binary-operator,
.mathquill-rendered-math sub .binary-operator {
padding: 0 .1em;
}
.mathquill-rendered-math sup .unary-operator,
.mathquill-rendered-math sub .unary-operator {
padding-left: .1em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sub.limit,
.mathquill-rendered-math sup.nthroot,
.mathquill-rendered-math sub.nthroot {
font-size: 80%;
}
.mathquill-rendered-math sup .fraction,
.mathquill-rendered-math sub .fraction {
font-size: 70%;
vertical-align: -0.4em;
}
.mathquill-rendered-math sup .numerator,
.mathquill-rendered-math sub .numerator {
padding-bottom: 0;
}
.mathquill-rendered-math sup .denominator,
.mathquill-rendered-math sub .denominator {
padding-top: 0;
}
.mathquill-rendered-math sup {
vertical-align: .5em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sup.nthroot {
vertical-align: 0.8em;
}
.mathquill-rendered-math sup.nthroot {
margin-right: -0.6em;
margin-left: .2em;
min-width: .5em;
}
.mathquill-rendered-math sub {
vertical-align: -0.4em;
}
.mathquill-rendered-math sub.limit {
vertical-align: -0.6em;
}
.mathquill-rendered-math .paren {
padding: 0 .1em;
vertical-align: bottom;
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-ms-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
}
.mathquill-rendered-math .array {
vertical-align: middle;
text-align: center;
}
.mathquill-rendered-math .array > span {
display: block;
}
.mathquill-rendered-math .non-italicized-function {
font-family: Symbola, "Times New Roman", serif;
line-height: .9;
font-style: normal;
padding-right: .2em;
}
.mathquill-rendered-math .fraction {
font-size: 90%;
text-align: center;
vertical-align: -0.5em;
padding: 0 .2em;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link {
display: -moz-groupbox;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link,
.mathquill-rendered-math x:default {
display: inline-block;
}
.mathquill-rendered-math .numerator,
.mathquill-rendered-math .denominator {
display: block;
}
.mathquill-rendered-math .numerator {
padding: 0 0.1em;
margin-bottom: -0.1em;
}
.mathquill-rendered-math .denominator {
border-top: 1px solid;
float: right;
width: 100%;
padding: .1em .1em 0 .1em;
margin-right: -0.1em;
margin-left: -0.1em;
}
.mathquill-rendered-math .sqrt-prefix {
padding-top: 0;
position: relative;
top: .1em;
vertical-align: top;
-webkit-transform-origin: top;
-moz-transform-origin: top;
-ms-transform-origin: top;
-o-transform-origin: top;
transform-origin: top;
}
.mathquill-rendered-math .sqrt-stem {
border-top: 1px solid;
margin-top: 1px;
padding-left: .15em;
padding-right: .2em;
margin-right: .1em;
}
.mathquill-rendered-math .vector-prefix {
display: block;
text-align: center;
line-height: .25em;
margin-bottom: -0.1em;
font-size: 0.75em;
}
.mathquill-rendered-math .vector-stem {
display: block;
}
.mathquill-rendered-math,
.mathquill-rendered-math .mathquill-editable {
cursor: text;
font-family: Symbola, "Times New Roman", serif;
}
.mathquill-rendered-math .selection,
.mathquill-editable .selection,
.mathquill-rendered-math .selection .non-leaf,
.mathquill-editable .selection .non-leaf,
.mathquill-rendered-math .selection .scaled,
.mathquill-editable .selection .scaled {
background: #B4D5FE !important;
background: Highlight !important;
color: HighlightText;
border-color: HighlightText;
}
.mathquill-rendered-math .selection .matrixed,
.mathquill-editable .selection .matrixed {
background: #39F !important;
}
.mathquill-rendered-math .selection .matrixed-container,
.mathquill-editable .selection .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important;
}
.mathquill-rendered-math .selection.blur,
.mathquill-editable .selection.blur,
.mathquill-rendered-math .selection.blur .non-leaf,
.mathquill-editable .selection.blur .non-leaf,
.mathquill-rendered-math .selection.blur .scaled,
.mathquill-editable .selection.blur .scaled,
.mathquill-rendered-math .selection.blur .matrixed,
.mathquill-editable .selection.blur .matrixed {
background: #D4D4D4 !important;
color: black;
border-color: black;
}
.mathquill-rendered-math .selection.blur .matrixed-container,
.mathquill-editable .selection.blur .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important;
}
.mathquill-editable .textarea,
.mathquill-rendered-math .textarea {
position: relative;
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
}
.mathquill-editable .textarea textarea,
.mathquill-rendered-math .textarea textarea,
.mathquill-editable .selectable,
.mathquill-rendered-math .selectable {
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
position: absolute;
clip: rect(1em 1em 1em 1em);
}
.mathquill-rendered-math .matrixed {
background: white;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='white');
margin-top: -0.1em;
}

文件差异内容过多而无法显示 加载差异

文件差异因一行或多行过长而隐藏