Skip to content

Commit 18bce08

Browse files
authored
Merge pull request #22 from cloudoptlab/feat/2.x/internationalization
Feat/2.x/internationalization
2 parents ed3ecdb + 0b0ba97 commit 18bce08

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/content/block.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,24 @@ import * as utils from '../core/utils'
33
import * as message from '../core/message'
44
import $ from 'jquery'
55

6-
const href = $('.block-page a>.block-pre').parent().attr('href')
7-
$('.block-page a>.block-pre').parent().attr('href', '#')
8-
$('.block-page a>.block-pre').parent().click(async () => {
9-
const config = await coreConfig.get()
10-
const hrefHost = utils.getHost(href)
11-
if (config.allowList.indexOf(hrefHost) < 0) {
12-
config.allowList.push(hrefHost)
13-
config.blockList.removeByValue(hrefHost)
14-
coreConfig.set(config).then(() => {
6+
$.ready.then(() => {
7+
const href = $('.block-page a>.block-pre').parent().attr('href')
8+
$('.block-page a>.block-pre').parent().attr('href', '#')
9+
$('.block-page a>.block-pre').parent().click(async () => {
10+
const config = await coreConfig.get()
11+
const hrefHost = utils.getHost(href)
12+
if (config.allowList.indexOf(hrefHost) < 0) {
13+
config.allowList.push(hrefHost)
14+
config.blockList.removeByValue(hrefHost)
15+
coreConfig.set(config).then(() => {
16+
location.href = href
17+
})
18+
} else {
1519
location.href = href
16-
})
17-
} else {
18-
location.href = href
19-
}
20-
})
20+
}
21+
})
2122

22-
const url = $('.block-button').parent().attr('href')
23-
$('.block-button').parent().attr('href', '#')
24-
$('.block-button').parent().attr('target', '')
25-
$('.block-button').parent().click(() => {
26-
message.send('open-tab', url)
23+
const url = $('.block-button').parent().attr('href')
24+
$('.block-button').parent().attr('href', url)
25+
$('.block-button').parent().attr('target', '_blank')
2726
})

src/guide/guide.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
align-items: center;
44
justify-content: center;
55
height: 100vh;
6-
background-color: rgb(245,246,247);
6+
background-color: rgb(245, 246, 247);
77
.btn {
88
outline: none;
99
border: none;
@@ -36,7 +36,7 @@
3636
align-items: center;
3737
justify-content: center;
3838
.switch-item {
39-
width: 570px;
39+
max-width: 570px;
4040
}
4141
>span.title {
4242
font-size: 16px;
@@ -92,11 +92,11 @@
9292
margin-bottom: 60px;
9393
display: block;
9494
}
95-
.guide-content{
95+
.guide-content {
9696
width: 100%;
9797
margin-bottom: 40px;
9898
}
9999
}
100100
}
101101
}
102-
}
102+
}

0 commit comments

Comments
 (0)