1(function( $ ) { 2 3 $.fn.breakingNews = function(params){ 4 5 var defaults={ 6 width :'100%', 7 modul :'breakingnews', 8 color :'default', 9 border :false, 10 effect :'fade', 11 fontstyle :'normal', 12 autoplay :false, 13 timer :4000, 14 feed :false, 15 feedlabels :false, 16 feedcount :5 17 }; 18 var feeds=[]; 19 var labels=[]; 20 var params=$.extend(defaults,params); 21 22 return this.each(function(){ 23 //Variables------------------------------------ 24 params.modul=$("#"+$(this).attr("id")); 25 var timername=params.modul; 26 var active=0; 27 var previous=0; 28 var count=params.modul.find("ul li").length; 29 var changestate=true; 30 31 if (params.feed!=false) 32 { 33 //nothing 34 } 35 else 36 { 37 params.modul.find("ul li").eq(active).fadeIn(); 38 } 39 resizeEvent(); 40 41 if (params.autoplay) 42 { 43 timername=setInterval(function(){autoPlay()},params.timer); 44 $(params.modul).on("mouseenter",function (){ 45 clearInterval(timername); 46 }); 47 48 $(params.modul).on("mouseleave",function (){ 49 timername=setInterval(function(){autoPlay()},params.timer); 50 }); 51 } 52 else 53 { 54 clearInterval(timername); 55 } 56 57 if (!params.border) 58 { 59 params.modul.addClass("bn-bordernone"); 60 } 61 62 if (params.fontstyle=="italic") 63 params.modul.addClass("bn-italic"); 64 65 if (params.fontstyle=="bold") 66 params.modul.addClass("bn-bold"); 67 68 if (params.fontstyle=="bold-italic") 69 params.modul.addClass("bn-bold bn-italic"); 70 71 params.modul.addClass("bn-"+params.color); 72 73 //Events--------------------------------------- 74 $(window).on("resize",function (){ 75 resizeEvent(); 76 }); 77 78 params.modul.find(".bn-navi span").on("click",function(){ 79 if (changestate) 80 { 81 changestate=false; 82 if ($(this).index()==0) 83 { 84 active--; 85 if (active<0) 86 active=count-1; 87 88 changeNews(); 89 } 90 else 91 { 92 active++; 93 if (active==count) 94 active=0; 95 96 changeNews(); 97 } 98 } 99 }); 100 101 //functions------------------------------------ 102 function resizeEvent() 103 { 104 if (params.modul.width()<480) 105 { 106 params.modul.find(".bn-title h2").css({"display":"none"}); 107 params.modul.find(".bn-title").css({"width":10}); 108 params.modul.find("ul").css({"left":30}); 109 } 110 else 111 { 112 params.modul.find(".bn-title h2").css({"display":"inline-block"}); 113 params.modul.find(".bn-title").css({"width":"auto"}); 114 params.modul.find("ul").css({"left":$(params.modul).find(".bn-title").width()+30}); 115 } 116 } 117 118 function autoPlay() 119 { 120 active++; 121 if (active==count) 122 active=0; 123 124 changeNews(); 125 } 126 127 function changeNews() 128 { 129 if (params.effect=="fade") 130 { 131 params.modul.find("ul li").css({"display":"none"}); 132 params.modul.find("ul li").eq(active).fadeIn("normal",function (){ 133 changestate=true; 134 }); 135 } 136 else if (params.effect=="slide-h") 137 { 138 params.modul.find("ul li").eq(previous).animate({width:0},function(){ 139 $(this).css({"display":"none","width":"100%"}); 140 params.modul.find("ul li").eq(active).css({"width":0,"dis
140play":"block"}); 141 params.modul.find("ul li").eq(active).animate({width:"100%"},function(){ 142 changestate=true; 143 previous=active; 144 }); 145 }); 146 } 147 else if (params.effect=="slide-v") 148 { 149 if (previous<=active) 150 { 151 params.modul.find("ul li").eq(previous).animate({top:-60}); 152 params.modul.find("ul li").eq(active).css({top:60,"display":"block"}); 153 params.modul.find("ul li").eq(active).animate({top:0},function(){ 154 previous=active; 155 changestate=true; 156 }); 157 } 158 else 159 { 160 params.modul.find("ul li").eq(previous).animate({top:60}); 161 params.modul.find("ul li").eq(active).css({top:-60,"display":"block"}); 162 params.modul.find("ul li").eq(active).animate({top:0},function(){ 163 previous=active; 164 changestate=true; 165 }); 166 } 167 } 168 } 169 170 171 172 }); 173 174 175 }; 176 177 178})( jQuery ); 179 180
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.