Commit 74739e65 authored by almin.ljajic's avatar almin.ljajic

[FEATURE] Bannermanagement

git-svn-id: http://svn.t3o.typo3.org/extensions/projects/t3org/randombanners/trunk@1365 e8cb78a8-64f2-4011-8042-bd1ea5058d47
parent 0c1ef1f0
......@@ -8,7 +8,7 @@ plugin.tx_randombanners {
storagePid = {$plugin.tx_randombanners.persistence.storagePid}
}
settings {
numberOfBannersShown = 4
numberOfBannersShown = 6
}
}
......@@ -25,8 +25,8 @@ lib.navigation.sub.20 {
10.value = Platinum sponsors
10.wrap = <h4 class="h4">|</h4>
20 < lib.misc.bannerWidget
20.settings.numberOfBannersShown = 2
stdWrap.wrap = <div class="d">|</div>
20.settings.numberOfBannersShown = 10
stdWrap.wrap = <div class="d navigationbanners">|</div>
}
......
......@@ -14,7 +14,57 @@ $(document).ready(function() {
url: 'index.php?type=69&tx_randombanners_list[action]=list&tx_randombanners_list[controller]=Banner&tx_randombanners_list[numberOfBannersShown]=' + parseInt($('#randombannersNumber').html()),
success: function(html) {
$('#randombanners').append(html);
$(".d.navigationbanners .tx-randombanners-item").each(function(){
if($(this).index() > 1)
$(this).css("display","none");
});
$(".d.navigationbanners .tx-randombanners-item:eq(0), .d.navigationbanners .tx-randombanners-item:eq(1)").addClass("shown");
for(var bannerfields = 0; bannerfields < 3; bannerfields++)
$(".gc .tx-randombanners:eq(0)").clone().insertAfter(".tx-randombanners:eq(0)");
for(var bannerfields = 0; bannerfields < 4; bannerfields++){
if(bannerfields%2 != 0)
$(".gc .tx-randombanners:eq("+bannerfields+")").addClass("rightbanner");
$(".gc .tx-randombanners:eq("+bannerfields+")").children(".tx-randombanners-item").addClass("banner"+((bannerfields)));
}
$(".gc .tx-randombanners-item").each(function(){
$(this).css("display","none");
});
$(".gc .tx-randombanners:eq(0) .tx-randombanners-item:eq(0), .gc .tx-randombanners:eq(1) .tx-randombanners-item:eq(1), .gc .tx-randombanners:eq(2) .tx-randombanners-item:eq(2), .gc .tx-randombanners:eq(3) .tx-randombanners-item:eq(3)").addClass("shown").fadeIn("slow");
}
});
}
$(document).everyTime(5000,function(){
var first_shown = $(".d.navigationbanners #randombanners .shown:first").index(".tx-randombanners-item");
var last_shown = $(".d.navigationbanners #randombanners .shown:last").index(".tx-randombanners-item");
$(".d.navigationbanners #randombanners .shown").each(function(){
$(this).removeClass("shown").fadeOut("slow",function(){
if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == 0){
$(".d.navigationbanners .tx-randombanners-item:eq(1), .d.navigationbanners .tx-randombanners-item:eq(2)").fadeIn("5000").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:eq(0), .d.navigationbanners .tx-randombanners-item:last").fadeIn("5000").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:first, .d.navigationbanners .tx-randombanners-item:eq(1)").fadeIn("slow").addClass("shown");
}
else{
$(".d.navigationbanners .tx-randombanners-item:eq("+(last_shown+1)+"), .d.navigationbanners .tx-randombanners-item:eq("+(last_shown+2)+")").fadeIn("slow").addClass("shown");
}
});
});
$(".gc .tx-randombanners-item.shown").each(function(){
var shown_index = $(this).index();
var last_shown2 = $(this).index(".banner"+(shown_index));
$(this).removeClass("shown").fadeOut("slow",function(){
if(last_shown2 == $(".banner"+(shown_index)).length-1)
$(".banner"+(shown_index)+":first").fadeIn("slow").addClass("shown");
else
$(".banner"+(shown_index)+":eq("+((last_shown2)+(1))+")").fadeIn("slow").addClass("shown");
});
});
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment