From 1a4a051404d908590ddd097a66d62429d5b58d10 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Tue, 30 Sep 2014 01:20:03 +0300 Subject: [PATCH] Fix stylesheets loading in pipeline mode. Ref #348 --- index.php | 3 ++- js/documents.js | 14 ++++++++++++++ public.php | 1 + templates/documents.php | 1 + templates/public.php | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index c4aa2c0a..437c21e6 100755 --- a/index.php +++ b/index.php @@ -39,13 +39,14 @@ namespace OCA\Documents; \OCP\Util::addScript('files', 'jquery.fileupload'); + $tmpl = new \OCP\Template('documents', 'documents', 'user'); $unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false'); $maxUploadFilesize = \OCP\Util::maxUploadFilesize("/"); $savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/'); - +$tmpl->assign('isPipelined', \OCP\Config::getSystemValue('asset-pipeline.enabled')); $tmpl->assign('useUnstable', $unstable); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize)); diff --git a/js/documents.js b/js/documents.js index dc8036a3..c6ecf2ce 100644 --- a/js/documents.js +++ b/js/documents.js @@ -775,6 +775,20 @@ FileList.getCurrentDirectory = function(){ $(document).ready(function() { "use strict"; + + /* Hotfix. Pipeline mode doesn't support @import */ + if ($('#isPipelined').val()>0){ + var required = [ + '../js/3rdparty/resources/dijit/themes/claro/claro.css', + '../js/3rdparty/resources/dojox/layout/resources/ExpandoPane.css', + '../js/3rdparty/resources/dojox/widget/ColorPicker/ColorPicker.css', + 'style.css' + ]; + for (var i=0;i'); + } + } documentsMain.docs = $('.documentslist').documentGrid(); documentsMain.overlay = $('
').documentOverlay(); diff --git a/public.php b/public.php index 91ea50f7..1415126a 100644 --- a/public.php +++ b/public.php @@ -52,6 +52,7 @@ if (isset($_GET['t'])) { } else { $tmpl->assign('total', 1); } + $tmpl->assign('isPipelined', \OCP\Config::getSystemValue('asset-pipeline.enabled')); $tmpl->assign('document', $token); } } catch (\Exception $e){ diff --git a/templates/documents.php b/templates/documents.php index 11bca4ce..92a567b2 100755 --- a/templates/documents.php +++ b/templates/documents.php @@ -36,3 +36,4 @@ + diff --git a/templates/public.php b/templates/public.php index 6f018e88..e30e750c 100644 --- a/templates/public.php +++ b/templates/public.php @@ -21,3 +21,4 @@
t('This link has been expired or is never existed. Please contact the person who shared it with you for details.')) ?>
+ \ No newline at end of file