var pkey = 'd009b9d1e8643c5a7e59bb467c9d7b81'; document.cookie = "mostwords=" + JSON.stringify({"12794":{"id":"12794","word":"\u0440\u0430\u0431\u043e\u043b\u0435\u043f\u0438\u0435","total_words":"19321","date_synchronization":"1667053086"},"13562":{"id":"13562","word":"\u0441\u0442\u0430\u0434\u0438\u043e\u043d","total_words":"19321","date_synchronization":"1667053086"},"567":{"id":"567","word":"\u0561\u0576\u0578\u0582\u0577","total_words":"19321","date_synchronization":"1667053086"},"566":{"id":"566","word":"\u0561\u0576\u0578\u0582\u0576","total_words":"19321","date_synchronization":"1667053086"},"12795":{"id":"12795","word":"\u0440\u0430\u0431\u043e\u0442\u0430","total_words":"19321","date_synchronization":"1667053086"}}); function read_cookie(k){return(document.cookie.match('(^|; )'+k+'=([^;]*)')||0)[2]}; var r = read_cookie("mostwords"); if(!window.jQuery) { var script = document.createElement('script'); script.type = "text/javascript"; script.src = "https://code.jquery.com/jquery-3.2.1.min.js"; document.getElementsByTagName('head')[0].appendChild(script); script.onload = initLoad(); } else { initLoad();} function initLoad(){ document.write('
'); /* var script = document.createElement('script'); script.type = "text/javascript"; script.src = "https://pararan.hy-bg.net/pararanapi/themes/assets/js/typeahead.js"; document.getElementsByTagName('head')[1].appendChild(script); */ document.write(''); $("#dg6div").load("https://pararan.hy-bg.net/pararanapi/index.php?pkey="+pkey, function(){loadJS();}); } function loadJS(){ var scripts = [ "https://code.jquery.com/ui/1.12.1/jquery-ui.js", /*"https://pararan.hy-bg.net/pararanapi/themes/assets/js/typeahead.js", "https://pararan.hy-bg.net/pararanapi/themes/assets/js/main.js",*/ "https://pararan.hy-bg.net/pararanapi/themes/assets/js/keyboard.js" ]; scripts.forEach(function(s){ var s0 = document.createElement('script'); s0.src = s; s0.type = "application/javascript"; s0.setAttribute('charset', 'UTF-8'); document.body.appendChild(s0); }); makeDraggable(); lastRequest() eval('$.ajax({type:"POST",dataType:"html",url:"https://pararan.hy-bg.net/pararanapi/index.php?action=mostRequested&pkey="+pkey,data:{cookie:r},success:function(data){$("#dg5most").html(data)}})'); $(document).on('click', function() { $('.tt-dropdown-menu').css('display', 'none'); }); $(document).on('click','.link-mostly-used',function(){ saveSearches($(this).data("id"), $(this).data("word")); wordsList($(this).data("id")); lastRequest(); }); document.getElementById("main-input").addEventListener("input", function() { if (/^[а-яА-Я]+$/.test(this.value)) { $("#main-input").css("font-family", "main_font"); } else if (!$(this).val()){ $("#main-input").css("font-family", "main_font"); } else { $("#main-input").css("font-family", "Cuprum"); } }); $('#main-input').blur(); $('.dg5inp').typeahead({ hint: false, highlight: false, autoselect: true, minLength: 2 }, { displayKey: 'value', name: 'word', source: function(e, process) { return $.getJSON('https://pararan.hy-bg.net/pararanapi/index.php?action=autocomplete', { query: e, pkey: pkey }, function(data) { return process(data); }); }, }).bind('typeahead:selected', function(obj, datum, name) { saveSearches(datum.id, datum.value); wordsList(datum.id); lastRequest(); }); /* $.ajax({ type: "POST", dataType: "html", url: "https://pararan.hy-bg.net/pararanapi/index.php?action=mostRequested&pkey="+pkey, data: {cookie: r}, success: function(data) { $("#dg5most").html(data); } });*/ } /* Words searching history starts here */ var par = read_cookie("last_words"); if(par) { var words = JSON.parse(par); } else { var words = []; } function saveSearches(id, word) { var exists = false; var length = words.length for(i=0; i<=length; i++) { if($.inArray(id, words[i]) != -1) { exists = true } if(i==10) { words.shift(); } } if(!exists) {words.push([id, word]); } var date = new Date(); var days = 30; date.setTime(date.getTime()+(days*24*60*60*1000)); /* var expires = "; expires="+date.toGMTString();*/ document.cookie = "last_words=" + JSON.stringify(words); } /* Words searching history ends here */ function wordsList(word_id){ $.ajax({ type: "POST", dataType: "html", url: 'https://pararan.hy-bg.net/pararanapi/index.php?action=display', data: {id: word_id, pkey:pkey}, success: function(data) { $('#dg5div').html(data); } }); } function lastRequest() { var z = read_cookie("last_words"); $.ajax({ type: "POST", dataType: "html", url: 'https://pararan.hy-bg.net/pararanapi/index.php?action=searches&pkey='+pkey, data: {ckie: z}, success: function(data) { $('#dg5last').html(data); } }); } function makeDraggable(){ $("#keyboardInputMaster").draggable({ handle: "tr:first", }); }