Skip to content

Commit

Permalink
Partial fix of api explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Sep 16, 2019
1 parent 80556f1 commit 1acd225
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions CRM/Api4/Page/Api4Explorer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function run() {
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');

Expand Down
2 changes: 2 additions & 0 deletions Civi/Angular/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public function getModules() {
$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());
Expand Down
1 change: 1 addition & 0 deletions ang/api4.ang.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
// Autoloader data for Api4 angular module.
return [
'ext' => 'civicrm',
'js' => [
'ang/api4.js',
'ang/api4/*.js',
Expand Down
6 changes: 3 additions & 3 deletions ang/api4Explorer.ang.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
// Autoloader data for Api4 explorer.
return [
'ext' => 'civicrm',
'js' => [
'ang/api4Explorer.js',
'ang/api4Explorer/*.js',
'ang/api4Explorer/*/*.js',
'lib/*.js',
],
'css' => [
'css/explorer.css',
'css/api4Explorer.css',
],
'partials' => [
'ang/api4Explorer',
'ang/api4-explorer',
],
'basePages' => [],
'requires' => ['crmUi', 'crmUtil', 'ngRoute', 'crmRouteBinder', 'ui.sortable', 'api4', 'ngSanitize'],
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions js/crm.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -629,4 +629,4 @@
});
});

}(jQuery, CRM));
}(jQuery, CRM, _));
6 changes: 3 additions & 3 deletions js/load-bootstrap.js
Original file line number Diff line number Diff line change
@@ -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('<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" />');
}
});
});

0 comments on commit 1acd225

Please sign in to comment.