removing ng-pendo from UI packaging

because Pendo pushed the updated ng-pendo to their server for delaying the bootstraping of pa.min.js
This commit is contained in:
Jared Tabor 2015-10-12 09:54:08 -07:00
parent 484a33f9c6
commit 414b8292ab
2 changed files with 1 additions and 131 deletions

View File

@ -1,129 +0,0 @@
/*
* pendo.io Angular Module
*
* (c) 2013 pendo.io
*/
(function(angular) {
'use strict';
var ap = {};
ap.waitForPendo = function(delay, registerFn) {
var waitFn = function() { ap.waitForPendo( delay, registerFn); };
if (ap.disabled) {
ap.afterReenable = waitFn;
return;
}
if(window.hasOwnProperty('pendo') && window.pendo.initialize) {
registerFn(pendo);
} else {
setTimeout(waitFn, delay);
}
};
angular.module('pendolytics', [])
.provider('$pendolytics', function() {
var eventCache = [];
var service = {};
var serviceImpl = {
pageLoad: function() {
eventCache.push( {method: 'pageLoad', args: [] });
},
identify: function( newName, accountId, props ) {
var saveMe = { method: 'identify', args: [ newName, accountId, props ] };
eventCache.push(saveMe);
},
updateOptions: function( obj ) {
eventCache.push({ method: 'updateOptions', args: [obj]});
},
/*
* This will allow for initalizing the Agent asynchronously
* with an API key that is set after the agent has been set.
*/
initialize: function(options) {
eventCache.unshift({
method: 'initialize',
args: [options]
});
}
};
service.pageLoad = function() {
serviceImpl.pageLoad();
};
service.load = function() {
pendo.log("PENDO LOADED!!!");
serviceImpl = pendo;
// Flush the cache
angular.forEach(eventCache, function(item) {
pendo[item.method].apply(pendo, item.args);
});
};
service.identify = function(newName, accountId, props){
serviceImpl.identify(newName, accountId, props);
};
service.updateOptions = function(json_obj) {
serviceImpl.updateOptions(json_obj);
};
service.initialize = function(options){
serviceImpl.initialize(options);
};
service.enable = function(){
if (ap.disabled) {
ap.disabled = false;
ap.afterReenable();
}
};
service.disable = function(){
ap.disabled = true;
};
service.bootstrap = function() {
if (!service.bootstrapped) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = ('https:' === document.location.protocol ? 'https://' : 'http://' ) + 'd3accju1t3mngt.cloudfront.net/js/pa.min.js';
var firstScript = document.getElementsByTagName('script')[0];
firstScript.parentNode.insertBefore(script, firstScript);
service.bootstrapped = true;
}
};
return {
$get: function(){ return service; },
doNotAutoStart: function() {
service.doNotAutoStart = true;
}
};
}).run(['$rootScope', '$pendolytics', function($rootScope, $pendolytics) {
if (!$pendolytics.doNotAutoStart) {
$pendolytics.bootstrap();
}
ap.waitForPendo( 500, function( p ) {
$pendolytics.load();
$rootScope.$on('$locationChangeSuccess', function() {
$pendolytics.pageLoad();
});
});
}]);
})(angular);

View File

@ -26,8 +26,7 @@
<script src="{{ STATIC_URL }}tower.concat.js?v={{version}}"></script>
<!-- <script src="//d3accju1t3mngt.cloudfront.net/js/angular/ng-pendo.js"></script> -->
<script src='{{ STATIC_URL }}lib/ng-pendo.js'></script>
<script src="//d3accju1t3mngt.cloudfront.net/js/angular/ng-pendo.js"></script>
<script>
window.pendo_options = {