Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. (function() {
  2.  
  3. var func = 'trace_id' + Math.floor(Math.random() * 9999999999);
  4.  
  5. ref = document.getElementsByTagName('script');
  6. for (i = 0, len = ref.length; i < len; i++) {
  7. script = ref[i];
  8. src = script.getAttribute('src');
  9. if (src) {
  10. matches = src.match(/promo_id=1655/);
  11. }
  12.  
  13. if (src && !script.getAttribute('script-initialized') && matches) {
  14.  
  15. function getParams() {
  16. var params = {};
  17. script.src.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
  18. params[key] = value;
  19. });
  20. return params;
  21. }
  22.  
  23. var widget_src = src;
  24. script.setAttribute('script-initialized', true);
  25. var url_params = getParams();
  26. widget_wrapper = document.createElement("div");
  27. widget_wrapper.id = "tuturu_widget_wrapper"+ func;
  28. script.parentElement.insertBefore(widget_wrapper, script);
  29.  
  30. var js = document.createElement('script');
  31. js.id = func + 'script';
  32. js.type = "text/javascript";
  33. js.charset = "utf-8";
  34. js.dataset.uxie = "true";
  35. js.setAttribute("role", "uxie_widget");
  36. js.src = '//www.travelpayouts.com/uxie_tutu/widget.js?data-uxie=true'+
  37. '&color_scheme='+ (!url_params["color_scheme"] ? 'bright' : decodeURIComponent(url_params["color_scheme"])) +
  38. '&logo='+ (url_params["logo"] === 'false') +
  39. '&shmarker='+ (!url_params["shmarker"] ? '11501' : decodeURIComponent(url_params["shmarker"])) +
  40. '&origin='+ (!url_params["origin"] ? '' : decodeURIComponent(url_params["origin"])) +
  41. '&destination='+ (!url_params["destination"] ? '' : decodeURIComponent(url_params["destination"])) +
  42. (url_params["tborder"] === 'true' ? '&transp_border=true' : '') +
  43. '&border_radius='+ (!url_params["border_radius"] ? '0px' : decodeURIComponent(url_params["border_radius"]));
  44. script.parentNode.insertBefore(js, script);
  45.  
  46. break;
  47.  
  48. }
  49.  
  50. }
  51.  
  52. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement