diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-06-04 17:31:36 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-06-05 12:01:49 +0300 |
commit | 3f1b6e2ce903dc53633adb09527b6977bd2e930b (patch) | |
tree | ed26b345d56c51ac1679878839111af29285ddc1 /apps/theming/lib/Controller | |
parent | 81f83d3c1f9be926bf1898212e2445aa9c292dc1 (diff) |
Move theming js to initial state
A bit more elegant. Plus it will allow us to also write a proper
@nextcloud/theming package. To make life easier down the line for all.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index b7e783b9cd5..3ef5f0de506 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -42,11 +42,9 @@ namespace OCA\Theming\Controller; use OC\Template\SCSSCacher; use OCA\Theming\ImageManager; use OCA\Theming\ThemingDefaults; -use OCA\Theming\Util; use OCP\App\IAppManager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; -use OCP\AppFramework\Http\DataDownloadResponse; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\NotFoundResponse; @@ -69,8 +67,6 @@ use OCP\IURLGenerator; class ThemingController extends Controller { /** @var ThemingDefaults */ private $themingDefaults; - /** @var Util */ - private $util; /** @var IL10N */ private $l10n; /** @var IConfig */ @@ -95,7 +91,6 @@ class ThemingController extends Controller { * @param IRequest $request * @param IConfig $config * @param ThemingDefaults $themingDefaults - * @param Util $util * @param IL10N $l * @param ITempManager $tempManager * @param IAppData $appData @@ -109,7 +104,6 @@ class ThemingController extends Controller { IRequest $request, IConfig $config, ThemingDefaults $themingDefaults, - Util $util, IL10N $l, ITempManager $tempManager, IAppData $appData, @@ -121,7 +115,6 @@ class ThemingController extends Controller { parent::__construct($appName, $request); $this->themingDefaults = $themingDefaults; - $this->util = $util; $this->l10n = $l; $this->config = $config; $this->tempManager = $tempManager; @@ -432,32 +425,6 @@ class ThemingController extends Controller { /** * @NoCSRFRequired * @PublicPage - * @NoSameSiteCookieRequired - * - * @return DataDownloadResponse - */ - public function getJavascript() { - $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); - $responseJS = '(function() { - OCA.Theming = { - name: ' . json_encode($this->themingDefaults->getName()) . ', - url: ' . json_encode($this->themingDefaults->getBaseUrl()) . ', - slogan: ' . json_encode($this->themingDefaults->getSlogan()) . ', - color: ' . json_encode($this->themingDefaults->getColorPrimary()) . ', - imprintUrl: ' . json_encode($this->themingDefaults->getImprintUrl()) . ', - privacyUrl: ' . json_encode($this->themingDefaults->getPrivacyUrl()) . ', - inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getColorPrimary())) . ', - cacheBuster: ' . json_encode($cacheBusterValue) . ' - }; -})();'; - $response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript'); - $response->cacheFor(3600); - return $response; - } - - /** - * @NoCSRFRequired - * @PublicPage * * @return Http\JSONResponse */ |