防止多次点击刷屏操作#52
Open
spm2020spring wants to merge 5 commits intomasterfrom
Hidden character warning
The head ref may contain hidden characters: "hwx-2018319903003-\u9632\u6b62\u5237\u5c4f"
Open
Conversation
多次点击发表评论,系统提示请勿刷屏
spm2020spring
commented
Jan 5, 2021
templates/article.html
Outdated
| </div> | ||
|
|
||
| <button class="btn btn-primary" type="submit" style="float:right">comment</button> | ||
| <button id="btn" class="btn btn-primary" type="submit" style="float:right" onClick="prevent()">comment</button> |
Member
Author
There was a problem hiding this comment.
Why do you have the prevent() method, which is not defined anywhere?
Could you remove onClick="prevent() if it is no longer needed?
-Hui
spm2020spring
commented
Jan 5, 2021
| // 第一种 通过点击事件 | ||
| var clicktag = 1; | ||
| btn.onclick = function () { | ||
| if (clicktag == 3) { |
Member
Author
There was a problem hiding this comment.
spm2020spring
commented
Jan 5, 2021
templates/article.html
Outdated
| btn.onclick = function () { | ||
| if (clicktag == 3) { | ||
| alert("请勿频繁点击!"); | ||
| setTimeout(function () { clicktag = 0 }, 5000); |
Member
Author
There was a problem hiding this comment.
Member
Author
|
Could you show that your changes work when the software is running. -Hui |
|
------------------ 原始邮件 ------------------
发件人: "lanlab-org/OAPS-TreeLib" <notifications@github.com>;
发送时间: 2021年1月5日(星期二) 下午2:35
收件人: "lanlab-org/OAPS-TreeLib"<OAPS-TreeLib@noreply.github.com>;
抄送: "1020193782"<1020193782@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [lanlab-org/OAPS-TreeLib] 防止多次点击刷屏操作 (#52)
@1500h
Could you show that your changes work when the software is running.
…-Hui
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
I was going to write a function of prevent (). Later, I found that I just need to add an ID instead of onclick = "prevent ()", and I forgot to delete it
…------------------ 原始邮件 ------------------
发件人: "lanlab-org/OAPS-TreeLib" <notifications@github.com>;
发送时间: 2021年1月5日(星期二) 下午2:27
收件人: "lanlab-org/OAPS-TreeLib"<OAPS-TreeLib@noreply.github.com>;
抄送: "1020193782"<1020193782@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [lanlab-org/OAPS-TreeLib] 防止多次点击刷屏操作 (#52)
@spm2020spring commented on this pull request.
In templates/article.html:
> @@ -130,8 +131,21 @@ <h2 class="card-title">{{ article.title }}</h2><!--title--> <textarea class="form-control" rows="3" name="body" placeholder="write something here..." required="required"></textarea> </div> - <button class="btn btn-primary" type="submit" style="float:right">comment</button> + <button id="btn" class="btn btn-primary" type="submit" style="float:right" onClick="prevent()">comment</button>
@1500h
Why do you have the prevent() method, which is not defined anywhere?
-Hui
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
It can be set to one minute,change 5000 to 5000*60
…------------------ 原始邮件 ------------------
发件人: "lanlab-org/OAPS-TreeLib" <notifications@github.com>;
发送时间: 2021年1月5日(星期二) 下午2:30
收件人: "lanlab-org/OAPS-TreeLib"<OAPS-TreeLib@noreply.github.com>;
抄送: "1020193782"<1020193782@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [lanlab-org/OAPS-TreeLib] 防止多次点击刷屏操作 (#52)
@spm2020spring commented on this pull request.
In templates/article.html:
> </form> + <script type="text/javascript"> + // 第一种 通过点击事件 + var clicktag = 1; + btn.onclick = function () { + if (clicktag == 3) { + alert("请勿频繁点击!"); + setTimeout(function () { clicktag = 0 }, 5000);
@1500h
Probably you want to use a bigger number than 5000, as a more serious warning.
-Hui
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
4 and 5 are also OK. It mainly depends on the requirements for creating this project. It has been operated frequently for three times
…------------------ 原始邮件 ------------------
发件人: "lanlab-org/OAPS-TreeLib" <notifications@github.com>;
发送时间: 2021年1月5日(星期二) 下午2:28
收件人: "lanlab-org/OAPS-TreeLib"<OAPS-TreeLib@noreply.github.com>;
抄送: "1020193782"<1020193782@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [lanlab-org/OAPS-TreeLib] 防止多次点击刷屏操作 (#52)
@spm2020spring commented on this pull request.
In templates/article.html:
> </form> + <script type="text/javascript"> + // 第一种 通过点击事件 + var clicktag = 1; + btn.onclick = function () { + if (clicktag == 3) {
@1500h
Why do you choose 3, instead of 4 or 5?
-Hui
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Member
Author
|
Thanks. Could you delete -Hui |
|
Push a new commit already
…------------------ 原始邮件 ------------------
发件人: "lanlab-org/OAPS-TreeLib" <notifications@github.com>;
发送时间: 2021年1月6日(星期三) 晚上9:36
收件人: "lanlab-org/OAPS-TreeLib"<OAPS-TreeLib@noreply.github.com>;
抄送: "1020193782"<1020193782@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [lanlab-org/OAPS-TreeLib] 防止多次点击刷屏操作 (#52)
@1500h
Thanks. Could you delete onClick="prevent()" and change to 5000 to 60000? Push a new commit after you made these changes.
-Hui
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
多次点击发表评论,系统提示请勿刷屏
By