Skip to content

Commit 57be82f

Browse files
committed
- 修复:恢复Freeanywhere的验证按钮(当前仅支持不需要扩展的任务)(#76)
1 parent 5b3f00e commit 57be82f

15 files changed

Lines changed: 144 additions & 22 deletions

.github/workflows/Release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
uses: softprops/action-gh-release@v1
2323
with:
2424
prerelease: false
25-
tag_name: v5.1.8
26-
name: 5.1.8
27-
body: '- 修复:Reddit任务失败'
25+
tag_name: v5.1.9
26+
name: 5.1.9
27+
body: '- 修复:恢复Freeanywhere的验证按钮(当前仅支持不需要扩展的任务)(#76)'
2828
files: |-
2929
dist/auto-task.user.js
3030
dist/auto-task.min.user.js

dist/auto-task.all.user.js

Lines changed: 23 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task.compatibility.all.user.js

Lines changed: 23 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task.compatibility.user.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task.compatibility
33
// @namespace auto-task.compatibility
4-
// @version 5.1.8
4+
// @version 5.1.9
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -739,6 +739,7 @@ function _toPrimitive(t, r) {
739739
updatingUserData: '正在更新用户数据...',
740740
gettingUserGames: '正在获取用户游戏...',
741741
skipExtensionToVerifyTask: '需要扩展,跳过自动验证',
742+
verifyExtensionNeeded: '此任务验证需要扩展程序,跳过',
742743
confirmingTask: '正在跳过警告页面...',
743744
unSupporttedTaskType: '不支持的任务类型: %0',
744745
taskNotFinished: '有任务未完成,不获取密钥',
@@ -1055,6 +1056,7 @@ function _toPrimitive(t, r) {
10551056
updatingUserData: 'Updating user data...',
10561057
gettingUserGames: 'Getting user games...',
10571058
skipExtensionToVerifyTask: 'Need extension, skip automatic verification',
1059+
verifyExtensionNeeded: 'This task verification requires the extension. Skip.',
10581060
confirmingTask: 'Confirming task...',
10591061
unSupporttedTaskType: 'Unsupportted task type: %0',
10601062
taskNotFinished: 'There are tasks not completed, do not get the key',
@@ -9399,7 +9401,7 @@ function _toPrimitive(t, r) {
93999401
_defineProperty(this, 'socialTasks', JSON.parse(defaultTasks$9));
94009402
_defineProperty(this, 'undoneTasks', JSON.parse(defaultTasks$9));
94019403
_defineProperty(this, 'games', void 0);
9402-
_defineProperty(this, 'buttons', [ 'doTask', 'undoTask', 'getKey' ]);
9404+
_defineProperty(this, 'buttons', [ 'doTask', 'undoTask', 'verifyTask', 'getKey' ]);
94039405
}
94049406
static test() {
94059407
const isMatch = window.location.host === 'freeanywhere.net';
@@ -9529,6 +9531,12 @@ function _toPrimitive(t, r) {
95299531
result: result
95309532
});
95319533
echoLog({}).success(I18n('allTasksComplete'));
9534+
const tasksNotDone = $('.game__content-tasks__task').toArray().find((el => !$(el).hasClass('done')));
9535+
if (tasksNotDone) {
9536+
$('.js-get-key').addClass('inactive');
9537+
} else {
9538+
$('.js-get-key').removeClass('inactive');
9539+
}
95329540
if (result.every((item => item.status === 'fulfilled' && item.value === true))) {
95339541
return !!await this.getKey(true);
95349542
}
@@ -9823,6 +9831,13 @@ function _toPrimitive(t, r) {
98239831
const logStatus = echoLog({
98249832
text: ''.concat(I18n('verifyingTask')).concat(task.title.trim(), '...')
98259833
});
9834+
const $parrent = $('.game__content-tasks__task[data-id="'.concat(task.id, '"]'));
9835+
const extension = $parrent.data('extension');
9836+
if (extension) {
9837+
logStatus.warning(I18n('verifyExtensionNeeded'));
9838+
return false;
9839+
}
9840+
$parrent.find('.task-check').addClass('loading');
98269841
const {result: result, statusText: statusText, status: status, data: data} = await httpRequest({
98279842
url: 'https://freeanywhere.net/php/user_task_update.php',
98289843
method: 'POST',
@@ -9848,8 +9863,14 @@ function _toPrimitive(t, r) {
98489863
status: data === null || data === void 0 ? void 0 : data.status
98499864
});
98509865
logStatus.error('Error:'.concat(data === null || data === void 0 ? void 0 : data.statusText, '(').concat(data === null || data === void 0 ? void 0 : data.status, ')'));
9866+
$parrent.removeClass('error');
9867+
$parrent.removeClass('done');
9868+
$parrent.find('.task-check').removeClass('loading');
98519869
return false;
98529870
}
9871+
$parrent.addClass('done');
9872+
$parrent.removeClass('error');
9873+
$parrent.find('.task-check').removeClass('loading');
98539874
debug('验证成功');
98549875
logStatus.success();
98559876
return true;

dist/auto-task.min.all.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task.min.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task.user.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task
33
// @namespace auto-task
4-
// @version 5.1.8
4+
// @version 5.1.9
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -654,6 +654,7 @@ if (missingDependencies.length > 0) {
654654
updatingUserData: '正在更新用户数据...',
655655
gettingUserGames: '正在获取用户游戏...',
656656
skipExtensionToVerifyTask: '需要扩展,跳过自动验证',
657+
verifyExtensionNeeded: '此任务验证需要扩展程序,跳过',
657658
confirmingTask: '正在跳过警告页面...',
658659
unSupporttedTaskType: '不支持的任务类型: %0',
659660
taskNotFinished: '有任务未完成,不获取密钥',
@@ -970,6 +971,7 @@ if (missingDependencies.length > 0) {
970971
updatingUserData: 'Updating user data...',
971972
gettingUserGames: 'Getting user games...',
972973
skipExtensionToVerifyTask: 'Need extension, skip automatic verification',
974+
verifyExtensionNeeded: 'This task verification requires the extension. Skip.',
973975
confirmingTask: 'Confirming task...',
974976
unSupporttedTaskType: 'Unsupportted task type: %0',
975977
taskNotFinished: 'There are tasks not completed, do not get the key',
@@ -9071,7 +9073,7 @@ if (missingDependencies.length > 0) {
90719073
socialTasks=JSON.parse(defaultTasks$9);
90729074
undoneTasks=JSON.parse(defaultTasks$9);
90739075
games;
9074-
buttons=[ 'doTask', 'undoTask', 'getKey' ];
9076+
buttons=[ 'doTask', 'undoTask', 'verifyTask', 'getKey' ];
90759077
static test() {
90769078
const isMatch = window.location.host === 'freeanywhere.net';
90779079
debug('检查网站匹配', {
@@ -9341,6 +9343,12 @@ if (missingDependencies.length > 0) {
93419343
result: result
93429344
});
93439345
echoLog({}).success(I18n('allTasksComplete'));
9346+
const tasksNotDone = $('.game__content-tasks__task').toArray().find((el => !$(el).hasClass('done')));
9347+
if (tasksNotDone) {
9348+
$('.js-get-key').addClass('inactive');
9349+
} else {
9350+
$('.js-get-key').removeClass('inactive');
9351+
}
93449352
if (result.every((item => item.status === 'fulfilled' && item.value === true))) {
93459353
return !!await this.getKey(true);
93469354
}
@@ -9490,6 +9498,13 @@ if (missingDependencies.length > 0) {
94909498
const logStatus = echoLog({
94919499
text: `${I18n('verifyingTask')}${task.title.trim()}...`
94929500
});
9501+
const $parrent = $(`.game__content-tasks__task[data-id="${task.id}"]`);
9502+
const extension = $parrent.data('extension');
9503+
if (extension) {
9504+
logStatus.warning(I18n('verifyExtensionNeeded'));
9505+
return false;
9506+
}
9507+
$parrent.find('.task-check').addClass('loading');
94939508
const {result: result, statusText: statusText, status: status, data: data} = await httpRequest({
94949509
url: 'https://freeanywhere.net/php/user_task_update.php',
94959510
method: 'POST',
@@ -9515,8 +9530,14 @@ if (missingDependencies.length > 0) {
95159530
status: data?.status
95169531
});
95179532
logStatus.error(`Error:${data?.statusText}(${data?.status})`);
9533+
$parrent.removeClass('error');
9534+
$parrent.removeClass('done');
9535+
$parrent.find('.task-check').removeClass('loading');
95189536
return false;
95199537
}
9538+
$parrent.addClass('done');
9539+
$parrent.removeClass('error');
9540+
$parrent.find('.task-check').removeClass('loading');
95209541
debug('验证成功');
95219542
logStatus.success();
95229543
return true;

doc/docs/.vuepress/public/report.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

doc/docs/logs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ lang: zh-CN
55

66
## V5.1
77

8+
### V5.1.9
9+
10+
[Release](https://github.com/HCLonely/auto-task/releases/tag/v5.1.9)
11+
12+
- 修复:恢复Freeanywhere的验证按钮(当前仅支持不需要扩展的任务)([#76](https://github.com/HCLonely/auto-task/issues/76))
13+
814
### V5.1.8
915

1016
[Release](https://github.com/HCLonely/auto-task/releases/tag/v5.1.8)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "auto-task",
3-
"version": "5.1.8",
3+
"version": "5.1.9",
44
"change": [
5-
"修复:Reddit任务失败"
5+
"修复:恢复Freeanywhere的验证按钮(当前仅支持不需要扩展的任务)(#76)"
66
],
77
"description": "赠Key站自动任务脚本",
88
"engines": {

0 commit comments

Comments
 (0)