From 24859fe5b64925f93f5b2decee28d3bba23a5b44 Mon Sep 17 00:00:00 2001 From: Sondre Nilsen Date: Wed, 31 May 2017 03:05:49 +0200 Subject: [PATCH] Fix FOUC on Firefox (#1728) Firefox users will experience a flash of unstyled content on loading various pages, this patch will fix this issue using Filament Groups loadCSS library to asynchronously load the CSS responsible for the FOUC. Will fix #1698. Signed-off-by: Sondre Nilsen --- public/assets/librejs/librejs.html | 9 +++++++++ public/js/libs/cssrelpreload.min.js | 2 ++ public/js/libs/loadCSS.min.js | 2 ++ templates/base/head.tmpl | 6 ++++-- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 public/js/libs/cssrelpreload.min.js create mode 100644 public/js/libs/loadCSS.min.js diff --git a/public/assets/librejs/librejs.html b/public/assets/librejs/librejs.html index 59991e8ac2..57d4769184 100644 --- a/public/assets/librejs/librejs.html +++ b/public/assets/librejs/librejs.html @@ -36,6 +36,15 @@ emojify-1.1.0.tar.gz + loadCSS.min.js + MIT License + loadCSS-1.3.1.tar.gz + + + cssrelpreload.min.js + MIT License + loadCSS-1.3.1.tar.gz + dropzone.js Expat dropzone.js diff --git a/public/js/libs/cssrelpreload.min.js b/public/js/libs/cssrelpreload.min.js new file mode 100644 index 0000000000..1204401b09 --- /dev/null +++ b/public/js/libs/cssrelpreload.min.js @@ -0,0 +1,2 @@ +/*! loadCSS rel=preload polyfill. [c]2017 Filament Group, Inc. MIT License */ +!function(a){if(a.loadCSS){var b=loadCSS.relpreload={};if(b.support=function(){try{return a.document.createElement("link").relList.supports("preload")}catch(b){return!1}},b.poly=function(){for(var b=a.document.getElementsByTagName("link"),c=0;c - + + {{if .RequireSimpleMDE}} @@ -53,7 +54,8 @@ {{end}} - + + {{if .PageIsUserProfile}}