Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. if ((location.href.indexOf('sushi-lover.ru/trening_writing/')==-1) && location.href.indexOf(('/coupon/')==-1)) {
  2. $(function() {
  3. var fnInjectEvent = function(sSelector, sKey, sOp) {
  4. $(document).on('blur', sSelector, function() {
  5. //console.log(sSelector, this.value);
  6. carrotquest.identify([
  7. {
  8. op: sOp ? sOp : 'update_or_create',
  9. key: sKey,
  10. value: this.value
  11. }
  12. ]);
  13. });
  14. };
  15.  
  16. var snames = [
  17. 'form input#NAME',
  18. 'input#cname',
  19. 'input[name*="Èìÿ"]',
  20. 'input[name*="name"]',
  21. 'input[name*="uName"]',
  22. 'input[name*="user_name"]'
  23. ],
  24. sphones = [
  25. 'form input#PHONE',
  26. 'input#cphone',
  27. 'input[name*="Òåëåôîí"]',
  28. 'input[name*="phone"]',
  29. 'input[name*="uPhone"]'
  30. ],
  31. semails = [
  32. 'form input#EMAIL',
  33. 'input#cemail',
  34. 'input[name*="Ïî÷òà "]',
  35. 'input[name*="mail"]',
  36. 'input[name*="uEmail"]',
  37. 'input[name*="email"]'
  38. ],
  39. stext = [
  40. 'input#ccmnt',
  41. //'textarea[name*="mess"]',
  42. //'textarea[name*="descr"]'
  43. 'textarea'
  44. ];
  45.  
  46. fnInjectEvent(snames.join(','), '$name');
  47. fnInjectEvent(sphones.join(','), '$phone');
  48. fnInjectEvent(semails.join(','), '$email');
  49. fnInjectEvent(stext.join(','), 'text');
  50.  
  51. //console.log('debug: carrot events hook injected');
  52. });
  53.  
  54. (function() {
  55. init()
  56. function init() {
  57. setTimeout(addMouseout, 5000);
  58. }
  59. function addMouseout() {
  60. document.addEventListener('mouseout', mouseout);
  61. }
  62. function mouseout(e) {
  63. if (Math.round(e.x) >= 0 && Math.round(e.y) <= 0) {
  64. carrotquest.track('Ïîïûòêà óõîäà ñ ñà éòà ');
  65. deleteEvent();
  66. setTimeout(addMouseout, 10000);
  67. }
  68. }
  69. function deleteEvent() {
  70. document.removeEventListener('mouseout', mouseout);
  71. }
  72. }
  73. }());
  74. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement