Bug 512 - 文章朗读问题

在fillwowrd.js中添加了stopRead()函数,将其添加给对应按钮或超链接以终止朗读。
任榆 2022-11-25 15:42:37 +08:00
parent 671df67723
commit 5c85041135
2 changed files with 9 additions and 5 deletions

View File

@ -62,3 +62,7 @@ function onReadClick() {
function onChooseClick() { function onChooseClick() {
isChoose = !isChoose; isChoose = !isChoose;
} }
function stopRead() {
reader.cancel();
}

View File

@ -23,15 +23,15 @@
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<p><b>English Pal for <font id="username" color="red">{{ username }}</font></b> <p><b>English Pal for <font id="username" color="red">{{ username }}</font></b>
<a class="btn btn-secondary" href="/logout" role="button">退出</a> <a class="btn btn-secondary" href="/logout" role="button" onclick="stopRead()">退出</a>
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a> <a class="btn btn-secondary" href="/reset" role="button" onclick="stopRead()">重设密码</a>
</p> </p>
{{ flashed_messages|safe }} {{ flashed_messages|safe }}
<a class="btn btn-success" href="/{{ username }}/reset" role="button"> 下一篇 Next Article </a> <a class="btn btn-success" href="/{{ username }}/reset" role="button" onclick="stopRead()"> 下一篇 Next Article </a>
{% if session.get('articleID') != session.get('old_articleID') %} {% if session.get('articleID') != session.get('old_articleID') %}
{% if session.get('old_articleID') != None %} {% if session.get('old_articleID') != None %}
<a class="btn btn-success" href="/{{ username }}/back" role="button"> 上一篇 Previous Article </a> <a class="btn btn-success" href="/{{ username }}/back" role="button" onclick="stopRead()"> 上一篇 Previous Article </a>
{% endif%} {% endif%}
{% endif %} {% endif %}
@ -52,7 +52,7 @@
<p><b>收集生词吧</b> (可以在正文中划词,也可以复制黏贴)</p> <p><b>收集生词吧</b> (可以在正文中划词,也可以复制黏贴)</p>
<form method="post" action="/{{ username }}"> <form method="post" action="/{{ username }}">
<textarea name="content" id="selected-words" rows="10" cols="120"></textarea><br/> <textarea name="content" id="selected-words" rows="10" cols="120"></textarea><br/>
<input type="submit" value="把生词加入我的生词库"/> <input type="submit" onclick="stopRead()" value="把生词加入我的生词库"/>
<input type="reset" value="清除"/> <input type="reset" value="清除"/>
</form> </form>
{% if session.get['thisWord'] %} {% if session.get['thisWord'] %}