@@ -100,23 +100,23 @@ function closeWin() {
100100 * @param clientY 相对窗口纵坐标
101101 * @param distance 滑动距离
102102 */
103- function dragandDrop ( btn_hk , clientX , clientY , distance ) {
103+ function dragandDrop ( btn_hk , clientX , clientY , distance ) {
104104 var elem = btn_hk ,
105105 k = 0 ,
106106 interval ;
107- iME ( elem , "mousedown" , 0 , 0 , clientX , clientY ) ;
108- interval = setInterval ( function ( ) {
107+ iME ( elem , "mousedown" , 0 , 0 , clientX , clientY ) ;
108+ interval = setInterval ( function ( ) {
109109 k ++ ;
110110 iter ( k ) ;
111111 if ( k === distance ) {
112112 clearInterval ( interval ) ;
113- iME ( elem , "mouseup" , clientX + k , clientY , 220 + k , 400 ) ;
113+ iME ( elem , "mouseup" , clientX + k , clientY , 220 + k , 400 ) ;
114114 }
115115 } , 10 ) ;
116116 function iter ( y ) {
117- iME ( elem , "mousemove" , clientX + y , clientY , clientX + y , clientY ) ;
117+ iME ( elem , "mousemove" , clientX + y , clientY , clientX + y , clientY ) ;
118118 }
119- function iME ( obj , event , screenXArg , screenYArg , clientXArg , clientYArg ) {
119+ function iME ( obj , event , screenXArg , screenYArg , clientXArg , clientYArg ) {
120120 var mousemove = document . createEvent ( "MouseEvent" ) ;
121121 mousemove . initMouseEvent ( event , true , true , unsafeWindow , 0 , screenXArg , screenYArg , clientXArg , clientYArg , 0 , 0 , 0 , 0 , 0 , null ) ;
122122 obj . dispatchEvent ( mousemove ) ;
@@ -235,40 +235,46 @@ function getVideoTag() {
235235 let video = null ;
236236 let pauseButton = null ;
237237 var u = navigator . userAgent ;
238- if ( u . indexOf ( 'Mac' ) > - 1 ) { //Mac
239- if ( iframe != null && iframe . innerHTML ) {
240- //如果有iframe,说明外面的video标签是假的
241- video = iframe . contentWindow . document . getElementsByTagName ( "video" ) [ 0 ] ;
242- pauseButton = iframe . contentWindow . document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
243- } else {
244- //否则这个video标签是真的
245- video = document . getElementsByTagName ( "video" ) [ 0 ] ;
246- pauseButton = document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
247- }
248- return {
249- "video" : video ,
250- "pauseButton" : pauseButton
251- }
252- }
253- else {
254- // if (iframe) {
255- // //如果有iframe,说明外面的video标签是假的
256- // video = iframe.contentWindow.document.getElementsByTagName("video")[0];
257- // pauseButton = iframe.contentWindow.document.getElementsByClassName("prism-play-btn")[0];
258- // } else {
259- // //否则这个video标签是真的
260- // video = document.getElementsByTagName("video")[0];
261- // pauseButton = document.getElementsByClassName("prism-play-btn")[0];
262- // }
263238
264- // 视频播放按钮更新
265- video = document . getElementsByTagName ( "video" ) [ 0 ] ;
266- pauseButton = document . getElementsByClassName ( "prism-big-play-btn" ) [ 0 ] ;
267- return {
268- "video" : video ,
269- "pauseButton " : pauseButton
270- }
239+ // 视频播放按钮更新
240+ video = document . getElementsByTagName ( "video" ) [ 0 ] ;
241+ pauseButton = document . getElementsByClassName ( "prism-big-play-btn" ) [ 0 ] ;
242+
243+ return {
244+ "video " : video ,
245+ "pauseButton" : pauseButton
271246 }
247+
248+ // if (u.indexOf('Mac') > -1) {//Mac
249+ // if (iframe != null && iframe.innerHTML) {
250+ // //如果有iframe,说明外面的video标签是假的
251+ // video = iframe.contentWindow.document.getElementsByTagName("video")[0];
252+ // pauseButton = iframe.contentWindow.document.getElementsByClassName("prism-play-btn")[0];
253+ // } else {
254+ // //否则这个video标签是真的
255+ // video = document.getElementsByTagName("video")[0];
256+ // pauseButton = document.getElementsByClassName("prism-play-btn")[0];
257+ // }
258+ // return {
259+ // "video": video,
260+ // "pauseButton": pauseButton
261+ // }
262+ // }
263+ // else {
264+ // if (iframe) {
265+ // //如果有iframe,说明外面的video标签是假的
266+ // video = iframe.contentWindow.document.getElementsByTagName("video")[0];
267+ // pauseButton = iframe.contentWindow.document.getElementsByClassName("prism-play-btn")[0];
268+ // } else {
269+ // //否则这个video标签是真的
270+ // video = document.getElementsByTagName("video")[0];
271+ // pauseButton = document.getElementsByClassName("prism-play-btn")[0];
272+ // }
273+ // return {
274+ // "video": video,
275+ // "pauseButton": pauseButton
276+ // }
277+ // }
272278}
273279
274280//读新闻或者看视频
@@ -734,8 +740,8 @@ async function doingExam() {
734740 await waitRandomBetween ( 2 , 5 ) ;
735741 await doingPause ( ) ;
736742 nextButton = await getNextButton ( ) ;
737- if ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] != null ) {
738- dragandDrop ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] , 0 , 0 , 300 ) ;
743+ if ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] != null ) {
744+ dragandDrop ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] , 0 , 0 , 300 ) ;
739745 }
740746 if ( nextButton . textContent == "再练一次" || nextButton . textContent == "再来一组" || nextButton . textContent == "查看解析" ) {
741747 break ;
0 commit comments