js/*.js - Fix loading with alternate packages path
authorTim Otten <totten@civicrm.org>
Thu, 16 Jan 2020 09:24:35 +0000 (01:24 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 28 Jan 2020 23:14:28 +0000 (15:14 -0800)
js/jquery/jquery.crmEditable.js
js/view/crm.designer.js
js/wysiwyg/crm.ckeditor.js
templates/CRM/common/l10n.js.tpl

index ca1a08e24845a26c1ec129c0175bba0aed50d7ce..b68b27f0a24012a04ecf7d34a41526bfe4b31902 100644 (file)
           });
       }
 
-      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);
       });
 
index 3db0eb0ca1fd8bd0224cc7ef2ed5116d18ee9535..9d43b92bf06322c2066a6626cd5a454842d8779a 100644 (file)
           "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 () {
index 64d4a116f35437fdf83e3eed5484e590392f0e61..59bf880df9f63f7eca131e784606be8592be83bb 100644 (file)
@@ -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 :
index 38001a762f99f6b84e071790b06a555f5139d930..74777751aec8fca0578b7af6568e1fe2926f22af 100644 (file)
@@ -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};