mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-08-06 22:41:39 +08:00
1.调整编辑器条目
2.增加代码块复制
This commit is contained in:
parent
2b3372c8e8
commit
e24cf1bd1c
@ -15,6 +15,8 @@ class SyncAppInfoTask extends Task
|
|||||||
|
|
||||||
public function mainAction()
|
public function mainAction()
|
||||||
{
|
{
|
||||||
|
echo '------ start sync app info ------' . PHP_EOL;
|
||||||
|
|
||||||
$url = 'https://www.koogua.com/api/instance/collect';
|
$url = 'https://www.koogua.com/api/instance/collect';
|
||||||
|
|
||||||
$site = $this->getSettings('site');
|
$site = $this->getSettings('site');
|
||||||
@ -37,6 +39,8 @@ class SyncAppInfoTask extends Task
|
|||||||
$client = new Client();
|
$client = new Client();
|
||||||
|
|
||||||
$client->request('POST', $url, ['form_params' => $params]);
|
$client->request('POST', $url, ['form_params' => $params]);
|
||||||
|
|
||||||
|
echo '------ end sync app info ------' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,19 @@ layui.use(['jquery'], function () {
|
|||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
uploadJson: '/admin/upload/content/img',
|
uploadJson: '/admin/upload/content/img',
|
||||||
cssPath: '/static/lib/kindeditor/content.css',
|
cssPath: '/static/home/css/content.css',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '300px',
|
height: '300px',
|
||||||
items: [
|
items: [
|
||||||
'selectall', '|',
|
'selectall', '|',
|
||||||
'undo', 'redo', '|',
|
'undo', 'redo', '|',
|
||||||
'copy', 'plainpaste', 'wordpaste', '|',
|
'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|',
|
||||||
'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|',
|
'insertorderedlist', 'insertunorderedlist', 'table', 'code', '|',
|
||||||
'insertorderedlist', 'insertunorderedlist', 'table', '|',
|
'superscript', 'subscript', '|',
|
||||||
'superscript', 'subscript', '|', 'image', 'link', 'unlink', '|',
|
'image', 'link', 'unlink', '|',
|
||||||
'source', 'about'
|
'source', 'about'
|
||||||
],
|
],
|
||||||
|
pasteType: 1,
|
||||||
extraFileUploadParams: {
|
extraFileUploadParams: {
|
||||||
csrf_token: $('meta[name="csrf-token"]').attr('content')
|
csrf_token: $('meta[name="csrf-token"]').attr('content')
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,8 @@
|
|||||||
font-family: Consolas, Monaco, Andale Mono, monospace;
|
font-family: Consolas, Monaco, Andale Mono, monospace;
|
||||||
line-height: 1.7em;
|
line-height: 1.7em;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 6px 10px;
|
padding: 15px 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
border-left: 5px solid #6CE26C;
|
border-left: 5px solid #6CE26C;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,3 +220,24 @@
|
|||||||
.ke-content blockquote p {
|
.ke-content blockquote p {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ke-content pre {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ke-content pre > span.kg-copy {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 3px;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ke-content pre:hover > span.kg-copy {
|
||||||
|
display: block;
|
||||||
|
}
|
@ -12,12 +12,13 @@ layui.use(['jquery'], function () {
|
|||||||
items: [
|
items: [
|
||||||
'selectall', '|',
|
'selectall', '|',
|
||||||
'undo', 'redo', '|',
|
'undo', 'redo', '|',
|
||||||
'copy', 'plainpaste', 'wordpaste', '|',
|
'formatblock', 'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|',
|
||||||
'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|',
|
'insertorderedlist', 'insertunorderedlist', 'table', 'code', '|',
|
||||||
'insertorderedlist', 'insertunorderedlist', 'table', '|',
|
'superscript', 'subscript', '|',
|
||||||
'superscript', 'subscript', '|', 'image', 'link', 'unlink', '|',
|
'image', 'link', 'unlink', '|',
|
||||||
'source', 'about'
|
'source', 'about'
|
||||||
],
|
],
|
||||||
|
pasteType: 1,
|
||||||
extraFileUploadParams: {
|
extraFileUploadParams: {
|
||||||
csrf_token: $('meta[name="csrf-token"]').attr('content')
|
csrf_token: $('meta[name="csrf-token"]').attr('content')
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
layui.use(['layer'], function () {
|
layui.use(['jquery','layer'], function () {
|
||||||
|
|
||||||
|
var $ = layui.jquery;
|
||||||
var layer = layui.layer;
|
var layer = layui.layer;
|
||||||
|
|
||||||
|
if ($('.ke-content').length > 0) {
|
||||||
|
var kePres = $('pre');
|
||||||
|
if (kePres.length > 0) {
|
||||||
|
kePres.each(function () {
|
||||||
|
var text = $(this).text();
|
||||||
|
var btn = $('<span class="kg-copy">复制</span>').attr('data-clipboard-text', text);
|
||||||
|
$(this).prepend(btn);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var clipboard = new ClipboardJS('.kg-copy');
|
var clipboard = new ClipboardJS('.kg-copy');
|
||||||
|
|
||||||
clipboard.on('success', function (e) {
|
clipboard.on('success', function () {
|
||||||
layer.msg('内容已经复制到剪贴板');
|
layer.msg('内容已经复制到剪贴板');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user