X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fangular-crmMailingAB%2Fdirectives.js;h=d5f170c58f7ee0100ca54d95d16f02fd2add047e;hb=65742a3ed0f9444378e73bdab10469176f07ce49;hp=fb6ea8822193fc6d92d2c6b308d9cfd85c3c4cbb;hpb=29d98e1314e345f1b9044f5359c2d0a67f380d21;p=civicrm-core.git diff --git a/js/angular-crmMailingAB/directives.js b/js/angular-crmMailingAB/directives.js index fb6ea88221..d5f170c58f 100644 --- a/js/angular-crmMailingAB/directives.js +++ b/js/angular-crmMailingAB/directives.js @@ -1,14 +1,11 @@ (function (angular, $, _) { - var partialUrl = function (relPath) { - return CRM.resourceUrls.civicrm + '/partials/crmMailingAB/' + relPath; - }; // example: // scope.myAbtest = new CrmMailingAB(); // var simpleDirectives = { - crmMailingAbBlockMailing: partialUrl('joint-mailing.html'), - crmMailingAbBlockSetup: partialUrl('setup.html') + crmMailingAbBlockMailing: '~/crmMailingAB/joint-mailing.html', + crmMailingAbBlockSetup: '~/crmMailingAB/setup.html' }; _.each(simpleDirectives, function (templateUrl, directiveName) { angular.module('crmMailingAB').directive(directiveName, function ($parse, crmMailingABCriteria) { @@ -23,7 +20,7 @@ scope.abtest = model(scope.$parent); scope.crmMailingConst = CRM.crmMailing; scope.crmMailingABCriteria = crmMailingABCriteria; - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); var fieldsModel = $parse(attr[directiveName]); scope.fields = fieldsModel(scope.$parent); @@ -37,14 +34,14 @@ return { require: '?ngModel', scope: {}, - templateUrl: partialUrl('slider.html'), + templateUrl: '~/crmMailingAB/slider.html', link: function (scope, element, attrs, ngModel) { var TEST_MIN = 1, TEST_MAX = 50; var sliders = $('.slider-test,.slider-win', element); var sliderTests = $('.slider-test', element); var sliderWin = $('.slider-win', element); - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); scope.testValue = 0; scope.winValue = 100; @@ -140,6 +137,7 @@ split_count: options.split_count, split_count_select: i }); + /*jshint -W083 */ result.then(function (data) { var temp = 0; keep_cnt++; @@ -151,7 +149,7 @@ var year = t[2]; var day = t[1].substr(0, t[1].length - 3); var t1, hur, hour, min; - if (t[3] == "") { + if (_.isEmpty(t[3])) { t1 = t[4].split(":"); hur = t1[0]; if (t[5] == "AM") {