Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Essem
Sharkey
Commits
1e237a7d
Commit
1e237a7d
authored
1 year ago
by
syuilo
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of
https://github.com/misskey-dev/misskey
into develop
parents
1dcf25c2
9a40b366
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/frontend/src/components/MkCode.vue
+42
-14
42 additions, 14 deletions
packages/frontend/src/components/MkCode.vue
with
43 additions
and
14 deletions
CHANGELOG.md
+
1
−
0
View file @
1e237a7d
...
...
@@ -24,6 +24,7 @@
-
Feat: 絵文字の詳細ダイアログを追加
-
Feat: 枠線をつけるMFM
`$[border.width=1,style=solid,color=fff,radius=0 ...]`
を追加
-
デフォルトで枠線からはみ出る部分が隠されるようにしました。初期と同じ挙動にするには
`$[border.noclip`
が必要です
-
Enhance: MFM等のコードブロックに全文コピー用のボタンを追加
-
Enhance: ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように
-
Enhance: チャンネルノートのピン留めをノートのメニューからできるように
-
Enhance: 管理者の場合はAPI tokenの発行画面で管理機能に関する権限を付与できるように
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/components/MkCode.vue
+
42
−
14
View file @
1e237a7d
...
...
@@ -4,29 +4,36 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<
template
>
<Suspense>
<template
#fallback
>
<MkLoading
v-if=
"!inline ?? true"
/>
</
template
>
<code
v-if=
"inline"
:class=
"$style.codeInlineRoot"
>
{{ code }}
</code>
<XCode
v-else-if=
"show && lang"
:code=
"code"
:lang=
"lang"
/>
<pre
v-else-if=
"show"
:class=
"$style.codeBlockFallbackRoot"
><code
:class=
"$style.codeBlockFallbackCode"
>
{{ code }}
</code></pre>
<button
v-else
:class=
"$style.codePlaceholderRoot"
@
click=
"show = true"
>
<div
:class=
"$style.codePlaceholderContainer"
>
<div><i
class=
"ti ti-code"
></i>
{{ i18n.ts.code }}
</div>
<div>
{{ i18n.ts.clickToShow }}
</div>
</div>
<code
v-if=
"inline"
:class=
"$style.codeInlineRoot"
>
{{
code
}}
</code>
<div
v-else
:class=
"$style.codeBlockRoot"
>
<button
:class=
"$style.codeBlockCopyButton"
class=
"_button"
@
click=
"copy"
>
<i
class=
"ti ti-copy"
></i>
</button>
</Suspense>
<Suspense>
<template
#fallback
>
<MkLoading
/>
</
template
>
<XCode
v-if=
"show && lang"
:code=
"code"
:lang=
"lang"
/>
<pre
v-else-if=
"show"
:class=
"$style.codeBlockFallbackRoot"
><code
:class=
"$style.codeBlockFallbackCode"
>
{{ code }}
</code></pre>
<button
v-else
:class=
"$style.codePlaceholderRoot"
@
click=
"show = true"
>
<div
:class=
"$style.codePlaceholderContainer"
>
<div><i
class=
"ti ti-code"
></i>
{{ i18n.ts.code }}
</div>
<div>
{{ i18n.ts.clickToShow }}
</div>
</div>
</button>
</Suspense>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
defineAsyncComponent
,
ref
}
from
'
vue
'
;
import
*
as
os
from
'
@/os.js
'
;
import
MkLoading
from
'
@/components/global/MkLoading.vue
'
;
import
{
defaultStore
}
from
'
@/store.js
'
;
import
{
i18n
}
from
'
@/i18n.js
'
;
import
copyToClipboard
from
'
@/scripts/copy-to-clipboard.js
'
;
defineProps
<
{
const
props
=
defineProps
<
{
code
:
string
;
lang
?:
string
;
inline
?:
boolean
;
...
...
@@ -35,9 +42,30 @@ defineProps<{
const
show
=
ref
(
!
defaultStore
.
state
.
dataSaver
.
code
);
const
XCode
=
defineAsyncComponent
(()
=>
import
(
'
@/components/MkCode.core.vue
'
));
function
copy
()
{
copyToClipboard
(
props
.
code
);
os
.
success
();
}
</
script
>
<
style
module
lang=
"scss"
>
.codeBlockRoot
{
position
:
relative
;
}
.codeBlockCopyButton
{
color
:
#D4D4D4
;
position
:
absolute
;
top
:
8px
;
right
:
8px
;
opacity
:
0
.5
;
&
:hover
{
opacity
:
0
.8
;
}
}
.codeInlineRoot
{
display
:
inline-block
;
font-family
:
Consolas
,
Monaco
,
Andale
Mono
,
Ubuntu
Mono
,
monospace
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment