1(function (window) { 2 3if (!!window.JCCatalogTopBannerList) 4 return; 5 6window.JCCatalogTopBannerList = function (arParams) 7{ 8 this.params = null; 9 this.prevIndex = -1; 10 this.currentIndex = 0; 11 this.size = 0; 12 this.rotate = false; 13 this.rotateTimer = 30000; 14 this.rotatePause = false; 15 this.errorCode = 0; 16 17 this.slider = { 18 cont: null, 19 row: null, 20 items: null, 21 arrows: null, 22 left: null, 23 right: null, 24 pagination: null, 25 pages: null 26 }; 27 28 if (!arParams || 'object' != typeof(arParams)) 29 { 30 this.errorCode = -1; 31 } 32 if (0 === this.errorCode) 33 { 34 this.params = arParams; 35 } 36 if (!!this.params.rotate) 37 this.rotate = this.params.rotate; 38 if (!!this.params.rotateTimer) 39 { 40 this.params.rotateTimer = parseInt(this.params.rotateTimer); 41 if (!isNaN(this.params.rotateTimer) && 0 <= this.params.rotateTimer) 42 this.rotateTimer = this.params.rotateTimer; 43 } 44 45 if (0 === this.errorCode) 46 { 47 BX.ready(BX.delegate(this.Init,this)); 48 } 49}; 50 51window.JCCatalogTopBannerList.prototype.Init = function() 52{ 53 if (0 > this.errorCode) 54 return; 55 56 var i = 0; 57 if (!!this.params.cont) 58 { 59 this.slider.cont = BX(this.params.cont); 60 } 61 if (!!this.params.items && BX.type.isArray(this.params.items)) 62 { 63 this.slider.items = []; 64 for (i = 0; i < this.params.items.length; i++) 65 { 66 this.slider.items[this.slider.items.length] = BX(this.params.items[i]); 67 this.slider.items[this.slider.items.length-1].style.opacity = 0; 68 if (!this.slider.row) 69 this.slider.row = this.slider.items[this.slider.items.length-1].parentNode; 70 } 71 this.slider.items[0].style.opacity = 1; 72 this.size = this.slider.items.length; 73 } 74 75 if (!!this.params.arrows) 76 { 77 if (BX.type.isDomNode(this.params.arrows)) 78 this.slider.arrows = this.params.arrows; 79 else if ('object' == typeof(this.params.arrows)) 80 this.slider.arrows = this.slider.cont.appendChild(BX.create( 81 'DIV', 82 { 83 props: { 84 id: this.params.arrows.id, 85 className: this.params.arrows.className 86 } 87 } 88 )); 89 else if (BX.type.isNotEmptyString(this.params.arrows)) 90 this.slider.arrows = BX(this.params.arrows); 91 } 92 if (!this.slider.arrows) 93 { 94 this.slider.arrows = this.slider.cont; 95 } 96 if (!!this.params.left) 97 { 98 if (BX.type.isDomNode(this.params.left)) 99 this.slider.left = this.params.left; 100 else if ('object' == typeof(this.params.left)) 101 this.slider.left = this.slider.arrows.appendChild(BX.create( 102 'DIV', 103 { 104 props: { 105 id: this.params.left.id, 106 className: this.params.left.className 107 } 108 } 109 )); 110 else if (BX.type.isNotEmptyString(this.params.left)) 111 this.slider.left = BX(this.params.left); 112 } 113 if (!!this.params.right) 114 { 115 if (BX.type.isDomNode(this.params.right)) 116 this.slider.right = this.params.right; 117 else if ('object' == typeof(this.params.right)) 118 this.slider.right = this.slider.arrows.appendChild(BX.create( 119 'DIV', 120 { 121 props: { 122 id: this.params.right.id, 123 className: this.params.right.className 124 } 125 } 126 )); 127 else if (BX.type.isNotEmptyString(this.params.right)) 128 this.slider.right = BX(this.params.right); 129 } 130 if (!!this.params.pagination) 131 { 132 if (BX.type.isDomNode(this.params.pagination)) 133 this.slider.pagination = this.params.pagination; 134 else if ('object' == typeof(this.params.pagination)) 135 this.slider.pagination = this.slider.cont.appendChild(BX.create( 136 'UL', 137 { 138 props: { 139 id: this.params.pagination.id, 140 className: this.params.pagination.className 141 } 142 } 143 )); 144 else if (BX.type.isNotEmptyString(this.params.pagination)) 145 this.slider.pagination = BX(this.params.pagination); 146 } 147 if (!!this.slider.pagination) 148 { 149 this.slider.pages = []; 150 for (i = 0; i < this.slider.items.length; i++) 151 { 152 this.slider.pages[this.slider.pages.length] = this.slider.pagination.appendChild(BX.create( 153 'LI', 154 { 155 props: { 156 className: (0 === i ? 'active' : '') 157 }, 158 attrs: { 159 'data-pagevalue': i.toString() 160 }, 161 events: { 162 'click': BX.delegate(this.RowMove, this) 163 }, 164 html: '<span></span>' 165 } 166 )); 167 } 168 } 169 170 if (0 === this.errorCode) 171 { 172 if (this.rotate && !!this.slider.cont && 0 < this.rotateTimer) 173 { 174 BX.bind(this.slider.cont, 'mouseover', BX.delegate(this.RotateStop, this)); 175 BX.bind(this.slider.cont, 'mouseout', BX.delegate(this.RotateStart, this)); 176 setTimeout(BX.delegate(this.RowRotate, this), this.rotateTimer); 177 } 178 if (!!this.slider.left) 179 { 180 BX.bind(this.slider.left, 'click', BX.delegate(this.RowLeft, this)); 181 } 182 if (!!this.slider.right) 183 { 184 BX.bind(this.slider.right, 'click', BX.delegate(this.RowRight, this)); 185 } 186 } 187}; 188 189window.JCCatalogTopBannerList.prototype.RowStart = function() 190{ 191 if (0 > this.errorCode) 192 return; 193 BX.removeClass(this.slider.items[this.prevIndex], 'active'); 194 BX.removeClass(this.slider.pages[this.prevIndex], 'active'); 195}; 196 197window.JCCatalogTopBannerList.prototype.RowAnimate = function(state) 198{ 199 if (0 > this.errorCode) 200 return; 201 this.slider.items[this.prevIndex].style.opacity = (100 - state.opacity)/100; 202 this.slider.items[this.currentIndex].style.opacity = state.opacity/100; 203}; 204 205window.JCCatalogTopBannerList.prototype.RowComplete = function() 206{ 207 if (0 > this.errorCode) 208 return; 209 BX.addClass(this.slider.items[this.currentIndex], 'active'); 210 BX.addClass(this.slider.pages[this.currentIndex], 'active'); 211}; 212 213window.JCCatalogTopBannerList.prototype.RowLeft = function() 214{ 215 if (0 > this.errorCode) 216 return; 217 this.prevIndex = this.currentIndex; 218 this.currentIndex = (0 === this.currentIndex ? this.size : this.currentIndex)-1; 219 new BX.easing({ 220 duration : 800, 221 start : { left : -this.prevIndex*100 }, 222 finish : { left : -this.currentIndex*100 }, 223 transition : BX.easing.transitions.quart, 224 step : BX.delegate(function(state){ 225 this.slider.row.style.left = state.left+'%'; 226 }, this) 227 }).animate(); 228 this.RowStart(); 229 new BX.easing({ 230 duration : 1200, 231 start : { opacity : 0 }, 232 finish : { opacity : 100 }, 233 transition : BX.easing.transitions.quart, 234 step : BX.delegate(function(state) {this.RowAnimate(state); }, this), 235 complete: BX.delegate(this.RowComplete, this) 236 }).animate(); 237}; 238 239window.JCCatalogTopBannerList.prototype.RowRight = function() 240{ 241 if (0 > this.errorCode) 242 return; 243 this.prevIndex = this.currentIndex; 244 this.currentIndex++; 245 if (this.currentIndex == this.size) 246 this.currentIndex = 0; 247 new BX.easing({ 248 duration : 800, 249 start : { left : -this.prevIndex*100 }, 250 finish : { left : -this.currentIndex*100 }, 251 transition : BX.easing.transitions.quart, 252 step : BX.delegate(function(state){ 253 this.slider.row.style.left = state.left+'%'; 254 }, this) 255 }).animate(); 256 this.RowStart(); 257 new BX.easing({ 258 duration : 1200, 259 start : { opacity : 0 }, 260 finish : { opacity : 100 }, 261 transition : BX.easing.transitions.quart, 262 step : BX.delegate(function(state) {this.RowAnimate(state); }, this), 263 complete: BX.delegate(this.RowComplete, this) 264 }).animate(); 265}; 266 267window.JCCatalogTopBannerList.prototype.RowMove = function() 268{ 269 if (0 > this.errorCode) 270 return; 271 var target = BX.proxy_context; 272 if (!!target && target.hasAttribute('data-pagevalue')) 273 {
274 var pageValue = parseInt(target.getAttribute('data-pagevalue')); 275 if (!isNaN(pageValue) && pageValue < this.size) 276 { 277 this.prevIndex = this.currentIndex; 278 this.currentIndex = pageValue; 279 this.slider.row.style.left = -this.currentIndex*100+'%'; 280 this.slider.items[this.prevIndex].style.opacity = 0; 281 this.RowStart(); 282 new BX.easing({ 283 duration : 800, 284 start : { opacity : 0 }, 285 finish : { opacity : 100 }, 286 transition : BX.easing.transitions.quart, 287 step : BX.delegate(function(state) { this.RowAnimate(state); }, this), 288 complete: BX.delegate(this.RowComplete, this) 289 }).animate(); 290 } 291 } 292}; 293 294window.JCCatalogTopBannerList.prototype.RowRotate = function() 295{ 296 if (0 > this.errorCode) 297 return; 298 if (!this.rotatePause) 299 { 300 this.RowRight(); 301 } 302 setTimeout(BX.delegate(this.RowRotate, this), this.rotateTimer); 303}; 304 305window.JCCatalogTopBannerList.prototype.RotateStart = function() 306{ 307 if (0 > this.errorCode) 308 return; 309 this.rotatePause = false; 310}; 311 312window.JCCatalogTopBannerList.prototype.RotateStop = function() 313{ 314 if (0 > this.errorCode) 315 return; 316 this.rotatePause = true; 317}; 318})(window);
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.