Fix view cover not work

This commit is contained in:
the1812 2018-10-18 12:38:49 +08:00
parent 979a2d9730
commit 4eb1c16e4f
8 changed files with 89 additions and 77 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Preview)
// @version 1.5.9
// @version 1.5.10
// @description 增强哔哩哔哩Web端体验. (预览版分支)
// @author Grant Howard, Coulomb-G
// @match *://*.bilibili.com/*
@ -57,7 +57,7 @@
clearCache: true,
fixFullscreen: false,
latestVersionLink: "https://github.com/the1812/Bilibili-Evolved/raw/preview/bilibili-evolved.preview.user.js",
currentVersion: "1.5.9"
currentVersion: "1.5.10"
};
function loadSettings()
{
@ -779,16 +779,19 @@
return null;
}
const promise = resource.download();
promise.then(text =>
return new Promise(resolve =>
{
this.applyComponent(key, text);
}).catch(reason =>
{
// download error
console.error(`Download error, XHR status: ${reason}`);
Toast.error(`无法下载组件<span>${Resource.all[key].displayName}</span>`, "错误");
promise.then(text =>
{
this.applyComponent(key, text);
resolve();
}).catch(reason =>
{
// download error
console.error(`Download error, XHR status: ${reason}`);
Toast.error(`无法下载组件<span>${Resource.all[key].displayName}</span>`, "错误");
});
});
return promise;
}
fetch()
{

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved
// @version 1.5.9
// @version 1.5.10
// @description 增强哔哩哔哩Web端体验.
// @author Grant Howard, Coulomb-G
// @match *://*.bilibili.com/*
@ -57,7 +57,7 @@
clearCache: true,
fixFullscreen: false,
latestVersionLink: "https://github.com/the1812/Bilibili-Evolved/raw/master/bilibili-evolved.user.js",
currentVersion: "1.5.9"
currentVersion: "1.5.10"
};
function loadSettings()
{
@ -779,16 +779,19 @@
return null;
}
const promise = resource.download();
promise.then(text =>
return new Promise(resolve =>
{
this.applyComponent(key, text);
}).catch(reason =>
{
// download error
console.error(`Download error, XHR status: ${reason}`);
Toast.error(`无法下载组件<span>${Resource.all[key].displayName}</span>`, "错误");
promise.then(text =>
{
this.applyComponent(key, text);
resolve();
}).catch(reason =>
{
// download error
console.error(`Download error, XHR status: ${reason}`);
Toast.error(`无法下载组件<span>${Resource.all[key].displayName}</span>`, "错误");
});
});
return promise;
}
fetch()
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -240,36 +240,36 @@
});
}
}
addSettingsIcon($("body"));
const settingsBox = resources.data.guiSettingsDom.text;
if (settingsBox)
{
$("body").append(settingsBox);
setupEvents();
fillSvgData();
syncGui();
listenDependencies();
addPredefinedColors();
listenSettingsChange();
if (settings.blurSettingsPanel)
{
$(".gui-settings-box").addClass("blur");
}
else
{
$(".gui-settings-panel").addClass("animation");
}
if (typeof offlineData !== "undefined")
{
$("input[key=useCache]").prop("disabled", true);
}
}
new SpinQuery(
() => $("body"),
it => it.length > 0 && !unsafeWindow.frameElement && unsafeWindow.$,
it =>
{
addSettingsIcon(it);
const settingsBox = resources.data.guiSettingsDom.text;
if (settingsBox)
{
$("body").append(settingsBox);
setupEvents();
fillSvgData();
syncGui();
listenDependencies();
addPredefinedColors();
listenSettingsChange();
if (settings.blurSettingsPanel)
{
$(".gui-settings-box").addClass("blur");
}
else
{
$(".gui-settings-panel").addClass("animation");
}
if (typeof offlineData !== "undefined")
{
$("input[key=useCache]").prop("disabled", true);
}
}
}
it => it.length > 0 && !(unsafeWindow.parent.window === unsafeWindow),
_ => $(".gui-settings-icon-panel").css("display", "none")
).start();
};
})();

View File

@ -1 +1 @@
1.5.9
1.5.10