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

View File

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

View File

@ -1 +1 @@
1.5.9 1.5.10