artalk 2.4.4 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +4872 -4072
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.js +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +2468 -1779
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.js +1 -1
- package/dist/i18n/jp.js +1 -1
- package/dist/i18n/zh-TW.js +1 -1
- package/dist/src/api/index.d.ts +2 -2
- package/dist/src/api/system.d.ts +5 -2
- package/dist/src/artalk.d.ts +42 -34
- package/dist/src/comment/comment.d.ts +2 -2
- package/dist/src/comment/height-limit.d.ts +30 -0
- package/dist/src/comment/render-ctx.d.ts +23 -0
- package/dist/src/comment/render.d.ts +2 -50
- package/dist/src/comment/renders/actions.d.ts +5 -0
- package/dist/src/comment/renders/avatar.d.ts +5 -0
- package/dist/src/comment/renders/content.d.ts +5 -0
- package/dist/src/comment/renders/header.d.ts +5 -0
- package/dist/src/comment/renders/index.d.ts +2 -0
- package/dist/src/comment/renders/pending.d.ts +5 -0
- package/dist/src/comment/renders/reply-at.d.ts +5 -0
- package/dist/src/comment/renders/reply-to.d.ts +5 -0
- package/dist/src/components/dialog.d.ts +1 -1
- package/dist/src/config.d.ts +8 -0
- package/dist/src/context.d.ts +15 -29
- package/dist/src/editor/edit-mode.d.ts +9 -0
- package/dist/src/editor/editor-ui.d.ts +25 -0
- package/dist/src/editor/editor.d.ts +37 -45
- package/dist/src/editor/funcs.d.ts +2 -0
- package/dist/src/editor/mover.d.ts +8 -0
- package/dist/src/editor/plug-manager.d.ts +17 -0
- package/dist/src/editor/plugs/editor-plug.d.ts +13 -1
- package/dist/src/editor/reply.d.ts +9 -0
- package/dist/src/editor/submit.d.ts +16 -0
- package/dist/src/editor/ui.d.ts +25 -0
- package/dist/src/i18n/index.d.ts +11 -7
- package/dist/src/layer/index.d.ts +2 -2
- package/dist/src/layer/layer.d.ts +1 -1
- package/dist/src/lib/checker/captcha-renders.d.ts +5 -0
- package/dist/src/lib/checker/index.d.ts +18 -10
- package/dist/src/lib/dark-mode.d.ts +4 -0
- package/dist/src/lib/marked.d.ts +9 -0
- package/dist/src/lib/utils.d.ts +1 -5
- package/dist/src/list/list-lite.d.ts +15 -11
- package/dist/src/list/list-nest.d.ts +2 -2
- package/dist/src/list/list-ui.d.ts +7 -0
- package/dist/src/list/paginator/adaptors/index.d.ts +12 -0
- package/dist/src/list/paginator/adaptors/pagination.d.ts +9 -0
- package/dist/src/list/paginator/adaptors/read-more.d.ts +10 -0
- package/dist/src/list/paginator/holder.d.ts +16 -0
- package/dist/src/list/paginator/index.d.ts +10 -0
- package/dist/src/service.d.ts +40 -0
- package/dist/types/artalk-config.d.ts +5 -2
- package/dist/types/artalk-data.d.ts +3 -3
- package/dist/types/context.d.ts +11 -17
- package/dist/types/global.d.ts +1 -0
- package/package.json +6 -7
- package/src/api/system.ts +3 -12
- package/src/artalk.ts +101 -158
- package/src/comment/comment.ts +7 -6
- package/src/comment/height-limit.ts +100 -0
- package/src/comment/render-ctx.ts +30 -0
- package/src/comment/render.ts +31 -375
- package/src/comment/renders/actions.ts +114 -0
- package/src/comment/renders/avatar.ts +22 -0
- package/src/comment/renders/content.ts +39 -0
- package/src/comment/renders/header.ts +84 -0
- package/src/comment/renders/index.ts +19 -0
- package/src/comment/renders/pending.ts +12 -0
- package/src/comment/renders/reply-at.ts +16 -0
- package/src/comment/renders/reply-to.ts +24 -0
- package/src/config.ts +65 -0
- package/src/context.ts +31 -86
- package/src/defaults.ts +1 -0
- package/src/editor/edit-mode.ts +102 -0
- package/src/editor/editor.ts +100 -395
- package/src/editor/funcs.ts +96 -0
- package/src/editor/mover.ts +43 -0
- package/src/editor/plug-manager.ts +172 -0
- package/src/editor/plugs/editor-plug.ts +20 -2
- package/src/editor/plugs/{emoticons-plug.less → emoticons-plug.scss} +5 -4
- package/src/editor/plugs/emoticons-plug.ts +2 -1
- package/src/editor/plugs/header-input-plug.ts +5 -5
- package/src/editor/plugs/{preview-plug.less → preview-plug.scss} +1 -1
- package/src/editor/plugs/preview-plug.ts +8 -4
- package/src/editor/plugs/upload-plug.ts +10 -13
- package/src/editor/reply.ts +62 -0
- package/src/editor/submit.ts +98 -0
- package/src/editor/ui.ts +36 -0
- package/src/i18n/index.ts +21 -10
- package/src/layer/index.ts +2 -2
- package/src/layer/layer.ts +4 -4
- package/src/layer/sidebar-layer.ts +2 -1
- package/src/lib/checker/admin.ts +36 -0
- package/src/lib/checker/captcha-renders.ts +68 -0
- package/src/lib/checker/captcha.ts +26 -0
- package/src/lib/checker/index.ts +38 -20
- package/src/lib/dark-mode.ts +48 -0
- package/src/lib/marked.ts +133 -0
- package/src/lib/utils.ts +1 -123
- package/src/list/list-lite.ts +59 -162
- package/src/list/list-ui.ts +80 -0
- package/src/list/list.ts +16 -8
- package/src/list/paginator/adaptors/index.ts +21 -0
- package/src/list/paginator/adaptors/pagination.ts +42 -0
- package/src/list/paginator/adaptors/read-more.ts +56 -0
- package/src/list/paginator/holder.ts +55 -0
- package/src/list/paginator/index.ts +13 -0
- package/src/service.ts +118 -0
- package/src/style/{_color.less → _color.scss} +3 -3
- package/src/style/{_extend.less → _extend.scss} +1 -1
- package/src/style/_variables.scss +3 -0
- package/src/style/{comment.less → comment.scss} +36 -12
- package/src/style/{editor.less → editor.scss} +11 -11
- package/src/style/{list.less → list.scss} +8 -6
- package/src/style/{main.less → main.scss} +24 -23
- package/src/style/{sidebar-layer.less → sidebar-layer.scss} +8 -8
- package/types/artalk-config.d.ts +5 -2
- package/types/artalk-data.d.ts +3 -3
- package/types/context.d.ts +11 -17
- package/types/global.d.ts +1 -0
- package/CNAME +0 -1
- package/LICENSE +0 -165
- package/index.html +0 -157
- package/postcss.config.js +0 -5
- package/scripts/build-i18n.mjs +0 -46
- package/src/lib/checker/admin-checker.ts +0 -36
- package/src/lib/checker/captcha-checker.ts +0 -84
- package/src/style/_variables.less +0 -3
- package/test/ArtalkCount.html +0 -16
- package/test/ArtalkI18n.html +0 -16
- package/test/ArtalkLite.html +0 -15
- package/test/CSRF.html +0 -26
- package/tsconfig.json +0 -12
- package/vite-base.config.ts +0 -21
- package/vite-demo.config.ts +0 -12
- package/vite-lite.config.ts +0 -22
- package/vite.config.ts +0 -27
- /package/dist/src/lib/checker/{admin-checker.d.ts → admin.d.ts} +0 -0
- /package/dist/src/lib/checker/{captcha-checker.d.ts → captcha.d.ts} +0 -0
- /package/src/style/{pagination.less → pagination.scss} +0 -0
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
padding: 0.6rem 0;
|
|
47
47
|
border: 1px solid var(--at-color-border);
|
|
48
48
|
text-align: center;
|
|
49
|
-
border-radius:
|
|
49
|
+
border-radius: $block-radius;
|
|
50
50
|
white-space: nowrap;
|
|
51
51
|
margin: 0;
|
|
52
52
|
list-style: none;
|
|
@@ -159,11 +159,13 @@
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.atk-list-no-comment {
|
|
162
|
-
text-align: center;
|
|
163
162
|
height: 150px;
|
|
164
|
-
|
|
165
|
-
display: block;
|
|
163
|
+
display: flex;
|
|
166
164
|
font-size: 19px;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
align-items: center;
|
|
167
|
+
word-break: break-word;
|
|
168
|
+
text-align: center;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
.atk-list-read-more {
|
|
@@ -179,8 +181,8 @@
|
|
|
179
181
|
cursor: pointer;
|
|
180
182
|
user-select: none;
|
|
181
183
|
padding: 0 15px;
|
|
182
|
-
font-size:
|
|
183
|
-
border-radius:
|
|
184
|
+
font-size: $font-size;
|
|
185
|
+
border-radius: $block-radius;
|
|
184
186
|
border: 1px solid transparent;
|
|
185
187
|
display: flex;
|
|
186
188
|
height: 30px;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import "./_color.
|
|
2
|
-
@import './comment.
|
|
3
|
-
@import './list.
|
|
4
|
-
@import './pagination.
|
|
5
|
-
@import './editor.
|
|
6
|
-
@import './sidebar-layer.
|
|
1
|
+
@import "./_color.scss";
|
|
2
|
+
@import './comment.scss';
|
|
3
|
+
@import './list.scss';
|
|
4
|
+
@import './pagination.scss';
|
|
5
|
+
@import './editor.scss';
|
|
6
|
+
@import './sidebar-layer.scss';
|
|
7
7
|
|
|
8
8
|
.artalk {
|
|
9
9
|
position: relative;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.artalk, .atk-layer-wrap {
|
|
15
15
|
color: var(--at-color-font);
|
|
16
16
|
word-wrap: break-word;
|
|
17
|
-
word-break: break-
|
|
17
|
+
word-break: break-word;
|
|
18
18
|
|
|
19
19
|
* {
|
|
20
20
|
box-sizing: border-box;
|
|
@@ -26,17 +26,18 @@
|
|
|
26
26
|
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
$codeFont: source code pro, Consolas, Monaco, Menlo, sans-serif;
|
|
30
30
|
|
|
31
31
|
code {
|
|
32
|
-
font-family:
|
|
33
|
-
margin: 0 .
|
|
34
|
-
padding: 0 .
|
|
32
|
+
font-family: $codeFont;
|
|
33
|
+
margin: 0 .05em;
|
|
34
|
+
padding: 0 .4em;
|
|
35
35
|
display: inline-block;
|
|
36
|
+
vertical-align: middle;
|
|
36
37
|
font-size: .9em;
|
|
37
38
|
background-color: var(--at-color-bg-grey);
|
|
38
39
|
color: var(--at-color-font);
|
|
39
|
-
border-radius:
|
|
40
|
+
border-radius: 2px;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
pre {
|
|
@@ -46,8 +47,8 @@
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
pre code {
|
|
49
|
-
* { font-family:
|
|
50
|
-
line-height:
|
|
50
|
+
* { font-family: $codeFont; }
|
|
51
|
+
line-height: $line-height;
|
|
51
52
|
display: block;
|
|
52
53
|
padding: 10px 15px;
|
|
53
54
|
white-space: pre-wrap;
|
|
@@ -142,8 +143,8 @@
|
|
|
142
143
|
|
|
143
144
|
/* Loading */
|
|
144
145
|
.atk-loading {
|
|
146
|
+
@extend .atk-full-layer;
|
|
145
147
|
z-index: 11;
|
|
146
|
-
&:extend(.atk-full-layer);
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
.atk-loading-spinner {
|
|
@@ -278,7 +279,7 @@ i.atk-icon {
|
|
|
278
279
|
|
|
279
280
|
/* Layer */
|
|
280
281
|
.atk-error-layer {
|
|
281
|
-
|
|
282
|
+
@extend .atk-full-layer;
|
|
282
283
|
background-color: var(--at-color-bg-transl);
|
|
283
284
|
|
|
284
285
|
.atk-error-title {
|
|
@@ -312,8 +313,8 @@ i.atk-icon {
|
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
.atk-layer-dialog-wrap {
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
$formInputHeight: 30px;
|
|
317
|
+
@extend .atk-full-layer;
|
|
317
318
|
background-color: var(--at-color-bg-transl);
|
|
318
319
|
|
|
319
320
|
& > .atk-layer-dialog {
|
|
@@ -332,10 +333,10 @@ i.atk-icon {
|
|
|
332
333
|
|
|
333
334
|
input {
|
|
334
335
|
width: 100%;
|
|
335
|
-
line-height: (
|
|
336
|
+
line-height: calc($formInputHeight + 4px);
|
|
336
337
|
background-color: var(--at-color-bg);
|
|
337
338
|
border: 1px solid var(--at-color-border);
|
|
338
|
-
border-radius: (
|
|
339
|
+
border-radius: calc($block-radius / 2);
|
|
339
340
|
outline: none;
|
|
340
341
|
padding: 0 6px;
|
|
341
342
|
display: block;
|
|
@@ -356,9 +357,9 @@ i.atk-icon {
|
|
|
356
357
|
border: 1px solid var(--at-color-main);
|
|
357
358
|
background: transparent;
|
|
358
359
|
color: var(--at-color-main);
|
|
359
|
-
border-radius: (
|
|
360
|
+
border-radius: calc($block-radius / 2);
|
|
360
361
|
padding: 0 15px;
|
|
361
|
-
line-height:
|
|
362
|
+
line-height: $formInputHeight;
|
|
362
363
|
outline: none;
|
|
363
364
|
|
|
364
365
|
&:active {
|
|
@@ -426,7 +427,7 @@ i.atk-icon {
|
|
|
426
427
|
overflow: hidden;
|
|
427
428
|
background-color: #2c2c2c;
|
|
428
429
|
color: #FFF;
|
|
429
|
-
border-radius: (
|
|
430
|
+
border-radius: calc($block-radius / 2);
|
|
430
431
|
cursor: pointer;
|
|
431
432
|
font-size: 14px;
|
|
432
433
|
padding: 5px 15px;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
$header-height: 60px;
|
|
2
|
+
$nav-height: 40px;
|
|
3
3
|
|
|
4
4
|
.atk-sidebar-layer {
|
|
5
|
-
|
|
5
|
+
$width: 430px;
|
|
6
6
|
position: fixed;
|
|
7
7
|
z-index: 99999;
|
|
8
8
|
top: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
width:
|
|
10
|
+
width: $width;
|
|
11
11
|
height: 100%;
|
|
12
12
|
background: var(--at-color-bg);
|
|
13
13
|
transition: transform 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
|
14
|
-
transform: translate(
|
|
14
|
+
transform: translate($width, 0px);
|
|
15
15
|
|
|
16
|
-
@media only screen and (max-width:
|
|
16
|
+
@media only screen and (max-width: $width) {
|
|
17
17
|
& {
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
.atk-sidebar-close {
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
|
-
width:
|
|
41
|
-
height:
|
|
40
|
+
width: $header-height;
|
|
41
|
+
height: $header-height;
|
|
42
42
|
align-items: center;
|
|
43
43
|
place-content: center;
|
|
44
44
|
cursor: pointer;
|
package/types/artalk-config.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default interface ArtalkConfig {
|
|
|
26
26
|
/** 发送按钮文字 */
|
|
27
27
|
sendBtn: string
|
|
28
28
|
|
|
29
|
-
/**
|
|
29
|
+
/** 评论框穿梭(显示在待回复评论后面) */
|
|
30
30
|
editorTravel: boolean
|
|
31
31
|
|
|
32
32
|
/** 表情包 */
|
|
@@ -60,6 +60,9 @@ export default interface ArtalkConfig {
|
|
|
60
60
|
|
|
61
61
|
/** 子评论区域限高 */
|
|
62
62
|
children: number
|
|
63
|
+
|
|
64
|
+
/** 滚动限高 */
|
|
65
|
+
scrollable: boolean
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
/** 评论投票按钮 */
|
|
@@ -77,7 +80,7 @@ export default interface ArtalkConfig {
|
|
|
77
80
|
/** PV 数绑定元素 Selector */
|
|
78
81
|
pvEl: string
|
|
79
82
|
|
|
80
|
-
/**
|
|
83
|
+
/** 夜间模式 */
|
|
81
84
|
darkMode: boolean|'auto'
|
|
82
85
|
|
|
83
86
|
/** 请求超时(单位:秒) */
|
package/types/artalk-data.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export interface CommentData {
|
|
|
44
44
|
/** 徽章颜色 */
|
|
45
45
|
badge_color?: string
|
|
46
46
|
|
|
47
|
+
/** IP 归属地 */
|
|
48
|
+
ip_region?: string
|
|
49
|
+
|
|
47
50
|
/** 是否允许回复 */
|
|
48
51
|
is_allow_reply?: boolean
|
|
49
52
|
|
|
@@ -221,7 +224,4 @@ export interface ApiVersionData {
|
|
|
221
224
|
|
|
222
225
|
/** API 程序 CommitHash */
|
|
223
226
|
commit_hash: string
|
|
224
|
-
|
|
225
|
-
/** API 程序要求前端最小版本 */
|
|
226
|
-
fe_min_version: string
|
|
227
227
|
}
|
package/types/context.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { marked as libMarked } from 'marked'
|
|
2
1
|
import ArtalkConfig from './artalk-config'
|
|
3
2
|
import { CommentData, NotifyData } from './artalk-data'
|
|
4
3
|
import { EventPayloadMap, Event, EventScopeType, Handler } from './event'
|
|
5
4
|
import { internal as internalLocales, I18n } from '../src/i18n'
|
|
6
5
|
import Api from '../src/api'
|
|
7
6
|
import User from '../src/lib/user'
|
|
8
|
-
import Editor from '../src/editor'
|
|
9
7
|
import Comment from '../src/comment'
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import { SidebarShowPayload } from '../src/layer/sidebar-layer'
|
|
9
|
+
import { CheckerCaptchaPayload, CheckerPayload } from '../src/lib/checker'
|
|
10
|
+
import type { TMarked } from '../src/lib/marked'
|
|
11
|
+
import type { TInjectedServices } from '../src/service'
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Context 接口
|
|
@@ -17,31 +16,26 @@ import CheckerLauncher, { CheckerCaptchaPayload, CheckerPayload } from '../src/l
|
|
|
17
16
|
* (面向接口的编程)
|
|
18
17
|
*/
|
|
19
18
|
export default interface ContextApi {
|
|
20
|
-
/** Context 唯一标识 */
|
|
21
|
-
cid: number
|
|
22
|
-
|
|
23
19
|
/** Artalk 根元素对象 */
|
|
24
20
|
$root: HTMLElement
|
|
25
21
|
|
|
22
|
+
/** 依赖注入函数 */
|
|
23
|
+
inject<K extends keyof TInjectedServices>(depName: K, obj: TInjectedServices[K]): void
|
|
24
|
+
|
|
26
25
|
/** 配置对象 */
|
|
26
|
+
// TODO 修改为 getConf() 和 setConf()
|
|
27
27
|
conf: ArtalkConfig
|
|
28
28
|
|
|
29
29
|
/** 用户对象 */
|
|
30
|
+
// TODO 修改为 getUser()
|
|
30
31
|
user: User
|
|
31
32
|
|
|
32
33
|
/** marked 依赖对象 */
|
|
33
|
-
|
|
34
|
+
getMarkedInstance(): TMarked | undefined
|
|
34
35
|
|
|
35
36
|
/** marked 内容替换器 */
|
|
36
37
|
markedReplacers: ((raw: string) => string)[]
|
|
37
38
|
|
|
38
|
-
/* 设置持有的同事类 (中介者模式) */
|
|
39
|
-
setApi(api: Api): void
|
|
40
|
-
setEditor(editor: Editor): void
|
|
41
|
-
setList(list?: ListLite): void
|
|
42
|
-
setSidebarLayer(list: SidebarLayer): void
|
|
43
|
-
setCheckerLauncher(checkerLauncher: CheckerLauncher): void
|
|
44
|
-
|
|
45
39
|
/** 获取 API 以供 HTTP 请求 */
|
|
46
40
|
getApi(): Api
|
|
47
41
|
|
|
@@ -141,7 +135,7 @@ export default interface ContextApi {
|
|
|
141
135
|
/** i18n 翻译 */
|
|
142
136
|
$t(key: keyof I18n, args?: {[key: string]: string}): string
|
|
143
137
|
|
|
144
|
-
/**
|
|
138
|
+
/** 设置夜间模式 */
|
|
145
139
|
setDarkMode(darkMode: boolean): void
|
|
146
140
|
|
|
147
141
|
/** 更新配置 */
|
package/types/global.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare const ARTALK_LITE: boolean
|
package/CNAME
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
artalk.js.org
|
package/LICENSE
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
-
Version 3, 29 June 2007
|
|
3
|
-
|
|
4
|
-
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
-
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
-
of this license document, but changing it is not allowed.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
This version of the GNU Lesser General Public License incorporates
|
|
10
|
-
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
-
License, supplemented by the additional permissions listed below.
|
|
12
|
-
|
|
13
|
-
0. Additional Definitions.
|
|
14
|
-
|
|
15
|
-
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
-
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
-
General Public License.
|
|
18
|
-
|
|
19
|
-
"The Library" refers to a covered work governed by this License,
|
|
20
|
-
other than an Application or a Combined Work as defined below.
|
|
21
|
-
|
|
22
|
-
An "Application" is any work that makes use of an interface provided
|
|
23
|
-
by the Library, but which is not otherwise based on the Library.
|
|
24
|
-
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
-
of using an interface provided by the Library.
|
|
26
|
-
|
|
27
|
-
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
-
Application with the Library. The particular version of the Library
|
|
29
|
-
with which the Combined Work was made is also called the "Linked
|
|
30
|
-
Version".
|
|
31
|
-
|
|
32
|
-
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
-
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
-
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
-
based on the Application, and not on the Linked Version.
|
|
36
|
-
|
|
37
|
-
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
-
object code and/or source code for the Application, including any data
|
|
39
|
-
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
-
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
-
|
|
42
|
-
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
-
|
|
44
|
-
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
-
without being bound by section 3 of the GNU GPL.
|
|
46
|
-
|
|
47
|
-
2. Conveying Modified Versions.
|
|
48
|
-
|
|
49
|
-
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
-
facility refers to a function or data to be supplied by an Application
|
|
51
|
-
that uses the facility (other than as an argument passed when the
|
|
52
|
-
facility is invoked), then you may convey a copy of the modified
|
|
53
|
-
version:
|
|
54
|
-
|
|
55
|
-
a) under this License, provided that you make a good faith effort to
|
|
56
|
-
ensure that, in the event an Application does not supply the
|
|
57
|
-
function or data, the facility still operates, and performs
|
|
58
|
-
whatever part of its purpose remains meaningful, or
|
|
59
|
-
|
|
60
|
-
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
-
this License applicable to that copy.
|
|
62
|
-
|
|
63
|
-
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
-
|
|
65
|
-
The object code form of an Application may incorporate material from
|
|
66
|
-
a header file that is part of the Library. You may convey such object
|
|
67
|
-
code under terms of your choice, provided that, if the incorporated
|
|
68
|
-
material is not limited to numerical parameters, data structure
|
|
69
|
-
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
-
(ten or fewer lines in length), you do both of the following:
|
|
71
|
-
|
|
72
|
-
a) Give prominent notice with each copy of the object code that the
|
|
73
|
-
Library is used in it and that the Library and its use are
|
|
74
|
-
covered by this License.
|
|
75
|
-
|
|
76
|
-
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
-
document.
|
|
78
|
-
|
|
79
|
-
4. Combined Works.
|
|
80
|
-
|
|
81
|
-
You may convey a Combined Work under terms of your choice that,
|
|
82
|
-
taken together, effectively do not restrict modification of the
|
|
83
|
-
portions of the Library contained in the Combined Work and reverse
|
|
84
|
-
engineering for debugging such modifications, if you also do each of
|
|
85
|
-
the following:
|
|
86
|
-
|
|
87
|
-
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
-
the Library is used in it and that the Library and its use are
|
|
89
|
-
covered by this License.
|
|
90
|
-
|
|
91
|
-
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
-
document.
|
|
93
|
-
|
|
94
|
-
c) For a Combined Work that displays copyright notices during
|
|
95
|
-
execution, include the copyright notice for the Library among
|
|
96
|
-
these notices, as well as a reference directing the user to the
|
|
97
|
-
copies of the GNU GPL and this license document.
|
|
98
|
-
|
|
99
|
-
d) Do one of the following:
|
|
100
|
-
|
|
101
|
-
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
-
License, and the Corresponding Application Code in a form
|
|
103
|
-
suitable for, and under terms that permit, the user to
|
|
104
|
-
recombine or relink the Application with a modified version of
|
|
105
|
-
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
-
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
-
Corresponding Source.
|
|
108
|
-
|
|
109
|
-
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
-
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
-
a copy of the Library already present on the user's computer
|
|
112
|
-
system, and (b) will operate properly with a modified version
|
|
113
|
-
of the Library that is interface-compatible with the Linked
|
|
114
|
-
Version.
|
|
115
|
-
|
|
116
|
-
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
-
be required to provide such information under section 6 of the
|
|
118
|
-
GNU GPL, and only to the extent that such information is
|
|
119
|
-
necessary to install and execute a modified version of the
|
|
120
|
-
Combined Work produced by recombining or relinking the
|
|
121
|
-
Application with a modified version of the Linked Version. (If
|
|
122
|
-
you use option 4d0, the Installation Information must accompany
|
|
123
|
-
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
-
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
-
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
-
for conveying Corresponding Source.)
|
|
127
|
-
|
|
128
|
-
5. Combined Libraries.
|
|
129
|
-
|
|
130
|
-
You may place library facilities that are a work based on the
|
|
131
|
-
Library side by side in a single library together with other library
|
|
132
|
-
facilities that are not Applications and are not covered by this
|
|
133
|
-
License, and convey such a combined library under terms of your
|
|
134
|
-
choice, if you do both of the following:
|
|
135
|
-
|
|
136
|
-
a) Accompany the combined library with a copy of the same work based
|
|
137
|
-
on the Library, uncombined with any other library facilities,
|
|
138
|
-
conveyed under the terms of this License.
|
|
139
|
-
|
|
140
|
-
b) Give prominent notice with the combined library that part of it
|
|
141
|
-
is a work based on the Library, and explaining where to find the
|
|
142
|
-
accompanying uncombined form of the same work.
|
|
143
|
-
|
|
144
|
-
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
-
|
|
146
|
-
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
-
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
-
versions will be similar in spirit to the present version, but may
|
|
149
|
-
differ in detail to address new problems or concerns.
|
|
150
|
-
|
|
151
|
-
Each version is given a distinguishing version number. If the
|
|
152
|
-
Library as you received it specifies that a certain numbered version
|
|
153
|
-
of the GNU Lesser General Public License "or any later version"
|
|
154
|
-
applies to it, you have the option of following the terms and
|
|
155
|
-
conditions either of that published version or of any later version
|
|
156
|
-
published by the Free Software Foundation. If the Library as you
|
|
157
|
-
received it does not specify a version number of the GNU Lesser
|
|
158
|
-
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
-
General Public License ever published by the Free Software Foundation.
|
|
160
|
-
|
|
161
|
-
If the Library as you received it specifies that a proxy can decide
|
|
162
|
-
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
-
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
-
permanent authorization for you to choose that version for the
|
|
165
|
-
Library.
|
package/index.html
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Artalk DEMO</title>
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
|
|
7
|
-
<style>
|
|
8
|
-
* { box-sizing: border-box; }
|
|
9
|
-
body { padding:45px 10px;margin:0;background:#f4f4f4 }
|
|
10
|
-
body.dark-mode { background:#000; }
|
|
11
|
-
.card { margin:0 auto;max-width:700px;position:relative;overflow:hidden;background:#FFF;border-radius:4px;padding:20px;border: 1px solid transparent; }
|
|
12
|
-
body.dark-mode .card { background: #1e2223;border: 1px solid #2d3235; }
|
|
13
|
-
.card:not(:last-child) { margin-bottom:10px; }
|
|
14
|
-
.card.billboard { text-align: center; }
|
|
15
|
-
.title > a { display:block;text-decoration:none;color:#0083ff;font-size:35px;margin-top:0;margin-bottom:10px; }
|
|
16
|
-
.title > a:hover { margin-left:0 }
|
|
17
|
-
.title > a > span { opacity:0 }
|
|
18
|
-
.title > a:hover>span { opacity:1 }
|
|
19
|
-
.desc { font-size:12px;color:#697182 }
|
|
20
|
-
body.dark-mode .desc { color:#848da3 }
|
|
21
|
-
.social { margin-top:20px }
|
|
22
|
-
.social > a:not(:last-child) { margin-right:2px }
|
|
23
|
-
@media only screen and (max-width: 768px) {
|
|
24
|
-
body { padding: 0;background: #FFF; }
|
|
25
|
-
.card.billboard { padding-top: 20px; }
|
|
26
|
-
.card { width: 100%;padding: 5px; }
|
|
27
|
-
}
|
|
28
|
-
.float-btn { user-select: none;bottom: 25px;display: block;cursor: pointer;text-align: center;width: 60px;height: 37px;line-height: 37px;font-size: 13px;color: #757e91;background: #fff;opacity: 0.8;border-radius: 4px;border: 1px solid #eceff2;position: fixed; }
|
|
29
|
-
.to-night { z-index: 99999;left: 25px;background: #1e2223;color: #fff; }
|
|
30
|
-
body.dark-mode .to-night { background: #006fd9;border: 1px solid #2d3235;color: #fff; }
|
|
31
|
-
.to-top { right: 25px; }
|
|
32
|
-
</style>
|
|
33
|
-
<!--<link rel="stylesheet"
|
|
34
|
-
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/arta.min.css">
|
|
35
|
-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>-->
|
|
36
|
-
|
|
37
|
-
<!-- For mobile testing -->
|
|
38
|
-
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
|
39
|
-
<script>
|
|
40
|
-
// VConsole will be exported to `window.VConsole` by default.
|
|
41
|
-
if (navigator.userAgentData.mobile) {
|
|
42
|
-
var vConsole = new window.VConsole();
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
</head>
|
|
46
|
-
<body>
|
|
47
|
-
<div class="card billboard atk-fade-in">
|
|
48
|
-
<div class="title"><a href="https://github.com/ArtalkJS/Artalk" target="_blank"><span>『 </span>Artalk<span> 』</span></a></div>
|
|
49
|
-
<div class="desc">一款简洁的自托管评论系统 <span id="ArtalkPV"></span></div>
|
|
50
|
-
<div class="social">
|
|
51
|
-
<a href="https://www.npmjs.com/package/artalk" aria-label="npm package version" target="_blank"><img src="https://img.shields.io/npm/v/artalk.svg?style=flat-square"></a>
|
|
52
|
-
<a href="https://www.npmjs.com/package/artalk" aria-label="npm package download number" target="_blank"><img src="https://img.shields.io/npm/dt/artalk.svg?style=flat-square"></a>
|
|
53
|
-
<a href="https://github.com/ArtalkJS/Artalk/commits/master" aria-label="last commit" target="_blank"><img src="https://img.shields.io/github/last-commit/ArtalkJS/Artalk?style=flat-square"></a>
|
|
54
|
-
<a href="https://github.com/ArtalkJS/Artalk/blob/master/LICENSE" aria-label="open source license" target="_blank"><img src="https://img.shields.io/github/license/ArtalkJS/Artalk.svg?style=flat-square"></a>
|
|
55
|
-
<a href="https://github.com/ArtalkJS/Artalk" aria-label="GitHub star number" target="_blank"><img src="https://img.shields.io/github/stars/ArtalkJS/Artalk?style=flat-square"></a>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="card atk-fade-in">
|
|
59
|
-
<div id="comments"></div>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="float-btn to-night atk-fade-in">Blink</div>
|
|
62
|
-
<div class="float-btn to-top atk-fade-in" style="display: none;">TOP</div>
|
|
63
|
-
|
|
64
|
-
<script type="module">
|
|
65
|
-
import Artalk from './src/main'
|
|
66
|
-
var artalk = new Artalk({
|
|
67
|
-
el: '#comments',
|
|
68
|
-
pageKey: 'https://artalk.js.org/guide/intro.html',
|
|
69
|
-
pageTitle: 'Artalk Home',
|
|
70
|
-
server: (import.meta.env.DEV) ? 'http://localhost:23366' : 'https://artalk.qwqaq.com',
|
|
71
|
-
site: 'ArtalkDocs',
|
|
72
|
-
//useBackendConf: true,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
window.artalk = artalk;
|
|
76
|
-
|
|
77
|
-
;(function () {
|
|
78
|
-
const toTopElem = document.querySelector('.to-top')
|
|
79
|
-
toTopElem.addEventListener('click', () => {
|
|
80
|
-
window.scrollTo(0, 0)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
checkShowToTop()
|
|
84
|
-
document.addEventListener('scroll', () => {
|
|
85
|
-
checkShowToTop()
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
function checkShowToTop() {
|
|
89
|
-
const scrollTop = window.scrollY
|
|
90
|
-
const whereShow = window.screen.height
|
|
91
|
-
const isNeedShow = (scrollTop > 0) && (scrollTop > whereShow)
|
|
92
|
-
|
|
93
|
-
if (isNeedShow) {
|
|
94
|
-
toTopElem.style.display = ''
|
|
95
|
-
} else {
|
|
96
|
-
toTopElem.style.display = 'none'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
})();
|
|
100
|
-
|
|
101
|
-
;(function () {
|
|
102
|
-
// @Refer: https://stackoverflow.com/questions/50840168/how-to-detect-if-the-os-is-in-dark-mode-in-browsers
|
|
103
|
-
let darkMode = false
|
|
104
|
-
|
|
105
|
-
if (getLS() == "true") {
|
|
106
|
-
darkMode = true;
|
|
107
|
-
} else {
|
|
108
|
-
try {
|
|
109
|
-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
110
|
-
darkMode = true;
|
|
111
|
-
}
|
|
112
|
-
} catch {}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function getLS() {
|
|
116
|
-
return localStorage.getItem("dark_mode_on") || null
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function setLS(val) {
|
|
120
|
-
return localStorage.setItem("dark_mode_on", String(val))
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function checkAndApplyDarkMode () {
|
|
124
|
-
artalk.setDarkMode(darkMode)
|
|
125
|
-
if (darkMode) {
|
|
126
|
-
document.body.classList.add('dark-mode')
|
|
127
|
-
} else {
|
|
128
|
-
document.body.classList.remove('dark-mode')
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
checkAndApplyDarkMode()
|
|
133
|
-
|
|
134
|
-
const toNightElem = document.querySelector('.to-night')
|
|
135
|
-
toNightElem.addEventListener('click', () => {
|
|
136
|
-
darkMode = !darkMode
|
|
137
|
-
setLS(darkMode)
|
|
138
|
-
checkAndApplyDarkMode()
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
// Listen
|
|
142
|
-
try {
|
|
143
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
|
144
|
-
const newColorScheme = e.matches ? "dark" : "light";
|
|
145
|
-
if (newColorScheme == "dark") {
|
|
146
|
-
darkMode = true
|
|
147
|
-
} else {
|
|
148
|
-
darkMode = false
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
checkAndApplyDarkMode()
|
|
152
|
-
});
|
|
153
|
-
} catch {}
|
|
154
|
-
})()
|
|
155
|
-
</script>
|
|
156
|
-
</body>
|
|
157
|
-
</html>
|