shdjxy

storehouse

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/496840/1387591/shdjxy.js

  1. (function() {
  2. 'use strict';
  3. /* globals jQuery, $, waitForKeyElements */
  4. unsafeWindow.GM_getValue = GM_getValue
  5. unsafeWindow.GM_xmlhttpRequest = GM_xmlhttpRequest
  6.  
  7. // 检查当前窗口是否为顶层窗口
  8. if (window.self !== window.top) {
  9. // return;// 如果是顶层窗口,则不执行脚本
  10. }else{
  11.  
  12. }
  13.  
  14. let btn1=GM_registerMenuCommand ("\u4f5c\u8005\uff1a\ud83c\udf49\u897f\u74dc\u8981\u5927\u7684\ud83c\udf49", function(){
  15. confirm("Hello,\u611f\u8c22\u4f7f\u7528\ud83c\udf49\u897f\u74dc\u5237\u8bfe\u52a9\u624b\ud83c\udf49\uff01\u591a\u591a\u53cd\u9988\u54e6");
  16. GM_unregisterMenuCommand(btn1);
  17. }, "");
  18. let btn2=GM_registerMenuCommand ("\u4ed8\u8d39\u5185\u5bb9", function(){
  19. alert("\u9650\u65f6\u514d\u8d39\uff0c\u5168\u529b\u5f00\u53d1\u4e2d...");
  20. }, "p");
  21.  
  22. var ddds3 = null;
  23. var addMessage = null;
  24.  
  25. //----解决重复监听start----
  26. //视频组件
  27. var elevideo = null;
  28. //视频开始的公共方法
  29. var vdplay = null;
  30. //视频正在播放的公共方法
  31. var vdplaying = null;
  32. //视频暂停的公共方法
  33. var vdpause = null;
  34. //视频结束的公共方法
  35. var vdended = null;
  36. //监听音量的公共方法
  37. var vdvolume = null;
  38. //----解决重复监听end----
  39.  
  40. var isListening = false;
  41.  
  42. //-----添加监听start------
  43. function addLisenner(){
  44.  
  45. //获取播放器组件
  46. elevideo = document.getElementsByTagName("video")[0];
  47.  
  48. vdplay = function(){
  49. console.log("xigua:\u5f00\u59cb\u64ad\u653e");
  50. addMessage("xigua:\u5f00\u59cb\u64ad\u653e");
  51. };
  52. vdpause = function(){
  53. console.log("xigua:\u6682\u505c\u64ad\u653e");
  54. addMessage("xigua:\u6682\u505c\u64ad\u653e");
  55.  
  56. setTimeout(function(){
  57. if(document.querySelector("#learnNextSection").href != ''){
  58. document.querySelector("#learnNextSection").click();
  59. }
  60. },3689)
  61. };
  62. vdended = function(){
  63. console.log("xigua:结束播放");
  64. addMessage("xigua:结束播放");
  65. // setTimeout(function(){
  66. // if(document.querySelector("#learnNextSection").style.display != 'none'){
  67. // document.querySelector("#learnNextSection").click();
  68. // }
  69. // },3689)
  70. };
  71. vdvolume = function(){
  72. if(elevideo.volume < 1 && elevideo.volume > 0){
  73. let vlum = elevideo.volume.toString();
  74. console.log("xigua:当前音量("+vlum.substring(2,4)+"%)");
  75. addMessage("xigua:当前音量("+vlum.substring(2,4)+"%)");
  76. }else if(elevideo.volume == 0){
  77. console.log("xigua:当前音量(0%)");
  78. addMessage("xigua:当前音量(0%)");
  79. }else{
  80. console.log("xigua:当前音量(100%)");
  81. addMessage("xigua:当前音量(100%)");
  82. }
  83. }
  84.  
  85. elevideo.addEventListener('play',vdplay);
  86. elevideo.addEventListener('playing',vdplaying);
  87. elevideo.addEventListener('pause',vdpause);
  88. elevideo.addEventListener('ended',vdended);
  89. elevideo.addEventListener('volumechange',vdvolume);
  90.  
  91. elevideo.volume = 0.3;
  92. setTimeout(function(){
  93. elevideo.play();
  94. setTimeout(function(){
  95. elevideo.playbackRate = 2;
  96. },1000);
  97. },1000);
  98. }
  99. //-----添加监听end------
  100.  
  101. //-----移除监听start---
  102. function removeLisenner(){
  103. if(vdplay != null){
  104. elevideo.removeEventListener("play", vdplay);
  105. }
  106. if(vdplaying != null){
  107. elevideo.removeEventListener("playing", vdplaying);
  108. }
  109. if(vdpause != null){
  110. elevideo.removeEventListener("pause", vdpause);
  111. }
  112. if(vdended != null){
  113. elevideo.removeEventListener("ended", vdended);
  114. }
  115. if(vdended != null){
  116. elevideo.removeEventListener("ended", vdended);
  117. }
  118. if(vdvolume != null){
  119. elevideo.removeEventListener("volumechange",vdvolume);
  120. }
  121. }
  122. //-----移除监听end---
  123.  
  124. const panel = function(){
  125. var container = $('<div id="gm-interface"></div>');
  126. var titleBar = $('<div id="gm-title-bar">\ud83c\udf49\u897f\u74dc\u7f51\u8bfe\u52a9\u624b\ud83c\udf49</div>');
  127. var minimizeButton = $('<div title="\u6536\u8d77" style="display:black"><svg id="gm-minimize-button" class="bi bi-dash-square" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/><path fill-rule="evenodd" d="M3.5 8a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.5-.5z"/></svg></div>');
  128. var maxButton = $('<div title="\u5c55\u5f00" style="display:none"><svg id="gm-minimize-button" class="bi bi-plus-square" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 3.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H4a.5.5 0 0 1 0-1h3.5V4a.5.5 0 0 1 .5-.5z"/><path fill-rule="evenodd" d="M7.5 8a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1H8.5V12a.5.5 0 0 1-1 0V8z"/><path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/></svg></div>');
  129. var content = $('<div id="gm-content"></div>');
  130. var tips = $('<div class="tip" style="display:none;">\u957f\u6309\u62d6\u62fd</div>');
  131. var scrollText = $('<marquee>').text('\u4e7e\u5764\u672a\u5b9a\uff0c\u4f60\u6211\u7686\u662f\u9ed1\u9a6c----\u4f5c\u8005\uff1a\u897f\u74dc\u8981\u5927\u7684\uff08\u611f\u8c22\u652f\u6301\uff01\uff09').css({
  132. 'position': 'absolute',
  133. 'top': '15%',
  134. 'left': '50%',
  135. 'transform': 'translate(-50%, -50%)',
  136. 'width': '90%',
  137. 'height': '25px',
  138. 'font-size': '16px',
  139. 'line-height': '1.5',
  140. 'white-space': 'nowrap'
  141. }).appendTo(content);
  142. //var ddds1 = $('<div style="position: absolute;top: 20%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u70b9\u51fb\u542f\u52a8\uff1a<button id="startxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">\u542f\u52a8</button></div>');
  143. //var ddds5 = $('<div style="position: absolute;top: 35%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u70b9\u51fb\u542f\u52a8\uff1a<button id="stopxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">暂停</button></div>');
  144. //var ddds2 = $('<div style="position: absolute;top: 50%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u89c6\u9891\u500d\u901f\uff1a<button id="speedxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">X16</button></div>');
  145. ddds3 = $('<div id="message-container" style="position: absolute;display: grid;align-content: center;justify-content: center;top: 20%;width:94%;height:62%;max-height:62%;overflow-y:auto;padding: 3px;background: #ffffff;border-radius: 5px;"></div>');
  146. var ddds4 = $('<div style="position: absolute;top: 85%;width:94%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;"><button id="beginExam" style="position: absolute;width:139px;right: 216px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">手动验证</button><a href="http://8.130.116.135/?article/" style="position: absolute;right: 10px;text-decoration: none;color: pink;">\u003e\u003e\u003e\u8054\u7cfb\u003a\u0031\u0039\u0030\u0038\u0032\u0034\u0035\u0033\u0030\u0032\u0040\u0071\u0071\u002e\u0063\u006f\u006d</a></div>');
  147.  
  148. container.append(titleBar);
  149. //content.append(ddds1);
  150. //content.append(ddds5);
  151. //content.append(ddds2);
  152. content.append(ddds3);
  153. content.append(ddds4);
  154. container.append(content);
  155. container.append(maxButton);
  156. container.append(minimizeButton);
  157. $('body').append(container);
  158. $('body').append(tips);
  159.  
  160. GM_addStyle(`
  161. #gm-interface {
  162. position: fixed;
  163. top: 10%;
  164. left: 70%;
  165. border-radius: 5px;
  166. background-color: white;
  167. z-index: 9999;
  168. }
  169.  
  170. #gm-title-bar {
  171. padding: 5px;
  172. background-color: #ffc0c0;
  173. border: 1px solid black;
  174. border-radius: 5px;
  175. cursor: grab;
  176. }
  177.  
  178. #gm-minimize-button {
  179. position: absolute;
  180. top: 2px;
  181. right: 2px;
  182. width: 30px;
  183. height: 30px;
  184. border-radius: 5px;
  185. padding: 0;
  186. font-weight: bold;
  187. background-color: #ffc0c0;
  188. cursor: pointer;
  189. }
  190.  
  191. #gm-content {
  192. padding: 10px;
  193. border: 1px solid black;
  194. border-radius: 2px 2px 5px 5px;
  195. background-color: #ffe5e5;
  196. width: 400px;
  197. height: 300px;
  198. }
  199. .tip{
  200. font-family: "黑体";
  201. color: black;
  202. -webkit-transform: scale(0.8);
  203. position:absolute;
  204. padding: 6px 5px;
  205. background-color:#ffe8f0;
  206. border-radius: 4px;
  207. z-index: 9999;
  208. }
  209. `);
  210.  
  211. titleBar.on('mousemove',function(e){
  212. tips.attr("style", "display:black;");
  213. var top = e.pageY+5;
  214. var left = e.pageX+5;
  215. tips.css({
  216. 'top' : top + 'px',
  217. 'left': left+ 'px'
  218. });
  219. });
  220.  
  221. titleBar.on('mouseout',function(){
  222. tips.hide();
  223. });
  224.  
  225. titleBar.on('mousedown', function(e) {
  226. var startX = e.pageX - container.offset().left + window.scrollX;
  227. var startY = e.pageY - container.offset().top + window.scrollY;
  228.  
  229. $(document).on('mousemove', function(e) {
  230. e.preventDefault();
  231. var newX = e.pageX - startX;
  232. var newY = e.pageY - startY;
  233. container.css({ left: newX, top: newY });
  234. });
  235.  
  236. $(document).on('mouseup', function() {
  237. $(document).off('mousemove');
  238. $(document).off('mouseup');
  239. });
  240. });
  241.  
  242.  
  243. $("#beginExam").on('click',function(){
  244. ddds3.children().remove();
  245. if(window.location.href.split('?')[0].toString() === 'https://l.shou.org.cn/study/assignment-preview.aspx' || window.location.href.split('?')[0].toString() === 'https://l.shou.org.cn/study/assignment/preview.aspx'){
  246. if(document.querySelector("#navigateToAnswer") != null){
  247. addMessage("请稍等...");
  248. let t = Math.floor(Math.random() * 4);
  249. setTimeout(function(){
  250. addMessage("验证成功");
  251. qrCodeDialog.find("#navigateToAnswer").parent().show();
  252. setTimeout(function(){
  253. document.querySelector("#navigateToAnswer").click();
  254. },2000);
  255. },t * 1000);
  256. }
  257. else if(window.location.href.split('?')[0].toString() === 'https://l.shou.org.cn/study/assignment/preview.aspx'){
  258. addMessage("请稍等...");
  259. let t = Math.floor(Math.random() * 4);
  260. setTimeout(function(){
  261. ddds3.children().remove();
  262. addMessage("验证成功");
  263. setItem('qrcode_validateResult_' + data.userNo, 1, new Date().getTime() + 7200000);// 两小时有效
  264. setTimeout(function(){
  265. data.qrCodeDialog.dialog("close");
  266. },2000);
  267. },t * 1000);
  268. }
  269. else{
  270. addMessage("当前状态不可用");
  271. }
  272. }
  273. else{
  274. addMessage("此功能只用于识别二维码");
  275. }
  276. });
  277.  
  278. minimizeButton.on('click', function() {
  279. minimizeButton.attr("style", "display:none;");
  280. maxButton.attr("style", "display:black;");
  281. content.slideToggle(0);
  282. container.css({ width: 200 });
  283. });
  284.  
  285. maxButton.on('click', function() {
  286. minimizeButton.attr("style", "display:black;");
  287. maxButton.attr("style", "display:none;");
  288. content.slideToggle(0);
  289. container.css({ width: 422 });
  290. });
  291.  
  292. ddds3.on('mousewheel', function(event) {
  293. event.preventDefault();
  294. var scrollTop = ddds3.scrollTop();
  295. ddds3.scrollTop(scrollTop + event.originalEvent.deltaY);
  296. });
  297.  
  298. addMessage = function(message){
  299. if (ddds3.children().length >= 288) {
  300. ddds3.children().first().remove();
  301. }
  302. var messageElement = $('<div class="message"></div>').text(message).css({
  303. 'margin-bottom': '10px'
  304. }).appendTo(ddds3);
  305. }
  306.  
  307. }
  308.  
  309. // addMessage("》》》》》辅助工具");
  310.  
  311.  
  312. var wait = null;
  313. var overlay;
  314. function startSetInt(){
  315. wait = setInterval(function (){
  316. // ddds3.children().remove();
  317. if(window.location.href.split('?')[0].toString() === 'https://shdjxy.htxyedu.com/University/course/play.aspx' || window.location.href.split('?')[0].toString() === 'https://shdjxy.htxyedu.com/University/course/play.html'){
  318. try{
  319. tipsWin().then((result) => {
  320. if(!result){
  321. panel();
  322. ddds3.children().remove();
  323. addMessage("启动");
  324. setTimeout(function(){
  325. removeLisenner();
  326. addLisenner();
  327. },1000);
  328. }else{
  329. addMessage("取消");
  330. }
  331. });
  332. }catch(e){
  333. addMessage(e);
  334. }
  335. }
  336. stopTimer();
  337. }, 900);
  338. }
  339.  
  340. // 手动停止定时器
  341. function stopTimer() {
  342. clearInterval(wait);
  343. }
  344.  
  345. function tipsWin(){
  346. return new Promise((resolve, reject) => {
  347.  
  348. var popup = document.createElement('div');
  349. popup.id = 'customPopup';
  350. popup.style.display = 'none';
  351. popup.style.position = 'fixed';
  352. popup.style.top = '50%';
  353. popup.style.left = '50%';
  354. popup.style.transform = 'translate(-50%, -50%)';
  355. popup.style.backgroundColor = '#fff';
  356. popup.style.padding = '20px';
  357. popup.style.border = '1px solid #ccc';
  358. popup.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.2)';
  359. popup.style.zIndex = '9999';
  360. popup.innerHTML = `
  361. <p id="timeCount">5秒后执行脚本?</p>
  362. <button id="confirmButton">是</button>
  363. <button id="cancelButton">否</button>
  364. `;
  365.  
  366. document.body.appendChild(popup);
  367.  
  368. var confirmButton = document.getElementById('confirmButton');
  369. var cancelButton = document.getElementById('cancelButton');
  370. var confirmed = false;
  371. let juNext = false;
  372.  
  373. popup.style.display = 'block';
  374.  
  375. confirmButton.addEventListener('click', function() {
  376. confirmed = true;
  377. closePopup();
  378. resolve(false);
  379. });
  380.  
  381. cancelButton.addEventListener('click', function() {
  382. // ddds3.children().remove();
  383. // addMessage("刷新页面即可重启");
  384. confirmed = true;
  385. closePopup();
  386. resolve(true);
  387. });
  388.  
  389. function ju(time){
  390. if(!confirmed){
  391. if(time < 1){
  392. popup.innerHTML = ` <p>时间到了! 脚本启动.</p>`;
  393. setTimeout(function() {
  394. closePopup();
  395. resolve(false);
  396.  
  397. }, 1000);
  398. }
  399. else{
  400. document.getElementById('timeCount').innerText = time+'秒后执行脚本?';
  401. }
  402.  
  403. setTimeout(function(){
  404. ju(--time)
  405. },1000);
  406.  
  407. }
  408. }
  409.  
  410. ju(5);
  411.  
  412. function closePopup() {
  413. popup.style.display = 'none';
  414. }
  415. });
  416.  
  417. }
  418.  
  419. function toggleOverlay(show) {
  420. if (show) {
  421. overlay = document.createElement('div');
  422. overlay.style.position = 'fixed';
  423. overlay.style.top = '0';
  424. overlay.style.left = '0';
  425. overlay.style.width = '100%';
  426. overlay.style.height = '100%';
  427. overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
  428. overlay.style.zIndex = '9999';
  429.  
  430. overlay.addEventListener('click', function(event) {
  431. event.stopPropagation();
  432. event.preventDefault();
  433. });
  434.  
  435. document.body.appendChild(overlay);
  436. } else {
  437. if (overlay) {
  438. overlay.parentNode.removeChild(overlay);
  439. overlay = null;
  440. }
  441. }
  442. }
  443.  
  444. startSetInt();
  445. })();

QingJ © 2025

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