Skip to content
Snippets Groups Projects
Commit 0b873c9a authored by colemanw's avatar colemanw
Browse files

Fix api explorer module loading

parent cddf293f
Branches
Tags
No related merge requests found
......@@ -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');
......
......@@ -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());
......
<?php
// Autoloader data for Api4 angular module.
return [
'ext' => 'civicrm',
'js' => [
'ang/api4.js',
'ang/api4/*.js',
......
<?php
// Autoloader data for Api4 explorer.
return [
'ext' => 'civicrm',
'js' => [
'ang/api4Explorer.js',
'ang/api4Explorer/*.js',
'ang/api4Explorer/*/*.js',
'lib/*.js',
'ang/api4Explorer/Explorer.js',
],
'css' => [
'css/api4-explorer.css',
......
......@@ -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"]
......
......@@ -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, _));
// 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('<link type="text/css" rel="stylesheet" href="' + CRM.vars.api4.basePath + 'lib/shoreditch/bootstrap.css" />');
//CRM.loadScript(CRM.vars.api4.basePath + 'lib/shoreditch/dropdown.js');
//$('head').append('<link type="text/css" rel="stylesheet" href="' + CRM.vars.api4.basePath + 'lib/shoreditch/bootstrap.css" />');
}
});
\ No newline at end of file
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment