CRM-15578 - Remove uunused JS/CSS/html
authorTim Otten <totten@civicrm.org>
Sat, 20 Dec 2014 14:22:17 +0000 (06:22 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 20 Dec 2014 14:22:17 +0000 (06:22 -0800)
The content has been integrated into the main crmMailingAB module.

20 files changed:
css/angular-crmMailingAB.css.orig [deleted file]
js/angular-crmMailingAB-ReportCtrl.js.orig [deleted file]
js/angular-crmMailingAB.js.orig [deleted file]
partials/crmMailingAB.orig/attachments.html [deleted file]
partials/crmMailingAB.orig/compose.html [deleted file]
partials/crmMailingAB.orig/from_name.html [deleted file]
partials/crmMailingAB.orig/headerfooter.html [deleted file]
partials/crmMailingAB.orig/list.html [deleted file]
partials/crmMailingAB.orig/main.html [deleted file]
partials/crmMailingAB.orig/modal.html [deleted file]
partials/crmMailingAB.orig/next.html [deleted file]
partials/crmMailingAB.orig/report.html [deleted file]
partials/crmMailingAB.orig/subject_lines.html [deleted file]
partials/crmMailingAB.orig/tab1.html [deleted file]
partials/crmMailingAB.orig/tab2.html [deleted file]
partials/crmMailingAB.orig/tab3.html [deleted file]
partials/crmMailingAB.orig/tab4.html [deleted file]
partials/crmMailingAB.orig/trackandRespond.html [deleted file]
partials/crmMailingAB.orig/two_emails.html [deleted file]
partials/crmMailingAB.orig/uploadContent.html [deleted file]

diff --git a/css/angular-crmMailingAB.css.orig b/css/angular-crmMailingAB.css.orig
deleted file mode 100644 (file)
index f39411d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-div#settings {
-  position: relative;
-  padding-left: 200px;
-}
-
-div#settings > div {
-  min-height: 300px;
-}
-
-div#settings .ui-tabs-nav {
-  position: absolute;
-  left: 0px;
-  top: 0px;
-  bottom: 0px;
-  width: 120px;
-  padding: 5px 0px 5px 5px;
-}
-
-div#settings .ui-tabs-nav li {
-  left: 0px;
-  width: 115px;
-  border-right: none;
-  overflow: hidden;
-  margin-bottom: 2px;
-}
-
-div#settings .ui-tabs-nav li a {
-  float: right;
-  width: 100%;
-  text-align: right;
-}
-
-div#settings .ui-tabs-nav li.ui-tabs-selected {
-  border: none;
-  border-right: solid 1px #fff;
-  background: none;
-  background-color: #fff;
-  width: 120px;
-}
-
-div#frag1 {
-  height:600px;
-  width:800px;
-  overflow: auto;
-  position: relative;
-
-}
-
-div#frag2 {
-  height:600px;
-  width:800px;
-  overflow: auto;
-}
-
-.abtesting-form-label {
-  width: 30%;
-}
-.abtesting-form-element *{
-  width: 100%;
-}
\ No newline at end of file
diff --git a/js/angular-crmMailingAB-ReportCtrl.js.orig b/js/angular-crmMailingAB-ReportCtrl.js.orig
deleted file mode 100644 (file)
index 45ee3bb..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-(function (angular, $, _) {
-
-  var partialUrl = function (relPath) {
-    return CRM.resourceUrls['civicrm'] + '/partials/crmMailingAB/' + relPath;
-  };
-  var crmMailingAB = angular.module('crmMailingAB');
-
-  crmMailingAB.controller('ReportCtrl', function ($scope, crmApi, selectedABTest, $location) {
-    $scope.graph_data = [
-      {},
-      {},
-      {},
-      {},
-      {}
-    ];
-
-    $scope.graphload = false;
-    if (selectedABTest.winner_criteria_id == 1) {
-      $scope.winnercriteria = "Open";
-    }
-    else {
-      if (selectedABTest.winner_criteria_id == 2) {
-        $scope.winnercriteria = "Total Unique Clicks";
-      }
-      else {
-        if (selectedABTest.winner_criteria_id == 3) {
-          $scope.winnercriteria = "Total Clicks on a particular link";
-        }
-      }
-    }
-
-    $scope.copyatoc = function () {
-      var res = crmApi('Mailing', 'get', {id: selectedABTest.mailing_id_a});
-      res.success(function (data) {
-        for (var key in data.values) {
-          var mail = data.values[key];
-        }
-        mail.id = selectedABTest.mailing_id_c;
-        crmApi('Mailing', 'create', mail);
-      });
-      $location.path('abtest');
-    };
-
-    $scope.sendc = function () {
-      var res = crmApi('Mailing', 'get', {id: selectedABTest.mailing_id_b});
-      res.success(function (data) {
-        for (var key in data.values) {
-          var mail = data.values[key];
-        }
-        mail.id = selectedABTest.mailing_id_c;
-        crmApi('Mailing', 'create', mail);
-      });
-      $location.path('abtest');
-    };
-    var result = crmApi('Mailing', 'stats', {mailing_id: selectedABTest.mailing_id_a});
-    $scope.r = [];
-    result.success(function (data) {
-      $scope.rtt = data;
-      $scope.r.push(data.values[selectedABTest.mailing_id_a]["Delivered"].toString());
-      $scope.r.push(data.values[selectedABTest.mailing_id_a]["Bounces"].toString());
-      $scope.r.push(data.values[selectedABTest.mailing_id_a]["Unsubscribers"].toString());
-      $scope.r.push(data.values[selectedABTest.mailing_id_a]["Opened"].toString());
-      $scope.r.push(data.values[selectedABTest.mailing_id_a]["Unique Clicks"].toString());
-      $scope.$apply();
-    });
-
-    $scope.d = [];
-    result = crmApi('Mailing', 'stats', {mailing_id: selectedABTest.mailing_id_b});
-    result.success(function (data) {
-      $scope.d.push(data.values[selectedABTest.mailing_id_b]["Delivered"].toString());
-      $scope.d.push(data.values[selectedABTest.mailing_id_b]["Bounces"].toString());
-      $scope.d.push(data.values[selectedABTest.mailing_id_b]["Unsubscribers"].toString());
-      $scope.d.push(data.values[selectedABTest.mailing_id_b]["Opened"].toString());
-      $scope.d.push(data.values[selectedABTest.mailing_id_b]["Unique Clicks"].toString());
-      $scope.$apply();
-    });
-    $scope.aastop = false;
-    $scope.asure = function () {
-      $scope.aastop = true;
-    };
-    $scope.bbstop = false;
-    $scope.bsure = function () {
-      $scope.bbstop = true;
-    };
-
-    var numdiv = 5;
-    var keep_cnt = 0;
-    for (i = 1; i <= numdiv; i++) {
-      var result = crmApi('MailingAB', 'graph_stats', {id: selectedABTest.id, split_count: numdiv, split_count_select: i});
-      result.success(function (data) {
-        var temp = 0;
-        keep_cnt++;
-        for (var key in data.values.A) {
-          temp = key;
-        }
-        var t = data.values.A[temp].time.split(" ");
-        var m = t[0];
-        var year = t[2];
-        var day = t[1].substr(0, t[1].length - 3);
-        if (t[3] == "") {
-          var t1 = t[4].split(":");
-          var hur = t1[0];
-          if (t[5] == "AM") {
-            hour = hur;
-            if (hour == 12) {
-              hour = 0;
-            }
-          }
-          if (t[5] == "PM") {
-            hour = parseInt(hur) + 12;
-          }
-          var min = t1[1];
-        }
-        else {
-          var t1 = t[3].split(":");
-          var hur = t1[0];
-          if (t[4] == "AM") {
-            hour = hur;
-            if (hour == 12) {
-              hour = 0;
-            }
-          }
-          if (t[4] == "PM") {
-            hour = parseInt(hur) + 12;
-          }
-          var min = t1[1];
-        }
-        var month = 0;
-        switch (m) {
-          case "January":
-            month = 0;
-            break;
-          case "February":
-            month = 1;
-            break;
-          case "March":
-            month = 2;
-            break;
-          case "April":
-            month = 3;
-            break;
-          case "May":
-            month = 4;
-            break;
-          case "June":
-            month = 5;
-            break;
-          case "July":
-            month = 6;
-            break;
-          case "August":
-            month = 7;
-            break;
-          case "September":
-            month = 8;
-            break;
-          case "October":
-            month = 9;
-            break;
-          case "November":
-            month = 10;
-            break;
-          case "December":
-            month = 11;
-            break;
-
-        }
-        var tp = new Date(year, month, day, hour, min, 0, 0);
-        $scope.graph_data[temp - 1] = {
-          time: tp,
-          x: data.values.A[temp].count,
-          y: data.values.B[temp].count
-        };
-
-        if (keep_cnt == numdiv) {
-          $scope.graphload = true;
-          $scope.$apply();
-          var data = $scope.graph_data;
-
-          // set up a colour variable
-          var color = d3.scale.category10();
-
-          // map one colour each to x, y and z
-          // keys grabs the key value or heading of each key value pair in the json
-          // but not time
-          color.domain(d3.keys(data[0]).filter(function (key) {
-            return key !== "time";
-          }));
-
-          // create a nested series for passing to the line generator
-          // it's best understood by console logging the data
-          var series = color.domain().map(function (name) {
-            return {
-              name: name,
-              values: data.map(function (d) {
-                return {
-                  time: d.time,
-                  score: +d[name]
-                };
-              })
-            };
-          });
-
-          // Set the dimensions of the canvas / graph
-          var margin = {
-              top: 30,
-              right: 20,
-              bottom: 40,
-              left: 75
-            },
-            width = 550 - margin.left - margin.right,
-            height = 350 - margin.top - margin.bottom;
-
-          // Set the ranges
-          //var x = d3.time.scale().range([0, width]).domain([0,10]);
-          var x = d3.time.scale().range([0, width]);
-          var y = d3.scale.linear().range([height, 0]);
-
-          // Define the axes
-          var xAxis = d3.svg.axis().scale(x)
-            .orient("bottom").ticks(10);
-
-          var yAxis = d3.svg.axis().scale(y)
-            .orient("left").ticks(5);
-
-          // Define the line
-          // Note you plot the time / score pair from each key you created ealier
-          var valueline = d3.svg.line()
-            .x(function (d) {
-              return x(d.time);
-            })
-            .y(function (d) {
-              return y(d.score);
-            });
-
-          // Adds the svg canvas
-          var svg = d3.select("#linegraph")
-            .append("svg")
-            .attr("width", width + margin.left + margin.right)
-            .attr("height", height + margin.top + margin.bottom)
-            .append("g")
-            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
-
-          // Scale the range of the data
-          x.domain(d3.extent(data, function (d) {
-            return d.time;
-          }));
-
-          // note the nested nature of this you need to dig an additional level
-          y.domain([
-            d3.min(series, function (c) {
-              return d3.min(c.values, function (v) {
-                return v.score;
-              });
-            }),
-            d3.max(series, function (c) {
-              return d3.max(c.values, function (v) {
-                return v.score;
-              });
-            })
-          ]);
-          svg.append("text")      // text label for the x axis
-            .attr("x", width / 2)
-            .attr("y", height + margin.bottom)
-            .style("text-anchor", "middle")
-            .text("Time");
-
-          svg.append("text")      // text label for the x axis
-            .style("text-anchor", "middle")
-            .text($scope.winnercriteria).attr("transform",function (d) {
-              return "rotate(-90)"
-            }).attr("x", -height / 2)
-            .attr("y", -30);
-
-          // create a variable called series and bind the date
-          // for each series append a g element and class it as series for css styling
-          var series = svg.selectAll(".series")
-            .data(series)
-            .enter().append("g")
-            .attr("class", "series");
-
-          // create the path for each series in the variable series i.e. x, y and z
-          // pass each object called x, y nad z to the lne generator
-          series.append("path")
-            .attr("class", "line")
-            .attr("d", function (d) {
-              // console.log(d); // to see how d3 iterates through series
-              return valueline(d.values);
-            })
-            .style("stroke", function (d) {
-              return color(d.name);
-            });
-
-          // Add the X Axis
-          svg.append("g") // Add the X Axis
-            .attr("class", "x axis")
-            .attr("transform", "translate(0," + height + ")")
-            .call(xAxis)
-            .selectAll("text")
-            .attr("transform", function (d) {
-              return "rotate(-30)";
-            });
-
-          // Add the Y Axis
-          svg.append("g") // Add the Y Axis
-            .attr("class", "y axis")
-            .call(yAxis);
-        }
-      });
-    }
-    console.log($scope.graph_data);
-  });
-
-})(angular, CRM.$, CRM._);
diff --git a/js/angular-crmMailingAB.js.orig b/js/angular-crmMailingAB.js.orig
deleted file mode 100755 (executable)
index d872dbf..0000000
+++ /dev/null
@@ -1,1181 +0,0 @@
-/**
- * Created by aditya on 6/12/14.
- */
-(function (angular, $, _) {
-
-  var partialUrl = function (relPath) {
-    return CRM.resourceUrls['civicrm'] + '/partials/crmMailingAB/' + relPath;
-  };
-  var crmMailingAB = angular.module('crmMailingAB', ['ngRoute', 'ui.utils', 'ngSanitize']);
-
-  crmMailingAB.run(function ($rootScope, $templateCache) {
-    $rootScope.$on('$viewContentLoaded', function () {
-      $templateCache.removeAll();
-    });
-  });
-  crmMailingAB.config([
-    '$routeProvider',
-    function ($routeProvider) {
-      $routeProvider.when('/abtest', {
-        templateUrl: partialUrl('list.html'),
-        controller: 'ABListingCtrl',
-        resolve: {
-          mailingABList: function ($route, crmApi) {
-            return crmApi('MailingAB', 'get', {rowCount: 0});
-          }
-        }
-      });
-      $routeProvider.when('/abtest/report/:id', {
-        templateUrl: partialUrl('report.html'),
-        controller: 'ReportCtrl',
-        resolve: {
-          selectedABTest: function ($route, crmApi) {
-            return crmApi('MailingAB', 'getsingle', {id: $route.current.params.id});
-          }
-        }
-      });
-      $routeProvider.when('/abtest/:id', {
-        templateUrl: partialUrl('main.html'),
-        controller: 'crmABTestingTabsCtrl',
-        resolve: {
-          selectedABTest: function ($route, crmApi) {
-            if ($route.current.params.id !== 'new') {
-
-              return crmApi('MailingAB', 'getsingle', {id: $route.current.params.id});
-            }
-            else {
-              //created_id has been set to my id. Does not save without created_id. Needs to made generic based on the user
-              return { just_created: "1"
-              };
-            }
-          }
-        }
-      });
-    }
-  ]);
-
-  //-----------------------------------------
-  // Add a new record by name.
-  // Ex: <crmAddName crm-options="['Alpha','Beta','Gamma']" crm-var="newItem" crm-on-add="callMyCreateFunction(newItem)" />
-  /**
-   * This controler lists the existing ABtests
-   * used on /partials/abtest/list.html
-   * @returns mailingABList - object that contains the existing AB mailings
-   * @returns testing_criteria - array that has the name of the different test types
-   */
-  crmMailingAB.controller('ABListingCtrl', function ($scope, crmApi, mailingABList) {
-    $scope.mailingABList = mailingABList.values;
-    $scope.testing_criteria = {
-      '1': "Subject lines",
-      '2': "From names",
-      '3': "Two different emails"
-    };
-  });
-
-  crmMailingAB.controller('crmABTestingTabsCtrl', function ($scope, crmApi, selectedABTest, $sce) {
-    $scope.partialUrl = partialUrl;
-    $scope.abId = "";
-    $scope.whatnext = 2;
-    $scope.currentABTest = selectedABTest;
-    $scope.groups = CRM.crmMailing.groupNames;
-    $scope.mailList = CRM.crmMailing.civiMails;
-    $scope.eMailing = CRM.crmMailing.emailAdd;
-    $scope.tmpList = CRM.crmMailing.mesTemplate;
-    $scope.mailingGrp = CRM.crmMailing.mailGrp;
-    $scope.headerfooter = CRM.crmMailing.headerfooterList;
-    $scope.sparestuff = {};
-    $scope.sparestuff.emailadd = "";
-    $scope.sparestuff.winnercriteria = "";
-    $scope.sparestuff.isnew = false;
-    $scope.sparestuff.allgroups = "";
-    $scope.mailid = [];
-    $scope.preventsubmit = false;
-
-    if ($scope.currentABTest.declare_winning_time != null) {
-      $scope.ans = $scope.currentABTest.declare_winning_time.split(" ");
-      $scope.currentABTest.date = $scope.ans[0];
-      $scope.currentABTest.time = $scope.ans[1];
-    }
-    $scope.token = [];
-
-    if ($scope.currentABTest.just_created != 1) {
-      $scope.abId = $scope.currentABTest.id;
-      $scope.sparestuff.isnew = false;
-
-      var abmailA = crmApi('Mailing', 'getsingle', {id: $scope.currentABTest.mailing_id_a});
-      var abmailB = crmApi('Mailing', 'getsingle', {id: $scope.currentABTest.mailing_id_b});
-      var abmailC = crmApi('Mailing', 'getsingle', {id: $scope.currentABTest.mailing_id_c});
-      abmailA.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailA = data;
-        }
-      });
-      abmailB.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailB = data;
-        }
-      });
-      abmailC.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailC = data;
-        }
-      });
-    }
-    else {
-      $scope.sparestuff.isnew = true;
-      $scope.mailA = {};
-      $scope.mailB = {};
-      $scope.mailC = {};
-    }
-
-    $scope.sendtest = false;
-    if (typeof $scope.mailA == 'undefined') {
-      $scope.mailA = {};
-    }
-    if (typeof $scope.mailB == 'undefined') {
-      $scope.mailB = {};
-    }
-    if (typeof $scope.mailB == 'undefined') {
-      $scope.mailC = {};
-    }
-
-    $scope.templates =
-      [
-        { name: 'Subject Lines', url: partialUrl('subject_lines.html'), val: 1},
-        { name: 'From Name', url: partialUrl('from_name.html'), val: 2},
-        { name: 'Two different Emails', url: partialUrl('two_emails.html'), val: 3}
-      ];
-
-    if ($scope.currentABTest.just_created != 1) {
-      $scope.sparestuff.template = $scope.templates[$scope.currentABTest.testing_criteria_id - 1];
-    }
-    else {
-      $scope.sparestuff.template = $scope.templates[0];
-    }
-
-
-    $scope.deliberatelyTrustDangerousSnippeta = function () {
-      return $sce.trustAsHtml($scope.sparestuff.previewa);
-    };
-
-    $scope.deliberatelyTrustDangerousSnippetb = function () {
-      return $sce.trustAsHtml($scope.sparestuff.previewb);
-    };
-
-    $scope.tab_val = 0;
-    $scope.max_tab = ($scope.sparestuff.isnew == true) ? 0 : 4;
-
-    /**
-     * Example: gotoTab('campaign')
-     */
-    $scope.gotoTab = function(name) {
-      var TABS = {campaign: 0, compose: 1, rec: 2, preview: 3}; // FIXME
-      if ($scope.max_tab >= TABS[name]) {
-        $scope.tab_val = TABS[name];
-      }
-    }
-
-    $scope.preview = false;
-    $scope.slide_value = 0;
-
-    $scope.setifyes = function (val) {
-      $scope.ifyes = val == 1;
-    };
-
-    /*    $scope.reply = function () {
-     if ($scope.trackreplies == 0) {
-     $scope.trackreplies = 1;
-     }
-     else {
-     $scope.trackreplies = 0;
-     $scope.mailA.forward_replies = 0;
-     $scope.mailA.auto_responder = 0;
-     }
-     }
-     */
-    $scope.isAuto = function (au) {
-      return au.component_type == "Reply";
-    };
-
-    $scope.trackr = function (trackreplies) {
-      return trackreplies == "1";
-    };
-
-    $scope.sendTestMailing = function () {
-      $scope.sendtest = true;
-    };
-
-    $scope.isHeader = function (hf) {
-      return hf.component_type == "Header";
-    };
-    //filter so we only get footers from mailing component
-    $scope.isFooter = function (f) {
-      return f.component_type == "Footer";
-    };
-
-    $scope.send_date = "01/01/2000";
-    $scope.dt = "";
-
-    $scope.savea = function (dat) {
-
-      var result = crmApi('Mailing', 'create', dat, true);
-      result.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailA.id = data.id;
-          $scope.currentABTest.mailing_id_a = $scope.mailA.id;
-        }
-      });
-    };
-
-    $scope.append_mails = function () {
-      crmApi('MailingAB', 'create', {
-        id: $scope.abId,
-        mailing_id_a: $scope.mailA.id,
-        mailing_id_b: $scope.mailB.id,
-        mailing_id_c: $scope.mailC.id
-      });
-      $scope.currentABTest.id = $scope.abId;
-    };
-
-    $scope.saveb = function (dat) {
-      var result = crmApi('Mailing', 'create', dat, true);
-      result.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailB.id = data.id;
-          $scope.currentABTest.mailing_id_b = $scope.mailB.id;
-          //$scope.append_mails();
-        }
-      });
-    };
-
-    $scope.savec = function (dat) {
-      var result = crmApi('Mailing', 'create', dat, true);
-
-      result.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.mailC.id = data.id;
-          $scope.currentABTest.mailing_id_c = $scope.mailC.id;
-          $scope.append_mails();
-        }
-      });
-    };
-
-    $scope.sparestuff.previewa = "";
-    $scope.pre = function () {
-      $scope.preview = true;
-    };
-
-    $scope.init = function (par) {
-      if (par == "3") {
-        $scope.sparestuff.template.url = partialUrl('from_name.html');
-      }
-      else {
-        if (par == "2") {
-          $scope.sparestuff.template.url = partialUrl('subject_lines.html');
-        }
-        else {
-          $scope.sparestuff.template.url = partialUrl('two_emails.html');
-        }
-      }
-      $scope.whatnext = par.toString();
-    };
-
-    $scope.tab_upd = function () {
-      $scope.tab_val = $scope.tab_val + 1;
-      $scope.max_tab = Math.max($scope.tab_val, $scope.max_tab);
-    };
-
-    $scope.tab_upd_dec = function () {
-      $scope.tab_val = $scope.tab_val - 1;
-    };
-
-    $scope.setdate = function (par) {
-      $scope.send_date = par;
-      $scope.dt = par;
-      $scope.apply();
-    };
-
-    $scope.testmailid = "";
-    $scope.incGroup = [];
-    $scope.excGroup = [];
-    $scope.incGroupids = [];
-    $scope.excGroupids = [];
-    $scope.tp1 = {};
-    $scope.create_abtest = function () {
-      var result;
-      $scope.currentABTest.testing_criteria_id = $scope.sparestuff.template.val;
-
-      if ($scope.abId == "") {
-        result = crmApi('MailingAB', 'create', {name: $scope.currentABTest.name, testing_criteria_id: $scope.sparestuff.template.val});
-      }
-      else {
-        if (typeof $scope.currentABTest.mailing_id_a == 'undefined') {
-          result = crmApi('MailingAB', 'create', {name: $scope.currentABTest.name, id: $scope.abId, testing_criteria_id: $scope.sparestuff.template.val});
-        }
-        else {
-          result = crmApi('MailingAB', 'create', {name: $scope.currentABTest.name, id: $scope.abId, testing_criteria_id: $scope.sparestuff.template.val, mailing_id_a: $scope.currentABTest.mailing_id_a, mailing_id_b: $scope.currentABTest.mailing_id_b});
-        }
-      }
-
-      result.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.abId = data.id;
-        }
-      });
-    };
-    $scope.tokenfunc = function (elem, e, chng) {
-      var msg = document.getElementById(elem).value;
-      var cursorlen = document.getElementById(elem).selectionStart;
-      var textlen = msg.length;
-      document.getElementById(elem).value = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen);
-      chng = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen);
-      var cursorPos = (cursorlen + e.val.length);
-      document.getElementById(elem).selectionStart = cursorPos;
-      document.getElementById(elem).selectionEnd = cursorPos;
-      document.getElementById(elem).focus();
-    };
-
-    $scope.sparestuff.ingrps = "";
-    $scope.sparestuff.excgrps = "";
-    $scope.a_b_update = function () {
-      $scope.tp1.include = $scope.incGroupids;
-      $scope.tp1.exclude = $scope.excGroupids;
-      console.log($scope.tp1);
-      crmApi('MailingAB', 'recipients_update', {
-        id: $scope.currentABTest.id,
-        groups: $scope.tp1
-      });
-
-      var resulta = crmApi('Mailing', 'preview', {id: $scope.currentABTest.mailing_id_a});
-
-      resulta.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.sparestuff.previewa = data.values.html;
-        }
-      });
-
-      resulta = crmApi('Mailing', 'preview', {id: $scope.currentABTest.mailing_id_b});
-
-      resulta.success(function (data) {
-        if (data.is_error == 0) {
-          $scope.sparestuff.previewb = data.values.html;
-        }
-      });
-
-      $scope.startabtest = function () {
-        if (typeof $scope.sparestuff.date == 'undefined') {
-          $scope.sparestuff.date = 'now';
-        }
-        crmApi('MailingAB', 'send_mail', {id: $scope.abId,
-          scheduled_date: $scope.sparestuff.date, scheduled_date_time: $scope.currentABTest.latertime});
-      };
-
-      angular.forEach($scope.incGroup, function (value) {
-        $scope.sparestuff.ingrps += value.toString() + ", ";
-      });
-      angular.forEach($scope.excGroup, function (value) {
-        $scope.sparestuff.excgrps += value.toString() + ", ";
-      });
-      if ($scope.sparestuff.ingrps.length != 0) {
-        $scope.sparestuff.ingrps = $scope.sparestuff.ingrps.substr(0, $scope.sparestuff.ingrps.length - 2);
-      }
-      if ($scope.sparestuff.excgrps.length != 0) {
-        $scope.sparestuff.excgrps = $scope.sparestuff.excgrps.substr(0, $scope.sparestuff.excgrps.length - 2);
-      }
-    };
-
-    $scope.update_abtest = function () {
-      $scope.currentABTest.declare_winning_time = $scope.currentABTest.date + " " + $scope.currentABTest.time;
-      crmApi('MailingAB', 'create', {
-        id: $scope.abId,
-        testing_criteria_id: $scope.sparestuff.template.val,
-        mailing_id_a: $scope.currentABTest.mailing_id_a,
-        mailing_id_b: $scope.currentABTest.mailing_id_b,
-        mailing_id_c: $scope.currentABTest.mailing_id_c,
-        specific_url: $scope.currentABTest.acturl,
-        winner_criteria_id: $scope.currentABTest.winner_criteria_id,
-        group_percentage: $scope.currentABTest.group_percentage,
-        declare_winning_time: $scope.currentABTest.declare_winning_time
-      });
-    };
-    $scope.currentABTest.latertime = "";
-    $scope.tmp = function (tst, aorb) {
-      if (aorb == 1) {
-        $scope.mailA.msg_template_id = tst;
-        if ($scope.mailA.msg_template_id == null) {
-          $scope.mailA.body_html = "";
-          $scope.mailA.subject = "";
-        }
-        else {
-          for (var a in $scope.tmpList) {
-            if ($scope.tmpList[a].id == $scope.mailA.msg_template_id) {
-              $scope.mailA.body_html = $scope.tmpList[a].msg_html;
-              if (typeof $scope.mailA.subject == 'undefined' || $scope.mailA.subject.length == 0) {
-                $scope.mailA.subject = $scope.tmpList[a].msg_subject;
-              }
-            }
-          }
-        }
-      }
-      else {
-        if (aorb == 2) {
-          $scope.mailB.msg_template_id = tst;
-          if ($scope.mailB.msg_template_id == null) {
-            $scope.mailB.body_html = "";
-            $scope.mailB.subject = "";
-          }
-          else {
-            for (var a in $scope.tmpList) {
-              if ($scope.tmpList[a].id == $scope.mailB.msg_template_id) {
-                $scope.mailB.body_html = $scope.tmpList[a].msg_html;
-                if (typeof $scope.mailB.subject == 'undefined' || $scope.mailB.subject.length == 0) {
-                  $scope.mailB.subject = $scope.tmpList[a].msg_subject;
-                }
-
-              }
-            }
-          }
-        }
-        else {
-          $scope.mailA.msg_template_id = tst;
-          if ($scope.mailA.msg_template_id == null) {
-            $scope.mailA.body_html = "";
-            $scope.mailA.subject = "";
-          }
-          else {
-            for (var a in $scope.tmpList) {
-              if ($scope.tmpList[a].id == $scope.mailA.msg_template_id) {
-                $scope.mailA.body_html = $scope.tmpList[a].msg_html;
-                if (typeof $scope.mailA.subject == 'undefined' || $scope.mailA.subject.length == 0) {
-                  $scope.mailA.subject = $scope.tmpList[a].msg_subject;
-                }
-              }
-            }
-          }
-
-          $scope.mailB.msg_template_id = tst;
-          if ($scope.mailB.msg_template_id == null) {
-            $scope.mailB.body_html = "";
-            $scope.mailB.subject = "";
-
-          }
-          else {
-            for (var a in $scope.tmpList) {
-              if ($scope.tmpList[a].id == $scope.mailB.msg_template_id) {
-                $scope.mailB.body_html = $scope.tmpList[a].msg_html;
-                if (typeof $scope.mailB.subject == 'undefined' || $scope.mailB.subject.length == 0) {
-                  $scope.mailB.subject = $scope.tmpList[a].msg_subject;
-                }
-
-              }
-            }
-          }
-        }
-      }
-    };
-
-    /*$scope.tmp = function (tst){
-     $scope.currentMailing.msg_template_id=tst;
-     console.log($scope.currentMailing.msg_template_id+ "sasas");
-     if($scope.currentMailing.msg_template_id == null){
-     $scope.currentMailing.body_html="";
-     $scope.currentMailing.subject="";
-     }
-     else{
-     for(var a in $scope.tmpList){
-
-     if($scope.tmpList[a].id==$scope.currentMailing.msg_template_id){
-     $scope.currentMailing.body_html=$scope.tmpList[a].msg_html;
-     console.log($scope.tmpList[a].msg_subject);
-     $scope.currentMailing.subject=$scope.tmpList[a].msg_subject;
-     console.log($scope.currentMailing.subject);
-     }
-     }
-     }
-     };*/
-
-
-    $scope.$watch('preview', function () {
-      if ($scope.preview == true) {
-        $('#prevmail').dialog({
-          title: 'Preview Mailing',
-          width: 1000,
-          height: 500,
-          closed: false,
-          cache: false,
-          modal: true,
-          position: {
-            my: 'left',
-            at: 'top',
-            of: $(".crmABTestingAllTabs")
-          },
-
-          close: function () {
-            $scope.preview = false;
-            $scope.$apply();
-          }
-        });
-
-        $("#prevmail").dialog('option', 'position', [300, 50]);
-      }
-
-    }, true);
-
-    $scope.call = function () {
-      $scope.$apply();
-      crmApi('Mailing', 'send_test', {
-        mailing_id: $scope.currentABTest.mailing_id_a,
-        test_email: $scope.sparestuff.emailadd
-      });
-
-      crmApi('Mailing', 'send_test', {
-        mailing_id: $scope.currentABTest.mailing_id_b,
-        test_email: $scope.sparestuff.emailadd
-      })
-    };
-
-    $scope.$watch('sendtest', function () {
-      if ($scope.sendtest == true) {
-        $('#sendtest').dialog({
-          title: 'Send Test Mails',
-          width: 300,
-          height: 150,
-          closed: false,
-          cache: false,
-          modal: true,
-          buttons: {
-            'Send': function () {
-              $scope.call();
-              $scope.sendtest = false;
-              $('#sendtest').dialog("close");
-
-            }
-          },
-          close: function () {
-            $scope.sendtest = false;
-            $scope.$apply()
-          }
-        });
-      }
-    });
-  });
-
-
-  crmMailingAB.directive('nexttab', function () {
-    return {
-      // Restrict it to be an attribute in this case
-      restrict: 'A',
-      priority: 500,
-      // responsible for registering DOM listeners as well as updating the DOM
-      link: function (scope, element, attrs) {
-
-        var tabselector = $(".crmABTestingAllTabs");
-        tabselector.tabs(scope.$eval(attrs.nexttab));
-
-        // disable remaining tabs
-        if (scope.sparestuff.isnew == true) {
-          tabselector.tabs({disabled: [1, 2, 3]});
-        }
-
-        $(element).on("click", function () {
-          if (scope.tab_val == 0) {
-            scope.create_abtest();
-          }
-          else {
-            if (scope.tab_val == 2) {
-              scope.update_abtest();
-              if (scope.currentABTest.winner_criteria_id == 1) {
-                scope.sparestuff.winnercriteria = "Open";
-                scope.$apply();
-              }
-              else {
-                if (scope.currentABTest.winner_criteria_id == 2) {
-                  scope.sparestuff.winnercriteria = " Total Unique Clicks";
-                  scope.$apply();
-                }
-                else {
-                  if (scope.currentABTest.winner_criteria_id == 3) {
-                    scope.sparestuff.winnercriteria = "Total Clicks on a particular link";
-                    scope.$apply();
-                  }
-                }
-              }
-              scope.a_b_update();
-            }
-          }
-          scope.tab_upd();
-
-          var myArray1 = [];
-          for (var i = scope.max_tab + 1; i < 4; i++) {
-            myArray1.push(i);
-          }
-          tabselector.tabs("option", "disabled", myArray1);
-          tabselector.tabs("option", "active", scope.tab_val);
-          scope.$apply();
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('prevtab', function () {
-    return {
-      // Restrict it to be an attribute in this case
-      restrict: 'A',
-      priority: 500,
-      // responsible for registering DOM listeners as well as updating the DOM
-      link: function (scope, element, attrs) {
-        $(element).on("click", function () {
-          var temp = scope.tab_val - 1;
-          scope.tab_upd_dec();
-          scope.$apply();
-          if (temp != 3) {
-            $(".crmABTestingAllTabs").tabs("option", "active", temp);
-          }
-          scope.$apply();
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('chsgroup', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        function format(item) {
-          if (!item.id) {
-            // return `text` for optgroup
-            return item.text;
-          }
-          // return item template
-          var a = item.id.split(" ");
-          if (a[1] == "civicrm_group" && a[2] == "include") {
-            return "<img src='../../sites/all/modules/civicrm/i/include.jpeg' height=12 width=12/>" + " " + "<img src='../../sites/all/modules/civicrm/i/group.png' height=12 width=12/>" + item.text;
-          }
-          if (a[1] == "civicrm_group" && a[2] == "exclude") {
-            return "<img src='../../sites/all/modules/civicrm/i/Error.gif' height=12 width=12/>" + " " + "<img src='../../sites/all/modules/civicrm/i/group.png' height=12 width=12/>" + item.text;
-          }
-          if (a[1] == "civicrm_mailing" && a[2] == "include") {
-            return "<img src='../../sites/all/modules/civicrm/i/include.jpeg' height=12 width=12/>" + " " + "<img src='../../sites/all/modules/civicrm/i/EnvelopeIn.gif' height=12 width=12/>" + item.text;
-          }
-          if (a[1] == "civicrm_mailing" && a[2] == "exclude") {
-            return "<img src='../../sites/all/modules/civicrm/i/Error.gif' height=12 width=12/>" + " " + "<img src='../../sites/all/modules/civicrm/i/EnvelopeIn.gif' height=12 width=12/>" + item.text;
-          }
-        }
-
-
-        $(element).select2({
-          width: "400px",
-          placeholder: "Select the groups you wish to include",
-          formatResult: format,
-          formatSelection: format,
-          escapeMarkup: function (m) {
-            return m;
-          }
-        }).select2("data", scope.sparestuff.allgroups);
-
-
-        $(element).on('select2-selecting', function (e) {
-          var a = e.val.split(" ");
-          var l = a.length;
-          if (a[2] == "include") {
-            var str = "";
-            for (i = 3; i < l; i++) {
-              str += a[i];
-              str += " ";
-            }
-            scope.incGroup.push(str);
-            scope.incGroupids.push(a[0]);
-            scope.$apply();
-          }
-
-          else {
-            var str = "";
-            for (i = 3; i < l; i++) {
-              str += a[i];
-              str += " ";
-            }
-
-            scope.excGroup.push(str);
-            scope.excGroupids.push(a[0]);
-            scope.$apply();
-          }
-
-          scope.$apply();
-
-        });
-        $(element).on("select2-removed", function (e) {
-          if (e.val.split(" ")[2] == "exclude") {
-            var excIndex = scope.excGroup.indexOf(e.val.split(" ")[3]);
-            scope.excGroup.splice(excIndex, 1);
-            scope.excGroupids.splice(excIndex, 1);
-            scope.$apply();
-          }
-          else {
-            var incIndex = scope.incGroup.indexOf(e.val.split(" ")[3]);
-            scope.incGroup.splice(incIndex, 1);
-            scope.incGroupids.splice(incIndex, 1);
-            scope.$apply();
-          }
-
-          scope.$apply();
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('sliderbar', function () {
-    return{
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        if (typeof scope.currentABTest.group_percentage != 'undefined') {
-          $(element).slider({value: scope.currentABTest.group_percentage});
-        }
-        $(element).slider({min: 1});
-        $(element).slider({
-          slide: function (event, ui) {
-            scope.currentABTest.group_percentage = ui.value;
-            scope.$apply();
-          }
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('datepick', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        $(element).datepicker({
-          dateFormat: "dd-mm-yy",
-          onSelect: function (date) {
-            $(".ui-datepicker a").removeAttr("href");
-            scope.sparestuff.date = date.toString();
-            scope.$apply();
-          }
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('submitform', function () {
-    return {
-      restrict: 'A',
-      priority: 1000,
-      link: function (scope, element, attrs) {
-        $(element).on("click", function () {
-          scope.savea({
-            id: scope.mailA.id,
-            name: scope.currentABTest.name + ' (AB test A)',
-            visibility: scope.mailA.visibility,
-            created_id: 1,
-            subject: scope.mailA.subject,
-            msg_template_id: scope.mailA.msg_template_id == null ? "" : scope.mailA.msg_template_id,
-            open_tracking: scope.mailA.open_tracking,
-            url_tracking: scope.mailA.url_tracking,
-            forward_replies: scope.mailA.forward_replies,
-            auto_responder: scope.mailA.auto_responder,
-            from_name: scope.mailA.from_name,
-            from_email: scope.mailA.from_email,
-            replyto_email: scope.mailA.replyto_email,
-            unsubscribe_id: scope.mailA.unsubscribe_id,
-            resubscribe_id: scope.mailA.resubscribe_id,
-            body_html: scope.mailA.body_html,
-            body_text: scope.mailA.body_text,
-            scheduled_date: scope.mailA.scheduled_date,
-            scheduled_id: scope.mailA.scheduled_id,
-            campaign_id: scope.mailA.campaign_id == null ? "" : scope.mailA.campaign_id,
-            header_id: scope.mailA.header_id,
-            footer_id: scope.mailA.footer_id,
-            is_completed: scope.mailA.is_completed
-          });
-
-          if (scope.whatnext == "3") {
-            scope.mailB.name = scope.mailA.name;
-            scope.mailB.visibility = scope.mailA.visibility;
-            scope.mailB.created_id = scope.mailA.created_id;
-            scope.mailB.subject = scope.mailA.subject;
-            scope.mailB.msg_template_id = scope.mailA.msg_template_id == null ? "" : scope.mailA.msg_template_id;
-            scope.mailB.open_tracking = scope.mailA.open_tracking;
-            scope.mailB.url_tracking = scope.mailA.url_tracking;
-            scope.mailB.forward_replies = scope.mailA.forward_replies;
-            scope.mailB.auto_responder = scope.mailA.auto_responder;
-            scope.mailB.from_name = scope.mailA.from_name;
-            scope.mailB.replyto_email = scope.mailA.replyto_email;
-            scope.mailB.unsubscribe_id = scope.mailA.unsubscribe_id;
-            scope.mailB.resubscribe_id = scope.mailA.resubscribe_id;
-            scope.mailB.body_html = scope.mailA.body_html;
-            scope.mailB.body_text = scope.mailA.body_text;
-            scope.mailB.scheduled_id = scope.mailA.scheduled_id;
-            scope.mailB.campaign_id = scope.mailA.campaign_id == null ? "" : scope.mailA.campaign_id;
-            scope.mailB.header_id = scope.mailA.header_id;
-            scope.mailB.footer_id = scope.mailA.footer_id;
-            scope.mailB.is_completed = scope.mailA.is_completed;
-          }
-          else {
-            if (scope.whatnext == "2") {
-              scope.mailB.fromEmail = scope.mailA.fromEmail;
-              scope.mailB.name = scope.mailA.name;
-              scope.mailB.visibility = scope.mailA.visibility;
-              scope.mailB.created_id = scope.mailA.created_id;
-              scope.mailB.msg_template_id = scope.mailA.msg_template_id == null ? "" : scope.mailA.msg_template_id;
-              scope.mailB.open_tracking = scope.mailA.open_tracking;
-              scope.mailB.url_tracking = scope.mailA.url_tracking;
-              scope.mailB.forward_replies = scope.mailA.forward_replies;
-              scope.mailB.auto_responder = scope.mailA.auto_responder;
-              scope.mailB.from_name = scope.mailA.from_name;
-              scope.mailB.replyto_email = scope.mailA.replyto_email;
-              scope.mailB.unsubscribe_id = scope.mailA.unsubscribe_id;
-              scope.mailB.resubscribe_id = scope.mailA.resubscribe_id;
-              scope.mailB.body_html = scope.mailA.body_html;
-              scope.mailB.body_text = scope.mailA.body_text;
-              scope.mailB.scheduled_id = scope.mailA.scheduled_id;
-              scope.mailB.campaign_id = scope.mailA.campaign_id == null ? "" : scope.mailA.campaign_id;
-              scope.mailB.header_id = scope.mailA.header_id;
-              scope.mailB.footer_id = scope.mailA.footer_id;
-              scope.mailB.is_completed = scope.mailA.is_completed;
-            }
-          }
-          scope.saveb({
-            id: scope.mailB.id,
-            name: scope.currentABTest.name + ' (AB test B)',
-            visibility: scope.mailB.visibility,
-            created_id: 1,
-            subject: scope.mailB.subject,
-            msg_template_id: scope.mailB.msg_template_id == null ? "" : scope.mailB.msg_template_id,
-            open_tracking: scope.mailB.open_tracking,
-            url_tracking: scope.mailB.url_tracking,
-            forward_replies: scope.mailB.forward_replies,
-            auto_responder: scope.mailB.auto_responder,
-            from_name: scope.mailB.from_name,
-            from_email: scope.mailB.from_email,
-            replyto_email: scope.mailB.replyto_email,
-            unsubscribe_id: scope.mailB.unsubscribe_id,
-            resubscribe_id: scope.mailB.resubscribe_id,
-            body_html: scope.mailB.body_html,
-            body_text: scope.mailB.body_text,
-            scheduled_id: scope.mailB.scheduled_id,
-            campaign_id: scope.mailB.campaign_id == null ? "" : scope.mailB.campaign_id,
-            header_id: scope.mailB.header_id,
-            footer_id: scope.mailB.footer_id,
-            is_completed: scope.mailA.is_completed
-          });
-
-          scope.savec({
-            id: scope.mailC.id,
-            name: scope.currentABTest.name + ' (AB test winner)',
-            visibility: scope.mailB.visibility,
-            created_id: 1,
-            subject: scope.mailB.subject,
-            msg_template_id: scope.mailB.msg_template_id == null ? "" : scope.mailB.msg_template_id,
-            open_tracking: scope.mailB.open_tracking,
-            url_tracking: scope.mailB.url_tracking,
-            forward_replies: scope.mailB.forward_replies,
-            auto_responder: scope.mailB.auto_responder,
-            from_name: scope.mailB.from_name,
-            from_email: scope.mailB.from_email,
-            replyto_email: scope.mailB.replyto_email,
-            unsubscribe_id: scope.mailB.unsubscribe_id,
-            resubscribe_id: scope.mailB.resubscribe_id,
-            body_html: scope.mailB.body_html,
-            body_text: scope.mailB.body_text,
-            campaign_id: scope.mailB.campaign_id == null ? "" : scope.mailB.campaign_id,
-            header_id: scope.mailB.header_id,
-            footer_id: scope.mailB.footer_id,
-            is_completed: scope.mailA.is_completed,
-            'api.mailing_job.create': 0
-          });
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('chsdate', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        $(element).datepicker({
-          dateFormat: "yy-mm-dd",
-          onSelect: function (date) {
-            $(".ui-datepicker a").removeAttr("href");
-            scope.currentABTest.date = date.toString();
-            scope.$apply();
-          }
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('prevbutton', function () {
-    return {
-      restrict: 'AE',
-      replace: 'true',
-      template: '<div class="crm-submit-buttons" >' +
-        '<div class = "crm-button crm-button-type-upload crm-button_qf_Contact_upload_view"   >' +
-        '<input type="submit" value="Previous"  id="campaignbutton _qf_Contact_upload_view-top" class="btn btn-primary" prevtab={{tab_val}}>' +
-        '</div></div>'
-    };
-  });
-
-  crmMailingAB.directive('groupselect', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        $(element).select2({
-          width: "200px",
-          data: CRM.crmMailing.mailTokens,
-          placeholder: "Insert Token"
-        });
-        $(element).on('select2-selecting', function (e) {
-
-          scope.$evalAsync('_resetSelection()');
-          var a = $(element).attr('id');
-          if (a == "htgroupcompose") {
-            scope.tokenfunc("body_html", e, scope.mailA.body_html);
-          }
-          else {
-            if (a == "htgroupcomposetwob") {
-              scope.tokenfunc("twomailbbody_html", e, scope.mailB.body_html);
-            }
-            else {
-              if (a == "htgroupcomposetwoa") {
-                scope.tokenfunc("twomailabody_html", e, scope.mailA.body_html);
-              }
-              else {
-                if (a == "textgroupcompose") {
-                  scope.tokenfunc("body_text", e, scope.mailA.body_text);
-                }
-                else {
-                  if (a == "textgroupcomposetwoa") {
-                    scope.tokenfunc("twomailabody_text", e, scope.mailA.body_text);
-                  }
-                  else {
-                    if (a == "textgroupcomposetwob") {
-                      scope.tokenfunc("twomailbbody_text", e, scope.mailB.body_text);
-                    }
-                    else {
-                      if (a == "subgroupsuba") {
-                        scope.tokenfunc("suba", e, scope.mailA.subject);
-                      }
-                      else {
-                        if (a == "subgroupsubb") {
-                          scope.tokenfunc("subb", e, scope.mailB.subject);
-                        }
-                        else {
-                          if (a == "subgroupfrom") {
-                            scope.tokenfunc("subfrom", e, scope.mailA.subject);
-                          }
-                          else {
-                            if (a == "subgrouptwoa") {
-                              scope.tokenfunc("twomaila", e, scope.mailA.subject);
-                            }
-                            else {
-                              if (a == "subgrouptwob") {
-                                scope.tokenfunc("twomailb", e, scope.mailB.subject);
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          }
-
-          scope.$apply();
-          e.preventDefault();
-        })
-      }
-    };
-  });
-
-  crmMailingAB.directive('replytoselect',function(){
-    return {
-      restrict : 'AE',
-      link: function(scope, element, attrs){
-
-        function format(item){
-            return item.label.replace(/&/g, '&amp;')
-            .replace(/"/g, '&quot;')
-            .replace(/</g, '&lt;')
-            .replace(/>/g, '&gt;');
-        }
-
-        CRM.api3('OptionGroup', 'get', {
-          "sequential": 1,
-          "name": "from_email_address"
-        }).done(function(result) {
-          var emailGroupId = result.id;
-           CRM.api3('OptionValue', 'get', {
-            "sequential": 1,
-            "option_group_id": result.id
-          }).done(function(orgEmails) {
-
-              //$sce.trustAsHtml(
-
-            $(element).select2({
-              class: "abtesting-form-element",
-              data: orgEmails.values,
-              formatResult: format,
-              formatSelection: format,
-              placeholder:"Select reply to address"});
-
-          });
-        });
-      }
-    };
-  });
-
-  crmMailingAB.directive('stopa',function(){
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        scope.$watch('aastop', function () {
-          if (scope.aastop == true) {
-            $(element).dialog({
-              title: 'Confirmation',
-              width: 300,
-              height: 150,
-              closed: false,
-              cache: false,
-              modal: true,
-              buttons: {
-                'Yes': function () {
-                  scope.aastop = false;
-                  scope.copyatoc();
-                  $(element).dialog("close");
-                },
-                'No': function () {
-                  scope.aastop = false;
-                  $(element).dialog("close");
-                }
-              },
-              close: function () {
-                scope.aastop = false;
-
-                scope.$apply();
-              }
-            });
-          }
-        });
-      }
-    }
-  });
-
-  crmMailingAB.directive('stopb', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-
-        scope.$watch('bbstop', function () {
-          if (scope.bbstop == true) {
-            $(element).dialog({
-              title: 'Confirmation',
-              width: 300,
-              height: 150,
-              closed: false,
-              cache: false,
-              modal: true,
-              buttons: {
-                'Yes': function () {
-                  scope.bbstop = false;
-                  scope.sendc();
-                  $(element).dialog("close");
-                },
-                'No': function () {
-                  scope.bbstop = false;
-                  $(element).dialog("close");
-                }
-              },
-              close: function () {
-                scope.bbstop = false;
-
-                scope.$apply();
-              }
-            });
-          }
-        });
-      }
-    }
-  });
-
-
-  crmMailingAB.directive('checktimeentry', function () {
-    return {
-      restrict: 'AE',
-      link: function (scope, element, attrs) {
-        $(element).timeEntry({
-          show24Hours: true,
-          showSeconds: true,
-        });
-      }
-    }
-  });
-
-  crmMailingAB.directive('ckedit', function ($parse) {
-    CKEDITOR.disableAutoInline = true;
-    var counter = 0,
-      prefix = '__ckd_';
-
-    return {
-      restrict: 'A',
-      link: function (scope, element, attrs, controller) {
-        var getter = $parse(attrs.ckedit),
-          setter = getter.assign;
-
-        attrs.$set('contenteditable', true); // inline ckeditor needs this
-        if (!attrs.id) {
-          attrs.$set('id', prefix + (++counter));
-        }
-
-        // CKEditor stuff
-        // Override the normal CKEditor save plugin
-
-        CKEDITOR.plugins.registered['save'] =
-        {
-          init: function (editor) {
-            editor.addCommand('save',
-              {
-                modes: { wysiwyg: 1, source: 1 },
-                exec: function (editor) {
-                  if (editor.checkDirty()) {
-                    var ckValue = editor.getData();
-                    scope.$apply(function () {
-                      setter(scope, ckValue);
-                    });
-                    ckValue = null;
-                    editor.resetDirty();
-                  }
-                }
-              }
-            );
-            editor.ui.addButton('Save', { label: 'Save', command: 'save', toolbar: 'document' });
-          }
-        };
-        var options = {};
-        options.on = {
-          blur: function (e) {
-            if (e.editor.checkDirty()) {
-              var ckValue = e.editor.getData();
-              scope.$apply(function () {
-                setter(scope, ckValue);
-              });
-              ckValue = null;
-              e.editor.resetDirty();
-            }
-          }
-        };
-        options.extraPlugins = 'sourcedialog';
-        options.removePlugins = 'sourcearea';
-        var editorangular = CKEDITOR.inline(element[0], options); //invoke
-
-        scope.$watch(attrs.ckedit, function (value) {
-          editorangular.setData(value);
-        });
-      }
-    }
-
-  });
-
-})(angular, CRM.$, CRM._);
diff --git a/partials/crmMailingAB.orig/attachments.html b/partials/crmMailingAB.orig/attachments.html
deleted file mode 100755 (executable)
index e9fb793..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- will use Controller: browse -->
-<body>
-<table>
-    <tr>
-        <td class="label">Attach Files</td>
-        <td>
-            <input type="file" data-file="param.file"/>
-        </td>
-        <td>
-            <button ng-click="upload()" >Upload</button>
-        </td>
-    </tr>
-    <tr>
-        <td class="label">Attach Files</td>
-        <td>
-            <input type="file" data-file="param.file_2"/>
-        </td>
-        <td>
-            <button ng-click="upload_2()" >Upload</button>
-        </td>
-    </tr>
-    <tr>
-        <td class="label">Attach Files</td>
-        <td>
-            <input type="file" data-file="param.file_3"/>
-        </td>
-        <td>
-            <button ng-click="upload_3()" >Upload</button>
-        </td>
-    </tr>
-
-</table>
-
-</body>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/compose.html b/partials/crmMailingAB.orig/compose.html
deleted file mode 100755 (executable)
index fe79304..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="crm-accordion-wrapper ">
-  <div class="crm-accordion-wrapper ">
-    <div class="crm-accordion-header">HTML Format</div>
-    <div class="crm-accordion-body" >
-      <br>
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      <input type="hidden" groupselect id= "htgroupcompose"  ></input><br><br>
-      &nbsp &nbsp &nbsp &nbsp
-      <div ckedit id = "body_html" ng-model="mailA.body_html" style="width: 600px; height: 300px;" required></div>
-      <br> <br>
-    </div>
-  </div>
-
-  <div class="crm-accordion-wrapper collapsed">
-    <div class="crm-accordion-header">Plain Text</div>
-    <div class="crm-accordion-body">
-      <br>
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-      <input type="hidden" groupselect id= "textgroupcompose"  ></input>
-      <br> <br>
-      &nbsp &nbsp &nbsp &nbsp
-      <textarea id = "body_text" ng-model="mailA.body_text" style="width: 600px; height: 300px;" > </textarea>
-      <br>
-    </div>
-  </div>
-</div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/from_name.html b/partials/crmMailingAB.orig/from_name.html
deleted file mode 100755 (executable)
index 13bd32a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<table class="form-layout-compressed">
-  <tbody>
-  <tr>
-    <td class="abtesting-form-label label">From E-mail Address A</td>
-    <td class="abtesting-form-element">
-      <select ng-model="mailA.from_email" ng-options="frm.email as frm.email for frm in eMailing" required>
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">From E-mail Address B</td>
-    <td class="abtesting-form-element">
-      <select ng-model="mailB.from_email" ng-options="frm.email as frm.email for frm in eMailing" required>
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Reply to E-mail Address</td>
-    <td class="abtesting-form-element">
-      <select ng-model="mailA.replyto_email"
-              ng-options="frm.email as frm.email for frm in eMailing" >
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Mailing Subject</td>
-    <td class="abtesting-form-element">
-      <input id= "subfrom" placeholder="Enter Subject" name="subject" type="text" ng-model="mailA.subject" required>
-    </td>
-  </tr>
-  <tr>
-  <td class="abtesting-form-label label">Mailing Subject Token</td>
-  <td class="abtesting-form-element">
-    <input type="hidden" groupselect id= "subgroupfrom" ng-model="token" >
-  </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label" style="color:red" ng-show="mailing_form.subject.$invalid">
-      Mailing subject required.
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Use Template</td>
-    <td class="abtesting-form-element">
-      <select ng-change="tmp(mailA.msg_template_id,3)" ng-model="mailA.msg_template_id"
-              ng-options="mstemp.id as mstemp.msg_title for mstemp in tmpList" >
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-
-  </tbody>
-</table>
-
-<br>
-
-<div ng-include = "partialUrl('compose.html')"></div>
-<div ng-include="partialUrl('headerfooter.html')"></div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/headerfooter.html b/partials/crmMailingAB.orig/headerfooter.html
deleted file mode 100755 (executable)
index 3d55f30..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-Controller: crmABTestingTabsCtrl
-Required vars: headerfooter
--->
-<div class="crm-accordion-wrapper collapsed">
-  <div class="crm-accordion-header">Header and Footer</div>
-  <div class="crm-accordion-body">
-    <body>
-    <table>
-      <tr>
-        <td class="label">Mailing Header</td>
-        <td>
-          <select ng-model="mailA.header_id" ng-options="hf.id as hf.name for hf in headerfooter| filter:isHeader">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="label">Mailing Footer</td>
-        <td>
-          <select ng-model="mailA.footer_id" ng-options="f.id as f.name for f in headerfooter| filter:isFooter">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-    </table>
-    </body>
-  </div>
-</div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/list.html b/partials/crmMailingAB.orig/list.html
deleted file mode 100755 (executable)
index 99b691f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
-Controller: ABListingCtrl
-Required vars: mailingABList
--->
-<div id="help">
-  A/B Testing list
-</div>
-
-<div ng-show="!$.isEmptyObject(mailingABList)">
-  <table class="display">
-    <thead>
-    <tr>
-      <th>Title</th>
-      <th>Id</th>
-      <th>Test Type</th>
-      <th></th>
-
-      <th></th>
-    </tr>
-    </thead>
-    <tbody>
-    <tr ng-repeat="mailingAB in mailingABList">
-      <td>{{mailingAB.name}}</td>
-      <td>{{mailingAB.id}}</td>
-      <td>{{testing_criteria[mailingAB.testing_criteria_id]}}</td>
-      <td><a class="action-item crm-hover-button" ng-href="#/abtest/{{mailingAB.id}}">Edit</a>&nbsp
-      <a class="action-item crm-hover-button" ng-href="#/abtest/report/{{mailingAB.id}}">Results</a></td>
-
-    </tr>
-    </tbody>
-  </table>
-</div>
-
-<div ng-show="$.isEmptyObject(mailingABList)" class="messages status no-popup">
-  <div class="icon inform-icon"></div>
-  You have no A/B mailings
-</div>
-
-
-<div class="crm-submit-buttons">
-  <br>
-  <a ng-href="#/abtest/new" class="button"><span><div class="icon add-icon"></div>New A/B Test</span></a>
-</div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/main.html b/partials/crmMailingAB.orig/main.html
deleted file mode 100755 (executable)
index 7259da1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<div ui-jq="tabs" class="crmABTestingAllTabs" ui-options="{show: true, hide: true, collapsible: true}">
-  <ul>
-    <li><a href="#tabs-1" ng-click="gotoTab('campaign');">Campaign</a></li>
-    <li><a href="#tabs-2" ng-click="gotoTab('compose');">Compose</a></li>
-    <li><a href="#tabs-3" ng-click="gotoTab('rec');">Recipients and Winner Criteria</a></li>
-    <li><a href="#tabs-4" ng-click="gotoTab('preview');">Preview and Send</a></li>
-  </ul>
-
-  <div id="tabs-1">
-    <div ng-include="partialUrl('tab1.html')"></div>
-  </div>
-  <div id="tabs-2">
-    <div ng-include="partialUrl('tab2.html')"></div>
-  </div>
-  <div id="tabs-3">
-    <div ng-include="partialUrl('tab3.html')"></div>
-  </div>
-  <div id="tabs-4">
-    <div ng-include="partialUrl('tab4.html')"></div>
-  </div>
-</div>
diff --git a/partials/crmMailingAB.orig/modal.html b/partials/crmMailingAB.orig/modal.html
deleted file mode 100755 (executable)
index 94459be..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<div>
-
-    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
-    <meta http-equiv="Pragma" content="no-cache" />
-    <meta http-equiv="Expires" content="0" />
-    <form >
-    <h3> Please enter the confidence level at which a decision can be made</h3>
-   &nbsp <input type="text" style="height: 20px; width: 15px;" ng-modal="confidence" numbar><br><br>
-
-    <div sliderbar id="trial" style="margin: 10px;"></div>
-
-    {{4+6}}
-
-    dfsf: {{adi}}
-
-    <h3>If the confidence level is not reached what do you want us to do?</h3>
-    &nbsp <input type="radio" ng-model="ifnot" value="Open"> Inform me  <br/><br>
-    &nbsp <input type="radio" ng-model="ifnot" value="Total Unique Clicks"> Send Version A <br/><br>
-    &nbsp <input type="radio" ng-model="ifnot" value="Total Clicks on a particular link"> Send Version B <br/><br>
-
-    </form>
-
-</div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/next.html b/partials/crmMailingAB.orig/next.html
deleted file mode 100755 (executable)
index 21e84d0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="crm-submit-buttons" id="campaignbutton">  <div class = "crm-button crm-button-type-upload crm-button_qf_Contact_upload_view"   >
-    <input type="submit" value="Next"  id="campaignbutton _qf_Contact_upload_view-top" class="btn btn-primary"  nexttab={{adi}} ><br></div></div>
-<br>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/report.html b/partials/crmMailingAB.orig/report.html
deleted file mode 100755 (executable)
index dbc840c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<div>
-    <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
-  <style>
-    .series {
-      fill: none;
-    }
-    .axis path, .axis line {
-      fill: none;
-      stroke:#000;
-      shape-rendering: crispEdges;
-    }
-  </style>
-  <div id="grph" ></div>
-  <div id="linegraph"></div>
-  {{r5}}
-  <table  style ="position: relative;  right :-575px; top:-250px; width :250px;" ng-show= "graphload">
-    <tr  >
-      <th>Details</th>
-      <th style="width :90px;">Version A</th>
-      <th style="width :90px;">Version B</th>
-    </tr>
-    <tr>
-      <td>Delivered</td>
-      <td>{{r[0]}}</td>
-      <td>{{d[0]}}</td>
-    </tr>
-    <tr>
-      <td>Bounces</td>
-      <td>{{r[1]}}</td>
-      <td>{{d[1]}}</td>
-    </tr>
-    <tr>
-      <td>Unsuscribers</td>
-      <td>{{r[2]}}</td>
-      <td>{{d[2]}}</td>
-    </tr>
-    <tr>
-      <td>Opened</td>
-      <td>{{r[3]}}</td>
-      <td>{{d[3]}}</td>
-    </tr>
-    <tr>
-      <td>Unique Clicks</td>
-      <td>{{r[4]}}</td>
-      <td>{{d[4]}}</td>
-    </tr>
-
-  </table>
-
-   <hr>
-
-  <table>
-    <tbody>
-
-    <tr >
-
-      <td>
-        <input type="radio"  ng-click = "asure();" name="stop"  >  Stop Test and Send Version A
-        <div ng-show = "aastop" stopa>Are you Sure?</div>
-      </td>
-
-      <td>
-        <input type="radio" ng-click="bsure(); " name="stop" id="bstop">  Stop Test and Send Version B
-        <div ng-show = "bbstop" stopb>Are you Sure?</div>
-      </td>
-    </tr>
-
-    </tbody>
-  </table>
-
-
-</div>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/subject_lines.html b/partials/crmMailingAB.orig/subject_lines.html
deleted file mode 100755 (executable)
index f07aac7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<table class="form-layout-compressed">
-  <tbody>
-  <tr>
-    <td class="abtesting-form-label label">From E-mail Address </td>
-    <td class="abtesting-form-element">
-      <select ng-model="mailA.from_email" ng-options="frm.email as frm.email for frm in eMailing" >
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Reply to E-mail Address</td>
-    <td class="abtesting-form-element">
-      <input type="hidden" replytoselect id= "replyToEmail"   ng-model="mailA.replyto_email"
-              ng-options="frm.email as frm.email for frm in eMailing" />
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Mailing Subject A</td>
-    <td class="abtesting-form-element">
-      <input placeholder="Enter Subject A" id="suba" name="subject_a" type="text" ng-model="mailA.subject" required/>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Mailing Subject Token</td>
-    <td class="abtesting-form-element">
-      <input type="hidden" groupselect id="subgroupsuba"></input>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Mailing Subject B</td>
-    <td class="abtesting-form-element">
-      <input placeholder="Enter Subject B" id="subb" name="subject_b" type="text" ng-model="mailB.subject" required/>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Mailing Subject Token</td>
-    <td class="abtesting-form-element">
-      <input type="hidden" groupselect id= "subgroupsubb"  ></input>
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label" style="color:red" ng-show="mailing_form.subject.$invalid">
-      Mailing subject required.
-    </td>
-  </tr>
-  <tr>
-    <td class="abtesting-form-label label">Use Template</td>
-    <td class="abtesting-form-element">
-      <select ng-change="tmp(mailA.msg_template_id,3)" ng-model="mailA.msg_template_id"
-              ng-options="mstemp.id as mstemp.msg_title for mstemp in tmpList" >
-        <option value="">-none-</option>
-      </select>
-    </td>
-  </tr>
-  </tbody>
-</table>
-
-<br>
-
-
-<div ng-include = "partialUrl('compose.html')"></div>
-<div ng-include="partialUrl('headerfooter.html')"></div>
diff --git a/partials/crmMailingAB.orig/tab1.html b/partials/crmMailingAB.orig/tab1.html
deleted file mode 100755 (executable)
index ea8b8be..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<form name="tab1Form" unsaved-warning-form>
-  <div class="crm-block crm-form-block crmABTesting">
-    <br><h3> What would you like to name the test?</h3><p>
-    &nbsp&nbsp<input type="text" ng-model="currentABTest.name" name="abname" class="big crm-form-text" required>
-    <span ng-show="(!currentABTest.name.length && !tab1Form.abname.$pristine)">  *This field is required</span>
-    <br>
-
-    <h3> What would you like to test?</h3>
-    <label for="radio-option-subject-lines">
-      &nbsp <input id="radio-option-subject-lines" type="radio" ng-model="sparestuff.template" ng-value="templates[0]" ng-click="init(2)"
-                 ng-checked="currentABTest.testing_criteria_id==1" >
-      Subject lines <br/><br>
-    </label>
-    <label>
-      &nbsp <input type="radio" ng-model="sparestuff.template" ng-value="templates[1]" ng-click="init(3)"
-                 ng-checked="currentABTest.testing_criteria_id==2" >
-      From names <br/><br>
-    </label>
-    <label>
-      &nbsp <input type="radio" ng-model="sparestuff.template" ng-value="templates[2]" ng-click="init(1)"
-                 ng-checked="currentABTest.testing_criteria_id==3" >
-      Two different emails <br/><br>
-    </label>
-
-    <div class="crm-submit-buttons">
-    <span class="crm-button">
-      <input type="submit"   ng-click=" tab1Form.$setPristine();  " ng-disabled="tab1Form.$invalid"  value="Next" nexttab="{{tab_val}}"/>
-    </span>
-    <span class="crm-button">
-      <input type="submit" ng-click="tab1Form.$setPristine(); goto('abtest');" value="Cancel"/>
-    </span>
-    </div>
-  </div>
-</form>
diff --git a/partials/crmMailingAB.orig/tab2.html b/partials/crmMailingAB.orig/tab2.html
deleted file mode 100755 (executable)
index e1530a4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<form name="tab2Form" unsaved-warning-form>
-  <div class="crm-block crm-form-block crmABTesting">
-    <div ng-include="sparestuff.template.url"></div>
-    <div class="crm-submit-buttons">
-      <span class="crm-button">
-        <input type="submit" ng-click="tab2Form.$setPristine();" value="Previous" submitform prevtab/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab2Form.$setPristine();" value="Next" ng-disabled="tab2Form.$invalid" submitform nexttab="{{tab_val}}"/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab2Form.$setPristine(); goto('abtest');" value="Cancel"/>
-      </span>
-    </div>
-  </div>
-</form>
diff --git a/partials/crmMailingAB.orig/tab3.html b/partials/crmMailingAB.orig/tab3.html
deleted file mode 100755 (executable)
index cee2206..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<form name="tab3Form" unsaved-warning-form>
-  <div class="crm-block crm-form-block crmABTesting">
-    <h3>Select the groups you would like to add</h3>
-    &nbsp<br>
-    <select multiple chsgroup ng-model="sparestuff.allgroups" required>
-      <option id="1" ng-repeat="grp in groups" value="{{grp.id}} civicrm_group include {{grp.title}}"> {{grp.title}}
-      </option>
-      <option ng-repeat="grp in groups" value="{{grp.id}} civicrm_group exclude {{grp.title}}"> {{grp.title}}</option>
-      <option ng-repeat="ml in mailList" value="{{ml.id}} civicrm_mailing include {{ml.title}}"> {{ml.name}}</option>
-      <option ng-repeat="ml in mailList" value="{{ml.id}} civicrm_mailing exclude {{ml.title}}"> {{ml.name}}</option>
-    </select>
-    <br> <br>
-    <h3>Select the size of your test group</h3><br>
-    &nbsp Percentage Selected - {{currentABTest.group_percentage}}%
-
-    <div sliderbar id="trial" style="margin: 10px;" required></div>
-
-    <br><h3>How will the winner be decided (metric)</h3><br>
-    <label>
-      &nbsp <input type="radio" ng-model="currentABTest.winner_criteria_id" value=1 name="cri" required >
-      Opens <br/><br>
-    </label>
-    <label>
-      &nbsp <input type="radio" ng-model="currentABTest.winner_criteria_id" value=2 name="cri" >
-      Total Unique Clicks <br/><br>
-    </label>
-    <label>
-      &nbsp <input type="radio" ng-model="currentABTest.winner_criteria_id" value=3 name="cri"> Total
-      Clicks on a particular link
-    </label>
-    &nbsp &nbsp &nbsp &nbsp<input type="text"  ng-show="currentABTest.winner_criteria_id==3" ng-model="currentABTest.acturl">
-    <br><br>
-
-    <h3>Declare the winner by when?</h3><br>
-    <table>
-      <tbody>
-      <tr>
-        <td class="label">Date</td>
-        <td>
-          <input type="text" chsdate ng-model="currentABTest.date" required>
-        </td>
-        <td class="label">Time</td>
-        <td>
-          <input type="text" placeholder="hh:mm" ng-model="currentABTest.time"  checktimeentry required>
-        </td>
-      </tr>
-      </tbody>
-    </table>
-
-    <div id="help">
-      Enter the time in the 12:32:45 format where 12 is the hour, 32 the minutes and 45 the seconds.
-    </div>
-    <br>
-    <br>
-    <div class="crm-submit-buttons">
-      <span class="crm-button">
-        <input type="submit" ng-click="tab3Form.$setPristine();" value="Previous" prevtab/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab3Form.$setPristine();" ng-disabled="tab3Form.$invalid" value="Next" nexttab="{{tab_val}}"/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab3Form.$setPristine(); goto('abtest');" value="Cancel"/>
-      </span>
-    </div>
-  </div>
-</form>
diff --git a/partials/crmMailingAB.orig/tab4.html b/partials/crmMailingAB.orig/tab4.html
deleted file mode 100755 (executable)
index 326a415..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<form name="tab4Form" unsaved-warning-form>
-  <div class="crm-block crm-form-block crmABTesting">
-    <h3>Details</h3><br>
-    <table>
-      <tr>
-        <td>Test Criteria</td>
-        <td>{{sparestuff.template.name}}</td>
-      </tr>
-      <tr>
-        <td>Groups Included</td>
-        <td>{{sparestuff.ingrps}}</td>
-      </tr>
-      <tr>
-        <td>Groups Excluded</td>
-        <td>{{sparestuff.excgrps}}</td>
-      </tr>
-      <tr>
-        <td>Size of Test Group</td>
-        <td>{{currentABTest.group_percentage}}</td>
-      </tr>
-      <tr>
-        <td>Winner Criteria</td>
-        <td>{{sparestuff.winnercriteria}}</td>
-      </tr>
-      <tr>
-        <td>Declare Winner By</td>
-        <td>Date: {{currentABTest.date}} &nbsp; Time: {{currentABTest.time}}</td>
-      </tr>
-    </table>
-    <span class="crm-button">
-      <input type="button" value="Preview Mail" ng-click="pre()">
-    </span>
-    <br><br>
-    <div ng-show="preview" id="prevmail">
-      <div ui-jq="tabs" id="settings">
-        <ul>
-          <li>
-            <a href="#frag1"><span>Mail A</span></a>
-          </li>
-          <li>
-            <a href="#frag2"><span>Mail B</span></a>
-          </li>
-        </ul>
-        <div id="frag1" ng-bind-html="deliberatelyTrustDangerousSnippeta();"></div>
-        <div id="frag2" ng-bind-html="deliberatelyTrustDangerousSnippetb();"></div>
-      </div>
-    </div>
-    <span class="crm-button">
-      <input type="button" value="Send Test Emails" ng-click="sendTestMailing();">
-    </span>
-    <br><br>
-
-    <div ng-show="sendtest" id="sendtest">
-      Email-id : &nbsp<input placeholder = "abcd@civicrm.org" type="text" ng-model="sparestuff.emailadd">
-    </div>
-
-    <h3>When to Start</h3><br>
-
-    <div>
-      <label>
-        <input type="radio" name="Start" ng-model="start" value="now" ng-checked="true"> Now &nbsp
-      </label>
-      <label>
-        <input type="radio" name="Start" ng-model="start" value="later"> Later
-      </label>
-      <div ng-show="start=='later'">
-      &nbsp &nbsp <input type="text" class="dateplugin"  ng-model="send_date" datepick >
-      &nbsp &nbsp Time :<input type="text" placeholder="hh:mm" ng-model="currentABTest.latertime"  checktimeentry >
-      </div>
-    </div>
-
-    <br><br>
-
-    <div class="crm-submit-buttons">
-      <span class="crm-button">
-        <input type="submit" ng-click="tab4Form.$setPristine();" value="Previous" prevtab/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab4Form.$setPristine();  startabtest(); goto('abtest');" value="Submit & Send"/>
-      </span>
-      <span class="crm-button">
-        <input type="submit" ng-click="tab4Form.$setPristine(); goto('abtest');" value="Cancel"/>
-      </span>
-    </div>
-  </div>
-</form>
-
diff --git a/partials/crmMailingAB.orig/trackandRespond.html b/partials/crmMailingAB.orig/trackandRespond.html
deleted file mode 100755 (executable)
index 844eb09..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<!--
-Controller: MailCtrl
-Required vars: currentMailing
--->
-
-<table class="form-layout-compressed">
-    <tbody>
-    <tr>
-        <td>
-            <h3 style ="text-decoration:underline"> Tracking</h3>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <input type="checkbox" ng-model="currentMailing.url_tracking" ng-true-value="1" ng-false-value="0">&nbsp Track Click Throughs</input>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <div id="help">
-                Track the number of times recipients click each link in this mailing. NOTE: When this feature is enabled, all links in the message body will be automaticallly re-written to route through your CiviCRM server prior to redirecting to the target page.
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <input type="checkbox" ng-model="currentMailing.open_tracking" ng-true-value="1" ng-false-value="0">&nbsp Track Opens</input>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <div id="help">
-                Track the number of times recipients open this mailing in their email software.
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <h3 style ="text-decoration:underline">Responding</h3>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <input type="checkbox" ng-model="trackreplies" ng-change= "reply()" ng-true-value="1" ng-false-value="0">&nbsp Track Replies</input>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <div id="help">
-                Recipients' replies are sent to a CiviMail specific address instead of the sender's address so they can be stored within CiviCRM.
-            </div>
-        </td>
-    </tr>
-    <tr ng-show= "trackr(trackreplies)">
-        <td>
-            <input type="checkbox" ng-model="currentMailing.forward_replies" ng-true-value="1" ng-false-value="0">&nbsp Forward Replies</input>
-        </td>
-    </tr>
-    <tr ng-show= "trackr(trackreplies)">
-        <td>
-            <div id="help">
-                If a recipient replies to this mailing, forward the reply to the FROM Email address specified for the mailing.
-            </div>
-        </td>
-    </tr>
-    <tr ng-show= "trackr(trackreplies)">
-        <td>
-            <input type="checkbox" ng-model="currentMailing.auto_responder" ng-true-value="1" ng-false-value="0">&nbsp Auto-Respond to Replies &nbsp &nbsp</input>
-            <select ng-model="mailAutoResponder" ng-options="au.id as au.name for au in headerfooter| filter:isAuto">
-                <option value="">-none-</option>
-            </select>
-        </td>
-    </tr>
-    <tr ng-show= "trackr(trackreplies)">
-        <td>
-            <div id="help">
-                If a recipient replies to this mailing, send an automated reply using the selected message.
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <h3 style ="text-decoration:underline"> Online Publication</h3>
-        </td>
-    </tr>
-</table>
-
-<table class="form-layout-compressed">
-    <tr>
-        <td class="label">Mailing Visibility</td>
-        <td>
-            <select ng-model="currentMailing.visibility">
-                <option value="Public Pages">Public Pages</option>
-                <option value="User and User Admin Only">User and User Admin Only</option>
-            </select>
-        </td>
-        </tbody>
-</table>
\ No newline at end of file
diff --git a/partials/crmMailingAB.orig/two_emails.html b/partials/crmMailingAB.orig/two_emails.html
deleted file mode 100755 (executable)
index 615bdf0..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-<div ui-jq="tabs">
-
-<ul>
-  <li><a href="#tabs-21"><span>Email A</span></a></li>
-  <li><a href="#tabs-22"><span>Email B</span></a></li>
-</ul>
-
-<div id="tabs-21">
-    <table class="form-layout-compressed">
-      <tbody>
-      <tr>
-        <td class="abtesting-form-label label">From E-mail Address</td>
-        <td class="abtesting-form-element">
-          <select ng-model="mailA.from_email"
-                  ng-options="frm.email as frm.email for frm in eMailing" >
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Reply to E-mail Address</td>
-        <td  class="abtesting-form-element">
-          <select ng-model="mailA.replyto_email"
-                  ng-options="frm.email as frm.email for frm in eMailing">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Mailing Subject</td>
-        <td class="abtesting-form-element">
-          <input placeholder="Enter Subject" name="subject" id="twomaila" type="text" ng-model="mailA.subject" required>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Mailing Subject Token</td>
-        <td class="abtesting-form-element">
-          <input type="hidden" groupselect id= "subgrouptwoa">
-        </td>
-      </tr>
-
-      <tr>
-        <td class="label" style="color:red" ng-show="mailing_form.subject.$invalid">
-          Mailing subject required.
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Use Template</td>
-        <td class="abtesting-form-element">
-          <select ng-change="tmp(mailA.msg_template_id,1)" ng-model="mailA.msg_template_id"
-                  ng-options="mstemp.id as mstemp.msg_title for mstemp in tmpList">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      </tbody>
-    </table>
-
-    <br>
-
-    <div class="crm-accordion-wrapper ">
-      <div class="crm-accordion-wrapper ">
-        <div class="crm-accordion-header">HTML Format</div>
-        <div class="crm-accordion-body">
-          <br>
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          <input type="hidden" groupselect id= "htgroupcomposetwoa"  ></input><br><br>
-
-          &nbsp &nbsp &nbsp &nbsp
-          <textarea  ng-model="mailA.body_html" id="twomailabody_html" style="width: 600px; height: 300px;" required></textarea>
-          <br> <br>
-
-        </div>
-      </div>
-
-      <div class="crm-accordion-wrapper collapsed">
-        <div class="crm-accordion-header">Plain Text</div>
-        <div class="crm-accordion-body">
-          <br>
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          <input type="hidden" groupselect id= "textgroupcomposetwoa"  ></input><br><br>
-
-          &nbsp &nbsp &nbsp &nbsp
-          <textarea ng-model="mailA.body_text" id="twomailabody_text" style="width: 600px; height: 300px;"></textarea>
-          <br>
-        </div>
-      </div>
-
-      <table ng-show="false">
-        <tr>
-          <td>
-            <input type="checkbox">&nbsp Save Template</input>
-        </tr>
-      </table>
-
-    </div>
-
-    <div class="crm-accordion-wrapper collapsed">
-      <div class="crm-accordion-header">Header and Footer</div>
-      <div class="crm-accordion-body">
-        <table class="form-layout-compressed">
-          <tr>
-            <td class="abtesting-form-label label">Mailing Header</td>
-            <td class="abtesting-form-element">
-              <select ng-model="mailA.header_id" ng-options="hf.id as hf.name for hf in headerfooter| filter:isHeader">
-                <option value="">-none-</option>
-              </select>
-            </td>
-          </tr>
-          <tr>
-            <td class="abtesting-form-label label">Mailing Footer</td>
-            <td class="abtesting-form-element">
-              <select ng-model="mailA.footer_id" ng-options="f.id as f.name for f in headerfooter| filter:isFooter">
-                <option value="">-none-</option>
-              </select>
-            </td>
-          </tr>
-        </table>
-      </div>
-    </div>
-</div>
-
-<!-- ---------------------------------------- ######## ------------------------------------------  -->
-
-<div id="tabs-22">
-    <table class="form-layout-compressed">
-      <tbody>
-      <tr>
-        <td class="abtesting-form-label label">From E-mail Address</td>
-        <td class="abtesting-form-element">
-          <select ng-model="mailB.from_email"
-                  ng-options="frm.email as frm.email for frm in eMailing">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Reply to E-mail Address</td>
-        <td class="abtesting-form-element">
-          <select ng-model="mailB.replyto_email"
-                  ng-options="frm.email as frm.email for frm in eMailing">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Mailing Subject</td>
-        <td class="abtesting-form-element">
-          <input placeholder="Enter Subject" id = "twomailb" name="subject" type="text" ng-model="mailB.subject"/>
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Mailing Subject Token</td>
-        <td  class="abtesting-form-element">
-          <input type="hidden" groupselect id= "subgrouptwob">
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label" style="color:red" ng-show="mailing_form.subject.$invalid">
-          Mailing subject required.
-        </td>
-      </tr>
-      <tr>
-        <td class="abtesting-form-label label">Use Template</td>
-        <td class="abtesting-form-element">
-          <select ng-change="tmp(mailB.msg_template_id,2)" ng-model="mailB.msg_template_id"
-                  ng-options="mstemp.id as mstemp.msg_title for mstemp in tmpList">
-            <option value="">-none-</option>
-          </select>
-        </td>
-      </tr>
-      </tbody>
-    </table>
-    <br>
-
-    <div class="crm-accordion-wrapper ">
-      <div class="crm-accordion-wrapper ">
-        <div class="crm-accordion-header">HTML Format</div>
-        <div class="crm-accordion-body">
-          <br>
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          <input type="hidden" groupselect id= "htgroupcomposetwob"  ></input><br><br>
-          &nbsp &nbsp &nbsp &nbsp
-          <textarea id="twomailbbody_html"   ng-model="mailB.body_html" style="width: 600px; height: 300px;"></textarea>
-          <br> <br>
-        </div>
-      </div>
-
-      <div class="crm-accordion-wrapper collapsed">
-        <div class="crm-accordion-header">Plain Text</div>
-        <div class="crm-accordion-body">
-          <br>
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
-          <input type="hidden" groupselect id= "textgroupcomposetwob"  ></input><br><br>
-          &nbsp &nbsp &nbsp &nbsp
-          <textarea ng-model="mailB.body_text" id = "twomailbbody_text" style="width: 600px; height: 300px;"></textarea>
-          <br>
-        </div>
-      </div>
-
-      <table ng-show="false">
-        <tr>
-          <td>
-            <input type="checkbox">&nbsp Save Template</input>
-        </tr>
-      </table>
-    </div>
-
-    <div class="crm-accordion-wrapper collapsed">
-      <div class="crm-accordion-header">Header and Footer</div>
-      <div class="crm-accordion-body">
-        <body>
-        <table class="form-layout-compressed">
-          <tr>
-            <td class="abtesting-form-label label">Mailing Header</td>
-            <td class="abtesting-form-element">
-              <select ng-model="mailB.header_id" ng-options="hf.id as hf.name for hf in headerfooter| filter:isHeader">
-                <option value="">-none-</option>
-              </select>
-            </td>
-          </tr>
-          <tr>
-            <td class="abtesting-form-label label">Mailing Footer</td>
-            <td class="abtesting-form-element">
-              <select ng-model="mailB.footer_id" ng-options="f.id as f.name for f in headerfooter| filter:isFooter">
-                <option value="">-none-</option>
-              </select>
-            </td>
-          </tr>
-        </table>
-        </body>
-      </div>
-    </div>
-  </div>
-</div>
-</div>
-
-
-
diff --git a/partials/crmMailingAB.orig/uploadContent.html b/partials/crmMailingAB.orig/uploadContent.html
deleted file mode 100755 (executable)
index 0993f2c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<body>
-<table>
-    <tr>
-        <td class="label">Upload TEXT Message</td>
-        <td>
-            <input type="file"/>
-        </td>
-    </tr>
-    <tr>
-        <td class="label">Upload HTML Message</td>
-        <td>
-            <input type="file"/>
-        </td>
-    </tr>
-</table>
-
-</body>
\ No newline at end of file