Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
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
Vũ Hoàng Anh
canifa_note
Commits
65ade1fc
Commit
65ade1fc
authored
Jul 03, 2022
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update todo block
parent
5dd6d505
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
16 deletions
+12
-16
DailyMemo.tsx
web/src/components/DailyMemo.tsx
+1
-1
Memo.tsx
web/src/components/Memo.tsx
+1
-1
PreviewImageDialog.tsx
web/src/components/PreviewImageDialog.tsx
+1
-1
ShareMemoImageDialog.tsx
web/src/components/ShareMemoImageDialog.tsx
+1
-8
marked.ts
web/src/helpers/marked.ts
+2
-2
memo-content.less
web/src/less/memo-content.less
+4
-1
memo.less
web/src/less/memo.less
+2
-2
No files found.
web/src/components/DailyMemo.tsx
View file @
65ade1fc
...
...
@@ -32,7 +32,7 @@ const DailyMemo: React.FC<Props> = (props: Props) => {
<
Only
when=
{
imageUrls
.
length
>
0
}
>
<
div
className=
"images-container"
>
{
imageUrls
.
map
((
imgUrl
,
idx
)
=>
(
<
img
key=
{
idx
}
crossOrigin=
"anonymous"
src=
{
imgUrl
}
decoding=
"async"
/>
<
img
key=
{
idx
}
src=
{
imgUrl
}
decoding=
"async"
/>
))
}
</
div
>
</
Only
>
...
...
web/src/components/Memo.tsx
View file @
65ade1fc
...
...
@@ -112,7 +112,7 @@ const Memo: React.FC<Props> = (props: Props) => {
}
else
{
locationService
.
setTagQuery
(
tagName
);
}
}
else
if
(
targetEl
.
class
Name
===
"todo-block"
)
{
}
else
if
(
targetEl
.
class
List
.
contains
(
"todo-block"
)
)
{
const
status
=
targetEl
.
dataset
?.
value
;
const
todoElementList
=
[...(
memoContainerRef
.
current
?.
querySelectorAll
(
`span.todo-block[data-value=
${
status
}
]`
)
??
[])];
for
(
const
element
of
todoElementList
)
{
...
...
web/src/components/PreviewImageDialog.tsx
View file @
65ade1fc
...
...
@@ -29,7 +29,7 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrl }: Props) => {
</
button
>
</
div
>
<
div
className=
"img-container"
>
<
img
src=
{
imgUrl
}
crossOrigin=
"anonymous"
/>
<
img
src=
{
imgUrl
}
/>
</
div
>
</>
);
...
...
web/src/components/ShareMemoImageDialog.tsx
View file @
65ade1fc
...
...
@@ -91,14 +91,7 @@ const ShareMemoImageDialog: React.FC<Props> = (props: Props) => {
<
Only
when=
{
imageUrls
.
length
>
0
}
>
<
div
className=
"images-container"
>
{
imageUrls
.
map
((
imgUrl
,
idx
)
=>
(
<
img
crossOrigin=
"anonymous"
decoding=
"async"
key=
{
idx
}
src=
{
imgUrl
}
onLoad=
{
handleImageOnLoad
}
onError=
{
handleImageOnLoad
}
/>
<
img
decoding=
"async"
key=
{
idx
}
src=
{
imgUrl
}
onLoad=
{
handleImageOnLoad
}
onError=
{
handleImageOnLoad
}
/>
))
}
</
div
>
</
Only
>
...
...
web/src/helpers/marked.ts
View file @
65ade1fc
...
...
@@ -11,8 +11,8 @@ const parseMarkedToHtml = (markedStr: string): string => {
.
replace
(
/
([\u
4e00-
\u
9fa5
])([
A-Za-z0-9?.,;[
\]]
+
)
/g
,
"$1 $2"
)
.
replace
(
/
([
A-Za-z0-9?.,;[
\]]
+
)([\u
4e00-
\u
9fa5
])
/g
,
"$1 $2"
)
.
replace
(
CODE_BLOCK_REG
,
"<pre lang=''>$1</pre>"
)
.
replace
(
TODO_BLOCK_REG
,
"<span class='todo-block
' data-value='TODO'>⬜
</span>"
)
.
replace
(
DONE_BLOCK_REG
,
"<span class='todo-block
' data-value='DONE'>✅
</span>"
)
.
replace
(
TODO_BLOCK_REG
,
"<span class='todo-block
todo' data-value='TODO'>
</span>"
)
.
replace
(
DONE_BLOCK_REG
,
"<span class='todo-block
done' data-value='DONE'>✓
</span>"
)
.
replace
(
DOT_LI_REG
,
"<span class='counter-block'>•</span>"
)
.
replace
(
NUM_LI_REG
,
"<span class='counter-block'>$1.</span>"
)
.
replace
(
BOLD_TEXT_REG
,
"<strong>$1</strong>"
)
...
...
web/src/less/memo-content.less
View file @
65ade1fc
...
...
@@ -25,7 +25,10 @@
}
.todo-block {
@apply rounded select-none cursor-pointer hover:shadow-inner;
@apply w-4 h-4 leading-4 border rounded float-left box-border text-lg cursor-pointer shadow-inner hover:opacity-80;
margin-top: 6px;
margin-left: 6px;
margin-right: 6px;
}
pre {
...
...
web/src/less/memo.less
View file @
65ade1fc
...
...
@@ -127,11 +127,11 @@
.pretty-scroll-bar(0, 2px);
> .memo-img {
@apply mr-2 last:mr-0 w-auto h-
32
shrink-0 grow-0 overflow-y-hidden;
@apply mr-2 last:mr-0 w-auto h-
auto
shrink-0 grow-0 overflow-y-hidden;
.hide-scroll-bar();
> img {
@apply w-auto max-h-
32
rounded-lg;
@apply w-auto max-h-
40
rounded-lg;
}
}
}
...
...
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