use a fixed div for fediact running + go home button (easier to maintain and does not mess up the header)

pull/21/head v0.9.8.1
lartsch 2022-12-19 08:17:13 -05:00
rodzic a26c0d2d02
commit 69041eccd5
4 zmienionych plików z 16 dodań i 21 usunięć

Wyświetl plik

@ -574,18 +574,7 @@ function showModal(settings) {
function addFediElements() {
if (!$(".fediactrunning").length) {
if ($("div.ui__header").is(":visible")) {
$("a.ui__header__logo").remove()
$("div.ui__header__links").prepend("<span class='fediactrunning'>FediAct running</span>")
$("div.ui__header__links").append("<a target='" + settings.fediact_target + "' href='https://" + settings.fediact_homeinstance + "' class='button button-tertiary fediactgohome'><span>Go home</span></a>")
} else if ($("nav.header").length) {
$("nav.header a.brand").remove()
$("nav.header div.nav-right").prepend("<span class='fediactrunning fediv3'>FediAct running</span>")
$("nav.header div.nav-right").append("<a target='" + settings.fediact_target + "' class='webapp-btn nav-link nav-button fediactgohome' href='https://" + settings.fediact_homeinstance + "'>Go home</a>")
} else if ($("div.sign-in-banner").length) {
$("div.sign-in-banner").append("<a target='" + settings.fediact_target + "' href='https://" + settings.fediact_homeinstance + "' class='button button--block button-tertiary fediactgohome'><span>Go home</span></a>")
$("div.sign-in-banner").append("<span class='fediactrunning'>FediAct running</p>")
}
$("body").append("<div class='fediactrunning'><span>FediAct running</span> - <a target='" + settings.fediact_target + "' href='https://" + settings.fediact_homeinstance + "'>Go home</a></div>")
}
}
@ -1419,7 +1408,6 @@ async function backgroundProcessor() {
tmpSettings.processedFollow = []
tmpSettings.isProcessing = []
$(".fediactrunning").remove()
$(".fediactgohome").remove()
// rerun getSettings to keep mutes/blocks up to date while not reloading the page
if (!await getSettings()) {
// but reload if settings are invalid

2
src/inject.min.js vendored

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -70,15 +70,22 @@
}
.fediactrunning {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
z-index: 99998;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.7);
color: white;
margin: 0;
padding: 10px 15px;
}
.fediactrunning span {
color: green;
}
.fediactrunning.fediv3 {
padding-right: 10px;
.fediactrunning a {
color: white;
}

2
src/styles.min.css vendored
Wyświetl plik

@ -1 +1 @@
.fediactmodal{position:fixed;z-index:99999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.4);margin:0;padding:0}.fediactmodalinner{background-color:#494949;border:1px solid #888;width:50%;max-width:300px;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;margin:0;padding:0}.fediactmodallist{width:100%;margin:0;padding:0}.fediactmodalitem{cursor:pointer;width:100%;padding:5px 10px;box-sizing:border-box}.fediactmodallink{font-size:16px;cursor:pointer;text-decoration:none;color:white}.fediactprocessing{color:white;padding-right:10px;padding-left:10px}.fediactunresolved{color:orange;padding-right:10px;padding-left:10px}.fediactvoted{font-style:italic}.fediactvoted>a{font-weight:bold;color:orange}.fediactrunning{height:100%;display:flex;align-items:center;justify-content:center;color:green}.fediactrunning.fediv3{padding-right:10px}@-moz-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-webkit-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-ms-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-o-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@keyframes nodeInserted{from{opacity:1}to{opacity:1}}div.status,div.detailed-status,div.detailed-status__action-bar,div.account__header button.logo-button,div.account__header button.button--follow,div.public-account-header a.logo-button,div.account-card a.logo-button,div.directory-card a.icon-button,div.detailed-status a.logo-button,button.remote-button,script#initial-state{-webkit-animation-name:nodeInserted !important;-webkit-animation-duration:.001s !important;-ms-animation-name:nodeInserted !important;-ms-animation-duration:.001s !important;-moz-animation-name:nodeInserted !important;-moz-animation-duration:.001s !important;-o-animation-name:nodeInserted !important;-o-animation-duration:.001s !important;animation-name:nodeInserted !important;animation-duration:.001s !important}
.fediactmodal{position:fixed;z-index:99999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.4);margin:0;padding:0}.fediactmodalinner{background-color:#494949;border:1px solid #888;width:50%;max-width:300px;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;margin:0;padding:0}.fediactmodallist{width:100%;margin:0;padding:0}.fediactmodalitem{cursor:pointer;width:100%;padding:5px 10px;box-sizing:border-box}.fediactmodallink{font-size:16px;cursor:pointer;text-decoration:none;color:white}.fediactprocessing{color:white;padding-right:10px;padding-left:10px}.fediactunresolved{color:orange;padding-right:10px;padding-left:10px}.fediactvoted{font-style:italic}.fediactvoted>a{font-weight:bold;color:orange}.fediactrunning{position:fixed;z-index:99998;right:0;bottom:0;background-color:rgba(0,0,0,0.7);color:white;margin:0;padding:10px 15px}.fediactrunning span{color:green}.fediactrunning a{color:white}@-moz-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-webkit-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-ms-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-o-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@keyframes nodeInserted{from{opacity:1}to{opacity:1}}div.status,div.detailed-status,div.detailed-status__action-bar,div.account__header button.logo-button,div.account__header button.button--follow,div.public-account-header a.logo-button,div.account-card a.logo-button,div.directory-card a.icon-button,div.detailed-status a.logo-button,button.remote-button,script#initial-state{-webkit-animation-name:nodeInserted !important;-webkit-animation-duration:.001s !important;-ms-animation-name:nodeInserted !important;-ms-animation-duration:.001s !important;-moz-animation-name:nodeInserted !important;-moz-animation-duration:.001s !important;-o-animation-name:nodeInserted !important;-o-animation-duration:.001s !important;animation-name:nodeInserted !important;animation-duration:.001s !important}