diff options
author | libasys <sebastian.doell@libasys.de> | 2015-05-19 09:59:53 +0300 |
---|---|---|
committer | libasys <sebastian.doell@libasys.de> | 2015-05-19 09:59:53 +0300 |
commit | 6de054ca7cf8c4173f6d8e957e0dd165af6d2d7d (patch) | |
tree | 273d456ee22edccc4bf09e12e53a36c4d5d47565 /appinfo/app.php | |
parent | 120d336ab9c40612c70e0a7b9bc892275cc39882 (diff) |
Saving loading time ...
... called only if files app is loaded!
Diffstat (limited to 'appinfo/app.php')
-rw-r--r-- | appinfo/app.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index e778182..0d430a5 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -2,9 +2,18 @@ // only load text editor if the user is logged in if (\OCP\User::isLoggedIn()) { - OCP\Util::addStyle('files_texteditor', 'DroidSansMono/stylesheet'); - OCP\Util::addStyle('files_texteditor', 'style'); - OCP\Util::addStyle('files_texteditor', 'mobile'); - OCP\Util::addscript('files_texteditor', 'editor'); - OCP\Util::addscript('files_texteditor', 'vendor/ace/src-noconflict/ace'); + $app = new \OCP\AppFramework\App('files_texteditor'); + $c = $app->getContainer(); + $request = $c->query('Request'); + + if (isset($request->server['REQUEST_URI'])) { + $url = $request->server['REQUEST_URI']; + if (preg_match('%index.php/apps/files(/.*)?%', $url) || preg_match('%index.php/s/(/.*)?%', $url)) { + OCP\Util::addStyle('files_texteditor', 'DroidSansMono/stylesheet'); + OCP\Util::addStyle('files_texteditor', 'style'); + OCP\Util::addStyle('files_texteditor', 'mobile'); + OCP\Util::addscript('files_texteditor', 'editor'); + OCP\Util::addscript('files_texteditor', 'vendor/ace/src-noconflict/ace'); + } + } } |