update pluginsrepo, adds update check button

This commit is contained in:
Cynthia Foxwell 2018-05-22 13:50:02 -06:00
parent fdb93d6e2b
commit 88dbbdb77f

View file

@ -16,7 +16,7 @@ exports = {
author: "Cynosphere", author: "Cynosphere",
name: "Plugins Repo", name: "Plugins Repo",
description: "Download plugins.", description: "Download plugins.",
_version: 1 _version: 2
}, },
getInfo: async function(plugin){ getInfo: async function(plugin){
@ -239,6 +239,7 @@ exports = {
em.createButton("Reload list") em.createButton("Reload list")
.modify(async x=>{ .modify(async x=>{
x.className = `${x.className} ${int.buttons.colorGreen}`;
x.onclick=async ()=>{ x.onclick=async ()=>{
if(Date.now() < window._prTimeout){ if(Date.now() < window._prTimeout){
em.createH5(`Ratelimited, try again in ${Math.floor(window._prTimeout-Date.now())}s.`) em.createH5(`Ratelimited, try again in ${Math.floor(window._prTimeout-Date.now())}s.`)
@ -263,6 +264,22 @@ exports = {
}) })
.appendTo(btns); .appendTo(btns);
em.createButton("Check for updates")
.modify(async x=>{
x.className = `${x.className} ${int.buttons.colorYellow}`;
x.onclick=async ()=>{
if(Date.now() < window._prTimeout){
em.createH5(`Ratelimited, try again in ${Math.floor(window._prTimeout-Date.now())}s.`)
.modify(y=>setTimeout(_=>{y.parentNode.removeChild(y)},2000))
.appendTo(btns);
return;
}
exports.updateCheck();
}
})
.appendTo(btns);
var list = em.createVerticalPanel() var list = em.createVerticalPanel()
.appendTo(pnl); .appendTo(pnl);