8 |
@Model.PostInfo.Title
9 |
10 | @Model.PostInfo.PublishDate
11 |
12 |
13 | @Html.Raw(Model.PostInfo.Content)
14 |
15 |
16 | @if (null != Model.PostTags && Model.PostTags.Length > 0)
17 | {
18 |
@(Html.Raw(" "))
19 | foreach (var tag in Model.PostTags)
20 | {
21 |
[ @(tag) ]
22 | }
23 | }
24 |
25 |
26 |
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/packages/editormd/lib/codemirror/addon/mode/multiplex_test.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function() {
5 | CodeMirror.defineMode("markdown_with_stex", function(){
6 | var inner = CodeMirror.getMode({}, "stex");
7 | var outer = CodeMirror.getMode({}, "markdown");
8 |
9 | var innerOptions = {
10 | open: '$',
11 | close: '$',
12 | mode: inner,
13 | delimStyle: 'delim',
14 | innerStyle: 'inner'
15 | };
16 |
17 | return CodeMirror.multiplexingMode(outer, innerOptions);
18 | });
19 |
20 | var mode = CodeMirror.getMode({}, "markdown_with_stex");
21 |
22 | function MT(name) {
23 | test.mode(
24 | name,
25 | mode,
26 | Array.prototype.slice.call(arguments, 1),
27 | 'multiplexing');
28 | }
29 |
30 | MT(
31 | "stexInsideMarkdown",
32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
33 | })();
34 |
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/packages/editormd/lib/codemirror/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "codemirror",
3 | "version":"5.0.0",
4 | "main": "lib/codemirror.js",
5 | "description": "In-browser code editing made bearable",
6 | "licenses": [{"type": "MIT",
7 | "url": "http://codemirror.net/LICENSE"}],
8 | "directories": {"lib": "./lib"},
9 | "scripts": {"test": "node ./test/run.js"},
10 | "devDependencies": {"node-static": "0.6.0",
11 | "phantomjs": "1.9.2-5",
12 | "blint": ">=0.1.1"},
13 | "bugs": "http://github.com/codemirror/CodeMirror/issues",
14 | "keywords": ["JavaScript", "CodeMirror", "Editor"],
15 | "homepage": "http://codemirror.net",
16 | "maintainers":[{"name": "Marijn Haverbeke",
17 | "email": "marijnh@gmail.com",
18 | "web": "http://marijnhaverbeke.nl"}],
19 | "repository": {"type": "git",
20 | "url": "https://github.com/codemirror/CodeMirror.git"}
21 | }
22 |
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/packages/editormd/lib/codemirror/addon/lint/yaml-lint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml
15 |
16 | // declare global: jsyaml
17 |
18 | CodeMirror.registerHelper("lint", "yaml", function(text) {
19 | var found = [];
20 | try { jsyaml.load(text); }
21 | catch(e) {
22 | var loc = e.mark;
23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message });
24 | }
25 | return found;
26 | });
27 |
28 | });
29 |
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/js/myscripts/editPost.js:
--------------------------------------------------------------------------------
1 | var testEditor;
2 | $(function () {
3 | testEditor = editormd("test-editormd", {
4 | width: "100%",
5 | height: 640,
6 | syncScrolling: "single",
7 | saveHTMLToTextarea: true,
8 | path: "/packages/editormd/lib/",
9 | htmlDecode: true,
10 | imageUpload: true,
11 | imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
12 | imageUploadURL: "/file/UpLoadImg",
13 | /*
14 | 上传的后台只需要返回一个 JSON 数据,结构如下:
15 | {
16 | success : 0 | 1, // 0 表示上传失败,1 表示上传成功
17 | message : "提示的信息,上传成功或上传失败及错误信息等。",
18 | url : "图片地址" // 上传成功时才返回
19 | }
20 | */
21 | });
22 |
23 |
24 |
25 | $("form").submit(function (e) {
26 | $("#Content").val(testEditor.getHTML());
27 | });
28 |
29 | });
30 |
31 | function success(res) {
32 | if (res.code == 1) {
33 | location.href = res.url;
34 | } else {
35 | alert(res.msg);
36 | }
37 | }
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/js/myscripts/adminIndex.js:
--------------------------------------------------------------------------------
1 | // 更新数据库中的标签
2 | $("#updataTag").click(function () {
3 | $.ajax({
4 | url: "/Admin/RefreshTag",
5 | type: "post",
6 | success: function (res) {
7 | alert(res.msg);
8 | }
9 | });
10 | return false;
11 | });
12 |
13 | //// 退出登录
14 | //$("#loginOut").click(function () {
15 | // $.ajax({
16 | // url: "/Admin/LoginOut",
17 | // type: "get",
18 | // success: function (res) {
19 | // if (res.code == 1) {
20 | // location.href = res.url;
21 | // } else {
22 | // alert(res);
23 | // }
24 |
25 | // }
26 | // });
27 | //});
28 |
29 | // 清理异常文章数据
30 | $("#clearExceptionPosts").click(function () {
31 | $.ajax({
32 | url: "/Admin/RefreshPost",
33 | type: "post",
34 | success: function (res) {
35 | if (res.code == 1) {
36 | alert(res.msg);
37 | } else {
38 | alert(res.msg);
39 | }
40 | }
41 | });
42 | return false;
43 | });
--------------------------------------------------------------------------------
/MyBlog.Web/wwwroot/packages/editormd/fonts/editormd-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |