Breaking News

US information — RT Worldwide

0 0

len) throw new RangeError(“getRandom: extra components taken than accessible”); whereas (n–) { var x = Math.flooring(Math.random() * len); consequence[n] = arr[x in taken ? taken[x] : x]; taken[x] = –len in taken ? taken[len] : len; } return consequence; }; var shuffle = perform(array) { var currentIndex = array.size, temporaryValue, randomIndex; // Whereas there stay components to shuffle… whereas (0 !== currentIndex) { // Decide a remaining component… randomIndex = Math.flooring(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the present component. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; }; var appendHtml = perform() { if (!objects.size) { return; } var html = ‘

    ‘; for (var merchandise in objects) { html += ‘

  • ‘ + ” + (objects[item].cowl ? ‘]]>

‘ : ” )+ ‘

‘ + objects[item].title + ‘

‘ + ” + ” + ” } html += ”; bestcrosslinks.innerHTML += html; }; var getData = perform() { ajax(‘/widget/bestcrosslinks/json’, perform (response) { if (response) { strive { var docs = JSON.parse(response).docs; docs = shuffle(docs); objects = docs.size >= countOnPage ? getRandom(docs, countOnPage) : docs; appendHtml(); } catch (e) {console.log(‘Error parse information: ‘, e);} } }) }; var init = perform() { content material = doc.getElementsByClassName(“static-66_high-100”); aspect = doc.getElementsByClassName(“static-33_high-100”); if (!content material.size || !aspect.size) { return; } contentOffsetHeight = content material[0].offsetHeight; sideOffsetHeight = aspect[0].offsetHeight; var res = contentOffsetHeight – sideOffsetHeight; if (res > 0) { countOnPage = Math.flooring(res / 280); countOnPage = countOnPage 10 ? 10 : countOnPage; } getData(); }; doc.addEventListener(“DOMContentLoaded”, perform() { setTimeout(init, 2000); }); var moreButton = doc.querySelector(‘.js-listing__more’); moreButton.addEventListener(‘click on’, perform () { ajax(‘/widget/bestcrosslinks/json’, perform (response) { if (response) { strive { var docs = JSON.parse(response).docs; docs = shuffle(docs); objects = docs.size >= 3 ? getRandom(docs, 3) : docs; appendHtml(); } catch (e) {console.log(‘Error parse information: ‘, e);} } }) }); })(); isJqueryInit(perform() { $(perform () { var interval = setInterval(perform () { var $hyperlinks = $(‘#bestcrosslinks’).discover(‘a.bestcrosslinks__link[href]’); if ($hyperlinks.is(‘a’)) { clearInterval(interval); $hyperlinks.on(‘click on’, perform (e) { e.preventDefault(); var hyperlink = $(this).attr(‘href’); ga(‘ship’, ‘occasion’, ‘Popular_widget’, ‘Click on’, hyperlink); setTimeout(perform () { window.location.href = hyperlink; }, 300); }); return null; } return null; }, 300); }); });

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *