forked from mrlan/EnglishPal
				
			Merge branch 'Alpha-snapshot20230621' of http://121.4.94.30:3000/mrlan/EnglishPal into Alpha-snapshot20230621
						commit
						287d496ae9
					
				|  | @ -1,7 +1,7 @@ | |||
| {% block body %} | ||||
| {% if session['logged_in'] %} | ||||
| 
 | ||||
| 你已登录 <a href="/{{ session['username'] }}">{{ session['username'] }}</a>。 登出点击<a href="/logout">这里</a>。 | ||||
| 你已登录 <a href="/{{ session['username'] }}/userpage">{{ session['username'] }}</a>。 登出点击<a href="/logout">这里</a>。 | ||||
| 
 | ||||
| {% else %} | ||||
| <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes" /> | ||||
|  |  | |||
|  | @ -61,7 +61,7 @@ | |||
| {#    {% endfor %}#} | ||||
| 
 | ||||
|         <button class="btn btn-success" id="load_next_article" onclick="load_next_article();Reader.stopRead()"> 下一篇 Next Article </button> | ||||
|         <button class="btn btn-success" id="load_pre_article" onclick="load_pre_article();Reader.stopRead()" > 上一篇 Previous Article </button> | ||||
|         <button class="btn btn-success" id="load_pre_article" onclick="load_pre_article();Reader.stopRead()" style="display: none"> 上一篇 Previous Article </button> | ||||
| 
 | ||||
|     <p><b>阅读文章并回答问题</b></p> | ||||
|     <div id="text-content"> | ||||
|  | @ -162,6 +162,12 @@ | |||
|     {% endfor %} | ||||
| {% endif %} | ||||
| <script type="text/javascript"> | ||||
|     window.onload = function () { // 页面加载时执行 | ||||
|         // 刷新页面或进入页面时判断,若不是首篇文章,则上一篇按钮可见 | ||||
|         if(sessionStorage.getItem('pre_page_button')!="display" && sessionStorage.getItem('pre_page_button')){ | ||||
|             $('#load_pre_article').show(); | ||||
|         } | ||||
|      }; | ||||
|     function load_next_article(){ | ||||
|         $.ajax({ | ||||
|             url: '/get_next_article/{{username}}', | ||||
|  | @ -203,8 +209,10 @@ | |||
|     function check_pre(visited_articles){ | ||||
|         if((visited_articles=='')||(visited_articles['index']<=0)){ | ||||
|             $('#load_pre_article').hide(); | ||||
|             sessionStorage.setItem('pre_page_button', 'display') | ||||
|         }else{ | ||||
|             $('#load_pre_article').show(); | ||||
|             sessionStorage.setItem('pre_page_button', 'show') | ||||
|         } | ||||
|     } | ||||
|     function check_next(result_of_generate_article){ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue