Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
raygun
Browse files Browse the repository at this point in the history
  • Loading branch information
LtSquigs committed Feb 3, 2015
1 parent 1c0baeb commit 1183a66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
41 changes: 14 additions & 27 deletions app/initializers/tracker.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,39 @@
// By adding track.js via javascript we can control it better.
export default {
name: 'trackjs',
name: 'raygun',

initialize: function (container, application) {

// Clear out the old embedded version linked to from index.html
window.trackJs = null;
window.Raygun = null;

// Track hosted errors only
if (window.ENV.isDevelopment || window.ENV.selfHosted) {
/*if (window.ENV.isDevelopment || window.ENV.selfHosted) {
return;
}

// Figure out path to static assets
var trackerPath = (function () {
var links = document.getElementsByTagName('link'),
leafletRe = /[\/^]app[\-\._]?([\w\-\._]*)\.css\??/;

var i, len, href, matches, path;

for (i = 0, len = links.length; i < len; i++) {
href = links[i].href;
matches = href.match(leafletRe);

if (matches) {
path = href.split(leafletRe)[0];
return (path ? path + '/' : '') + 'javascript/tracker.js';
}
}
}());
}*/

application.deferReadiness();

window._trackJs = {
token: '2ec590caf8d5471a9514fd30e698cea6'
};

(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.crossOrigin = true;
script.onload = function(){
if(window.Raygun) {
Raygun.init('wsX+OdSk4B61TUjygEwg1Q==', {
allowInsecureSubmissions: true,
ignoreAjaxAbort: true,
ignore3rdPartyErrors: false,
wrapAsynchronousCallbacks: true
}).attach();
}
application.advanceReadiness();
};
script.onerror = function(){
application.advanceReadiness();
};
script.src = trackerPath;
script.src = 'http://cdn.raygun.io/raygun4js/raygun.min.js';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));

Expand Down
7 changes: 7 additions & 0 deletions app/views/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default Ember.View.extend({
didInsertElement: function () {
if(window.Raygun) {
window.Raygun.send(this.controller.model);
}
},
});

0 comments on commit 1183a66

Please sign in to comment.