Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
40aa4109
Unverified
Commit
40aa4109
authored
Jan 06, 2024
by
Zzm0809
Committed by
GitHub
Jan 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature]support codeshow wrap-button (#2924)
* support-code-show-wrap-button * Spotless Apply --------- Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
6bfe4663
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
index.tsx
dinky-web/src/components/CustomEditor/CodeShow/index.tsx
+6
-1
index.tsx
...-web/src/components/CustomEditor/EditorFloatBtn/index.tsx
+9
-1
global.ts
dinky-web/src/locales/en-US/global.ts
+1
-0
global.ts
dinky-web/src/locales/zh-CN/global.ts
+1
-0
No files found.
dinky-web/src/components/CustomEditor/CodeShow/index.tsx
View file @
40aa4109
...
@@ -166,6 +166,10 @@ const CodeShow = (props: CodeShowFormProps) => {
...
@@ -166,6 +166,10 @@ const CodeShow = (props: CodeShowFormProps) => {
return
URL
.
createObjectURL
(
blob
);
return
URL
.
createObjectURL
(
blob
);
};
};
const
handleWrap
=
()
=>
{
editorInstance
?.
current
?.
updateOptions
({
wordWrap
:
'on'
});
};
/**
/**
* editorDidMount
* editorDidMount
* @param {editor.IStandaloneCodeEditor} editor
* @param {editor.IStandaloneCodeEditor} editor
...
@@ -200,7 +204,8 @@ const CodeShow = (props: CodeShowFormProps) => {
...
@@ -200,7 +204,8 @@ const CodeShow = (props: CodeShowFormProps) => {
handleBackBottom
,
handleBackBottom
,
handleUpScroll
,
handleUpScroll
,
handleDownScroll
,
handleDownScroll
,
handleDownloadLog
handleDownloadLog
,
handleWrap
};
};
/**
/**
...
...
dinky-web/src/components/CustomEditor/EditorFloatBtn/index.tsx
View file @
40aa4109
...
@@ -22,6 +22,7 @@ import { l } from '@/utils/intl';
...
@@ -22,6 +22,7 @@ import { l } from '@/utils/intl';
import
{
import
{
CloudDownloadOutlined
,
CloudDownloadOutlined
,
DownCircleFilled
,
DownCircleFilled
,
EnterOutlined
,
StopFilled
,
StopFilled
,
SyncOutlined
,
SyncOutlined
,
UpCircleFilled
,
UpCircleFilled
,
...
@@ -48,6 +49,7 @@ type EditFloatBtnProps = {
...
@@ -48,6 +49,7 @@ type EditFloatBtnProps = {
handleUpScroll
?:
()
=>
void
;
// up scroll callback
handleUpScroll
?:
()
=>
void
;
// up scroll callback
handleDownScroll
?:
()
=>
void
;
// down scroll callback
handleDownScroll
?:
()
=>
void
;
// down scroll callback
handleDownloadLog
?:
()
=>
string
;
// download log callback
handleDownloadLog
?:
()
=>
string
;
// download log callback
handleWrap
?:
()
=>
void
;
// wrap callback
};
};
const
EditorFloatBtn
:
React
.
FC
<
EditFloatBtnProps
>
=
(
props
)
=>
{
const
EditorFloatBtn
:
React
.
FC
<
EditFloatBtnProps
>
=
(
props
)
=>
{
/**
/**
...
@@ -65,7 +67,8 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
...
@@ -65,7 +67,8 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
handleBackBottom
,
handleBackBottom
,
handleUpScroll
,
handleUpScroll
,
handleDownScroll
,
handleDownScroll
,
handleDownloadLog
handleDownloadLog
,
handleWrap
}
=
props
;
}
=
props
;
/**
/**
...
@@ -121,6 +124,11 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
...
@@ -121,6 +124,11 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
href=
{
handleDownloadLog
?
handleDownloadLog
()
:
'123 '
}
href=
{
handleDownloadLog
?
handleDownloadLog
()
:
'123 '
}
title=
{
'Download'
}
title=
{
'Download'
}
/>
/>
<
CircleBtn
icon=
{
<
EnterOutlined
/>
}
onClick=
{
()
=>
handleWrap
&&
handleWrap
()
}
title=
{
l
(
'button.wrap'
)
}
/>
</
Space
>
</
Space
>
</>
</>
);
);
...
...
dinky-web/src/locales/en-US/global.ts
View file @
40aa4109
...
@@ -79,6 +79,7 @@ export default {
...
@@ -79,6 +79,7 @@ export default {
'button.backTop'
:
'Back Top'
,
'button.backTop'
:
'Back Top'
,
'button.backBottom'
:
'Back Bottom'
,
'button.backBottom'
:
'Back Bottom'
,
'button.downScroll'
:
'Down Scroll'
,
'button.downScroll'
:
'Down Scroll'
,
'button.wrap'
:
'Wrap'
,
'button.upScroll'
:
'Up Scroll'
,
'button.upScroll'
:
'Up Scroll'
,
'button.stopRefresh'
:
'Stop Auto Refresh'
,
'button.stopRefresh'
:
'Stop Auto Refresh'
,
'button.startRefresh'
:
'Start Auto Refresh(5s/e)'
,
'button.startRefresh'
:
'Start Auto Refresh(5s/e)'
,
...
...
dinky-web/src/locales/zh-CN/global.ts
View file @
40aa4109
...
@@ -79,6 +79,7 @@ export default {
...
@@ -79,6 +79,7 @@ export default {
'button.backTop'
:
'返回顶部'
,
'button.backTop'
:
'返回顶部'
,
'button.backBottom'
:
'去底部'
,
'button.backBottom'
:
'去底部'
,
'button.downScroll'
:
'向下滚动'
,
'button.downScroll'
:
'向下滚动'
,
'button.wrap'
:
'换行'
,
'button.upScroll'
:
'向上滚动'
,
'button.upScroll'
:
'向上滚动'
,
'button.stopRefresh'
:
'停止自动刷新'
,
'button.stopRefresh'
:
'停止自动刷新'
,
'button.startRefresh'
:
'开始自动刷新(5s/次)'
,
'button.startRefresh'
:
'开始自动刷新(5s/次)'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment