Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial fix of api explorer #1

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 3 additions & 4 deletions ang/api4Explorer.ang.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?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/explorer.css',
'css/api4-explorer.css',
],
'partials' => [
'ang/api4Explorer',
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" />');
}
});
});