From 04b4ab5614fb3a35e3a7b029a0bc379ecffa41ca Mon Sep 17 00:00:00 2001 From: CodFrm Date: Sun, 23 Dec 2018 15:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=92=E8=BF=87=E7=A1=AE=E8=AE=A4&=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cxmooc-tools/action.js | 1 + src/cxmooc-tools/popup.html | 4 ++++ src/cxmooc-tools/popup.js | 10 ++++++++++ src/cxmooc-tools/start.js | 3 ++- src/cxmooc-tools/video.js | 5 +++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/cxmooc-tools/action.js b/src/cxmooc-tools/action.js index ca8133a..445a8c2 100644 --- a/src/cxmooc-tools/action.js +++ b/src/cxmooc-tools/action.js @@ -49,6 +49,7 @@ window.monitorPlay = function (playOver, config) { player.play(); console.log(config); player.muted = config.video_mute; + player.playbackRate = config.video_multiple; } else { clearInterval(time); } diff --git a/src/cxmooc-tools/popup.html b/src/cxmooc-tools/popup.html index 5b95e70..d651c9a 100644 --- a/src/cxmooc-tools/popup.html +++ b/src/cxmooc-tools/popup.html @@ -70,6 +70,10 @@ +
+ + 倍 +
题库导入
diff --git a/src/cxmooc-tools/popup.js b/src/cxmooc-tools/popup.js index f608288..363fd6c 100644 --- a/src/cxmooc-tools/popup.js +++ b/src/cxmooc-tools/popup.js @@ -31,6 +31,11 @@ window.onload = function () { document.getElementById('video-mute').checked = items.video_mute; document.getElementById('video-mute').onchange(); }); + + chrome.storage.sync.get('video_multiple', function (items) { + document.getElementById('video-multiple').value = items.video_multiple == undefined ? 1 : items.video_multiple; + }); + chrome.storage.sync.get('answer_ignore', function (items) { document.getElementById('answer-ignore').checked = items.answer_ignore; document.getElementById('answer-ignore').onchange(); @@ -71,4 +76,9 @@ window.onload = function () { 'interval': document.getElementById('interval').value }); } + document.getElementById('video-multiple').onblur = function () { + chrome.storage.sync.set({ + 'video_multiple': document.getElementById('video-multiple').value + }); + } } \ No newline at end of file diff --git a/src/cxmooc-tools/start.js b/src/cxmooc-tools/start.js index b41faef..af8abd6 100644 --- a/src/cxmooc-tools/start.js +++ b/src/cxmooc-tools/start.js @@ -16,7 +16,8 @@ window.onload = function () { 'interval', 'auto', 'video_mute', - 'answer_ignore' + 'answer_ignore', + 'video_multiple' ], function (items) { //设置一下配置 console.log(items); diff --git a/src/cxmooc-tools/video.js b/src/cxmooc-tools/video.js index ed1a33d..8744e64 100644 --- a/src/cxmooc-tools/video.js +++ b/src/cxmooc-tools/video.js @@ -304,6 +304,11 @@ module.exports = function (_this, elLogo, index) { //秒过按钮事件 boom.onclick = function () { + if (localStorage['boom_no_prompt'] == undefined || localStorage['boom_no_prompt'] != 1) { + var msg = prompt('秒过视频会产生不良记录,是否继续?如果以后不想再弹出本对话框请在下方填写yes') + if (msg === null) return; + if (msg === 'yes') localStorage['boom_no_prompt'] = 1; + } getVideoInfo(function (json) { var playTime = parseInt(json.duration - Math.random(1, 2)); send_time_pack(playTime, function (ret) { -- GitLab