From 7195a9323d37111f74d848caafd84058c9865aa6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 10 Mar 2017 09:34:29 +0100 Subject: Merge vendor js There is a bunch of javascript we always load from vendors. This combines this into 1 javascript file. Which reduces the number of request by ~10. Signed-off-by: Roeland Jago Douma --- lib/private/legacy/template.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php index 8535e018879..aff42808621 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -140,20 +140,8 @@ class OC_Template extends \OC\Template\Base { OC_Util::addScript('files/fileinfo'); OC_Util::addScript('files/client'); - // Add the stuff we need always - // following logic will import all vendor libraries that are - // specified in core/js/core.json - $fileContent = file_get_contents(OC::$SERVERROOT . '/core/js/core.json'); - if($fileContent !== false) { - $coreDependencies = json_decode($fileContent, true); - foreach(array_reverse($coreDependencies['vendor']) as $vendorLibrary) { - // remove trailing ".js" as addVendorScript will append it - OC_Util::addVendorScript( - substr($vendorLibrary, 0, strlen($vendorLibrary) - 3),null,true); - } - } else { - throw new \Exception('Cannot read core/js/core.json'); - } + // Import all (combined) default vendor libraries + OC_Util::addVendorScript('core', null, true); if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) { // polyfill for btoa/atob for IE friends -- cgit v1.2.3