Last active
August 13, 2018 14:12
-
-
Save zlatkov/1df3817b92f86eb388f71aaf4c4af32d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(a,b){var c=window;c.SessionStack=a,c[a]=c[a]||function(){ | |
c[a].q=c[a].q||[],c[a].q.push(arguments)},c[a].t=b;var d=document.createElement("script"); | |
d.async=1,d.src="http://testing.sessionstack.com/recorder/sessionstack.js"; | |
var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(d,e); | |
}("sessionstack","c7d8c183c89045b28a174df444bf0a2c"); | |
// !function(a,b){var c=window;c.SessionStack=a,c[a]=c[a]||function(){ | |
// c[a].q=c[a].q||[],c[a].q.push(arguments)},c[a].t=b;var d=document.createElement("script"); | |
// d.async=1,d.src="https://staging.sessionstack.com/recorder/sessionstack.js"; | |
// var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(d,e); | |
// }("sessionstack","b37d602def8149f8a70b6427a972f76c"); | |
var userData = [ | |
{ | |
name: 'Rachal Johnson', | |
email: '[email protected]', | |
id: '243', | |
plan: '$349 per month' | |
}, | |
{ | |
name: 'Tim Roberts', | |
email: '[email protected]', | |
id: '458', | |
plan: '$149 per month' | |
}, | |
{ | |
name: 'James Smith', | |
email: '[email protected]', | |
id: '763', | |
plan: '$99 per month' | |
}, | |
{ | |
name: 'Maria Rodriguez', | |
email: '[email protected]', | |
id: '1323', | |
plan: '$599 per month' | |
}, | |
{ | |
name: 'David Robionson', | |
email: '[email protected]', | |
id: '4322', | |
plan: '$99 per month' | |
} | |
]; | |
var userIndex = Math.floor(Math.random() * userData.length); | |
var user = userData[userIndex]; | |
sessionstack('identify', { | |
userId: user.id, // Replace the USER-ID with the user id from your app | |
email: user.email, // Not required | |
displayName: user.name, // Not required | |
// Add your own custom user variables here. | |
role: 'user', | |
pricingPlan: user.plan | |
}); | |
var script = document.createElement("SCRIPT"); | |
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; | |
script.type = 'text/javascript'; | |
script.onload = function() { | |
var $ = window.jQuery; | |
$(document).on('click', '.x-btn.x-box-item.x-toolbar-item.x-btn-soft-green-small', function(){ | |
console.log('Send email'); | |
sendEmail(); | |
}); | |
$(document).on('click', 'table', function(){ | |
console.debug('Opening conversation...'); | |
console.error('GET https://app.example.com/api/conversations/122 500 (INTERNAL SERVERER ERROR)') | |
}); | |
$(document).on('click', '#button-1091-btnInnerEl', function() { | |
saveMessage(); | |
}) | |
function saveMessage() { | |
var messageLength = messageContent.length; | |
} | |
function sendEmail() { | |
processMessage(); | |
} | |
function processMessage() { | |
prepareAttachments(); | |
} | |
function prepareAttachments() { | |
console.warn('Invalid keyword warning') | |
filterKeywords(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment