xigualnzyys

storehouse

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

  1. // ==UserScript==
  2. // @name xigualnzyys
  3. // @version 0.0.7
  4. // @description storehouse
  5. // @author Xiguayaodade
  6. // @license MIT
  7. // @match *://www.lnlpa.cn/*
  8. // @match *://www.lnszyys.com/*
  9. // @grant GM_info
  10. // @grant GM_getTab
  11. // @grant GM_saveTab
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_addStyle
  15. // @grant unsafeWindow
  16. // @grant GM_listValues
  17. // @grant GM_deleteValue
  18. // @grant GM_setClipboard
  19. // @grant GM_notification
  20. // @grant GM_xmlhttpRequest
  21. // @grant GM_getResourceText
  22. // @grant GM_registerMenuCommand
  23. // @grant GM_unregisterMenuCommand
  24. // @grant GM_addValueChangeListener
  25. // @grant GM_removeValueChangeListener
  26. // @namespace http://tampermonkey.net/
  27. // @homepage http://8.130.116.135/?article/
  28. // @source http://8.130.116.135/?article/
  29. // @icon https://picx.zhimg.com/v2-ce62b58ab2c7dc67d6cabc3508db5795_l.jpg?source=32738c0c
  30. // @connect icodef.com
  31. // @connect localhost
  32. // @connect 8.130.116.135
  33. // @connect aip.baidubce.com
  34. // @require https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js
  35. // ==/UserScript==
  36.  
  37. (function() {
  38. 'use strict';
  39. /* globals jQuery, $, waitForKeyElements */
  40.  
  41. var ddds3 = null;
  42. var addMessage = null;
  43.  
  44. /**
  45. *播放器
  46. *@type {dom}
  47. */
  48. var elevideo;
  49. /**
  50. *var courseId = GM_getValue("courseId");
  51. *@type {int}
  52. */
  53. var courseId = 1;
  54. /**
  55. *courseCount
  56. *@type {int}
  57. */
  58. var courseCount = null;
  59. /**
  60. *courseIndex
  61. *@type {int}
  62. */
  63. var courseIndex = null;
  64. /**
  65. *capterCount
  66. *@type {int}
  67. */
  68. var capterCount = null;
  69.  
  70. var stInter = null;
  71.  
  72. let btn1=GM_registerMenuCommand ("\u4f5c\u8005\uff1a\ud83c\udf49\u897f\u74dc\u8981\u5927\u7684\ud83c\udf49", function(){
  73. confirm("Hello,\u611f\u8c22\u4f7f\u7528\ud83c\udf49\u897f\u74dc\u5237\u8bfe\u52a9\u624b\ud83c\udf49\uff01\u591a\u591a\u53cd\u9988\u54e6");
  74. GM_unregisterMenuCommand(btn1);
  75. }, "");
  76. let btn2=GM_registerMenuCommand ("\u4ed8\u8d39\u5185\u5bb9", function(){
  77. alert("\u9650\u65f6\u514d\u8d39\uff0c\u5168\u529b\u5f00\u53d1\u4e2d...");
  78. }, "p");
  79.  
  80. var bootstrapCSS = document.createElement("link");
  81. bootstrapCSS.rel = "stylesheet";
  82. bootstrapCSS.href = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-alpha1/dist/css/bootstrap.min.css";
  83. document.head.appendChild(bootstrapCSS);
  84.  
  85. var bootstrapJS = document.createElement("script");
  86. bootstrapJS.src = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-alpha1/dist/js/bootstrap.min.js";
  87. document.body.appendChild(bootstrapJS);
  88.  
  89. //----解决重复监听start----
  90. //视频开始的公共方法
  91. var vdplay = null;
  92. //视频正在播放的公共方法
  93. var vdplaying = null;
  94. //视频暂停的公共方法
  95. var vdpause = null;
  96. //视频结束的公共方法
  97. var vdended = null;
  98. //监听音量的公共方法
  99. var vdvolume = null;
  100. //----解决重复监听end----
  101.  
  102. //-----添加监听start------
  103. function addLisenner() {
  104.  
  105. //获取播放器组件
  106. elevideo = document.getElementsByTagName("video")[0];
  107.  
  108. vdplay = function(){
  109. let tm = 5 * 60 * 1000;
  110. console.log("xigua:\u5f00\u59cb\u64ad\u653e");
  111. addMessage("xigua:\u5f00\u59cb\u64ad\u653e");
  112. };
  113. vdplaying = function(){
  114. clearInterval(stInter);
  115. console.log("xigua:\u6b63\u5728\u64ad\u653e");
  116. addMessage("xigua:\u6b63\u5728\u64ad\u653e");
  117. };
  118. vdpause = function(){
  119. console.log("xigua:\u6682\u505c\u64ad\u653e");
  120. addMessage("xigua:\u6682\u505c\u64ad\u653e");
  121. setTimeout(function(){
  122. if(document.getElementsByClassName('el-dialog__wrapper')[0].style.display !== 'none'){
  123. document.getElementsByClassName("dialog-footer")[0].children[0].click();
  124. addMessage("挂机响应_xol");
  125. }
  126. else{
  127. setTimeout(function(){
  128. addMessage("禁止暂停");
  129. elevideo.play();
  130. },1000);
  131. }
  132. },1500);
  133. };
  134. vdended = function(){
  135. console.log("xigua:结束播放");
  136. addMessage("xigua:结束播放");
  137. setTimeout(function(){
  138. window.location.reload();
  139. // playVoide();
  140. },2000)
  141. };
  142. vdvolume = function(){
  143. if(elevideo.volume < 1 && elevideo.volume > 0){
  144. let vlum = elevideo.volume.toString();
  145. console.log("xigua:当前音量("+vlum.substring(2,4)+"%)");
  146. addMessage("xigua:当前音量("+vlum.substring(2,4)+"%)");
  147. }else if(elevideo.volume == 0){
  148. console.log("xigua:当前音量(0%)");
  149. addMessage("xigua:当前音量(0%)");
  150. }else{
  151. console.log("xigua:当前音量(100%)");
  152. addMessage("xigua:当前音量(100%)");
  153. }
  154. }
  155.  
  156. elevideo.addEventListener('play',vdplay);
  157. elevideo.addEventListener('playing',vdplaying);
  158. elevideo.addEventListener('pause',vdpause);
  159. elevideo.addEventListener('ended',vdended);
  160. elevideo.addEventListener('volumechange',vdvolume);
  161.  
  162. setTimeout(function(){
  163. elevideo.play();
  164. elevideo.volume = 0;
  165. },2000);
  166. }
  167. //-----添加监听end------
  168.  
  169. //-----移除监听start---
  170. function removeLisenner(){
  171. if(vdplay != null){
  172. elevideo.removeEventListener("play", vdplay);
  173. }
  174. if(vdplaying != null){
  175. elevideo.removeEventListener("playing", vdplaying);
  176. }
  177. if(vdpause != null){
  178. elevideo.removeEventListener("pause", vdpause);
  179. }
  180. if(vdended != null){
  181. elevideo.removeEventListener("ended", vdended);
  182. }
  183. if(vdended != null){
  184. elevideo.removeEventListener("ended", vdended);
  185. }
  186. if(vdvolume != null){
  187. elevideo.removeEventListener("volumechange",vdvolume);
  188. }
  189. }
  190. //-----移除监听end---
  191.  
  192. function sTime(){
  193. removeLisenner();
  194. addLisenner();
  195. }
  196.  
  197. function playVoide(){
  198. capterCount = document.getElementsByClassName('chapterList')[0].children.length;
  199. addMessage("xigua:共"+capterCount+"章");
  200. for(let i=0;i<=capterCount;i++){
  201. if(i >= capterCount){
  202. addMessage("xigua:课程学习完毕");
  203. let uRLList = GM_getValue("uRLList");
  204. console.log("xigua:",uRLList);
  205. window.open(uRLList,"_self");
  206. break;
  207. }
  208. let prevClassTxt = document.getElementsByClassName('chapterList')[0].children[i]._prevClass;
  209. if(prevClassTxt === 'avideoF' || prevClassTxt === 'active avideoF'){
  210.  
  211. // addMessage("xigua:第"+(i+1)+"章完成");
  212. }
  213. else{
  214. addMessage("xigua:第"+(i+1)+"章未完成");
  215. document.getElementsByClassName('chapterList')[0].children[i].click();
  216. stInter = setInterval(sTime,1000);
  217. break;
  218. }
  219. }
  220. }
  221.  
  222. function juzyk(){
  223. courseCount = document.getElementsByClassName("courseUl")[0].childElementCount;
  224. if(courseId <= courseCount){
  225. addMessage("当前第"+courseId+"科,共"+courseCount+"科");
  226. console.log("当前第"+courseId+"科,共"+courseCount+"科");
  227. let courseStatu = document.getElementsByClassName("courseUl")[0].children[courseId-1].children[1].children[2].innerText;
  228. if(courseStatu === '未听完'){
  229. // GM_setValue("courseId", (courseId+1));
  230. addMessage("第"+courseId+"科未听完");
  231. console.log("第"+courseId+"科未听完");
  232. setTimeout(function(){
  233. document.getElementsByClassName("courseUl")[0].children[courseId-1].children[0].click();
  234. setTimeout(function(){
  235. window.location.reload();
  236. },1500);
  237. },1000);
  238. }
  239. else{
  240. addMessage("第"+courseId+"科已完成");
  241. console.log("第"+courseId+"科已完成");
  242. courseId++;
  243. juzyk();
  244. }
  245. }else{
  246. GM_deleteValue("courseId");
  247. addMessage("专业课学习完成!");
  248. console.log("专业课学习完成!");
  249. document.getElementsByClassName("gxk")[0].click();
  250. setTimeout(function(){
  251. courseId = 1;
  252. jugxk();
  253. },1000);
  254. }
  255. }
  256.  
  257. function jugxk(){
  258. courseCount = document.getElementsByClassName("courseUl")[0].childElementCount;
  259. if(courseId <= courseCount){
  260. addMessage("当前第"+courseId+"科,共"+courseCount+"科");
  261. console.log("当前第"+courseId+"科,共"+courseCount+"科");
  262. let courseStatu = document.getElementsByClassName("courseUl")[0].children[courseId-1].children[1].children[2].innerText;
  263. if(courseStatu === '未听完'){
  264. // GM_setValue("courseId", (courseId+1));
  265. addMessage("第"+courseId+"科未听完");
  266. console.log("第"+courseId+"科未听完");
  267. setTimeout(function(){
  268. document.getElementsByClassName("courseUl")[0].children[courseId-1].children[0].click();
  269. setTimeout(function(){
  270. window.location.reload();
  271. },1500);
  272. },1000);
  273. }
  274. else{
  275. addMessage("第"+courseId+"科已完成");
  276. console.log("第"+courseId+"科已完成");
  277. // GM_setValue("courseId", (courseId+1));
  278. courseId++;
  279. jugxk();
  280. }
  281. }else{
  282. GM_deleteValue("courseId");
  283. addMessage("公需课学习完成,清空缓存,退出!");
  284. console.log("公需课学习完成,清空缓存,退出!");
  285. }
  286. }
  287.  
  288. var radioIndex = 0;
  289. var checkboxIndex = 0;
  290. var radioCount = 0;
  291. var checkboxCount = 0;
  292.  
  293. //------等待网页加载完成start-----
  294. var wait = setInterval(function (){
  295. ddds3.children().remove();
  296. let nowUrl = window.location.href;
  297. if(nowUrl.substring(0,22) === 'http://www.lnszyys.com'){
  298. addMessage("首页");
  299. }
  300. else if(nowUrl.substring(0,39) === 'http://www.lnlpa.cn/UserView/CourseList'){
  301. try {
  302. addMessage("课程列表...");
  303. GM_setValue("uRLList",nowUrl);
  304. if(document.getElementsByClassName('el-dialog__wrapper')[0].style.display !== 'none'){
  305. document.getElementsByClassName('el-icon-close')[0].click();
  306. addMessage("关闭弹窗...");
  307. }
  308. juzyk();
  309. clearInterval(wait);
  310. }catch(e){
  311. addMessage("发现异常:"+e+"|程序已终止运行...");
  312. clearInterval(wait);
  313. return;
  314. }
  315. }
  316. else if(nowUrl.substring(0,32) === 'http://www.lnlpa.cn/CourseDetail'){
  317. try {
  318. addMessage("学习页...");
  319. playVoide();
  320. clearInterval(wait);
  321. }catch(e){
  322. addMessage("发现异常:"+e+"|程序已终止运行...");
  323. clearInterval(wait);
  324. return;
  325. }
  326. }
  327. else if(nowUrl.substring(0,30) === 'http://www.lnlpa.cn/OnlineTest'){
  328. try {
  329. addMessage("考试页...");
  330. if(document.querySelector(".radioList") != null){
  331. radioCount = document.querySelector(".questionList").children[0].children[1].childElementCount;
  332. }
  333. if(document.querySelector(".checkboxList") != null){
  334. checkboxCount = document.querySelector(".questionList").children[1].children[1].childElementCount;
  335. }
  336. examRadio();
  337. // examCheckbox();
  338. clearInterval(wait);
  339. }catch(e){
  340. addMessage("发现异常:"+e+"|程序已终止运行...");
  341. clearInterval(wait);
  342. return;
  343. }
  344. }
  345. else{
  346. addMessage("请前往课程列表");
  347. }
  348. }, 2500);
  349. //------等待网页加载完成end-----
  350.  
  351. function goTest(){
  352. let nowUrl = window.location.href;
  353. if(nowUrl.substring(0,30) === 'http://www.lnlpa.cn/OnlineTest'){
  354. try {
  355. ddds3.children().remove();
  356. addMessage("开始考试...");
  357. if(document.querySelector(".radioList") != null){
  358. radioCount = document.querySelector(".questionList").children[0].children[1].childElementCount;
  359. }
  360. if(document.querySelector(".checkboxList") != null){
  361. checkboxCount = document.querySelector(".questionList").children[1].children[1].childElementCount;
  362. }
  363. examRadio();
  364. }catch(e){
  365. addMessage("发现异常:"+e+"|程序已终止运行...");
  366. clearInterval(wait);
  367. return;
  368. }
  369. }
  370. else{
  371. ddds3.children().remove();
  372. addMessage("请进入考试页再使用此功能...");
  373. }
  374. }
  375.  
  376. function wkAnswer(wkType,answor){
  377. if(wkType === '单选题:'){
  378. console.log("单选\u7b2c"+(radioIndex+1)+"\u9898");
  379. addMessage("单选\u7b2c"+(radioIndex+1)+"\u9898");
  380. let answerPrint;
  381. try{
  382. answerPrint = answor.match(/[A-E]/g)[0];
  383. }
  384. catch(e){
  385. addMessage("请查看参考答案:"+answor);
  386. }
  387. console.log("answerPrint",answerPrint);
  388. addMessage(answerPrint);
  389. switch(answerPrint)
  390. {
  391. case 'A':
  392. document.querySelector(".questionList").children[0].children[1].children[radioIndex].children[1].children[0].click();
  393. break;
  394. case 'B':
  395. document.querySelector(".questionList").children[0].children[1].children[radioIndex].children[1].children[1].click();
  396. break;
  397. case 'C':
  398. document.querySelector(".questionList").children[0].children[1].children[radioIndex].children[1].children[2].click();
  399. break;
  400. case 'D':
  401. document.querySelector(".questionList").children[0].children[1].children[radioIndex].children[1].children[3].click();
  402. break;
  403. case 'E':
  404. document.querySelector(".questionList").children[0].children[1].children[radioIndex].children[1].children[4].click();
  405. break;
  406. }
  407. radioIndex++;
  408. }
  409. if(wkType === '多选题:'){
  410. console.log("多选\u7b2c"+(checkboxIndex+1)+"\u9898");
  411. addMessage("多选\u7b2c"+(checkboxIndex+1)+"\u9898");
  412. let answerPrint;
  413. let duoxuan = /\[(.*?)\]/.exec(answor)[1];
  414. if(duoxuan === null){
  415. let str1 = answor.split('。')[0];
  416. answerPrint = str1.match(/[A-E]/g);
  417. }
  418. else{
  419. answerPrint = duoxuan.split('');
  420. }
  421. console.log("---------------------",answerPrint);
  422. addMessage(answerPrint);
  423. answerPrint.forEach((answer, index) => {
  424. setTimeout(() => {
  425. let clickTarget;
  426. switch(answer) {
  427. case 'A':
  428. console.log("---------------------"+checkboxIndex);
  429. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[0];
  430. break;
  431. case 'B':
  432. console.log("---------------------"+checkboxIndex);
  433. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[1];
  434. break;
  435. case 'C':
  436. console.log("---------------------"+checkboxIndex);
  437. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[2];
  438. break;
  439. case 'D':
  440. console.log("---------------------"+checkboxIndex);
  441. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[3];
  442. break;
  443. case 'E':
  444. console.log("---------------------"+checkboxIndex);
  445. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[4];
  446. break;
  447. case 'F':
  448. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[5];
  449. break;
  450. case 'G':
  451. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[6];
  452. break;
  453. case 'H':
  454. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[7];
  455. break;
  456. case 'I':
  457. clickTarget = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].children[1].children[8];
  458. break;
  459. default:
  460. console.log("当前多选题选择过多,系统需更新!");
  461. addMessage("当前多选题选择过多,系统需更新!");
  462. return;
  463. }
  464. if (clickTarget) {
  465. clickTarget.click();
  466. console.log("点击" + answer);
  467. }
  468. }, index * 50); // 将每次点击的延迟设置为 500ms * 索引
  469. });
  470. setTimeout(function(){
  471. checkboxIndex++;
  472. },3000);
  473. }
  474. setTimeout(function(){
  475. examRadio();
  476. },3500);
  477. }
  478.  
  479. var examRadioText = '单选题:';
  480. var examCheckboxText = '多选题:';
  481.  
  482. function examRadio(){
  483. if(radioIndex < radioCount){
  484. let qusetionStr = document.querySelector(".questionList").children[0].children[1].children[radioIndex].innerText;
  485. let newQusetionStr = qusetionStr.replace(/\n/g, '');
  486. console.log(radioIndex,examRadioText,newQusetionStr);
  487. wait1(examRadioText,newQusetionStr);
  488. }else{
  489. console.log("单选题作答完毕");
  490. radioIndex = 0;
  491. radioCount = 0;
  492. examCheckbox();
  493. }
  494. }
  495.  
  496. function examCheckbox(){
  497. if(checkboxIndex < checkboxCount){
  498. console.log("多选题开始作答");
  499. let qusetionStr = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].innerText;
  500. let newQusetionStr = qusetionStr.replace(/\n/g, '');
  501. console.log(checkboxIndex,examCheckboxText,newQusetionStr);
  502. wait1(examCheckboxText,newQusetionStr);
  503. }else{
  504. console.log("多选题作答完毕");
  505. checkboxIndex = 0;
  506. addMessage("作答完毕,请手动提交");
  507. }
  508. }
  509.  
  510. function wait2(){
  511. const apiKey = "";
  512. const sk = '';
  513.  
  514. // 构建请求URL
  515. const url = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=&client_secret=';
  516.  
  517. // 构建请求数据
  518. const data = {
  519. nlu_type: "text",
  520. query: ""
  521. };
  522.  
  523. GM_xmlhttpRequest({
  524. url: url,
  525. method: "POST",
  526. headers: {
  527. "Content-Type": "application/json"
  528. },
  529. data: JSON.stringify(data),
  530. onload: function(response) {
  531. var data = JSON.parse(response.responseText);
  532. console.log("access_token:",data.access_token);
  533. },
  534. onerror: function(response) {
  535. console.error("请求失败:", response);
  536. }
  537. });
  538. }
  539.  
  540. function wait1(wkType,con){
  541.  
  542. const url = 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro?access_token=24.d66a8e57726a305c45d0b4bf07751eea.2592000.1707580474.282335-46883328';
  543.  
  544. const qusetionData = wkType+con;
  545.  
  546. const data ={
  547. "messages": [{"role": "user","content": qusetionData}],
  548. "system": "我想让你充当一个参考答案,并且你只会回复正确答案的编号,例如:[A]、[C]、[ABC]、[BDE],不要包含其他任何内容,如答案解析或选项分析,除非我指示或要求你这么做。"
  549. }
  550.  
  551. GM_xmlhttpRequest({
  552. url: url,
  553. method: "POST",
  554. headers: {
  555. "Content-Type": "application/json"
  556. },
  557. data: JSON.stringify(data),
  558. onload: function(response) {
  559. var data = JSON.parse(response.responseText);
  560. let answor = data.result;
  561. console.log(data);
  562. console.log(answor);
  563. wkAnswer(wkType,answor);
  564. },
  565. onerror: function(response) {
  566. console.error("请求失败:", response);
  567. }
  568. });
  569. }
  570.  
  571. const panel = function(){
  572. var container = $('<div id="gm-interface"></div>');
  573. var titleBar = $('<div id="gm-title-bar">\ud83c\udf49\u897f\u74dc\u7f51\u8bfe\u52a9\u624b\ud83c\udf49</div>');
  574. 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>');
  575. 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>');
  576. var content = $('<div id="gm-content"></div>');
  577. var tips = $('<div class="tip" style="display:none;">\u957f\u6309\u62d6\u62fd</div>');
  578. 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({
  579. 'position': 'absolute',
  580. 'top': '15%',
  581. 'left': '50%',
  582. 'transform': 'translate(-50%, -50%)',
  583. 'width': '90%',
  584. 'height': '25px',
  585. 'font-size': '16px',
  586. 'line-height': '1.5',
  587. 'white-space': 'nowrap'
  588. }).appendTo(content);
  589. //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>');
  590. //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>');
  591. var ddds2 = $('<div style="position: absolute;top: 73%;width:94%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">操作\uff1a<button id="goTest" style="position: absolute;width:88px;right: 138px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">开始考试</button><button id="speedxgone" style="position: absolute;width:88px;right: 38px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">清空缓存</button></div>');
  592. ddds3 = $('<div id="message-container" style="position: absolute;display: ;align-content: center;justify-content: center;top: 20%;width:94%;height:52%;max-height:9999%;overflow-y:auto;padding: 3px;background: #ffffff;border-radius: 5px;"></div>');
  593. var ddds4 = $('<div style="position: absolute;top: 85%;width:94%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;"><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>');
  594.  
  595. container.append(titleBar);
  596. //content.append(ddds1);
  597. //content.append(ddds5);
  598. content.append(ddds2);
  599. content.append(ddds3);
  600. content.append(ddds4);
  601. container.append(content);
  602. container.append(maxButton);
  603. container.append(minimizeButton);
  604. $('body').append(container);
  605. $('body').append(tips);
  606.  
  607. GM_addStyle(`
  608. #gm-interface {
  609. position: fixed;
  610. top: 50%;
  611. left: 50%;
  612. border-radius: 5px;
  613. background-color: white;
  614. z-index: 9999;
  615. }
  616.  
  617. #gm-title-bar {
  618. padding: 5px;
  619. background-color: #ffc0c0;
  620. border: 1px solid black;
  621. border-radius: 5px;
  622. cursor: grab;
  623. }
  624.  
  625. #gm-minimize-button {
  626. position: absolute;
  627. top: 2px;
  628. right: 2px;
  629. width: 30px;
  630. height: 30px;
  631. border-radius: 5px;
  632. padding: 0;
  633. font-weight: bold;
  634. background-color: #ffc0c0;
  635. cursor: pointer;
  636. }
  637.  
  638. #gm-content {
  639. padding: 10px;
  640. border: 1px solid black;
  641. border-radius: 2px 2px 5px 5px;
  642. background-color: #ffe5e5;
  643. width: 400px;
  644. height: 300px;
  645. }
  646. .tip{
  647. font-family: "黑体";
  648. color: black;
  649. -webkit-transform: scale(0.8);
  650. position:absolute;
  651. padding: 6px 5px;
  652. background-color:#ffe8f0;
  653. border-radius: 4px;
  654. z-index: 9999;
  655. }
  656. `);
  657.  
  658. titleBar.on('mousemove',function(e){
  659. tips.attr("style", "display:black;");
  660. var top = e.pageY+5;
  661. var left = e.pageX+5;
  662. tips.css({
  663. 'top' : top + 'px',
  664. 'left': left+ 'px'
  665. });
  666. });
  667.  
  668. titleBar.on('mouseout',function(){
  669. tips.hide();
  670. });
  671.  
  672. titleBar.on('mousedown', function(e) {
  673. var startX = e.pageX - container.offset().left + window.scrollX;
  674. var startY = e.pageY - container.offset().top + window.scrollY;
  675.  
  676. $(document).on('mousemove', function(e) {
  677. e.preventDefault();
  678. var newX = e.pageX - startX;
  679. var newY = e.pageY - startY;
  680. container.css({ left: newX, top: newY });
  681. });
  682.  
  683. $(document).on('mouseup', function() {
  684. $(document).off('mousemove');
  685. $(document).off('mouseup');
  686. });
  687. });
  688.  
  689.  
  690. minimizeButton.on('click', function() {
  691. minimizeButton.attr("style", "display:none;");
  692. maxButton.attr("style", "display:black;");
  693. content.slideToggle(0);
  694. container.css({ width: 200 });
  695. });
  696.  
  697. maxButton.on('click', function() {
  698. minimizeButton.attr("style", "display:black;");
  699. maxButton.attr("style", "display:none;");
  700. content.slideToggle(0);
  701. container.css({ width: 400 });
  702. });
  703.  
  704. $("#goTest").on('click',function(){
  705. goTest();
  706. });
  707.  
  708. $("#speedxgone").on('click',function(){
  709. GM_deleteValue("courseId");
  710. ddds3.children().remove();
  711. addMessage("已清空缓存");
  712. addMessage("调用wait1()");
  713. console.log("调用wait1()");
  714. wait1();
  715. });
  716.  
  717. $("#switchButton").on('click',function(){
  718. // if (speedonoff) {
  719. // speedonoff = false;
  720. // addMessage("\u500d\u901f\uff1a\u5173\u95ed");
  721. // $("#switchButton").text("当前:关闭");
  722. // } else {
  723. // speedonoff = true;
  724. // addMessage("\u500d\u901f\uff1a\u5f00\u542f");
  725. // $("#switchButton").text("当前:开启");
  726. // }
  727. });
  728.  
  729. // 监听鼠标滚轮事件,实现消息框滚动
  730. ddds3.on('mousewheel', function(event) {
  731. event.preventDefault();
  732. var scrollTop = ddds3.scrollTop();
  733. ddds3.scrollTop(scrollTop + event.originalEvent.deltaY);
  734. });
  735.  
  736. // 添加新消息
  737. addMessage = function(message){
  738. // 检查消息数量,移除最早的一条消息
  739. // if (ddds3.children().length >= 288) {
  740. // ddds3.children().first().remove();
  741. // }
  742. // 创建消息元素并添加到消息框容器
  743. var messageElement = $('<div class="message"></div>').text(message).css({
  744. 'margin-bottom': '10px'
  745. }).appendTo(ddds3);
  746. }
  747.  
  748. }
  749. panel();
  750. addMessage("\u002d\u002d\u002d\u002d\u6b63\u5728\u542f\u52a8\uff0c\u8bf7\u7a0d\u540e\u002e\u002e\u002e\u002d\u002d\u002d\u002d");
  751. })();

QingJ © 2025

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