Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ <h1>玫枫跟打器<br>(<a target="_blank" href="https://github.com/KyleBing/typ
<div onclick="engine.repeatCountAdd()" title="增加重打次数">+</div>
<div onclick="engine.repeatCountMinus()" title="减少重打次数">-</div>
</div>
<div class="btn-vertical">
<div onclick="engine.repeatCountInfinity()" title="不限次重打">∞</div>
</div>
</div>
<div class="btn-group">
<label class="hidden" for="article"></label>
Expand Down
29 changes: 23 additions & 6 deletions js/class/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ define(
this.config.isBigCharacter ? enterBigCharacterMode() : leaveBigCharacterMode();

// Repeat Monitor
$('#repeatCountTotal').innerText = this.config.repeatCountTotal
$('#repeatCountTotal').innerText = this.config.repeatCountTotal == Number.MAX_VALUE ? '∞' : this.config.repeatCountTotal
$('#repeatCountCurrent').innerText = this.config.repeatCountCurrent

this.currentOriginWords = this.config.article.split('');
Expand Down Expand Up @@ -511,22 +511,39 @@ define(

// 重复次数 +
repeatCountAdd(){
this.config.repeatCountTotal++;
$('#repeatCountTotal').innerText = this.config.repeatCountTotal;
this.config.save()
if (this.config.repeatCountTotal != Number.MAX_VALUE) {
this.config.repeatCountTotal++;
$('#repeatCountTotal').innerText = this.config.repeatCountTotal;
this.config.save()
} else {
console.log('cannot be greater than infinity')
let btn = $('#repeatMonitor')
Utility.shakeDom(btn)
}
}
// 重复次数 -
repeatCountMinus(){
if (this.config.repeatCountTotal > 1){
if (this.config.repeatCountTotal > 1 && this.config.repeatCountTotal != Number.MAX_VALUE){
this.config.repeatCountTotal--;
$('#repeatCountTotal').innerText = this.config.repeatCountTotal;
this.config.save()
} else {
console.log('can not lower than 1')
console.log('can not lower than 1 or infinite')
let btn = $('#repeatMonitor')
Utility.shakeDom(btn)
}
}
// 不限重复次数
repeatCountInfinity() {
if (this.config.repeatCountTotal != Number.MAX_VALUE) {
this.config.repeatCountTotal = Number.MAX_VALUE
$('#repeatCountTotal').innerText = '∞';
} else {
this.config.repeatCountTotal = 1
$('#repeatCountTotal').innerText = this.config.repeatCountTotal;
}
this.config.save()
}

// 切换全局内容乱序模式
shuffleCurrentArticle() {
Expand Down
4 changes: 4 additions & 0 deletions scss/mixin/_black.scss
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ body.black {
> *{
border-right: none;
border-bottom: 1px solid $black-color-border;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
&:last-child{
border-bottom: none;
}
Expand Down
4 changes: 4 additions & 0 deletions scss/mixin/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ input[type=checkbox]:checked + label.checker {
flex-flow: column nowrap;
justify-content: center;
align-items: center;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
> *{
@extend .btn;
padding: 2px;
Expand Down
5 changes: 4 additions & 1 deletion scss/typepad.css
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,11 @@ input[type=checkbox]:checked + label.checker {
text-align: center;
background-color: #fff;
border-bottom: 1px solid #dddddd;
height: 50%;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.btn-group .btn-vertical > *:last-child {
border-bottom: none;
Expand Down