From: Coleman Watts Date: Mon, 16 Sep 2019 20:31:24 +0000 (-0400) Subject: Fix api explorer module loading X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0b873c9ab9967fbd35aa4a7aae5271c527186599;p=civicrm-core.git Fix api explorer module loading --- diff --git a/CRM/Api4/Page/Api4Explorer.php b/CRM/Api4/Page/Api4Explorer.php index 5566acde9f..83b88c633c 100644 --- a/CRM/Api4/Page/Api4Explorer.php +++ b/CRM/Api4/Page/Api4Explorer.php @@ -12,6 +12,7 @@ class CRM_Api4_Page_Api4Explorer extends CRM_Core_Page { Civi::resources() ->addVars('api4', $vars) ->addScriptFile('civicrm', 'js/load-bootstrap.js') + ->addScriptFile('civicrm', 'bower_components/js-yaml/dist/js-yaml.min.js') ->addScriptFile('civicrm', 'bower_components/google-code-prettify/bin/prettify.min.js') ->addStyleFile('civicrm', 'bower_components/google-code-prettify/bin/prettify.min.css'); diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index c44b854aa6..cb4c4c86d2 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -98,6 +98,8 @@ class Manager { $angularModules['ui.sortable'] = include "$civicrm_root/ang/ui.sortable.ang.php"; $angularModules['unsavedChanges'] = include "$civicrm_root/ang/unsavedChanges.ang.php"; $angularModules['statuspage'] = include "$civicrm_root/ang/crmStatusPage.ang.php"; + $angularModules['api4Explorer'] = include "$civicrm_root/ang/api4Explorer.ang.php"; + $angularModules['api4'] = include "$civicrm_root/ang/api4.ang.php"; foreach (\CRM_Core_Component::getEnabledComponents() as $component) { $angularModules = array_merge($angularModules, $component->getAngularModules()); diff --git a/ang/api4.ang.php b/ang/api4.ang.php index f7d69b39a3..2c8a85b753 100644 --- a/ang/api4.ang.php +++ b/ang/api4.ang.php @@ -1,6 +1,7 @@ 'civicrm', 'js' => [ 'ang/api4.js', 'ang/api4/*.js', diff --git a/ang/api4Explorer.ang.php b/ang/api4Explorer.ang.php index 176d740d89..9b974d53bf 100644 --- a/ang/api4Explorer.ang.php +++ b/ang/api4Explorer.ang.php @@ -1,11 +1,10 @@ 'civicrm', 'js' => [ 'ang/api4Explorer.js', - 'ang/api4Explorer/*.js', - 'ang/api4Explorer/*/*.js', - 'lib/*.js', + 'ang/api4Explorer/Explorer.js', ], 'css' => [ 'css/api4-explorer.css', diff --git a/composer.json b/composer.json index b298a5c9ba..ddbebd438c 100644 --- a/composer.json +++ b/composer.json @@ -199,6 +199,9 @@ "select2": { "url": "https://github.com/colemanw/select2/archive/v3.5-civicrm-1.0.zip" }, + "js-yaml": { + "url": "https://github.com/nodeca/js-yaml/archive/3.13.1.zip" + }, "smartmenus": { "url": "https://github.com/vadikom/smartmenus/archive/1.1.0.zip", "ignore": [".gitignore", "Gruntfile.js"] diff --git a/js/crm.ajax.js b/js/crm.ajax.js index e3ff56d1a6..bfff407843 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -3,7 +3,7 @@ * @see https://wiki.civicrm.org/confluence/display/CRMDOC/AJAX+Interface * @see https://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms */ -(function($, CRM, undefined) { +(function($, CRM, _, undefined) { /** * @param string path * @param string|object query @@ -629,4 +629,4 @@ }); }); -}(jQuery, CRM)); +}(jQuery, CRM, _)); diff --git a/js/load-bootstrap.js b/js/load-bootstrap.js index aff280a07b..e528805a18 100644 --- a/js/load-bootstrap.js +++ b/js/load-bootstrap.js @@ -1,7 +1,7 @@ // Loads a copy of shoreditch's bootstrap if bootstrap is missing CRM.$(function($) { if (!$.isFunction($.fn.dropdown)) { - CRM.loadScript(CRM.vars.api4.basePath + 'lib/shoreditch/dropdown.js'); - $('head').append(''); + //CRM.loadScript(CRM.vars.api4.basePath + 'lib/shoreditch/dropdown.js'); + //$('head').append(''); } -}); \ No newline at end of file +});