-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
We need to get the number of requests down a bit as discussed in #2272. Therefore, I've started a PR to create an image sprite for the icons (#3385). Furthermore, I plan to combine the vendor scripts we load on all pages, like jQuery, it's plugins, Backbone and the like.
We do also load a bunch of style sheets, of which some are included on all pages as well. Therefore, I've been thinking about saving some requests there too. As discussed with @skjnldsv on IRC, the simplest solution from my point of view, would be to create some kind of meta files, where we import all the source files that we load individually now.
This would looks like this:
core/css/server.scss | 31 +++++++++++++++++++++++++++++++
lib/private/legacy/template.php | 18 ++++++------------
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/core/css/server.scss b/core/css/server.scss
new file mode 100644
index 0000000000..2048a881dd
--- /dev/null
+++ b/core/css/server.scss
@@ -0,0 +1,31 @@
+/**
+ * @author Christoph Wurst <christoph@winzerhof-wurst.at>
+ * @copyright Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+@import 'styles.scss';
+@import 'inputs.scss';
+@import 'header.scss';
+@import 'icons.scss';
+@import 'fonts.css';
+@import 'apps.scss';
+@import 'apps.scss';
+@import 'global.css';
+@import 'multiselect.scss';
+@import 'tooltip.scss';
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index a07bf214f3..07dbe7d6a6 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -106,19 +106,13 @@ class OC_Template extends \OC\Template\Base {
}
}
- OC_Util::addStyle("tooltip",null,true);
- OC_Util::addStyle('jquery-ui-fixes',null,true);
+ OC_Util::addStyle('jquery-ui-fixes', null, true);
+ OC_Util::addStyle('mobile', null, true);
+ OC_Util::addStyle('fixes', null, true);
+ OC_Util::addStyle('global', null, true);
+ OC_Util::addStyle('server', null, true);
+
OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui',null,true);
- OC_Util::addStyle("mobile",null,true);
- OC_Util::addStyle("multiselect",null,true);
- OC_Util::addStyle("fixes",null,true);
- OC_Util::addStyle("global",null,true);
- OC_Util::addStyle("apps",null,true);
- OC_Util::addStyle("fonts",null,true);
- OC_Util::addStyle("icons",null,true);
- OC_Util::addStyle("header",null,true);
- OC_Util::addStyle("inputs");
- OC_Util::addStyle("styles",null,true);
// avatars
if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {The result: on my dev instance 173 instead of 185 were necessary to load the files app with cleared cache (ctrl+f5). Note that this does only affect the server files. We could do the same with files, sharing, settings and so on and save even more requests.
@nextcloud/designers would do you think? Any objections? I know @skjnldsv doesn't like the approach 😀