代码整理

This commit is contained in:
Anyon 2020-01-08 10:05:01 +08:00
parent 39af648118
commit d241b4c3a0
2 changed files with 121 additions and 148 deletions

View File

@ -1,4 +1,4 @@
// 定义编辑器标准配置 /*! 定义编辑器标准配置 */
CKEDITOR.editorConfig = function (config) { CKEDITOR.editorConfig = function (config) {
config.language = 'zh-cn'; config.language = 'zh-cn';
config.toolbar = [ config.toolbar = [
@ -16,7 +16,7 @@ CKEDITOR.editorConfig = function (config) {
config.font_names = '微软雅黑/Microsoft YaHei;宋体/SimSun;新宋体/NSimSun;仿宋/FangSong;楷体/KaiTi;黑体/SimHei;' + config.font_names; config.font_names = '微软雅黑/Microsoft YaHei;宋体/SimSun;新宋体/NSimSun;仿宋/FangSong;楷体/KaiTi;黑体/SimHei;' + config.font_names;
}; };
// 自定义图片上传插件 /*! 自定义图片上传插件 */
CKEDITOR.plugins.add("uimage", { CKEDITOR.plugins.add("uimage", {
init: function (editor) { init: function (editor) {
editor.ui.addButton("UploadImage", {label: "上传本地图片", command: 'uimage', icon: 'image', toolbar: 'insert,10'}); editor.ui.addButton("UploadImage", {label: "上传本地图片", command: 'uimage', icon: 'image', toolbar: 'insert,10'});
@ -30,7 +30,7 @@ CKEDITOR.plugins.add("uimage", {
} }
}); });
// 自定义视频插入插件 /*! 自定义视频插入插件 */
CKEDITOR.plugins.add('umusic', { CKEDITOR.plugins.add('umusic', {
init: function (editor) { init: function (editor) {
editor.ui.addButton("UploadMusic", {label: "上传MP3文件", command: 'umusic', icon: 'specialchar', toolbar: 'insert,10'}); editor.ui.addButton("UploadMusic", {label: "上传MP3文件", command: 'umusic', icon: 'specialchar', toolbar: 'insert,10'});
@ -44,7 +44,7 @@ CKEDITOR.plugins.add('umusic', {
} }
}); });
// 自定义视频插入插件 /*! 自定义视频插入插件 */
CKEDITOR.plugins.add('uvideo', { CKEDITOR.plugins.add('uvideo', {
init: function (editor) { init: function (editor) {
editor.ui.addButton("UploadVideo", {label: "上传MP4文件", command: 'uvideo', icon: 'flash', toolbar: 'insert,10'}); editor.ui.addButton("UploadVideo", {label: "上传MP4文件", command: 'uvideo', icon: 'flash', toolbar: 'insert,10'});
@ -58,7 +58,7 @@ CKEDITOR.plugins.add('uvideo', {
} }
}); });
// 自定义视频插入插件 /*! 自定义视频插入插件 */
CKEDITOR.plugins.add('uhtml', { CKEDITOR.plugins.add('uhtml', {
init: function (editor) { init: function (editor) {
editor.ui.addButton("UploadHtml", {label: "插入HTML代码", command: 'uhtml', icon: 'creatediv', toolbar: 'insert,10'}); editor.ui.addButton("UploadHtml", {label: "插入HTML代码", command: 'uhtml', icon: 'creatediv', toolbar: 'insert,10'});
@ -72,4 +72,4 @@ CKEDITOR.plugins.add('uhtml', {
} }
}); });
} }
}); });

View File

@ -3,206 +3,179 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/ */
body body {
{ /* Font */
/* Font */ /* Emoji fonts are added to visualise them nicely in Internet Explorer. */
/* Emoji fonts are added to visualise them nicely in Internet Explorer. */ font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 12px;
font-size: 12px;
/* Text color */ /* Text color */
color: #333; color: #333;
/* Remove the background color to make it transparent. */ /* Remove the background color to make it transparent. */
background-color: #fff; background-color: #fff;
margin: 20px; margin: 20px;
} }
.cke_editable .cke_editable {
{ font-size: 13px;
font-size: 13px; line-height: 1.6;
line-height: 1.6;
/* Fix for missing scrollbars with RTL texts. (#10488) */ /* Fix for missing scrollbars with RTL texts. (#10488) */
word-wrap: break-word; word-wrap: break-word;
} }
blockquote blockquote {
{ font-style: italic;
font-style: italic; font-family: Georgia, Times, "Times New Roman", serif;
font-family: Georgia, Times, "Times New Roman", serif; padding: 2px 0;
padding: 2px 0; border-style: solid;
border-style: solid; border-color: #ccc;
border-color: #ccc; border-width: 0;
border-width: 0;
} }
.cke_contents_ltr blockquote .cke_contents_ltr blockquote {
{ padding-left: 20px;
padding-left: 20px; padding-right: 8px;
padding-right: 8px; border-left-width: 5px;
border-left-width: 5px;
} }
.cke_contents_rtl blockquote .cke_contents_rtl blockquote {
{ padding-left: 8px;
padding-left: 8px; padding-right: 20px;
padding-right: 20px; border-right-width: 5px;
border-right-width: 5px;
} }
a a {
{ color: #0782C1;
color: #0782C1;
} }
ol,ul,dl ol, ul, dl {
{ /* IE7: reset rtl list margin. (#7334) */
/* IE7: reset rtl list margin. (#7334) */ *margin-right: 0px;
*margin-right: 0px; /* Preserved spaces for list items with text direction different than the list. (#6249,#8049)*/
/* Preserved spaces for list items with text direction different than the list. (#6249,#8049)*/ padding: 0 40px;
padding: 0 40px;
} }
h1,h2,h3,h4,h5,h6 h1, h2, h3, h4, h5, h6 {
{ font-weight: normal;
font-weight: normal; line-height: 1.2;
line-height: 1.2;
} }
hr hr {
{ border: 0px;
border: 0px; border-top: 1px solid #ccc;
border-top: 1px solid #ccc;
} }
img.right img.right {
{ border: 1px solid #ccc;
border: 1px solid #ccc; float: right;
float: right; margin-left: 15px;
margin-left: 15px; padding: 5px;
padding: 5px;
} }
img.left img.left {
{ border: 1px solid #ccc;
border: 1px solid #ccc; float: left;
float: left; margin-right: 15px;
margin-right: 15px; padding: 5px;
padding: 5px;
} }
pre pre {
{ white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-wrap; /* CSS 2.1 */ word-wrap: break-word; /* IE7 */
word-wrap: break-word; /* IE7 */ -moz-tab-size: 4;
-moz-tab-size: 4; tab-size: 4;
tab-size: 4;
} }
.marker .marker {
{ background-color: Yellow;
background-color: Yellow;
} }
span[lang] span[lang] {
{ font-style: italic;
font-style: italic;
} }
figure figure {
{ text-align: center;
text-align: center; outline: solid 1px #ccc;
outline: solid 1px #ccc; background: rgba(0, 0, 0, 0.05);
background: rgba(0,0,0,0.05); padding: 10px;
padding: 10px; margin: 10px 20px;
margin: 10px 20px; display: inline-block;
display: inline-block;
} }
figure > figcaption figure > figcaption {
{ text-align: center;
text-align: center; display: block; /* For IE8 */
display: block; /* For IE8 */
} }
a > img { a > img {
padding: 1px; padding: 1px;
margin: 1px; margin: 1px;
border: none; border: none;
outline: 1px solid #0782C1; outline: 1px solid #0782C1;
} }
/* Widget Styles */ /* Widget Styles */
.code-featured .code-featured {
{ border: 5px solid red;
border: 5px solid red;
} }
.math-featured .math-featured {
{ padding: 20px;
padding: 20px; box-shadow: 0 0 2px rgba(200, 0, 0, 1);
box-shadow: 0 0 2px rgba(200, 0, 0, 1); background-color: rgba(255, 0, 0, 0.05);
background-color: rgba(255, 0, 0, 0.05); margin: 10px;
margin: 10px;
} }
.image-clean .image-clean {
{ border: 0;
border: 0; background: none;
background: none; padding: 0;
padding: 0;
} }
.image-clean > figcaption .image-clean > figcaption {
{ font-size: .9em;
font-size: .9em; text-align: right;
text-align: right;
} }
.image-grayscale .image-grayscale {
{ background-color: white;
background-color: white; color: #666;
color: #666;
} }
.image-grayscale img, img.image-grayscale .image-grayscale img, img.image-grayscale {
{ filter: grayscale(100%);
filter: grayscale(100%);
} }
.embed-240p .embed-240p {
{ max-width: 426px;
max-width: 426px; max-height: 240px;
max-height: 240px; margin: 0 auto;
margin:0 auto;
} }
.embed-360p .embed-360p {
{ max-width: 640px;
max-width: 640px; max-height: 360px;
max-height: 360px; margin: 0 auto;
margin:0 auto;
} }
.embed-480p .embed-480p {
{ max-width: 854px;
max-width: 854px; max-height: 480px;
max-height: 480px; margin: 0 auto;
margin:0 auto;
} }
.embed-720p .embed-720p {
{ max-width: 1280px;
max-width: 1280px; max-height: 720px;
max-height: 720px; margin: 0 auto;
margin:0 auto;
} }
.embed-1080p .embed-1080p {
{ max-width: 1920px;
max-width: 1920px; max-height: 1080px;
max-height: 1080px; margin: 0 auto;
margin:0 auto;
} }