超星便捷

视频解除鼠标限制,允许快进、拖动,PDF快速翻页、跳转,作业允许粘贴(请勿大量刷课,封号斗罗警告)

  1. // ==UserScript==
  2. // @name 超星便捷
  3. // @description 视频解除鼠标限制,允许快进、拖动,PDF快速翻页、跳转,作业允许粘贴(请勿大量刷课,封号斗罗警告)
  4. // @namespace FuckChaoxingScript
  5. // @author 涛之雨
  6. // @version 1.4.8
  7. // @grant GM_addStyle
  8. // @run-at document-start
  9. // @require https://gf.qytechs.cn/scripts/18715-hooks/code/Hooks.js?version=661566
  10. // @require https://libs.baidu.com/jquery/2.1.4/jquery.min.js
  11. // @require https://gf.qytechs.cn/scripts/29782-docsready/code/docsReady.js?version=603417
  12. // @require https://gf.qytechs.cn/scripts/399356-dtoast/code/DToast.js?version=787349
  13. // @match *://*.fanya.chaoxing.com/*
  14. // @match *://i.mooc.chaoxing.com/*
  15. // @match *://*.chaoxing.com/space/*
  16. // @match *://*.chaoxing.com/mycourse/studentcourse*
  17. // @match *://*.chaoxing.com/mycourse/studentstudy*
  18. // @match *://*.chaoxing.com/ananas/modules/pdf/index.html*
  19. // @match *://*.chaoxing.com/ananas/modules/ppt/index.html*
  20. // @match *://*.chaoxing.com/ananas/modules/video/index.html*
  21. // @match *://*.chaoxing.com/ananas/modules/work/index.html*
  22. // @match *://*.chaoxing.com/work/doHomeWorkNew*
  23. // @match *://*.chaoxing.com/knowledge/cards*
  24. // @license BSD 2-Clause
  25. // @icon https://i.loli.net/2020/03/04/D3h1iWSFeyc8AKG.png
  26. // @home-url https://gf.qytechs.cn/zh-CN/scripts/403935
  27. // ==/UserScript==
  28.  
  29.  
  30. //借鉴:https://gf.qytechs.cn/zh-CN/scripts/20059-chaoxing
  31. // Fuck Chaoxing
  32. //新版本的是flash内的判断,上面的脚本已失效
  33. /**************************\
  34. * V1.4.8
  35. * 修复了对新版ppt/pdf按钮的适配问题
  36. * V1.4.7
  37. * 对新版视频播放器的适配(怎么又更新了。。。)
  38. * V1.4.6
  39. * 新增Ctrl+左右键快速跳转首末页
  40. * 修复按键绑定事异常
  41. * 修复对于图片加载的判定报错问题
  42. * V1.4.5
  43. * 修复页面旧数据无效导致的bug
  44. * V1.4.4
  45. * 修复部分历史问题,增加稳定性和纠正语法错误
  46. * 新增考试/作业见面Ctrl+s随手保存功能(防止手滑)
  47. * 新增对新版的PPT页面支持
  48. * V1.4.3
  49. * 删除超星和腾讯课堂的签到支持,单独抽取出新的脚本
  50. * 参见:https://gf.qytechs.cn/zh-CN/scripts/401115
  51. * V1.4.2
  52. * 适配新版超星的PDF/PPT翻页(天天要重新适配(╬ ̄皿 ̄)=○)
  53. * 顺便精简了部分的代码
  54. * V1.4.1
  55. * 增加了一个右下角的HOME图标(其实没啥用。。。)
  56. * 精简代码,删除臃肿部分
  57. * 优化了流程,(大更改。。。新旧版本的比较可以查看我的git小站)
  58. * 删除了所有注释。。。。(其实是不小心删除的。。。。。)
  59. * 如果需要看注释请查看旧版本(链接:http://taozhiyu.rthe.net/fuckcx_52_v1.3.11_backup.js)
  60. *
  61. * V1.3.12
  62. * 修改了部分遮挡文本的布局
  63. * 增加PDF/PPT页面左右按键快速翻页
  64. * 增加视频上下(音量增减)左右(快退进)空格(暂停/播放)的按键操作
  65. * 增加了一些奇怪的文字
  66. * V1.3.11
  67. * 增加对于非任务点的视频页面切换的支持(互相切换按钮)
  68. * V1.3.10
  69. * 修复了对于非任务PDF/PPT界面
  70. * 对部分流程进行了优化
  71. * 增加对于不同版本的适配,之前咱不知道啊(╬ ̄皿 ̄)=○
  72. * 增加了视屏倍速的选择框和视频实际倍速同步的功能
  73. * V1.3.9
  74. * 修复了对于视屏倍速的重新适配
  75. * 精简了部分代码
  76. * V1.3.8
  77. * 修复了新版ppt/pdf页面动态加载导致无法快速跳转的bug
  78. * 修复了【作业】界面提示文字不显示的bug
  79. * V1.3.7
  80. * 修复了部分ppt/pdf页面只有一页时跳转功能显示和点击跳转后出错的bug
  81. * 修复了对于部分学校视频界面显示不全的bug
  82. * V1.3.6
  83. * 增加了对于ppt页面的适配(参见pdf的功能)
  84. * V1.3.5
  85. * 增加了快速跳转到某一页
  86. * 增加了对于【拓展】页面视频的支持
  87. * V1.3.4
  88. * 增加了PDF快速跳转到某一页
  89. * V1.3.3
  90. * 增加了取消作业界面禁止粘贴的限制
  91. * 增加了对于PDF页面2分钟后显示上下页时间的修改(改为1秒)和渐隐插件未生效提醒
  92. * 增加了对于学习所有网页的图标支持
  93. * 多视频时视频同时自动播放,混乱,去除。
  94. * V1.3.2
  95. * 增加了对于PDF的时长强制改为1秒钟(我们学校为2分钟一页)
  96. * 增加了5秒后视频自动播放
  97. * V1.3.1
  98. * 增加了对于新版json的支持
  99. \**************************/
  100.  
  101.  
  102. (function () {
  103. /* if (location.href.match(/studentstudy/) !== null||location.href.match(/mooc/) !== null||location.href.match(/studentcourse/) !== null||location.href.match(/fanya/) !== null||location.href.match(/space/) !== null) {
  104. if(top.location==self.location){
  105. $(document).ready(function () {
  106. var home_btn = document.createElement("div");
  107. home_btn.id = 'home_tao';
  108. home_btn.title = "涛之雨的小站";
  109. home_btn.style = "transform: rotate(0deg);background: url('https:\/\/s1.ax1x.com/2020/03/30/GnMT6U.png') no-repeat center center;width: 60px;height: 60px;position: fixed;right: 0px;bottom: 10px;z-index: 999999999;cursor: pointer;border: 4px solid #00bdff96;border-radius: 50%;background-size: 100% 100%;box-sizing: border-box;";
  110. $("body")[0].append(home_btn);
  111. var TaoW = $('#home_tao')[0].offsetWidth;
  112. var TaoH = $('#home_tao')[0].offsetHeight;
  113. var cuntW = 0;
  114. var cuntH = 0;
  115. var wait_out;
  116. $('#home_tao')[0].onmouseover = function () {
  117. this.style.transition = '0.5s';
  118. move(0, 0);
  119. rate(0);
  120. if (!!wait_out) {
  121. clearTimeout(wait_out);
  122. }
  123. };
  124. $('#home_tao')[0].onmouseout = function () {
  125. this.style.transition = '0.5s';
  126. if (!!wait_out) {
  127. clearTimeout(wait_out);
  128. }
  129. wait_out = setTimeout(function () {
  130. move(TaoW / 2, TaoH / 2);
  131. rate(-90);
  132. }, 700);
  133. };
  134. window.onresize = function () {
  135. var bodyH = document.body.offsetHeight;
  136. var TaoT = $('#home_tao')[0].offsetTop;
  137. var bodyW = document.body.offsetWidth;
  138. var TaoL = $('#home_tao')[0].offsetLeft;
  139. if (TaoT + TaoH > bodyH) {
  140. $('#home_tao')[0].style.top = bodyH - TaoH + 'px';
  141. cuntH++;
  142. }
  143. if (bodyH > TaoT && cuntH > 0) {
  144. $('#home_tao')[0].style.top = bodyH - TaoH + 'px';
  145. }
  146. if (TaoL + TaoW > bodyW) {
  147. $('#home_tao')[0].style.left = bodyW - TaoW + 'px';
  148. cuntW++;
  149. }
  150. if (bodyW > TaoL && cuntW > 0) {
  151. $('#home_tao')[0].style.left = bodyW - TaoW + 'px';
  152. }
  153. move(TaoW / 2, TaoH / 2);
  154. };
  155. function move(w, h) {
  156. $('#home_tao')[0].style.left = document.body.offsetWidth - TaoW + w + 'px';
  157. }
  158. function rate(a) {
  159. $('#home_tao')[0].style.transform = 'rotate(' + a + 'deg)';
  160. }
  161. setTimeout(function () {
  162. var wait_out;
  163. $('#home_tao')[0].style.transition = '0.5s';
  164. move(TaoW / 2, TaoH / 2);
  165. rate(-90);
  166. } , 5000);
  167. $("#home_tao").click(function () {
  168. alert("虽然啥都没有。。。但是既然把你骗来了,就看看吧\n");
  169. var window_tab = window.open('');
  170. window_tab.location = 'https://taozhiyu.gitee.io';
  171. });
  172. $(document).keydown(function (event) {
  173. var e = event || window.event;
  174. if (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 37 || e.keyCode === 39 || e.keyCode === 32) {
  175. e.preventDefault();
  176. }
  177. });
  178. });
  179. }
  180. } */
  181. function set_icon() {
  182. var link = document.createElement('link');
  183. link.type = 'image/x-icon';
  184. link.rel = 'icon';
  185. link.href = 'https://i.loli.net/2020/03/04/D3h1iWSFeyc8AKG.png';
  186. document.getElementsByTagName('head')[0].appendChild(link);
  187. var link2 = document.createElement('link');
  188. link2.type = 'image/x-icon';
  189. link2.rel = 'shortcut icon';
  190. link2.href = 'https://i.loli.net/2020/03/04/D3h1iWSFeyc8AKG.png';
  191. document.getElementsByTagName('head')[0].appendChild(link2);
  192. }
  193. set_icon();
  194. if (location.href.match(/knowledge\/cards/) !== null) {
  195. window.onload = function () {
  196. $(document).keydown(function (event) {
  197. var e = event || window.event;
  198. if (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 37 || e.keyCode === 39 || e.keyCode === 32) {
  199. e.preventDefault();
  200. }
  201. });
  202. if ($("iframe").length !== 0) {
  203. console.log("%c当前界面有%c" + $("iframe").length + "个%c学习子页面","color:black","color:red;font-size:20px","color:black");
  204. $("iframe").each(function () {
  205. var src_ = $(this)[0].src;
  206. if (src_.match(/video/) !== null) {
  207. var data_json = $.parseJSON($(this)[0].getAttribute('data').toString());
  208. data_json.danmaku=0;
  209. data_json.fastforward=false;
  210. data_json.switchwindow=false;
  211. $(this)[0].setAttribute('data', JSON.stringify(data_json));
  212. $(this)[0].style.height = "645px";
  213. $(this)[0].src=$(this)[0].src;
  214. }
  215. if (src_.match(/doHomeWorkNew/) !== null) {
  216. $(".ans-job-icon")[0].style.width = "100%";
  217. var homeWork_view = '<p style="color:blue;float:right;font-size: 13px;">允许粘贴&nbsp;:涛之雨&nbsp;&nbsp;如果失效,可以按【F5】键刷新(注意保存哦)</p>';
  218. $(".ans-job-icon").append(homeWork_view);
  219. }
  220. if (src_.match(/pdf/) !== null || src_.match(/ppt/) !== null) {
  221. top.window.scrollBy(0, 241);
  222. }
  223. });
  224. }
  225. };
  226. }
  227. if (location.href.match(/pdf/) !== null || location.href.match(/ppt/) !== null) {
  228. $(document).ready(function() {
  229. GM_addStyle(".imglook{height:unset!important;}");});
  230. window.onload = function () {
  231. var check_page=function (page) {
  232. Number(page) != Number(endpage) ? $("#btn_r")[0].style.display = "" : $("#btn_r")[0].style.display = "none";
  233. Number(page) != 1 ? $("#btn_l")[0].style.display = "" : $("#btn_l")[0].style.display = "none";
  234. };
  235. var PDF_div, myDiv, mychooseDiv, choose_div,isok=false;
  236. function kbd_page(event) {
  237. var e = event || window.event, ev;
  238. if (e && e.keyCode === 37&&e.ctrlKey) {
  239. $("#btn_l")[0].click();
  240. return false;
  241. }
  242. else if (e && e.keyCode === 39&&e.ctrlKey) {
  243. $("#btn_r")[0].click();
  244. return false;
  245. }
  246. else if (e && e.keyCode === 37) {
  247. if (Number($(".num")[0].innerHTML) > 1) {
  248. $(".preBtn")[0].click();
  249. }
  250. else {
  251. alert("这已经是第一页了。我怀疑你再搞事情但是我没有证据\n打洗你 (╬ ̄皿 ̄)=○#( ̄#)3 ̄) ");
  252. }
  253. return false;
  254. }
  255. else if (e && e.keyCode === 39) {
  256. if (Number($(".num")[0].innerHTML) < endpage) {
  257. $(".nextBtn")[0].click();
  258. }
  259. else {
  260. alert("已经到最后了。。。。。\n学习也不至于这么投入吧。。。。");
  261. }
  262. return false;
  263. }
  264. else if (e && e.keyCode === 38) {
  265. $(".imglook")[0].scrollTop -= 30;
  266. }
  267. else if (e && e.keyCode === 40) {
  268. $(".imglook")[0].scrollTop += 30;
  269. }
  270. }
  271. var data_json = $.parseJSON(window.frameElement.getAttribute('data').toString());
  272. if (data_json.jobid || data_json.btime) {
  273. var endpage=-1;
  274. try{
  275. endpage= window.data.pagenum;
  276. }catch(e){}
  277. if(endpage==-1){
  278. var get_endpage = setInterval(function () {
  279. //window.data.timing = 1;
  280. if ($(".documentImg").length!==0&&$(".documentImg")[0]!==undefined&&$(".documentImg")[0].complete&&isok) {
  281. clearInterval(get_endpage);
  282. endpage = Number($(".all")[0].innerHTML);
  283. check_page(Number($(".num")[0].innerHTML));
  284. }
  285. }, 10);
  286. }else{
  287. setTimeout(()=>{check_page(endpage);},1000);
  288. }
  289. try{
  290. window.data.timing = 0;
  291. }catch(w){}
  292. function newbutton(){
  293. var setButton = setTimeout(function () {
  294. if(document.querySelectorAll(".turnpage_Btn").length==0){
  295. clearTimeout(setButton);
  296. newbutton();
  297. }
  298. var pdf_i = 0, pdf_timeout = 0;
  299. var pi_times = 0;
  300. PDF_div = '<p style="color:red;position:fixed;top:0;left:0;width:100%;font-size: 10px;opacity:1">PDF上下页强制显示&第一页最后一页&页面跳转&nbsp;:涛之雨</br>第一次加载可能比较慢,如果页面加载完,“前后页”和“第一/最后一页”按钮5秒钟内没有出现,请按【F5】键刷新</p>';
  301. myDiv = document.createElement("div");
  302. myDiv.id = 'mysellectid';
  303.  
  304. document.querySelectorAll(".turnpage_Btn")[0].insertBefore(myDiv, document.querySelectorAll(".turnpage_Btn")[0].children[0].firstChild);
  305. $("#mysellectid").append(PDF_div);
  306. var btnl = document.createElement("div");
  307. btnl.id = 'btn_l';
  308. btnl.title = "第一页";
  309. btnl.style = "display:none;background: url(https://s2.ax1x.com/2020/03/09/8pKLNQ.png) no-repeat;width: 60px;height: 60px;position: fixed;left: 20px;top: 50%;margin-top: -30px;z-index: 10;cursor: pointer;";
  310. $(".imglook")[0].insertBefore(btnl, $(".imglook")[0].firstChild);
  311. var btnr = document.createElement("div");
  312. btnr.id = 'btn_r';
  313. btnr.title = "最后一页";
  314. btnr.style = "display:none;background: url(https://s2.ax1x.com/2020/03/09/8pKOhj.png) no-repeat;width: 60px;height: 60px;position: fixed;right: 20px;top: 50%;margin-top: -30px;z-index: 10;cursor: pointer;";
  315. $(".imglook")[0].insertBefore(btnr, $(".imglook")[0].firstChild);
  316. //$(".mkeLbtn")[0].style.marginTop = "-120px";
  317. //$(".mkeRbtn")[0].style.marginTop = "-120px";
  318. var mygotopage = document.createElement("span");
  319. mygotopage.innerHTML = "跳转到第[<input id='goto_num' style='width:20px;BACKGROUND-COLOR:aliceblue;BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid;' type='editor'/>]页";
  320. //$(".mkeNum")[0].insertBefore(mygotopage, $(".mkeNum")[0].lastChild);
  321. var tip_keydown = document.createElement("span");
  322. tip_keydown.innerHTML = "<span style='font-size:2px;color:blue'> POWER BY:涛之雨</span>";//<font color='blue' style='font-size:2px;'>支持左右键翻页,Ctrl+左右键首/末页</font>";
  323. $(".fl.pageInfo").append(tip_keydown);
  324. isok=true;
  325. var show_pdf=function () {
  326. pi_times = 0;
  327. clearInterval(pdf_i);
  328. clearTimeout(pdf_timeout);
  329. $("#mysellectid")[0].style.opacity = 1;
  330. pdf_timeout = setTimeout(function () {
  331. pdf_i = setInterval(function () {
  332. if ($("#mysellectid")[0].style.opacity <= 0) {
  333. $("#mysellectid")[0].style.opacity = 0;
  334. $("#mysellectid")[0].innerHTML = '<p style="color:blue;position:fixed;top:0;left:0;width:100%;font-size: 10px;opacity:1">PDF上下页强制显示&第一页最后一页&页面跳转&nbsp;:涛之雨</p>';
  335. clearInterval(pdf_i);
  336. }else{
  337. $("#mysellectid")[0].style.opacity -= 0.07;
  338. }
  339. }, 100);
  340. }, 5000);
  341. };
  342. $(".preBtn")[0].onclick = function () {
  343. check_page(Number($(".num")[0].innerHTML));
  344. show_pdf();
  345. };
  346. $(".nextBtn")[0].onclick = function () {
  347. check_page(Number($(".num")[0].innerHTML));
  348. show_pdf();
  349. };
  350. show_pdf();
  351. var changePage=function (endnum = endpage) {
  352. var isNext = true, a = Number(endnum) - Number($(".num")[0].innerHTML);
  353. a === 0 ? alert("你自己看看你现在多少页?!\n有意思撒?") : (a > 0 ? isNext = true : (isNext = false, a = -a));
  354. for (; !!a; a--) {
  355. isNext ? $(".nextBtn")[0].click() : $(".preBtn")[0].click();
  356. }
  357. };
  358. $("#btn_r").click(function () {
  359. changePage();
  360. });
  361. $("#btn_l").click(function () {
  362. changePage(1);
  363. });
  364. $("#goto_num").keydown(function (event) {
  365. if (event.keyCode == 13) {
  366. var page_num;
  367. var pnum = $(this)[0].value;
  368. var isnum = new RegExp("[0-9]+");
  369. if (!isnum.test(pnum)) {
  370. shit(pnum, false);
  371. return false;
  372. }
  373. else {
  374. page_num = Number(pnum);
  375. }
  376. if (page_num <= 0 || page_num > endpage) {
  377. shit(page_num, true);
  378. return false;
  379. }
  380. else if (page_num == 1) {
  381. alert("你瞎啊,看不见左边有个“第一页”的图标啊!!!\n分不清哪一个?鼠标放上去等一会就有提醒了啊!\n虽然一行话就能解决跳转到第一页,但是我不愿意!");
  382. }
  383. else if (page_num == Number(endpage)) {
  384. alert("你瞎啊,看不见右边有个“最后一页”的图标啊!!!\n分不清哪一个?鼠标放上去等一会就有提醒了啊!\n虽然一行话就能解决跳转到第一页,但是我不愿意!");
  385. }
  386. else {
  387. changePage(page_num);
  388. }
  389. $(this)[0].value = "";
  390. return true;
  391. }
  392. function shit(page_num, isnum) {
  393. if (pi_times >= 3) {
  394. alert("皮皮皮!!!还皮!\n皮断腿了吧o(´^`)o");
  395. window.top.location.href = "https://taozhiyu.gitee.io/bd?q=.";
  396. return;
  397. }
  398. else if (!isnum) {
  399. alert("不要皮好不好ヾ(。`Д´。)ノ彡。。。\n你让我怎么跳到第" + page_num + "页 (╬ ̄皿 ̄)\n你告诉我那一页是第" + page_num + "页?!!\n你家页数不是数字啊!!!\n做脚本很累的好伐!!!");
  400. }
  401. else {
  402. alert("不要皮好不好ヾ(。`Д´。)ノ彡。。。\n一共只有" + endpage + "页,你让我怎么跳到第" + page_num + "页 (╬ ̄皿 ̄)\n做脚本很累的好伐!!!");
  403. }
  404. $(this)[0].value = "";
  405. pi_times++;
  406. return false;
  407. }
  408. });
  409. top.document.onkeydown=function(e){
  410. kbd_page(e);
  411. return 0;
  412. }
  413. parent.document.onkeydown=function(e){
  414. kbd_page(e);
  415. return 0;
  416. }
  417. document.onkeydown=function(e){
  418. kbd_page(e);
  419. return 0;
  420. }
  421. if (data_json.isTao == 1) {
  422. choose_div = '<p style="width: 25px;height: 25px;line-height: 25px;text-align: center; font-size: 3px; color: #ffffff;">On</p>';
  423. mychooseDiv = document.createElement("div");
  424. mychooseDiv.id = 'My_choose';
  425. mychooseDiv.style = 'border-radius: 50%;background-color:#d71345;width:25px;height:25px;position:fixed;right:2px;top:0%;z-index:10;cursor:pointer;-moz-background-size:100% 100%;-o-background-size:100% 100%;-webkit-background-size:100% 100%;background-size:100% 100%;';
  426. $(".imglook")[0].insertBefore(mychooseDiv, $(".imglook")[0].firstChild);
  427. $("#My_choose").append(choose_div);
  428. $("#My_choose").click(function () {
  429. data_json.isTao = 0;
  430. data_json.jobid = "";
  431. data_json.btime = "";
  432. window.frameElement.setAttribute('data', JSON.stringify(data_json));
  433. location.href = location.href + (location.href.indexOf("?") > -1 ? "&" : "?") + "wuai=" + (new Date()).getTime();
  434. });
  435. }
  436. },100);
  437. }
  438. newbutton();
  439. }
  440. else {
  441. PDF_div = '<p style="color:red;position:fixed;top:0;left:0;width:100%;font-size:15px;">没有作业任务的PDF就不需要我了吧。(那我隐退了,右边有开关。自己玩吧)</p>';
  442. myDiv = document.createElement("div");
  443. myDiv.id = 'mysellectid';
  444. document.querySelectorAll(".turnpage_Btn")[0].insertBefore(myDiv, document.querySelectorAll(".turnpage_Btn")[0].children[0].firstChild);
  445. $("#mysellectid").append(PDF_div);
  446. choose_div = '<p style="width: 25px;height: 25px;line-height: 25px;text-align: center; font-size: 3px; color: #ffffff;">Off</p>';
  447. mychooseDiv = document.createElement("div");
  448. mychooseDiv.id = 'My_choose';
  449. mychooseDiv.style = 'border-radius: 50%;background-color:#ffc20e;width:25px;height:25px;position:fixed;right:20px;top:0%;z-index:10;cursor:pointer;-moz-background-size:100% 100%;-o-background-size:100% 100%;-webkit-background-size:100% 100%;background-size:100% 100%;';
  450. $(".imglook")[0].insertBefore(mychooseDiv, $(".imglook")[0].firstChild);
  451. $("#My_choose").append(choose_div);
  452. $("#My_choose").click(function () {
  453. data_json.isTao = 1;
  454. if (data_json._jobid !== "") {
  455. data_json.jobid = data_json._jobid;
  456. }
  457. else {
  458. data_json.btime = 1;
  459. }
  460. window.frameElement.setAttribute('data', JSON.stringify(data_json));
  461. location.href = location.href + (location.href.indexOf("?") > -1 ? "&" : "?") + "time=" + (new Date()).getTime();
  462. });
  463. setTimeout(function () {
  464. $("#mysellectid")[0].style.opacity = 1;
  465. var pdf__ = setInterval(function () {
  466. $("#mysellectid")[0].style.opacity -= 0.01;
  467. if ($("#mysellectid")[0].style.opacity <= 0) {
  468. clearInterval(pdf__);
  469. $("#mysellectid")[0].style.opacity = 0;
  470. }
  471. }, 200);
  472. }, 1000);
  473. }
  474. };
  475. }
  476. if (location.href.match(/doHomeWorkNew/) !== null) {
  477. $(document).ready(function(){
  478. function keyDown(keydown){
  479. keydown.preventDefault();
  480. var currKey=0, e=keydown||event||window.event;
  481. currKey = e.keyCode||e.which||e.charCode;
  482. if(currKey == 83 && (e.ctrlKey||e.metaKey)){
  483. noSubmit();
  484. return false;
  485. }
  486. }
  487. document.onkeydown = keyDown;
  488. var cancel_paste = setInterval(function () {
  489. try {
  490. window.myEditor_paste = "";
  491. window.pasteText = "";
  492. }
  493. catch (e) { }
  494. }, 1);
  495. setTimeout(function () {
  496. clearInterval(cancel_paste);
  497. }, 5000);
  498. });
  499. }
  500. function fuck_CX_flash() {
  501. var fuck_CX = setInterval(function () {
  502. try {
  503. var str = window.frameElement.getAttribute('data').toString();
  504. if (str.indexOf("\"danmaku\":1")) {
  505. window.frameElement.setAttribute('data', str.replace(/"danmaku":1/g, '"danmaku":0'));
  506. console.log("danmaku拦截");
  507. }
  508. if (str.indexOf("\"fastforward\":false")) {
  509. window.frameElement.setAttribute('data', str.replace(/"fastforward":false/g, '"fastforward":true'));
  510. console.log("fastforward拦截");
  511. }
  512. if (str.indexOf("\"switchwindow\":1")) {
  513. window.frameElement.setAttribute('data', str.replace(/"switchwindow":false/g, '"switchwindow":true'));
  514. console.log("switchwindow拦截");
  515. }
  516. var mouse_times = 0;
  517. window.Ext.EventManager.mouseLeaveRe = {
  518. 'test': (e) => {
  519. if (/mouseout/.test(e)) {
  520. mouse_times++;
  521. console.log("已为您过滤" + mouse_times + "次鼠标移出暂停");
  522.  
  523. }
  524. }
  525. };
  526. }
  527. catch (e) { }
  528. }, 1);
  529. setTimeout(function () {
  530. clearInterval(fuck_CX);
  531. }, 5000);
  532. window.onload = function () {
  533. var quick_ddiv = "<font color='#238E23' size=2>播放速度:</font><select style='text-align:center;text-align-last:center;padding-left:6px;margin:-0.6rem 0;' class='select_class_name'><option value='0.5'>0.5</option><option value='1' selected='selected'>1</option><option value='1.25'>1.25(慢快推荐)</option><option value='1.5'>1.5</option><option value='2'>2</option><option value='2.6'>2.6(快推荐)</option><option value='3'>3</option><option value='4'>4</option></select><font color='blue' size=2> POWER BY:涛之雨 </font><font style='background-color: rgb(255,165,0);color: white;position: fixed;right: 0px;' size=1>本页面上下左右空格已绑定视频,可以快进退、增减音量</font><br /><font color='red' size=2>如果未生效请刷新,多次刷新无效说明失效了,请认真学习,等我补吧(后面没有字了)</font><font color='azure' size=1>(那是不可能的)</font>";
  534. var btn_only_video = document.createElement("div");
  535. btn_only_video.id = 'mysellectid';
  536. $("body")[0].insertBefore(btn_only_video, $("body")[0].firstChild);
  537. $("#mysellectid").append(quick_ddiv);
  538. $(".select_class_name").change(function () {
  539. $("video")[0].playbackRate = $(this).val();
  540. });
  541. var rate_Interval = setInterval(function () {
  542. try {
  543. $("video")[0].onratechange = function () {
  544. $(".select_class_name").val($("video")[0].playbackRate);
  545. };
  546. clearInterval(rate_Interval);
  547. set_ctrl();
  548. }
  549. catch (e) { }
  550. }, 1);
  551. function set_ctrl() {
  552. var vol = 0.1;
  553. var time = 10;
  554. var videoElement = $("video")[0];
  555. $(document).keydown(function (event) {
  556. if (event.target.tagName.toLowerCase() == "input") {
  557. return 1;
  558. }
  559. var e = event || window.event;
  560. if (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 37 || e.keyCode === 39 || e.keyCode === 32) {
  561. e.preventDefault();
  562. }
  563. });
  564. document.onkeyup = function (event) {
  565. if (event.target.tagName.toLowerCase() == "input") {
  566. return 1;
  567. }
  568. var e = event || window.event;
  569. if (e && e.keyCode === 38) {
  570. videoElement.volume !== 1 ? videoElement.volume += vol : 1;
  571. return false;
  572. }
  573. else if (e && e.keyCode === 40) {
  574. videoElement.volume !== 0 ? videoElement.volume -= vol : 1;
  575. return false;
  576. }
  577. else if (e && e.keyCode === 37) {
  578. videoElement.currentTime !== 0 ? videoElement.currentTime -= time : 1;
  579. return false;
  580. }
  581. else if (e && e.keyCode === 39) {
  582. videoElement.volume !== videoElement.duration ? videoElement.currentTime += time : 1;
  583. return false;
  584. }
  585. else if (e && e.keyCode === 32) {
  586. videoElement.paused === true ? videoElement.play() : videoElement.pause();
  587. return false;
  588. }
  589. };
  590. }
  591. };
  592. }
  593. function hookCXPlayer(onPlayerInit, contextWindow) {
  594. if (undefined === contextWindow) {
  595. contextWindow = window;
  596. }
  597. Hooks.set(contextWindow, "jQuery", function (target, propertyName, ignored, jQuery) {
  598. Hooks.method(jQuery.fn, "cxplayer", function (target, methodName, method, thisArg, args) {
  599. var replyArgs = arguments, $globalPlayer, $player,
  600. globalConfig = args[0];
  601. function createCXPlayer(config) {
  602. if (undefined !== config) {
  603. globalConfig = config;
  604. args[0] = config;
  605. }
  606. $globalPlayer = Hooks.Reply.method(replyArgs);
  607. return $globalPlayer;
  608. }
  609. $player = onPlayerInit(globalConfig, createCXPlayer);
  610. if (undefined !== $player) {
  611. $globalPlayer = $player;
  612. }
  613. return $globalPlayer;
  614. });
  615. return Hooks.Reply.set(arguments);
  616. });
  617. }
  618. var globalVideoJs;
  619. function videoJsStudyUncontrolAndTimelineNull(contextWindow) {
  620. if (undefined === contextWindow) {
  621. contextWindow = window;
  622. }
  623. Hooks.set(contextWindow, "videojs", function (target, propertyName, ignored, videojs) {
  624. globalVideoJs = videojs;
  625. Hooks.method(videojs, "registerPlugin", function (target, methodName, method, thisArg, args) {
  626. if ("studyControl" === args[0]) {
  627. method.call(thisArg, "studyControl", function () { });
  628. return args[1];
  629. }
  630. else if ("timelineObjects" === args[0]) {
  631. method.call(thisArg, "timelineObjects", function () { });
  632. return args[1];
  633. }
  634. else {
  635. return Hooks.Reply.method(arguments);
  636. }
  637. });
  638. return Hooks.Reply.set(arguments);
  639. });
  640. }
  641. function hookVideojs(onPlayerInit, contextWindow) {
  642. if (undefined === contextWindow) {
  643. contextWindow = window;
  644. }
  645. Hooks.set(contextWindow, "ans", function (target, propertyName, ignored, ans) {
  646. Hooks.method(ans, "VideoJs", function (target, methodName, method, thisArg, args) {
  647. var replyArgs = arguments, $globalPlayer, $player,
  648. globalConfig = args[0].params;
  649. function createPlayer(config) {
  650. var player;
  651. if (undefined !== config) {
  652. globalConfig = config;
  653. args[0].params = config;
  654. }
  655. Hooks.Reply.method(replyArgs);
  656. return globalVideoJs(args[0].videojs);
  657. }
  658. $player = onPlayerInit(globalConfig, createPlayer);
  659. if (undefined !== $player) {
  660. $globalPlayer = $player;
  661. }
  662. return $globalPlayer;
  663. });
  664. return Hooks.Reply.set(arguments);
  665. });
  666. }
  667. // if ("/ananas/modules/video/index.html" === window.location.pathname) {
  668. // debugger;
  669. // hookCXPlayer(function (config, createCXPlayer) {
  670. // var $player;
  671. // config.datas.enableFastForward = true;
  672. // config.datas.enableSwitchWindow = 1;
  673. // config.datas.errorBackTime = false;
  674. // config.datas.isAutoPlayNext = true;
  675. // config.datas.isDefaultPlay = true;
  676. // config.datas.switchwindow = false;
  677. // config.datas.fastforward = false;
  678. // config.datas.pauseAdvertList = [];
  679. // config.datas.preAdvertList = [];
  680. // $player = createCXPlayer();
  681. // $player.unbind("onPause");
  682. // $player.pauseMovie = function () { };
  683. // $player.bind("onError", function () {
  684. // if (4 === $player.getPlayState()) {
  685. // window.location.reload();
  686. // }
  687. // });
  688. // window.MoocPlayer.prototype.switchWindow = function () {
  689. // return this;
  690. // };
  691. // window.jQuery.fn.pauseMovie = function () { };
  692. // });
  693. // videoJsStudyUncontrolAndTimelineNull();
  694. // hookVideojs(function (config, createPlayer) {
  695. // var $player;
  696. // config.enableFastForward = 1;
  697. // config.enableSwitchWindow = 1;
  698. // $player = createPlayer();
  699. // });
  700. // }
  701. if (location.href.match(/video/) !== null) {
  702. fuck_CX_flash();
  703. }
  704. })();
  705.  
  706.  
  707.  
  708.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址