From efd95528d7a565c51d6c13048bbaf17890d098fb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 17 Dec 2014 22:54:48 -0800 Subject: [PATCH] CRM-15578 - Rename crmMailingAB2 crmMailingAB --- CRM/Core/Page/Angular.php | 3 ++- CRM/Mailing/Info.php | 24 ++++++++++++------------ js/angular-crmMailingAB.js | 18 +++++++++--------- js/angular-crmMailingAB/directives.js | 6 +++--- js/angular-crmMailingAB/services.js | 4 ++-- partials/crmMailingAB/edit.html | 2 +- partials/crmMailingAB/list.html | 6 +++--- 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/CRM/Core/Page/Angular.php b/CRM/Core/Page/Angular.php index 4626cb6073..0ab871872c 100644 --- a/CRM/Core/Page/Angular.php +++ b/CRM/Core/Page/Angular.php @@ -71,8 +71,9 @@ class CRM_Core_Page_Angular extends CRM_Core_Page { $angularModules['angularFileUpload'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-file-upload/angular-file-upload.min.js')); $angularModules['dialogService'] = array('ext' => 'civicrm' , 'js' => array('packages/bower_components/angular-jquery-dialog-service/dialog-service.js')); $angularModules['crmAttachment'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmAttachment.js'), 'css' => array('css/angular-crmAttachment.css')); - $angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-ui.js')); + $angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js')); $angularModules['crmUtil'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-util.js')); + $angularModules['ngSanitize'] = array('ext' => 'civicrm', 'js' => array('js/angular-sanitize.js')); foreach (CRM_Core_Component::getEnabledComponents() as $component) { $angularModules = array_merge($angularModules, $component->getAngularModules()); diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index 5e117c770b..d59bfc15e2 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -62,22 +62,22 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { 'js' => array('js/angular-crmMailing.js', 'js/angular-crmMailing/services.js', 'js/angular-crmMailing/directives.js'), 'css' => array('css/angular-crmMailing.css'), ); - $result['crmMailingAB2'] = array( - 'ext' => 'civicrm', - 'js' => array('js/angular-crmMailingAB2.js', 'js/angular-crmMailingAB2-services.js', 'js/angular-crmMailingAB2-directives.js'), - 'css' => array('css/angular-crmMailingAB2.css'), - ); $result['crmMailingAB'] = array( 'ext' => 'civicrm', - 'js' => array( - 'js/angular-crmMailingAB.js', - 'js/angular-crmMailingAB-ReportCtrl.js', - 'js/d3.min.js', - 'js/angular-sanitize.js', - 'packages/ckeditor/ckeditor.js', - ), + 'js' => array('js/angular-crmMailingAB.js', 'js/angular-crmMailingAB/services.js', 'js/angular-crmMailingAB/directives.js'), 'css' => array('css/angular-crmMailingAB.css'), ); +// $result['crmMailingAB'] = array( +// 'ext' => 'civicrm', +// 'js' => array( +// 'js/angular-crmMailingAB.js', +// 'js/angular-crmMailingAB-ReportCtrl.js', +// 'js/d3.min.js', +// 'js/angular-sanitize.js', +// 'packages/ckeditor/ckeditor.js', +// ), +// 'css' => array('css/angular-crmMailingAB.css'), +// ); $config = CRM_Core_Config::singleton(); $session = CRM_Core_Session::singleton(); diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index b391c222f8..d4841feae3 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -2,27 +2,27 @@ var partialUrl = function (relPath, module) { if (!module) { - module = 'crmMailingAB2'; + module = 'crmMailingAB'; } return CRM.resourceUrls['civicrm'] + '/partials/' + module + '/' + relPath; }; - angular.module('crmMailingAB2', ['ngRoute', 'ui.utils', 'ngSanitize', 'crmUi', 'crmAttachment', 'crmMailing']); - angular.module('crmMailingAB2').config([ + angular.module('crmMailingAB', ['ngRoute', 'ui.utils', 'ngSanitize', 'crmUi', 'crmAttachment', 'crmMailing']); + angular.module('crmMailingAB').config([ '$routeProvider', function ($routeProvider) { - $routeProvider.when('/abtest2', { + $routeProvider.when('/abtest', { templateUrl: partialUrl('list.html'), - controller: 'CrmMailingAB2ListCtrl', + controller: 'CrmMailingABListCtrl', resolve: { mailingABList: function ($route, crmApi) { return crmApi('MailingAB', 'get', {rowCount: 0}); } } }); - $routeProvider.when('/abtest2/:id', { + $routeProvider.when('/abtest/:id', { templateUrl: partialUrl('edit.html'), - controller: 'CrmMailingAB2EditCtrl', + controller: 'CrmMailingABEditCtrl', resolve: { abtest: function ($route, CrmMailingAB) { var abtest = new CrmMailingAB($route.current.params.id == 'new' ? null : $route.current.params.id); @@ -33,12 +33,12 @@ } ]); - angular.module('crmMailingAB2').controller('CrmMailingAB2ListCtrl', function ($scope, mailingABList, crmMailingABCriteria) { + angular.module('crmMailingAB').controller('CrmMailingABListCtrl', function ($scope, mailingABList, crmMailingABCriteria) { $scope.mailingABList = mailingABList.values; $scope.testing_criteria = crmMailingABCriteria.getAll(); }); - angular.module('crmMailingAB2').controller('CrmMailingAB2EditCtrl', function ($scope, abtest, crmMailingABCriteria, crmMailingMgr) { + angular.module('crmMailingAB').controller('CrmMailingABEditCtrl', function ($scope, abtest, crmMailingABCriteria, crmMailingMgr) { window.ab = abtest; $scope.abtest = abtest; $scope.ts = CRM.ts('CiviMail'); diff --git a/js/angular-crmMailingAB/directives.js b/js/angular-crmMailingAB/directives.js index f2a8e272d7..53c12f4d09 100644 --- a/js/angular-crmMailingAB/directives.js +++ b/js/angular-crmMailingAB/directives.js @@ -1,6 +1,6 @@ (function (angular, $, _) { var partialUrl = function (relPath) { - return CRM.resourceUrls['civicrm'] + '/partials/crmMailingAB2/' + relPath; + return CRM.resourceUrls['civicrm'] + '/partials/crmMailingAB/' + relPath; }; // example: @@ -11,7 +11,7 @@ crmMailingAbBlockSetup: partialUrl('setup.html') }; _.each(simpleDirectives, function (templateUrl, directiveName) { - angular.module('crmMailingAB2').directive(directiveName, function ($parse, crmMailingABCriteria) { + angular.module('crmMailingAB').directive(directiveName, function ($parse, crmMailingABCriteria) { var scopeDesc = {crmAbtest: '@'}; scopeDesc[directiveName] = '@'; @@ -33,7 +33,7 @@ }); // example:
- angular.module('crmMailingAB2').directive('crmMailingAbSlider', function () { + angular.module('crmMailingAB').directive('crmMailingAbSlider', function () { return { require: '?ngModel', scope: {}, diff --git a/js/angular-crmMailingAB/services.js b/js/angular-crmMailingAB/services.js index bb82e01142..7fe65355aa 100644 --- a/js/angular-crmMailingAB/services.js +++ b/js/angular-crmMailingAB/services.js @@ -1,6 +1,6 @@ (function (angular, $, _) { - angular.module('crmMailingAB2').factory('crmMailingABCriteria', function () { + angular.module('crmMailingAB').factory('crmMailingABCriteria', function () { // TODO Get data from server var values = { '1': {value: '1', name: 'Subject lines', label: ts('Test different "Subject" lines')}, @@ -26,7 +26,7 @@ // abtest.load().then(function(){ // alert("Mailing A is named "+abtest.mailings.a.name); // }); - angular.module('crmMailingAB2').factory('CrmMailingAB', function (crmApi, crmMailingMgr, $q, CrmAttachments) { + angular.module('crmMailingAB').factory('CrmMailingAB', function (crmApi, crmMailingMgr, $q, CrmAttachments) { function CrmMailingAB(id) { this.id = id; this.mailings = {}; diff --git a/partials/crmMailingAB/edit.html b/partials/crmMailingAB/edit.html index 560a4c9565..a0fff6206e 100644 --- a/partials/crmMailingAB/edit.html +++ b/partials/crmMailingAB/edit.html @@ -10,7 +10,7 @@ merge shared settings from "A" into "B". --> -
+
diff --git a/partials/crmMailingAB/list.html b/partials/crmMailingAB/list.html index 6556c52440..780a3454c4 100644 --- a/partials/crmMailingAB/list.html +++ b/partials/crmMailingAB/list.html @@ -23,8 +23,8 @@ Required vars: mailingABList {{mailingAB.id}} {{testing_criteria[mailingAB.testing_criteria_id].label}} - Edit  - Results + Edit  + Results @@ -39,5 +39,5 @@ Required vars: mailingABList -- 2.25.1