From 3130950c51d3ceadc913495e8dc52125bb22503e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 16 Jan 2020 01:24:35 -0800 Subject: [PATCH] js/*.js - Fix loading with alternate packages path --- js/jquery/jquery.crmEditable.js | 2 +- js/view/crm.designer.js | 2 +- js/wysiwyg/crm.ckeditor.js | 4 ++-- templates/CRM/common/l10n.js.tpl | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/jquery/jquery.crmEditable.js b/js/jquery/jquery.crmEditable.js index ca1a08e248..b68b27f0a2 100644 --- a/js/jquery/jquery.crmEditable.js +++ b/js/jquery/jquery.crmEditable.js @@ -168,7 +168,7 @@ }); } - CRM.loadScript(CRM.config.resourceBase + 'packages/jquery/plugins/jquery.jeditable.min.js').done(function() { + CRM.loadScript(CRM.config.packagesBase + 'jquery/plugins/jquery.jeditable.min.js').done(function() { $i.editable(callback, settings); }); diff --git a/js/view/crm.designer.js b/js/view/crm.designer.js index 3db0eb0ca1..9d43b92bf0 100644 --- a/js/view/crm.designer.js +++ b/js/view/crm.designer.js @@ -370,7 +370,7 @@ "theme": 'classic', "dots": false, "icons": false, - "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css' + "url": CRM.config.packagesBase + 'jquery/plugins/jstree/themes/classic/style.css' }, 'plugins': ['themes', 'json_data', 'ui', 'search'] }).bind('loaded.jstree', function () { diff --git a/js/wysiwyg/crm.ckeditor.js b/js/wysiwyg/crm.ckeditor.js index 64d4a116f3..59bf880df9 100644 --- a/js/wysiwyg/crm.ckeditor.js +++ b/js/wysiwyg/crm.ckeditor.js @@ -54,8 +54,8 @@ function initialize() { var - browseUrl = CRM.config.resourceBase + "packages/kcfinder/browse.php?cms=civicrm", - uploadUrl = CRM.config.resourceBase + "packages/kcfinder/upload.php?cms=civicrm&format=json", + browseUrl = CRM.config.packagesBase + "kcfinder/browse.php?cms=civicrm", + uploadUrl = CRM.config.packagesBase + "kcfinder/upload.php?cms=civicrm&format=json", preset = $(item).data('preset') || 'default', // This variable is always an array but a legacy extension could be setting it as a string. customConfig = (typeof CRM.config.CKEditorCustomConfig === 'string') ? CRM.config.CKEditorCustomConfig : diff --git a/templates/CRM/common/l10n.js.tpl b/templates/CRM/common/l10n.js.tpl index 38001a762f..74777751ae 100644 --- a/templates/CRM/common/l10n.js.tpl +++ b/templates/CRM/common/l10n.js.tpl @@ -13,6 +13,7 @@ // Config settings CRM.config.userFramework = {$config->userFramework|@json_encode}; CRM.config.resourceBase = {$config->userFrameworkResourceURL|@json_encode}; + CRM.config.packagesBase = {capture assign=packagesBase}{crmResURL expr='[civicrm.packages]/.'}{/capture}{$packagesBase|@json_encode}; CRM.config.lcMessages = {$config->lcMessages|@json_encode}; CRM.config.locale = {$locale|@json_encode}; CRM.config.cid = {$cid|@json_encode}; -- 2.25.1