Fix Flash Of Unstyled Content (fouc)

This commit is contained in:
yflory
2016-12-21 18:33:21 +01:00
parent 046220f239
commit 87abfff66b
14 changed files with 149 additions and 51 deletions

View File

@@ -10,8 +10,7 @@ define([
var main = function () {
var url = window.location.pathname;
var isHtml = /\.html/.test(url) || url === '/' || url === '';
var isPoll = /\/poll\//.test(url);
if (!isHtml && !isPoll) {
if (!isHtml) {
Messages._applyTranslation();
return;
}

View File

@@ -146,11 +146,6 @@ define([
if (!Cryptpad.getUserHash()) {
localStorage.FS_hash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
}
window.patchText = TextPatcher.create({
realtime: realtime,
logging: true,
});
}).on('ready', function () {
if (!rt.proxy[Cryptpad.storageKey] || !Cryptpad.isArray(rt.proxy[Cryptpad.storageKey])) {
var oldStore = Cryptpad.getStore(true);
@@ -171,7 +166,7 @@ define([
}
return;
}
Cryptpad.alert(Messages.common_connectionLost);
//Cryptpad.alert(Messages.common_connectionLost);
});
};

View File

@@ -315,6 +315,37 @@ tr {
font-family: lato, Helvetica, sans-serif;
font-size: 1.02em;
}
#loading {
position: fixed;
z-index: 9999;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: #302B28;
text-align: center;
font-size: 1.5em;
}
#loading .loadingContainer {
margin-top: 50vh;
transform: translateY(-50%);
}
#loading .cryptofist {
margin-left: auto;
margin-right: auto;
}
@media screen and (max-height: 450px) {
#loading .cryptofist {
display: none;
}
}
#loading .spinnerContainer {
position: relative;
height: 100px;
}
#loading .spinnerContainer > div {
height: 100px;
}
#main {
width: 70vw;
margin: auto;

View File

@@ -142,6 +142,36 @@ p, pre, td, a, table, tr {
.lato;
}
#loading {
position: fixed;
z-index: 9999;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: @bg-loading;
text-align: center;
font-size: 1.5em;
.loadingContainer {
margin-top: 50vh;
transform: translateY(-50%);
}
.cryptofist {
margin-left: auto;
margin-right: auto;
@media screen and (max-height: 450px) {
display: none;
}
}
.spinnerContainer {
position: relative;
height: 100px;
> div {
height: 100px;
}
}
}
#main {
width: 70vw;
margin: auto;

View File

@@ -32,3 +32,4 @@
@alertify-input-bg: @base;
@alertify-input-fg: @fore;
@bg-loading: @base;

View File

@@ -19,6 +19,10 @@ define(function () {
].join('');
out.common_connectionLost = 'Connexion au serveur perdue';
out.websocketError = 'Impossible de se connecter au serveur WebSocket...';
out.loading = "Chargement...";
out.error = "Erreur";
out.disconnected = 'Déconnecté';
out.synchronizing = 'Synchronisation';
@@ -212,6 +216,7 @@ define(function () {
out.fo_existingNameError = "Ce nom est déjà utilisé dans ce répertoire. Veuillez en choisir un autre.";
out.fo_moveFolderToChildError = "Vous ne pouvez pas déplacer un dossier dans un de ses descendants";
out.fo_unableToRestore = "Impossible de restaurer ce fichier à son emplacement d'origine. Vous pouvez essayer de le déplacer à un nouvel emplacement.";
out.fo_unavailableName = "Un fichier ou dossier avec le même nom existe déjà au nouvel emplacement. Renommez cet élément avant d'essayer à nouveau.";
// index.html

View File

@@ -23,6 +23,9 @@ define(function () {
out.common_connectionLost = 'Server Connection Lost';
out.websocketError = 'Unable to connect to the websocket server...';
out.loading = "Loading...";
out.error = "Error";
out.disconnected = 'Disconnected';
out.synchronizing = 'Synchronizing';
out.reconnecting = 'Reconnecting...';
@@ -211,6 +214,7 @@ define(function () {
out.fo_existingNameError = "Name already used in that directory. Please choose another one.";
out.fo_moveFolderToChildError = "You can't move a folder into one of its descendants";
out.fo_unableToRestore = "Unable to restore that file to its original location. You can try to move it to a new location.";
out.fo_unavailableName = "A file or a folder with the same name already exist at the new location. Rename the element and try again.";
// login
out.login_login = "log in";