From e88c001ec47c62204ceec45a96abb22c1731f05c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 21 Jun 2017 23:29:53 -0700 Subject: [PATCH] CRM-20756 - Add Angular `ui.bootstrap` library This adds the library [ui.bootstrap](https://angular-ui.github.io/bootstrap/), which makes it easier to include the functional elements of Bootstrap in AngularJS pages. In the past, adding this was problematic, but now the situation has improved: 1. civicrm-core has upgraded to AngularJS 1.5. (In the past, civicrm-core used AngularJS 1.3, which was incompatible.) 2. civicrm-core allows optional AngularJS modules. (In the past, all modules were loaded unconditionally, which could result in loading new/unnecessary code for legacy users. Now, you can opt-out of this behavior with `basePages=>array()`.) --- Civi/Angular/Manager.php | 1 + ang/ui.bootstrap.ang.php | 11 +++++++++++ ang/ui.bootstrap.css | 1 + bower.json | 1 + 4 files changed, 14 insertions(+) create mode 100644 ang/ui.bootstrap.ang.php create mode 100644 ang/ui.bootstrap.css diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index 61c2c69c338f..3f4776205156 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -89,6 +89,7 @@ public function getModules() { $angularModules['ngRoute'] = include "$civicrm_root/ang/ngRoute.ang.php"; $angularModules['ngSanitize'] = include "$civicrm_root/ang/ngSanitize.ang.php"; $angularModules['ui.utils'] = include "$civicrm_root/ang/ui.utils.ang.php"; + $angularModules['ui.bootstrap'] = include "$civicrm_root/ang/ui.bootstrap.ang.php"; $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"; diff --git a/ang/ui.bootstrap.ang.php b/ang/ui.bootstrap.ang.php new file mode 100644 index 000000000000..51e727cb75f3 --- /dev/null +++ b/ang/ui.bootstrap.ang.php @@ -0,0 +1,11 @@ + 'civicrm', + 'basePages' => array(), + 'js' => array('bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js'), + 'css' => array('bower_components/angular-bootstrap/ui-bootstrap-csp.css', 'ang/ui.bootstrap.css'), +); diff --git a/ang/ui.bootstrap.css b/ang/ui.bootstrap.css new file mode 100644 index 000000000000..e8cf3de92e68 --- /dev/null +++ b/ang/ui.bootstrap.css @@ -0,0 +1 @@ +.nav, .pagination, .carousel, .panel-title a { cursor: pointer; } diff --git a/bower.json b/bower.json index 759f2f2fa9b4..343c2fb96fbf 100644 --- a/bower.json +++ b/bower.json @@ -25,6 +25,7 @@ "jstree": "~3", "ckeditor": "~4.5", "font-awesome": "~4", + "angular-bootstrap": "^2.5.0", "angular-sanitize": "~1.5.0", "phantomjs-polyfill": "^0.0.2" },