/* YOU CAN CHANGE THESE VARIABLES */
var offerImage = "https://i.hizliresim.com/k1qba6.png";
/* BUT PLEASE DON'T CHANGE THESE */
var offerIndex = 0;
// How many Offers are shown per page?
var offersPerPage = parseInt(useLockerSettings['offers']['display']);
var shownOffers = parseInt(useLockerSettings['offers']['display']);
$(document).ready(function() {
$('#my-locker-body-offers-list a').attr('rel', 'nofollow');
var index = 0;
var stars = [4.5, 4.5, 4.5, 4, 4, 3.5, 3.5, 3, 3, 3, 2.5, 2.5];
$('#best-apps').remove();
$('#my-locker-body-offers-list a').each(function() {
var offer = useOffers[index];
var starList = [];
var hasStars = stars[index];
for(var i = 1; i <= 5; i++) {
if (hasStars >= i) {
starList.push('');
}
else if (i - 0.5 == hasStars) {
starList.push('');
}
else {
starList.push('');
}
}
var text = $('span', this).text();
// What image should be used?
var useImage = ('network_icon' in offer && offer.network_icon.length > 0 ? offer.network_icon : offerImage);
$(this)
.html('' +
'' +
'' +
'' +
' BAŞLIK ' +
'' +
'En iyler ' +
'Hediye ' +
'' +
'');
index++;
});
var $footing = $('#my-locker-bottom');
$('#loading-bar', $footing).remove();
$('').insertBefore($('span', $footing));
var $bottom = $('.my-locker-body-text-bottom');
$bottom.insertBefore('#my-locker-body-offers-list');
// When the Show More Pages button is pressed.
$('#show-more').on('click', function() {
$('#my-locker-body-offers-list a').addClass('hidden');
// If we've shown the maximum amount of offers, restart.
if (shownOffers >= 10) {
shownOffers = 0;
}
for(var i = 0; i < offersPerPage; i++) {
$('#my-locker-body-offers-list a:eq('+(i + shownOffers)+')').removeClass('hidden');
}
shownOffers += offersPerPage;
});
});