From: Tim Düsterhus Date: Wed, 15 Jul 2020 09:29:44 +0000 (+0200) Subject: Serve Google Fonts locally X-Git-Tag: 5.3.0_Alpha_1~120^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d987fe378b074f04c2429db73507eac53bc9e8a6;p=GitHub%2FWoltLab%2FWCF.git Serve Google Fonts locally see #3394 --- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index c149ef0066..dec2c8c9bd 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -52,6 +52,7 @@ + diff --git a/com.woltlab.wcf/templates/headInclude.tpl b/com.woltlab.wcf/templates/headInclude.tpl index 51a29c2ebc..f54caa9768 100644 --- a/com.woltlab.wcf/templates/headInclude.tpl +++ b/com.woltlab.wcf/templates/headInclude.tpl @@ -6,9 +6,6 @@ {event name='metaTags'} -{if $__wcf->getStyleHandler()->getStyle()->getVariable('useGoogleFont')} - -{/if} {@$__wcf->getStyleHandler()->getStylesheet()} {event name='stylesheets'} diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index a4778a18c7..fc5cea273a 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -21,10 +21,6 @@ new AcpUiStyleImageUpload({if $action == 'add'}0{else}{@$style->styleID}{/if}, '{$tmpHash}', false); new AcpUiStyleImageUpload({if $action == 'add'}0{else}{@$style->styleID}{/if}, '{$tmpHash}', true); - new UiToggleInput('input[name="useGoogleFont"]', { - show: ['#wcfFontFamilyGoogleContainer'] - }); - {if $action === 'edit'} new AcpUiStyleFaviconUpload({@$style->styleID}); @@ -532,13 +528,6 @@ -
-
-
-
diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index de23403372..96488ae62d 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -275,7 +275,6 @@ class StyleAddForm extends AbstractForm { } } $this->variables['useFluidLayout'] = isset($_POST['useFluidLayout']) ? 1 : 0; - $this->variables['useGoogleFont'] = isset($_POST['useGoogleFont']) ? 1 : 0; // style data if (isset($_POST['authorName'])) $this->authorName = StringUtil::trim($_POST['authorName']); @@ -574,7 +573,6 @@ class StyleAddForm extends AbstractForm { 'pageLogoHeight', 'pageLogoMobile', 'useFluidLayout', - 'useGoogleFont', 'wcfFontFamilyGoogle', 'wcfFontFamilyFallback' ]; diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 48f1961337..534d696a9b 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -274,6 +274,14 @@ class StyleCompiler extends SingletonFactory { $content .= $this->prepareFile($mixin); } + // add google fonts + if (!empty($variables['wcfFontFamilyGoogle'])) { + $cssFile = FontManager::getInstance()->getCssFilename(substr($variables['wcfFontFamilyGoogle'], 1, -1)); + if (is_readable($cssFile)) { + $content .= file_get_contents($cssFile); + } + } + return $content; } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 7f735aabc8..09cf35b7fc 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2947,7 +2947,6 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen - diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 00edddeb3b..f87eec7a04 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2875,7 +2875,6 @@ If you have already bought the licenses for the listed apps, th - diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 77d05ecdc7..56a4a06e11 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -2263,7 +2263,6 @@ INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('pageLogoWi INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('pageLogoHeight', '40'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('pageLogoMobile', ''); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('useFluidLayout', '1'); -INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('useGoogleFont', '1'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfButtonBackground', 'rgba(207, 216, 220, 1)'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfButtonBackgroundActive', 'rgba(120, 144, 156, 1)'); INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfButtonDisabledBackground', 'rgba(223, 223, 223, 1)');