Commit 841872a0 authored by Vanesssa's avatar Vanesssa

fixed #12146

parent b7876d2d
......@@ -18,7 +18,7 @@
<label>${tags1WithTips1Label}</label>
<input id="tag" type="text"/>
</div>
<div>
<div class="comment-content">
<label>${abstract1Label}</label>
<textarea id="abstract" style="height: 200px;width: 100%;" name="abstract"></textarea>
</div>
......
......@@ -7,6 +7,7 @@
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-base${miniPostfix}.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-admin${miniPostfix}.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/CodeMirrorEditor/codemirror.min.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/highlight/styles/github.css?${staticResourceVersion}" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
</head>
<body onhashchange="admin.setCurByHash();">
......@@ -129,14 +130,8 @@
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="http://b3log.org/services/#solo" target="_blank">Solo</a> ${version}
</div>
</div>
<script src="${staticServePath}/js/lib/jquery/jquery.min.js"></script>
<script src="${staticServePath}/js/lib/jquery/file-upload-9.10.1/vendor/jquery.ui.widget.js"></script>
<script src="${staticServePath}/js/lib/jquery/file-upload-9.10.1/jquery.iframe-transport.js"></script>
<script src="${staticServePath}/js/lib/jquery/file-upload-9.10.1/jquery.fileupload.js"></script>
<script src="${staticServePath}/js/lib/jquery/jquery.bowknot.min.js?${staticResourceVersion}"></script>
<script src="${staticServePath}/js/lib/compress/admin-lib.min.js"></script>
<script src="${staticServePath}/js/lib/tiny_mce/tiny_mce.js"></script>
<script src="${staticServePath}/js/lib/KindEditor/kindeditor-min.js"></script>
<script src="${staticServePath}/js/lib/CodeMirrorEditor/codemirror.min.js"></script>
<script src="${staticServePath}/js/common${miniPostfix}.js"></script>
<#if "" == miniPostfix>
<script src="${staticServePath}/js/admin/admin.js"></script>
......
......@@ -88,187 +88,187 @@ a[class*=" icon-"]:hover {
}
.icon-upload:before {
content: "\f0ee";
content: "\f0ee";
}
.icon-copy:before {
content: "\e908";
content: "\e908";
}
.icon-time:before {
content: "\e906";
content: "\e906";
}
.icon-sortasc:before {
content: "\e905";
content: "\e905";
}
.icon-locked:before {
content: "\e61e";
content: "\e61e";
}
.icon-close:before {
content: "\e909";
content: "\e909";
}
.icon-points:before {
content: "\e900";
content: "\e900";
}
.icon-goods:before {
content: "\e904";
content: "\e904";
}
.icon-bold:before {
content: "\e000";
content: "\e000";
}
.icon-italic:before {
content: "\e001";
content: "\e001";
}
.icon-quote:before {
content: "\e003";
content: "\e003";
}
.icon-unordered-list:before {
content: "\e004";
content: "\e004";
}
.icon-ordered-list:before {
content: "\e005";
content: "\e005";
}
.icon-link:before {
content: "\e006";
content: "\e006";
}
.icon-image:before {
content: "\e007";
content: "\e007";
}
.icon-play:before {
content: "\e008";
content: "\e008";
}
.icon-music:before {
content: "\e009";
content: "\e009";
}
.icon-contract:before {
content: "\e00a";
content: "\e00a";
}
.icon-fullscreen:before {
content: "\e00b";
content: "\e00b";
}
.icon-question:before {
content: "\e00c";
content: "\e00c";
}
.icon-info:before {
content: "\e00d";
content: "\e00d";
}
.icon-undo:before {
content: "\e00e";
content: "\e00e";
}
.icon-redo:before {
content: "\e00f";
content: "\e00f";
}
.icon-code:before {
content: "\e011";
content: "\e011";
}
.icon-preview:before {
content: "\e002";
content: "\e002";
}
.icon-navigation:before {
content: "\e903";
content: "\e903";
}
.icon-thumbs-down:before {
content: "\e901";
content: "\e901";
}
.icon-thumbs-up:before {
content: "\e902";
content: "\e902";
}
.icon-video:before {
content: "\f057";
content: "\f057";
}
.icon-feed:before {
content: "\e61f";
content: "\e61f";
}
.icon-article:before {
content: "\e61d";
content: "\e61d";
}
.icon-star:before {
content: "\e600";
content: "\e600";
}
.icon-register:before {
content: "\e602";
content: "\e602";
}
.icon-logout:before {
content: "\e603";
content: "\e603";
}
.icon-setting:before {
content: "\e604";
content: "\e604";
}
.icon-google:before {
content: "\e605";
content: "\e605";
}
.icon-search:before {
content: "\e606";
content: "\e606";
}
.icon-weibo:before {
content: "\e607";
content: "\e607";
}
.icon-date:before {
content: "\e608";
content: "\e608";
}
.icon-view:before {
content: "\e609";
content: "\e609";
}
.icon-cmts:before {
content: "\e60a";
content: "\e60a";
}
.icon-refresh:before {
content: "\e60b";
content: "\e60b";
}
.icon-up:before {
content: "\e60c";
content: "\e60c";
}
.icon-twitter:before {
content: "\e60d";
content: "\e60d";
}
.icon-edit:before {
content: "\e60e";
content: "\e60e";
}
.icon-tencent:before {
content: "\e60f";
content: "\e60f";
}
.icon-tag:before {
content: "\e610";
content: "\e610";
}
.icon-tags:before {
content: "\e611";
content: "\e611";
}
.icon-addfile:before {
content: "\e612";
content: "\e612";
}
.icon-login:before {
content: "\e613";
content: "\e613";
}
.icon-articles:before {
content: "\e614";
content: "\e614";
}
.icon-userrole:before {
content: "\e615";
content: "\e615";
}
.icon-email:before {
content: "\e616";
content: "\e616";
}
.icon-flag:before {
content: "\e617";
content: "\e617";
}
.icon-chevron-down:before {
content: "\e618";
content: "\e618";
}
.icon-chevron-up:before {
content: "\e619";
content: "\e619";
}
.icon-reply:before {
content: "\e61a";
content: "\e61a";
}
.icon-clock:before {
content: "\e61b";
content: "\e61b";
}
.icon-compass:before {
content: "\e61c";
content: "\e61c";
}
.icon-heart:before {
content: "\e9da";
content: "\e9da";
}
.icon-wechat:before {
content: "\e907";
content: "\e907";
}
.ico-arrow-down, .ico-arrow-up {
......@@ -617,6 +617,19 @@ button#submitArticle:hover,
background-color: #ec6459;
border-color: #ec6459;
}
.CodeMirror {
border-radius: 0 0 3px 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.075) inset;
border: 1px solid #ccc;
margin-bottom: 20px;
border-top-width: 0;
height: 470px;
}
.comment-content .CodeMirror {
height: 170px;
}
/* end article */
/* start preference */
......
......@@ -18,8 +18,17 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.4, Aug 13, 2015
* @version 1.2.1.4, Aug 26, 2016
*/
Util.processClipBoard = function (text, cm) {
var text = toMarkdown(text, {converters: [
], gfm: true});
// ascii 160 替换为 30
text = $('<div>' + text + '</div>').text().replace(/\n{2,}/g, '\n\n').replace(/ /g, ' ');
return $.trim(text);
};
admin.editors.CodeMirror = {
/*
* @description 初始化编辑器
......@@ -41,13 +50,11 @@ admin.editors.CodeMirror = {
{name: 'bold'},
{name: 'italic'},
'|',
{name: 'link'},
{name: 'quote'},
{name: 'unordered-list'},
{name: 'ordered-list'},
'|',
{name: 'link'},
{name: 'image', html: '<form id="fileUpload" method="POST" enctype="multipart/form-data"><label class="icon-upload"><input type="file"/></label></form>'},
'|',
{name: 'redo'},
{name: 'undo'},
'|',
......@@ -90,6 +97,6 @@ admin.editors.CodeMirror = {
*/
remove: function (id) {
this[id].toTextArea();
$(".markdown-preivew").remove();
$('.editor-toolbar').remove();
}
};
\ No newline at end of file
.CodeMirror {
line-height: 1em;
background-color: #FFF;
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-right: 1px solid #D9D9D9;
border-style: solid;
border-width: 1px;
width: 50%;
float: left;
}
.CodeMirror-scroll {
overflow: auto;
height: 500px;
/* This is needed to prevent an IE[67] bug where the scrolled content
is visible outside of the scrolling box. */
position: relative;
outline: none;
outline: medium none;
}
.CodeMirror-gutter {
position: absolute; left: 0; top: 0;
z-index: 10;
background-color: #f3f3f3;
border-right: 1px solid #eee;
min-width: 2em;
height: 100%;
}
.CodeMirror-gutter-text {
color: #aaa;
text-align: right;
padding: .4em .2em .4em .4em;
white-space: pre !important;
}
.CodeMirror-lines {
padding: .4em;
white-space: pre;
}
.CodeMirror pre {
-moz-border-radius: 0;
-webkit-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
border-width: 0; margin: 0; padding: 0; background: transparent;
padding: 0; margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror textarea {
outline: none !important;
}
.CodeMirror pre.CodeMirror-cursor {
z-index: 10;
position: absolute;
visibility: hidden;
border-left: 1px solid black;
border-right:none;
width:0;
}
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
.CodeMirror-focused pre.CodeMirror-cursor {
visibility: visible;
}
div.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* Default theme */
.cm-s-default span.cm-keyword {color: #708;}
.cm-s-default span.cm-atom {color: #219;}
.cm-s-default span.cm-number {color: #164;}
.cm-s-default span.cm-def {color: #00f;}
.cm-s-default span.cm-variable {color: black;}
.cm-s-default span.cm-variable-2 {color: #05a;}
.cm-s-default span.cm-variable-3 {color: #085;}
.cm-s-default span.cm-property {color: black;}
.cm-s-default span.cm-operator {color: black;}
.cm-s-default span.cm-comment {color: #a50;}
.cm-s-default span.cm-string {color: #a11;}
.cm-s-default span.cm-string-2 {color: #f50;}
.cm-s-default span.cm-meta {color: #555;}
.cm-s-default span.cm-error {color: #f00;}
.cm-s-default span.cm-qualifier {color: #555;}
.cm-s-default span.cm-builtin {color: #30a;}
.cm-s-default span.cm-bracket {color: #cc7;}
.cm-s-default span.cm-tag {color: #170;}
.cm-s-default span.cm-attribute {color: #00c;}
.cm-s-default span.cm-header {color: #a0a;}
.cm-s-default span.cm-quote {color: #090;}
.cm-s-default span.cm-hr {color: #999;}
.cm-s-default span.cm-link {color: #00c;}
span.cm-header, span.cm-strong {font-weight: bold;}
span.cm-em {font-style: italic;}
span.cm-emstrong {font-style: italic; font-weight: bold;}
span.cm-link {text-decoration: underline;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -606,7 +606,7 @@ span.CodeMirror-selectedtext { background: none; }
top: 1px;
padding: 0px 4px;
left: 100%;
background: #FDFDFD;
background: #FCFCFC;
z-index: 9999;
overflow: auto;
-webkit-transition: left 0.2s ease;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1279,12 +1279,10 @@
var text = cm.getValue();
$.ajax({
url: Label.servePath + "/markdown",
url: latkeConfig.servePath + "/console/markdown/2html",
type: "POST",
cache: false,
data: {
markdownText: text
},
data: JSON.stringify({markdownText: text}),
success: function (result, textStatus) {
preview.innerHTML = result.html;
hljs.initHighlighting.called = false;
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment