Improve loading, add TM warning

This commit is contained in:
Piero Toffanin 2023-10-09 14:36:20 -04:00
parent 640d4f5bf2
commit e0a143987f
3 changed files with 17 additions and 3 deletions

View file

@ -74,6 +74,14 @@ a:not(.noline) {
min-height: 80vh;
}
.component{
visibility: hidden;
}
#app.loaded .component{
visibility: visible;
}
h3.header {
margin-bottom: 2.5rem;
}

View file

@ -45,6 +45,7 @@ document.addEventListener('DOMContentLoaded', function(){
},
mounted: function() {
const self = this;
self.$el.classList.add("loaded");
const settingsRequest = new XMLHttpRequest();
settingsRequest.open("GET", BaseUrl + "/frontend/settings", true);
@ -68,6 +69,11 @@ document.addEventListener('DOMContentLoaded', function(){
} else {
langsRequest.onload = function() {
handleLangsResponse(self, this);
var hostname = window.location.hostname.toLowerCase();
if (hostname.indexOf("libretranslate.") === 0 && !hostname.endsWith(".com")){
self.error = "This website might be in violation of our trademark guidelines: https://github.com/LibreTranslate/LibreTranslate/blob/main/TRADEMARK.md";
}
}
}
} else {

View file

@ -141,11 +141,11 @@
</div>
</div>
<div v-else-if="error">
<div v-else-if="error" class="component">
<div class="section no-pad-bot">
<div class="container">
<div class="row">
<div class="col s12 m7">
<div class="col s12 m12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
@ -162,7 +162,7 @@
</div>
</div>
<div v-else>
<div v-else class="component">
<div class="section no-pad-bot">
<div class="container">
<div class="row">