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",
name: "Plugins Repo",
description: "Download plugins.",
_version: 1
_version: 2
},
getInfo: async function(plugin){
@ -239,6 +239,7 @@ exports = {
em.createButton("Reload list")
.modify(async x=>{
x.className = `${x.className} ${int.buttons.colorGreen}`;
x.onclick=async ()=>{
if(Date.now() < window._prTimeout){
em.createH5(`Ratelimited, try again in ${Math.floor(window._prTimeout-Date.now())}s.`)
@ -263,6 +264,22 @@ exports = {
})
.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()
.appendTo(pnl);