Add some contents of about

This commit is contained in:
the1812 2018-11-07 22:17:44 +08:00
parent b0db91f06c
commit ef5c31af58
8 changed files with 66 additions and 24 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

@ -591,7 +591,7 @@
const pattern = `#?${part.repeat(count)}`;
return new RegExp(pattern, "ig");
}
_hexToRgb(hex, alpha)
hexToRgbOrRgba(hex, alpha)
{
const isShortHand = hex.length < 6;
if (isShortHand)
@ -627,7 +627,7 @@
}
else if (alpha)
{
const rgb = this._hexToRgb(hex, false);
const rgb = this.hexToRgbOrRgba(hex, false);
if (rgb)
{
rgb.a = 1;
@ -638,11 +638,11 @@
}
hexToRgb(hex)
{
return this._hexToRgb(hex, false);
return this.hexToRgbOrRgba(hex, false);
}
hexToRgba(hex)
{
return this._hexToRgb(hex, true);
return this.hexToRgbOrRgba(hex, true);
}
rgbToHsb(rgb)
{

View File

@ -591,7 +591,7 @@
const pattern = `#?${part.repeat(count)}`;
return new RegExp(pattern, "ig");
}
_hexToRgb(hex, alpha)
hexToRgbOrRgba(hex, alpha)
{
const isShortHand = hex.length < 6;
if (isShortHand)
@ -627,7 +627,7 @@
}
else if (alpha)
{
const rgb = this._hexToRgb(hex, false);
const rgb = this.hexToRgbOrRgba(hex, false);
if (rgb)
{
rgb.a = 1;
@ -638,11 +638,11 @@
}
hexToRgb(hex)
{
return this._hexToRgb(hex, false);
return this.hexToRgbOrRgba(hex, false);
}
hexToRgba(hex)
{
return this._hexToRgb(hex, true);
return this.hexToRgbOrRgba(hex, true);
}
rgbToHsb(rgb)
{

View File

@ -1 +1 @@
<div class="bilibili-evolved-about"></div>
<div class="bilibili-evolved-about"><div class="left"><h1>Bilibili Evolved</h1><h2 class="bilibili-evolved-version-name"></h2><h2 class="bilibili-evolved-version-number"></h2><div class="bilibili-evolved-info"><p>作者:<a href="https://github.com/the1812">Grant Howard</a>,<a href="https://github.com/Coulomb-G">Coulomb-G</a></p></div></div><div class="right"><ul class="open-source-components"></ul></div></div>

2
min/about.min.js vendored
View File

@ -1 +1 @@
(()=>{return(t,n)=>{$("body").append(n.data.aboutDom.text);function e(){n.applyStyle("aboutStyle");$("#about-link").on("click",()=>{$(".bilibili-evolved-about").toggleClass("opened")})}return{settingsWidget:{after:()=>$(".gui-settings-content"),content:`\n <div class="about gui-settings-footer">\n <span id="about-version">${GM_info.script.name}, version ${t.currentVersion}</span>\n <span id="about-link">About</span>\n </div>`,success:e}}}})();
(()=>{return(e,n)=>{$("body").append(n.data.aboutDom.text);$(".bilibili-evolved-version-name").text(GM_info.script.name.replace("Bilibili Evolved","").trim());$(".bilibili-evolved-version-number").text(e.currentVersion);const i=[{name:"jQuery",homepage:"https://jquery.com/",license:"MIT",version:"3.2.1"},{name:"JSZip",homepage:"https://stuk.github.io/jszip/",license:"MIT",version:"3.1.5"}];i.forEach(e=>{$(".open-source-components").append(`\n <li>\n <a href="${e.homepage}">\n <span class="component-name">${e.name}</span>\n <span class="component-info">${e.version} · ${e.license}</span>\n </a>\n </li>\n `)});function o(){n.applyStyle("aboutStyle");$("#about-link").on("click",()=>{$(".bilibili-evolved-about").toggleClass("opened")})}return{settingsWidget:{after:()=>$(".gui-settings-content"),content:`\n <div class="about gui-settings-footer">\n <span id="about-version">${GM_info.script.name}, version ${e.currentVersion}</span>\n <span id="about-link">About</span>\n </div>`,success:o}}}})();

View File

@ -1,3 +1,17 @@
<div class="bilibili-evolved-about">
<div class="left">
<h1>Bilibili Evolved</h1>
<h2 class="bilibili-evolved-version-name"></h2>
<h2 class="bilibili-evolved-version-number"></h2>
<div class="bilibili-evolved-info">
<p>
作者: <a href="https://github.com/the1812">Grant Howard</a>, <a href="https://github.com/Coulomb-G">Coulomb-G</a>
</p>
</div>
</div>
<div class="right">
<ul class="open-source-components">
</ul>
</div>
</div>

View File

@ -3,6 +3,34 @@
return (settings, resources) =>
{
$("body").append(resources.data.aboutDom.text);
$(".bilibili-evolved-version-name").text(GM_info.script.name.replace("Bilibili Evolved", "").trim());
$(".bilibili-evolved-version-number").text(settings.currentVersion);
const openSourceComponents = [
{
name: "jQuery",
homepage: "https://jquery.com/",
license: "MIT",
version: "3.2.1"
},
{
name: "JSZip",
homepage: "https://stuk.github.io/jszip/",
license: "MIT",
version: "3.1.5"
}
];
openSourceComponents.forEach(component =>
{
$(".open-source-components").append(`
<li>
<a href="${component.homepage}">
<span class="component-name">${component.name}</span>
<span class="component-info">${component.version} · ${component.license}</span>
</a>
</li>
`);
});
function init()
{
resources.applyStyle("aboutStyle");