1function UAParser(e) 2{ 3 var t = e || window.navigator.userAgent; 4 var n = function (e) 5 { 6 var t; 7 var n, r, i, s; 8 for (n = 1; n < arguments.length; n += 2) { 9 var o = arguments[n]; 10 var u = arguments[n + 1]; 11 var a = false; 12 for (r = 0; r < o.length; r++) { 13 var f = o[r].exec(e); 14 if (!!f) { 15 t = {}; 16 s = 1; 17 for (i = 0; i < u.length; i++) { 18 if (typeof u[i] === "object" && u[i].length === 2) { 19 t[u[i][0]] = u[i][1]; 20 s -= 1 21 } 22 else if (typeof u[i] === "object" && u[i].length === 3) { 23 t[u[i][0]] = !!f[i + s] ? f[i + s].replace(u[i][1], u[i][2]) : undefined 24 } 25 else { 26 t[u[i]] = !!f[i + s] ? f[i + s] : undefined 27 } 28 } 29 a = true; 30 break 31 } 32 } 33 if (!a) { 34 t = {}; 35 for (i in u) { 36 if (u.hasOwnProperty(i)) { 37 if (typeof u[i] == "object") { 38 t[u[i][0]] = undefined 39 } 40 else { 41 t[u[i]] = undefined 42 } 43 } 44 } 45 } 46 else { 47 return t 48 } 49 } 50 return t 51 }; 52 var r = { 53 os: { 54 win: function (e, t) 55 { 56 switch (t.toLowerCase()) { 57 case"nt 5.0": 58 return "2000"; 59 case"nt 5.1": 60 case"nt 5.2": 61 return "XP"; 62 case"nt 6.0": 63 return "Vista"; 64 case"nt 6.1": 65 return "7"; 66 case"nt 6.2": 67 return "8"; 68 default: 69 return t 70 } 71 } 72 } 73 }; 74 this.getBrowser = function (e) 75 { 76 return n(e || t, [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine)[\/\s]?((\d+)?[\w\.]+)/i, /(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\smobi)\/((\d+)?[\w\.-]+)/i, /(opera).*\/((\d+)?[\w\.]+)/i, /(avant\sbrowser|iemobile|slimbrowser)[\/\s]?((\d+)?[\w\.]*)/i, /ms(ie)\s((\d+)?[\w\.]+)/i, /(chromium|flock|rockmelt|midori|epiphany)\/((\d+)?[\w\.]+)/i, /(chrome|omniweb|arora|dolfin)\/((\d+)?[\w\.]+)/i], ["name", "version", "major"], [/android.+crmo\/((\d+)?[\w\.]+)/i], [["name", "Chrome"], "version", "major"], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [["name", "IE"], "version", "major"], [/(mobile\ssafari|safari|konqueror)\/((\d+)?[\w\.]+)/i, /(applewebkit|khtml)\/((\d+)?[\w\.]+)/i, /(iceweasel|camino|fennec|maemo|minimo)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|netscape|navigator|k-meleon|icecat|iceape)\/((\d+)?[\w\.]+)/i, /(mozilla)\/([\w\.]+).+rv\:.
76+gecko\/\d+/i, /(lynx|dillo|icab)[\/\s]?((\d+)?[\w\.]+)/i], ["name", "version", "major"]) 77 }; 78 this.getEngine = function (e) 79 { 80 return n(e || t, [/(presto)\/([\w\.]+)/i, /([aple]*webkit|trident)\/([\w\.]+)/i, /(khtml)\/([\w\.]+)/i], ["name", "version"], [/rv\:([\w\.]+).*(gecko)/i], ["version", "name"]) 81 }; 82 this.getOS = function (e) 83 { 84 return n(e || t, [/(windows\sphone\sos|windows)\s+([\w\.\s]+)*/i], ["name", ["version", /(nt\s[\d\.]+)/gi, r.os.win]], [/(blackberry).+version\/([\w\.]+)/i, /(android|symbianos|symbos|webos|palm\os|qnx|bada|rim\stablet\sos)[\/\s-]?([\w\.]+)*/i, /(nintendo|playstation)\s([wids3portable]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(gnu|linux)\s?([\w\.]+)*/i], ["name", "version"], [/cros\s([\w\.\s]+)/i], [["name", "Chromium OS"], "version"], [/sunos\s?([\w\.\s]+)*/i], [["name", "Solaris"], "version"], [/\s(\w*bsd|dragonfly)\s?([\w\.]+)*/i], ["name", "version"], [/(ip[honead]+).*os\s*([\w]+)*\slike\smac/i], [["name", /.+/g, "iOS"], ["version", /_/g, "."]], [/(mac\sos)\sx\s([\w\s\.]+)/i], ["name", ["version", /_/g, "."]], [/(macintosh|unix|minix|beos)[\/\s]?()*/i], ["name", "version"]) 85 }; 86 this.getDevice = function (e) 87 { 88 return n(e || t, [/\((ip[honead]+|playbook);/i, /(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|nokia|palm(?=\-)|sonyericsson)[\s-]?([\w-]+)*/i, /(hp)\s([\w\s]+)/i, /(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /(lg)[e;\s-]+(\w+)*/i, /(nintendo|playstation)\s([wids3portable]+)/i], ["name", "version"], [/(htc)[;_\s-]+([\w\s]+(?=\))|[\w]+)*/i, /(zte)-([\w]+)*/i], ["name", ["version", /_/g, " "]], [/\s(milestone|mz601|droid[2x]?|xoom)[globa\s]*\sbuild\//i, /mot[\s-]?(\w+)*/i], [["name", "Motorola"], "version"], [/(s[cgp]h-\w+|gt-\w+|galaxy\snexus)/i, /sam[sung]*[\s-]*(\w+-?[\w-]*)*/i, /sec-(sgh\w+)/i], [["name", "Samsung"], "version"], [/sie-(\w+)*/i], [["name", "Siemens"], "version"]) 89 }; 90 this.setUA = function (e) 91 { 92 t = e || t; 93 return this.result = { 94 browser: this.getBrowser(), 95 engine : this.getEngine(), 96 os : this.getOS(), 97 device : this.getDevice() 98 } 99 }; 100 this.setUA(t) 101} 102var TWEEN = TWEEN || function () 103 { 104 var e, t, n, r, i = 60, s = false, o = [], u; 105 return { 106 setFPS : function (e) 107 { 108 i = e || 60 109 }, start : function (e) 110 { 111 if (arguments.length != 0) { 112 this.setFPS(e) 113 } 114 n = setInterval(this.update, 1e3 / i) 115 }, stop : function () 116 { 117 clearInterval(n) 118 }, setAutostart: function (e) 119 { 120 s = e; 121 if (s && !n) { 122 this.start() 123 } 124 }, add : function (e) 125 { 126 o.push(e); 127 if (s && !n) { 128 this.start() 129 } 130 }, getAll : function () 131 { 132 return o 133 }, removeAll : function () 134 { 135 o = [] 136 }, remove : function (t) 137 { 138 e = o.indexOf(t); 139 if (e !== -1) { 140 o.splice(e, 1) 141 } 142 }, update : function (e) 143 { 144 var t = 0; 145 var n = e || Date.now(); 146 while (t < o.length) { 147 if (o[t].update(n)) { 148 t++ 149 } 150 else { 151 o.splice(t, 1) 152 } 153 } 154 if (u == 0 && s == true) { 155 this.stop() 156 } 157 } 158 } 159 }(); 160TWEEN.Tween = function (e) 161{ 162 var t = e, n = {}, r = {}, i = {}, s = 1e3, o = 0, u = null, a = TWEEN.Easing.Linear.EaseNone, f = null, l = null, c = null; 163 this.to = function (e, n) 164 { 165 if (n !== null) { 166 s = n 167 } 168 for (var r in e) { 169 if (t[r] === null) { 170 continue 171 } 172 i[r] = e[r] 173 } 174 return this 175 }; 176 this.start = function (e) 177 { 178 TWEEN.add(this); 179 u = e ? e + o : Date.now() + o; 180 for (var s in i) { 181 if (t[s] === null) { 182 continue 183 } 184 n[s] = t[s]; 185 r[s] = i[s] - t[s] 186 } 187 return this 188 }; 189 this.stop = function () 190 { 191 TWEEN.remove(this); 192 return this 193 }; 194 this.delay = function (e) 195 { 196 o = e; 197 return this 198 }; 199 this.easing = function (e) 200 { 201 a = e; 202 return this 203 }; 204 this.chain = function (e) 205 { 206 f = e 207 }; 208 this.onUpdate = function (e) 209 { 210 l = e; 211 return this 212 }; 213 this.onComplete = function (e) 214 { 215 c = e; 216 return this 217 }; 218 this.update = function (e) 219 { 220 var i, o, h; 221 if (e < u) { 222 return true 223 } 224 o = (e - u) / s; 225 o = o > 1 ? 1 : o; 226 h = a(o); 227 for (i in r) { 228 t[i] = n[i] + r[i] * h 229 } 230 if (l !== null) { 231 l.call(t, h) 232 } 233 if (o == 1) { 234 if (c !== null) { 235 c.call(t) 236 } 237 if (f !== null) { 238 f.start() 239 } 240 return false 241 } 242 return true 243 } 244}; 245TWEEN.Easing = { 246 Linear : {}, 247 Quadratic : {}, 248 Cubic : {}, 249 Quartic : {}, 250 Quintic : {}, 251 Sinusoidal : {}, 252 Exponential: {}, 253 Circular : {}, 254 Elastic : {}, 255 Back : {}, 256 Bounce : {} 257}; 258TWEEN.Easing.Linear.EaseNone = function (e) 259{ 260 return e 261};
262TWEEN.Easing.Quadratic.EaseIn = function (e) 263{ 264 return e * e 265}; 266TWEEN.Easing.Quadratic.EaseOut = function (e) 267{ 268 return -e * (e - 2) 269}; 270TWEEN.Easing.Quadratic.EaseInOut = function (e) 271{ 272 if ((e *= 2) < 1) { 273 return .5 * e * e; 274 } 275 return -.5 * (--e * (e - 2) - 1) 276}; 277TWEEN.Easing.Cubic.EaseIn = function (e) 278{ 279 return e * e * e 280}; 281TWEEN.Easing.Cubic.EaseOut = function (e) 282{ 283 return --e * e * e + 1 284}; 285TWEEN.Easing.Cubic.EaseInOut = function (e) 286{ 287 if ((e *= 2) < 1) { 288 return .5 * e * e * e; 289 } 290 return .5 * ((e -= 2) * e * e + 2) 291}; 292TWEEN.Easing.Quartic.EaseIn = function (e) 293{ 294 return e * e * e * e 295}; 296TWEEN.Easing.Quartic.EaseOut = function (e) 297{ 298 return -(--e * e * e * e - 1) 299}; 300TWEEN.Easing.Quartic.EaseInOut = function (e) 301{ 302 if ((e *= 2) < 1) { 303 return .5 * e * e * e * e; 304 } 305 return -.5 * ((e -= 2) * e * e * e - 2) 306}; 307TWEEN.Easing.Quintic.EaseIn = function (e) 308{ 309 return e * e * e * e * e 310}; 311TWEEN.Easing.Quintic.EaseOut = function (e) 312{ 313 return (e = e - 1) * e * e * e * e + 1 314}; 315TWEEN.Easing.Quintic.EaseInOut = function (e) 316{ 317 if ((e *= 2) < 1) { 318 return .5 * e * e * e * e * e; 319 } 320 return .5 * ((e -= 2) * e * e * e * e + 2) 321}; 322TWEEN.Easing.Sinusoidal.EaseIn = function (e) 323{ 324 return -Math.cos(e * Math.PI / 2) + 1 325}; 326TWEEN.Easing.Sinusoidal.EaseOut = function (e) 327{ 328 return Math.sin(e * Math.PI / 2) 329}; 330TWEEN.Easing.Sinusoidal.EaseInOut = function (e) 331{ 332 return -.5 * (Math.cos(Math.PI * e) - 1) 333}; 334TWEEN.Easing.Exponential.EaseIn = function (e) 335{ 336 return e == 0 ? 0 : Math.pow(2, 10 * (e - 1)) 337}; 338TWEEN.Easing.Exponential.EaseOut = function (e) 339{ 340 return e == 1 ? 1 : -Math.pow(2, -10 * e) + 1 341}; 342TWEEN.Easing.Exponential.EaseInOut = function (e) 343{ 344 if (e == 0) { 345 return 0; 346 } 347 if (e == 1) { 348 return 1; 349 } 350 if ((e *= 2) < 1) { 351 return .5 * Math.pow(2, 10 * (e - 1)); 352 } 353 return .5 * (-Math.pow(2, -10 * (e - 1)) + 2) 354}; 355TWEEN.Easing.Circular.EaseIn = function (e) 356{ 357 return -(Math.sqrt(1 - e * e) - 1) 358}; 359TWEEN.Easing.Circular.EaseOut = function (e) 360{ 361 return Math.sqrt(1 - --e * e) 362}; 363TWEEN.Easing.Circular.EaseInOut = function (e) 364{ 365 if ((e /= .5) < 1) { 366 return -.5 * (Math.sqrt(1 - e * e) - 1); 367 } 368 return .5 * (Math.sqrt(1 - (e -= 2) * e) + 1) 369}; 370TWEEN.Easing.Elastic.EaseIn = function (e) 371{ 372 var t, n = .1, r = .4; 373 if (e == 0) { 374 return 0; 375 } 376 if (e == 1) { 377 return 1; 378 } 379 if (!r) { 380 r = .3; 381 } 382 if (!n || n < 1) { 383 n = 1; 384 t = r / 4 385 } 386 else { 387 t = r / (2 * Math.PI) * Math.asin(1 / n); 388 } 389 return -(n * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r)) 390}; 391TWEEN.Easing.Elastic.EaseOut = function (e) 392{ 393 var t, n = .1, r = .4; 394 if (e == 0) { 395 return 0; 396 } 397 if (e == 1) { 398 return 1; 399 } 400 if (!r) { 401 r = .3; 402 } 403 if (!n || n < 1) { 404 n = 1; 405 t = r / 4 406 } 407 else { 408 t = r / (2 * Math.PI) * Math.asin(1 / n); 409 } 410 return n * Math.pow(2, -10 * e) * Math.sin((e - t) * 2 * Math.PI / r) + 1 411}; 412TWEEN.Easing.Elastic.EaseInOut = function (e) 413{ 414 var t, n = .1, r = .4; 415 if (e == 0) { 416 return 0; 417 } 418 if (e == 1) { 419 return 1; 420 } 421 if (!r) { 422 r = .3; 423 } 424 if (!n || n < 1) { 425 n = 1; 426 t = r / 4 427 } 428 else { 429 t = r / (2 * Math.PI) * Math.asin(1 / n); 430 } 431 if ((e *= 2) < 1) { 432 return -.5 * n * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r); 433 } 434 return n * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / r) * .5 + 1 435}; 436TWEEN.Easing.Back.EaseIn = function (e) 437{ 438 var t = 1.70158; 439 return e * e * ((t + 1) * e - t) 440}; 441TWEEN.Easing.Back.EaseOut = function (e) 442{ 443 var t = 1.70158; 444 return (e = e - 1) * e * ((t + 1) * e + t) + 1 445}; 446TWEEN.Easing.Back.EaseInOut = function (e) 447{ 448 var t = 1.70158 * 1.525; 449 if ((e *= 2) < 1) { 450 return .5 * e * e * ((t + 1) * e - t); 451 } 452 return .5 * ((e -= 2) * e * ((t + 1) * e + t) + 2) 453}; 454TWEEN.Easing.Bounce.EaseIn = function (e) 455{ 456 return 1 - TWEEN.Easing.Bounce.EaseOut(1 - e) 457}; 458TWEEN.Easing.Bounce.EaseOut = function (e) 459{ 460 if ((e /= 1) < 1 / 2.75) { 461 return 7.5625 * e * e 462 } 463 else if (e < 2 / 2.75) { 464 return 7.5625 * (e -= 1.5 / 2.75) * e + .75 465 } 466 else if (e < 2.5 / 2.75) { 467 return 7.5625 * (e -= 2.25 / 2.75) * e + .9375 468 } 469 else { 470 return 7.5625 * (e -= 2.625 / 2.75) * e + .984375 471 } 472}; 473TWEEN.Easing.Bounce.EaseInOut = function (e) 474{ 475 if (e < .5) { 476 return TWEEN.Easing.Bounce.EaseIn(e * 2) * .5; 477 } 478 return TWEEN.Easing.Bounce.EaseOut(e * 2 - 1) * .5 + .5 479}; 480window.Aroma = {version: 2, author: "Averta group"}; 481Aroma.Engine = function (e) 482{ 483 this._tweenList = []; 484 this._view = e; 485 this._view.engine = this; 486 this.startEff = function () 487 { 488 this._effect.prepare(); 489 this._part_duration = this._duration / (this._selector.getCount() - (1 - this._overlapping) * (this._selector.getCount() - 1)); 490 this._part_delay = this._part_duration * this._overlapping; 491 var e = [], t, n, r = 0, i = 0, s = [], o, u = null; 492 for (var a = 0, f = this._selector.getCount(); a < f; ++a) { 493 e = this._selector.getPieceList(); 494 for (var l = 0, c = e.length; l < c; ++l) { 495 s = this._effect.getToData(); 496 o = this._effect.getFromData(); 497 for (var h = 0, p = s.length; h < p; ++h) { 498 n = CloneObject.clone(s[h].options); 499 if (h == 0) { 500 if (n.delay == null) {
501 n.delay = this._part_delay + r + this._startDelay; 502 } 503 else { 504 n.delay += this._part_delay + r + this._startDelay 505 } 506 } 507 this.applyFromProperties(e[l], o); 508 t = (new TWEEN.Tween(e[l].proxy)).delay(n.delay * 1e3 || 0).to(s[h].to, this._part_duration * s[h].time * 1e3).easing(n.ease || TWEEN.Easing.Linear.EaseNone).onUpdate(e[l].proxyUpdate); 509 if (h == 0) { 510 t.start(); 511 } 512 if (u != null) { 513 u.chain(t); 514 } 515 u = t; 516 if (l + 1 == c && a + 1 == f && h + 1 == p) { 517 t.onComplete(this.effComp); 518 } 519 this._tweenList.push(t) 520 } 521 u = null 522 } 523 r += this._part_delay 524 } 525 if (this._view.sort) { 526 this._view.sortParts(); 527 } 528 this._view.prepare() 529 }; 530 this.applyFromProperties = function (e, t) 531 { 532 for (var n in t) { 533 e.proxy[n] = t[n]; 534 } 535 e.proxyUpdate.call(e.proxy) 536 }; 537 this.effComp = function () 538 { 539 if (this.piece.view.engine.onComplete) { 540 this.piece.view.engine.onComplete.listener.call(this.piece.view.engine.onComplete.ref) 541 } 542 } 543}; 544Aroma.Engine.prototype.start = function (e, t, n, r, i) 545{ 546 this._selector = t; 547 this._effect = e; 548 this._duration = n; 549 this._overlapping = r || .5; 550 this._startDelay = i || 0; 551 this._selector.setup(this._effect, this._view); 552 this.startEff() 553}; 554Aroma.Engine.prototype.reset = function () 555{ 556 this._selector = null; 557 this._effect = null; 558 this._duration = 0; 559 this._overlapping = 0; 560 this._startDelay = 0; 561 this._tweenList = [] 562}; 563Aroma.Engine.prototype.removeTweens = function () 564{ 565 for (var e = 0, t = this._tweenList.length; e < t; e++) { 566 TWEEN.remove(this._tweenList[e]); 567 this._tweenList[e] = null 568 } 569}; 570Aroma.Engine.prototype.getView = function () 571{ 572 return this._view 573}; 574Aroma.AbstractView = function (e, t) 575{ 576 this.sort = false; 577 this.col = t; 578 this.row = e; 579 this.part_width = 0; 580 this.part_height = 0; 581 this._pieceList = []; 582 this.width = 0; 583 this.height = 0; 584 this.vpWidth = 0; 585 this.vpHeight = 0; 586 this.needRendering = false; 587 this.extra_part_width = 0, this.extra_part_height = 0; 588 this.posToID = function (e, t) 589 { 590 return t * this.col + e 591 }; 592 this.getPieceBounds = function (e, t) 593 { 594 var n = {width: 0, height: 0, x: 0, y: 0}; 595 if (this.extra_part_width == 0) { 596 n.x = e * this.part_width; 597 n.width = this.part_width 598 } 599 else { 600 n.width = e > this.extra_part_width ? this.part_width : this.part_width + 1; 601 n.x = e > this.extra_part_width ? (this.part_width + 1) * this.extra_part_width + (e - this.extra_part_width) * this.part_width : (this.part_width + 1) * e 602 } 603 if (this.extra_part_height == 0) { 604 n.y = t * this.part_height; 605 n.height = this.part_height 606 } 607 else { 608 n.height = t > this.extra_part_height ? this.part_height : this.part_height + 1; 609 n.y = t > this.extra_part_height ? (this.part_height + 1) * this.extra_part_height + (t - this.extra_part_height) * this.part_height : (this.part_height + 1) * t 610 } 611 return n 612 }; 613 this.swapchildren_col = function (e, t) 614 { 615 for (var n = 0, r = (t - e) / 2; n < r; ++n) { 616 var i = this._pieceList[e + n]; 617 this._pieceList[e + n] = this._pieceList[t - n]; 618 this._pieceList[t - n] = i 619 } 620 }; 621 this.swapchildren_row = function (e) 622 { 623 for (var t = 0, n = e.length; t < n / 2; ++t) { 624 var r = this._pieceList[e[t]]; 625 this._pieceList[e[t]] = this._pieceList[e[n - t - 1]]; 626 this._pieceList[e[n - t - 1]] = r 627 } 628 }; 629 this.sortInCols = function () 630 { 631 if (this.col == 1) { 632 return; 633 } 634 var e = Math.floor(this.col >> 1); 635 for (var t = this._pieceList.length, n = e; n < t; n += this.col) { 636 this.swapchildren_col(n, n + (this.col - e) - 1) 637 } 638 }; 639 this.sortInRows = function () 640 { 641 if (this.row == 1) { 642 return; 643 } 644 var e = Math.floor(this.row >> 1); 645 var t = new Array; 646 for (var n = 0; n < this.col; ++n) { 647 for (var r = 0; r < this.row - e; ++r) { 648 t.push(e * this.col + n + r * this.col) 649 } 650 this.swapchildren_row(t); 651 t = new Array 652 } 653 } 654}; 655Aroma.AbstractView.prototype.getCount = function () 656{ 657 return this.row * this.col 658}; 659Aroma.AbstractView.prototype.prepare = function () 660{ 661}; 662Aroma.AbstractView.prototype.setSize = function (e, t) 663{ 664 this.part_height = Math.floor(t / this.row); 665 this.extra_part_height = t % this.row; 666 this.part_width = Math.floor(e / this.col); 667 this.extra_part_width = e % this.col; 668 this.width = e; 669 this.height = t 670}; 671Aroma.AbstractView.prototype.setViewPortSize = function (e, t) 672{ 673 this.vpWidth = e; 674 this.vpHeight = t 675}; 676Aroma.AbstractView.prototype.dispose = function () 677{ 678 for (var e = 0, t = this._pieceList.length; e < t; ++e) { 679 if (this._pieceList[e]) { 680 this._pieceList[e].dispose(); 681 } 682 this._pieceList[e] = null 683 } 684 this._pieceList = [] 685}; 686Aroma.AbstractView.prototype.sortParts = function () 687{ 688 this.sortInCols(); 689 this.sortInRows() 690}; 691window.CloneObject = window.ConcatObject || {}; 692CloneObject.clone = function (e) 693{ 694 if (e == null) { 695 return {}; 696 } 697 var t = {}; 698 for (var n in e) { 699 t[n] = e[n]; 700 } 701 return t 702}; 703ConcatObject = {}; 704ConcatObject.concat = function (e, t) 705{ 706 for (var n in t) { 707 e[n] = t[n]; 708 } 709 return e 710}; 711window.setOpacity = function (e, t) 712{ 713 e.style.filter = "alpha(opacity=" + t + ")"; 714 e.style.opacity = t * .01; 715 e.style.MozOpacity = t * .01; 716 e.style.KhtmlOpacity = t * .01; 717 e.style.MSOpacity = t * .01 718}; 719Aroma.AbstractSelector = function () 720{ 721 this.selectNum = 1 722}; 723Aroma.AbstractSelector.prototype.getCount = function () 724{ 725 return Math.floor(this.view.getCount() / this.selectNum) 726}; 727Aroma.AbstractSelector.prototype.setup = function (e, t) 728{ 729 this.effect = e; 730 this.view = t; 731 e.selector = this; 732 e.view = t 733}; 734Aroma.AbstractSelector.prototype.reset = function () 735{ 736}; 737Aroma.SerialSelector = function (e, t, n) 738{ 739 this.row = 0; 740 this.col = 0; 741 this.row_len = 0; 742 this.col_len = 0; 743 this.selectNum = n || 1; 744 this.zigzag = t; 745 this.dir = e || "tlr"; 746 this.convertPoint = function (e, t) 747 { 748 switch (this.dir) { 749 case"tlr": 750 return {row: e, col: t}; 751 break; 752 case"tld":
753 return {row: t, col: e}; 754 break; 755 case"trl": 756 return {row: e, col: this.col_len - t - 1}; 757 break; 758 case"trd": 759 return {row: t, col: this.row_len - e - 1}; 760 break; 761 case"brl": 762 return {row: this.row_len - e - 1, col: this.col_len - t - 1}; 763 break; 764 case"bru": 765 return {row: this.col_len - t - 1, col: this.row_len - e - 1}; 766 break; 767 case"blr": 768 return {row: row_len - e - 1, col: t}; 769 break; 770 case"blu": 771 return {row: this.col_len - t - 1, col: e}; 772 break 773 } 774 return {row: e, col: t} 775 } 776}; 777Aroma.SerialSelector.prototype = new Aroma.AbstractSelector; 778Aroma.SerialSelector.prototype.constructor = Aroma.SerialSelector; 779Aroma.SerialSelector.prototype.getPieceList = function () 780{ 781 var e = []; 782 var t = {}; 783 if (this.dir.charAt(2) == "u" || this.dir.charAt(2) == "d") { 784 this.col_len = this.view.row; 785 this.row_len = this.view.col 786 } 787 else { 788 this.col_len = this.view.col; 789 this.row_len = this.view.row 790 } 791 for (var n = 0; n < this.selectNum; n++) { 792 t = this.convertPoint(this.row, this.zigzag && this.row % 2 != 0 ? this.col_len - this.col - 1 : this.col); 793 e.push(this.view.getPieceAt(t.col, t.row, this.effect)); 794 this.col++; 795 if (this.col == this.col_len) { 796 this.col = 0; 797 this.row++ 798 } 799 } 800 return e 801}; 802Aroma.SerialSelector.prototype.reset = function () 803{ 804 this.row = 0; 805 this.col = 0 806}; 807Aroma.DiagonalSelector = function (e, t) 808{ 809 this.selectNum = t || 1; 810 this.startPoint = e || "tl"; 811 var n = 0, r = 0, i = 0, s = 0, o = 0, u = true; 812 this.getList = function () 813 { 814 var e = []; 815 for (var t = 0; t < this.selectNum; t++) { 816 switch (this.startPoint) { 817 case"tl": 818 if (u) { 819 u = false 820 } 821 else if (r != 0 && n != this.view.row - 1) { 822 r--; 823 n++ 824 } 825 else { 826 r = ++i; 827 if (r > this.view.col - 1) { 828 n = ++o; 829 r = this.view.col - 1 830 } 831 else { 832 n = 0 833 } 834 } 835 break; 836 case"tr": 837 if (u) { 838 u = false; 839 r = this.view.col - 1 840 } 841 else if (r != this.view.col - 1 && n != this.view.row - 1) { 842 r++; 843 n++ 844 } 845 else { 846 r = this.view.col - 1 - ++i; 847 if (r < 0) { 848 n = ++o; 849 r = 0 850 } 851 else { 852 n = 0 853 } 854 } 855 break; 856 case"bl": 857 if (u) { 858 u = false; 859 n = this.view.row - 1 860 } 861 else if (r != 0 && n != 0) { 862 r--; 863 n-- 864 } 865 else { 866 r = ++i; 867 if (r > this.view.col - 1) { 868 n = this.view.row - 1 - ++o; 869 r = this.view.col - 1 870 } 871 else { 872 n = this.view.row - 1 873 } 874 } 875 break; 876 case"br": 877 if (u) { 878 u = false; 879 n = this.view.row - 1; 880 r = this.view.col - 1 881 } 882 else if (r != this.view.col - 1 && n != 0) { 883 r++; 884 n-- 885 } 886 else { 887 r = this.view.col - 1 - ++i; 888 if (r < 0) { 889 n = this.view.row - 1 - ++o; 890 r = 0 891 } 892 else { 893 n = this.view.row - 1 894 } 895 } 896 break 897 } 898 e[t] = this.view.getPieceAt(r, n, this.effect) 899 } 900 return e 901 }; 902 this._reset = function () 903 { 904 n = 0, r = 0, i = 0, s = 0, o = 0, u = true 905 } 906}; 907Aroma.DiagonalSelector.prototype = new Aroma.AbstractSelector; 908Aroma.DiagonalSelector.prototype.constructor = Aroma.DiagonalSelector; 909Aroma.DiagonalSelector.TOP_LEFT = "tl"; 910Aroma.DiagonalSelector.BOTTOM_LEFT = "bl"; 911Aroma.DiagonalSelector.TOP_RIGHT = "tr"; 912Aroma.DiagonalSelector.BOTTOM_RIGHT = "br"; 913Aroma.DiagonalSelector.prototype.getPieceList = function () 914{ 915 return this.getList() 916}; 917Aroma.DiagonalSelector.prototype.reset = function () 918{ 919 return this._reset() 920}; 921Aroma.RandSelector = function (e) 922{ 923 this.selectNum = e || 1; 924 this.id_rand_list = []; 925 this.shuffle = function (e) 926 { 927 var t = Math.floor(Math.random() * e.length); 928 var n = e[t]; 929 e.splice(t, 1); 930 return n 931 } 932}; 933Aroma.RandSelector.prototype = new Aroma.AbstractSelector; 934Aroma.RandSelector.prototype.constructor = Aroma.RandSelector; 935Aroma.RandSelector.prototype.setup = function (e, t) 936{ 937 Aroma.AbstractSelector.prototype.setup.call(this, e, t); 938 for (var n = 0, r = t.col * t.row; n < r; ++n) { 939 this.id_rand_list[n] = n 940 } 941}; 942Aroma.RandSelector.prototype.getPieceList = function () 943{ 944 var e = []; 945 var t = 0; 946 for (var n = 0; n < this.selectNum; ++n) { 947 t = this.shuffle(this.id_rand_list); 948 e[n] = this.view.getPieceAt(Math.floor(t / this.view.row), t % this.view.row, this.effect) 949 } 950 return e 951}; 952Aroma.Piece = function () 953{ 954 this.col = 0; 955 this.row = 0; 956 this.bounds = {}; 957 this.origin_x = 0; 958 this.origin_y = 0; 959 this.origin_z = 0; 960 this.options = {} 961}; 962Aroma.Effect = function () 963{ 964 this.pieceOptions = {}; 965 this.isStatic = false 966}; 967Aroma.Effect.prototype.addFrame = function (e, t, n) 968{ 969 this.data.push({time: e, to: t, options: n}) 970}; 971Aroma.Effect.prototype.getToData = function () 972{ 973 if (this.data != null && this.isStatic) { 974 return this.data; 975 } 976 this.data = new Array; 977 this.getTo(); 978 return this.data 979}; 980Aroma.Effect.prototype.getFromData = function () 981{ 982 if (this.fromData != null && this.isStatic) { 983 return this.fromData; 984 } 985 else if (this.isStatic) { 986 this.fromData = this.getFrom(); 987 return this.fromData 988 } 989 else { 990 return this.getFrom() 991 } 992}; 993Aroma.Effect.prototype.prepare = function () 994{ 995}; 996Aroma.Effect.prototype.getPieceOptions = function () 997{ 998 return this.pieceOptions 999}; 1000window.Cute = {version: 2.2, name: "Cute Slider", author: "Averta Group"}; 1001Cute.Effect1 = function (e) 1002{ 1003 Aroma.Effect.prototype.constructor.call(this); 1004 e = e || {}; 1005 this.ease = e.ease || TWEEN.Easing.Linear; 1006 this.isStatic = true 1007}; 1008Cute.Effect1.prototype = new Aroma.Effect; 1009Cute.Effect1.prototype.constructor = Cute.Effect1; 1010Cute.Effect1.prototype.getToVars = function () 1011{ 1012 this.addFrame(1, {opacity: 100}, {ease: this.ease.EaseOut}) 1013}; 1014Cute.Effect1.prototype.getFromVars = function () 1015{ 1016 return {opacity: 0, slide: 100} 1017}; 1018Cute.Effect1.prototype.prepare = function () 1019{ 1020 this.getFrom = this.getFrom || this.getFromVars; 1021 this.getTo = this.getTo || this.getToVars 1022}; 1023Cute.Effect2 = function (e) 1024{ 1025 Aroma.Effect.prototype.constructor.call(this); 1026 e = e || {}; 1027 this.pieceOptions.dir = e.dir || "r"; 1028 this.pieceOptions.push = e.push; 1029 this.ease = e.ease || TWEEN.Easing.Linear; 1030 this.fade = e.fade; 1031 this.isStatic = true 1032}; 1033Cute.Effect2.prototype = new Aroma.Effect; 1034Cute.Effect2.prototype.constructor = Cute.Effect2; 1035Cute.Effect2.prototype.getToVars = function () 1036{ 1037 this.addFrame(1, this.fade ? {opacity: 100, slide: 100} : {slide: 100}, {ease: this.ease.EaseInOut}) 1038}; 1039Cute.Effect2.prototype.getFromVars = function () 1040{ 1041 return this.fade ? {opacity: 0, slide: 0} : {slide: 0} 1042}; 1043Cute.Effect2.prototype.prepare = function () 1044{ 1045 this.getFrom = this.getFrom || this.getFromVars; 1046 this.getTo = this.getTo || this.getToVars 1047}; 1048Cute.Effect3 = function (e) 1049{ 1050 Cute.Effect2.prototype.constructor.call(this, e); 1051 this.dir_name_arr = ["r", "l", "t", "b"] 1052}; 1053Cute.Effect3.prototype = new Cute.Effect2; 1054Cute.Effect3.prototype.constructor = Cute.Effect3; 1055Cute.Effect3.prototype.getPieceOptions = function () 1056{ 1057 this.pieceOptions.dir = this.dir_name_arr[Math.round(parseInt(Math.random() * 3))]; 1058 return this.pieceOptions 1059}; 1060Cute.Effect4 = function (e) 1061{ 1062 Cute.Effect3.prototype.constructor.call(this, e); 1063 this.counter = 0; 1064 this.rotation_dir = e.dir || "vertical" 1065}; 1066Cute.Effect4.prototype = new Cute.Effect3; 1067Cute.Effect4.prototype.constructor = Cute.Effect4; 1068Cute.Effect4.prototype.getPieceOptions = function () 1069{ 1070 this.pieceOptions.dir = this.dir_name_arr[(this.counter++ % 2 ? 0 : 1) + (this.rotation_dir == "vertical" ? 2 : 0)]; 1071 return this.pieceOptions 1072}; 1073Cute.Effect5 = function (e) 1074{ 1075 Aroma.Effect.prototype.constructor.call(this); 1076 e = e || {}; 1077 this.side = e.side || "r"; 1078 this.zmove = e.zmove || 0; 1079 this.rotation_axis = "y"; 1080 this.rotation_dir = 1; 1081 this.xspace = e.xspace || 0; 1082 this.yspace = e.yspace || 0; 1083 this.stack = e.stack || false; 1084 this.balance = e.blance || .5; 1085 this.ease = e.ease || TWEEN.Easing.Linear; 1086 this.isStatic = false 1087}; 1088Cute.Effect5.prototype = new Aroma.Effect; 1089Cute.Effect5.prototype.constructor = Cute.Effect5; 1090Cute.Effect5.prototype.createFrames = function (e, t) 1091{ 1092 if (!this.stack) { 1093 e.z = this.zmove; 1094 t.z = 0; 1095 e.x = (this.piece.col - Math.floor(this.view.col * .5)) * this.xspace; 1096 e.y = (this.piece.row - Math.floor(this.view.row * .5)) * this.yspace; 1097 t.y = t.x = 0; 1098 this.addFrame(.5, e, {ease: this.ease.EaseIn}); 1099 this.addFrame(.5, t, {ease: this.ease.EaseOut}) 1100 } 1101 else { 1102 var n = {}; 1103 n.x = (this.piece.col - Math.floor(this.view.col * .5)) * this.xspace; 1104 n.y = (this.piece.row - Math.floor(this.view.row * .5)) * this.yspace; 1105 n.z = this.zmove; 1106 this.addFrame(this.balance * .5, n, {ease: this.ease.EaseInOut}); 1107 this.addFrame(1 - this.balance, t, {ease: this.ease.EaseInOut}); 1108 this.addFrame(this.balance * .5, {z: 0, x: 0, y: 0}, {ease: this.ease.EaseInOut}) 1109 } 1110}; 1111Cute.Effect5.prototype.getToVars = function () 1112{ 1113 var e = {}; 1114 var t = {}; 1115 if (this.rotation_axis == "y") { 1116 e.rotationY = 45 * this.rotation_dir; 1117 t.rotationY = 90 * this.rotation_dir 1118 } 1119 else { 1120 e.rotationX = 45 * this.rotation_dir; 1121 t.rotationX = 90 * this.rotation_dir 1122 } 1123 this.createFrames(e, t) 1124}; 1125Cute.Effect5.prototype.getFromVars = function () 1126{ 1127 return {} 1128}; 1129Cute.Effect5.prototype.checkSidePos = function () 1130{ 1131 switch (this.side) { 1132 case"r": 1133 this.pieceOptions.newImageLocation = this.piece.side_dic.right; 1134 this.pieceOptions.depth = this.piece.bounds.width; 1135 this.rotation_axis = "y"; 1136 this.rotation_dir = 1; 1137 break; 1138 case"l": 1139 this.pieceOptions.newImageLocation = this.piece.side_dic.left; 1140 this.pieceOptions.depth = this.piece.bounds.width; 1141 this.rotation_axis = "y"; 1142 this.rotation_dir = -1; 1143 break; 1144 case"t": 1145 this.pieceOptions.newImageLocation = this.piece.side_dic.top; 1146 this.pieceOptions.depth = this.piece.bounds.height; 1147 this.rotation_axis = "x"; 1148 this.rotation_dir = 1; 1149 break; 1150 case"b": 1151 this.pieceOptions.newImageLocation = this.piece.side_dic.bottom; 1152 this.pieceOptions.depth = this.piece.bounds.height; 1153 this.rotation_axis = "x"; 1154 this.rotation_dir = -1; 1155 break 1156 } 1157}; 1158Cute.Effect5.prototype.prepare = function () 1159{ 1160 this.getFrom = this.getFrom || this.getFromVars; 1161 this.getTo = this.getTo || this.getToVars 1162}; 1163Cute.Effect5.prototype.getPieceOptions = function () 1164{ 1165 this.checkSidePos(); 1166 return this.pieceOptions 1167}; 1168Cute.Effect6 = function (e) 1169{ 1170 Cute.Effect5.prototype.constructor.call(this, e); 1171 this.slide_name_arr = ["l", "r", "b", "t"] 1172}; 1173Cute.Effect6.prototype = new Cute.Effect5; 1174Cute.Effect6.prototype.constructor = Cute.Effect6; 1175Cute.Effect6.prototype.getPieceOptions = function () 1176{ 1177 this.side = this.slide_name_arr[Math.round(parseInt(Math.random() * 3))]; 1178 this.checkSidePos(); 1179 return this.pieceOptions 1180}; 1181Cute.Effect7 = function (e) 1182{ 1183 Cute.Effect6.prototype.constructor.call(this, e); 1184 this.counter = 0; 1185 this._move = e.dir || "vertical" 1186}; 1187Cute.Effect7.prototype = new Cute.Effect6; 1188Cute.Effect7.prototype.constructor = Cute.Effect7; 1189Cute.Effect7.prototype.getPieceOptions = function () 1190{ 1191 this.side = this.slide_name_arr[(this.counter++ % 2 ? 0 : 1) + (this._move == "vertical" ? 2 : 0)]; 1192 this.checkSidePos(); 1193 return this.pieceOptions 1194}; 1195Cute.Effect8 = function (e) 1196{ 1197 e = e || {}; 1198 Cute.Effect5.prototype.constructor.call(this, e); 1199 this.sideColor = e.sidecolor || 0; 1200 this.depth = e.depth || -1; 1201 this.dir = e.dir || "u"; 1202 this.rotation_axis = "x"; 1203 this.rotation_dir = 1 1204}; 1205Cute.Effect8.prototype = new Cute.Effect5; 1206Cute.Effect8.prototype.constructor = Cute.Effect8; 1207Cute.Effect8.prototype.getToVars = function () 1208{ 1209 var e = {}; 1210 var t = {}; 1211 if (this.rotation_axis == "y") { 1212 e.rotationY = 90 * this.rotation_dir; 1213 t.rotationY = 180 * this.rotation_dir 1214 } 1215 else { 1216 e.rotationX = 90 * this.rotation_dir; 1217 t.rotationX = 180 * this.rotation_dir 1218 } 1219 this.createFrames(e, t) 1220}; 1221Cute.Effect8.prototype.updateConfig = function () 1222{ 1223 this.pieceOptions.sideColor = this.sideColor; 1224 this.pieceOptions.depth = this.depth <= 0 ? this.dir == "u" || this.dir == "d" ? this.piece.bounds.height : this.piece.bounds.width : this.depth; 1225 this.rotation_axis = this.dir == "u" || this.dir == "d" ? "x" : "y"; 1226 this.rotation_dir = this.dir == "u" || this.dir == "r" ? 1 : -1; 1227 this.pieceOptions.flipX = this.pieceOptions.flipY = this.dir == "u" || this.dir == "d" 1228}; 1229Cute.Effect8.prototype.getPieceOptions = function () 1230{ 1231 this.updateConfig(); 1232 return this.pieceOptions 1233}; 1234Cute.Effect9 = function (e) 1235{ 1236 Cute.Effect8.prototype.constructor.call(this, e); 1237 this.dir_name_arr = ["l", "r", "u", "d"] 1238}; 1239Cute.Effect9.prototype = new Cute.Effect8; 1240Cute.Effect9.prototype.constructor = Cute.Effect9; 1241Cute.Effect9.prototype.getPieceOptions = function () 1242{ 1243 this.dir = this.dir_name_arr[Math.round(parseInt(Math.random() * 3))]; 1244 this.updateConfig(); 1245 return this.pieceOptions 1246}; 1247Cute.Effect10 = function (e) 1248{ 1249 Cute.Effect9.prototype.constructor.call(this, e); 1250 this.counter = 0; 1251 this._move = e.dir || "vertical" 1252}; 1253Cute.Effect10.prototype = new Cute.Effect9; 1254Cute.Effect10.prototype.constructor = Cute.Effect10; 1255Cute.Effect10.prototype.getPieceOptions = function () 1256{ 1257 this.dir = this.dir_name_arr[(this.counter++ % 2 ? 0 : 1) + (this._move == "vertical" ? 2 : 0)]; 1258 this.updateConfig(); 1259 return this.pieceOptions 1260}; 1261Cute.Effect11 = function (e) 1262{ 1263 Cute.Effect8.call(this, e); 1264 e = e || {}; 1265 this.rotation_x = 0; 1266 this.rotation_y = 0; 1267 this.dir = e.dir || "tr"; 1268 this.pieceOptions.flipX = this.pieceOptions.flipY = true 1269}; 1270Cute.Effect11.prototype = new Cute.Effect8; 1271Cute.Effect11.prototype.constructor = Cute.Effect11; 1272Cute.Effect11.prototype.getToVars = function () 1273{ 1274 var e = {}; 1275 var t = {}; 1276 if (this.rotation_x != 0) { 1277 e.rotationX = 90 * this.rotation_x; 1278 t.rotationX = 180 * this.rotation_x 1279 } 1280 if (this.rotation_y != 0) { 1281 e.rotationY = 180 * this.rotation_y; 1282 t.rotationY = 360 * this.rotation_y 1283 } 1284 this.createFrames(e, t) 1285}; 1286Cute.Effect11.prototype.updateConfig = function () 1287{ 1288 this.pieceOptions.sideColor = this.sideColor; 1289 this.pieceOptions.depth = this.depth <= 0 ? 10 : this.depth; 1290 switch (this.dir.charAt(0)) { 1291 case"t": 1292 this.rotation_x = -1; 1293 break; 1294 case"b": 1295 this.rotation_x = 1; 1296 break 1297 } 1298 switch (this.dir.charAt(1)) { 1299 case"r": 1300 this.rotation_y = -1; 1301 break; 1302 case"l": 1303 this.rotation_y = 1; 1304 break 1305 } 1306}; 1307Cute.Effect12 = function (e) 1308{ 1309 Cute.Effect11.prototype.constructor.call(this, e); 1310 this.dir_name_arr = ["tl", "tr", "bl", "br"] 1311}; 1312Cute.Effect12.prototype = new Cute.Effect11; 1313Cute.Effect12.prototype.constructor = Cute.Effect12; 1314Cute.Effect12.prototype.getPieceOptions = function () 1315{ 1316 this.dir = this.dir_name_arr[Math.round(parseInt(Math.random() * 3))]; 1317 this.updateConfig(); 1318 return this.pieceOptions 1319}; 1320(function () 1321{ 1322 function e(e) 1323 { 1324 for (var t = 0, n = window.resizeListeners.length; t < n; ++t) { 1325 window.resizeListeners[t].listener.call(window.resizeListeners[t].ref) 1326 } 1327 } 1328 1329 window.resizeListeners = []; 1330 if (window.addEventListener) { 1331 window.addEventListener("resize", e); 1332 } 1333 else if (window.attachEvent) { 1334 window.attachEvent("onresize", e); 1335 } 1336 window.addResizeListener = function (e, t) 1337 { 1338 window.resizeListeners.push({listener: e, ref: t}) 1339 }; 1340 window.removeResizeListener = function (e, t) 1341 { 1342 for (var n = 0; n < window.resizeListeners.length; ++n) { 1343 if (window.resizeListeners[n].listener == e && window.resizeListeners[n].ref == t) { 1344 window.resizeListeners.splice(n, 1) 1345 } 1346 } 1347 } 1348})(); 1349Averta = {}; 1350Averta.Timer = function (e, t) 1351{ 1352 this.delay = e; 1353 this.currentCount = 0; 1354 this.paused = false;
1355 this.onTimer = null; 1356 this.refrence = null; 1357 if (t) { 1358 this.start() 1359 } 1360}; 1361Averta.Timer.prototype = { 1362 constructor: Averta.Timer, start: function () 1363 { 1364 this.paused = false; 1365 this.lastTime = Date.now() 1366 }, stop : function () 1367 { 1368 this.paused = true 1369 }, reset : function () 1370 { 1371 this.currentCount = 0; 1372 this.paused = true; 1373 this.lastTime = Date.now() 1374 }, update : function () 1375 { 1376 if (this.paused || Date.now() - this.lastTime < this.delay) { 1377 return; 1378 } 1379 this.currentCount++; 1380 this.lastTime = Date.now(); 1381 if (this.onTimer) { 1382 this.onTimer.call(this.refrence, this.getTime()) 1383 } 1384 }, getTime : function () 1385 { 1386 return this.delay * this.currentCount 1387 } 1388}; 1389var lastTime = 0; 1390var vendors = ["ms", "moz", "webkit", "o"]; 1391for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 1392 window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"]; 1393 window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] || window[vendors[x] + "CancelRequestAnimationFrame"] 1394} 1395if (!window.requestAnimationFrame) { 1396 window.requestAnimationFrame = function (e, t) 1397 { 1398 var n = (new Date).getTime(); 1399 var r = Math.max(0, 16 - (n - lastTime)); 1400 var i = window.setTimeout(function () 1401 { 1402 e(n + r) 1403 }, r); 1404 lastTime = n + r; 1405 return i 1406 }; 1407} 1408if (!window.cancelAnimationFrame) { 1409 window.cancelAnimationFrame = function (e) 1410 { 1411 clearTimeout(e) 1412 }; 1413} 1414Cute.Ticker = Cute.Ticker || { 1415 list : [], __stoped: true, add: function (e, t) 1416 { 1417 Cute.Ticker.list.push([e, t]); 1418 return Cute.Ticker.list.length 1419 }, remove: function (e, t) 1420 { 1421 for (var n = 0, r = Cute.Ticker.list.length; n < r; ++n) { 1422 if (Cute.Ticker.list[n] && Cute.Ticker.list[n][0] == e && Cute.Ticker.list[n][1] == t) { 1423 Cute.Ticker.list.splice(n, 1) 1424 } 1425 } 1426 }, start : function () 1427 { 1428 if (!Cute.Ticker.__stoped) { 1429 return; 1430 } 1431 Cute.Ticker.__stoped = false; 1432 Cute.Ticker.__tick() 1433 }, stop : function () 1434 { 1435 Cute.Ticker.__stoped = true 1436 }, __tick: function () 1437 { 1438 if (Cute.Ticker.__stoped) { 1439 return; 1440 } 1441 for (var e = 0; e < Cute.Ticker.list.length; ++e) { 1442 Cute.Ticker.list[e][0].call(Cute.Ticker.list[e][1]) 1443 } 1444 requestAnimationFrame(Cute.Ticker.__tick) 1445 } 1446}; 1447Cute.FallBack = function () 1448{ 1449}; 1450Cute.FallBack.CANVAS = "canvas"; 1451Cute.FallBack.CSS3D = "css3d"; 1452Cute.FallBack.DOM2D = "dom2d"; 1453Cute.FallBack.ua = (new UAParser).result; 1454Cute.FallBack.prototype = { 1455 force: null, __result: null, getType: function () 1456 { 1457 if (this.__result) { 1458 return this.__result; 1459 } 1460 if (this.force) { 1461 switch (this.force.toLowerCase()) { 1462 case"2d": 1463 this.__result = Cute.FallBack.DOM2D; 1464 break; 1465 case"canvas": 1466 this.__result = Cute.FallBack.CANVAS; 1467 break; 1468 case"css": 1469 this.__result = Cute.FallBack.CSS3D; 1470 break 1471 } 1472 if (this.__result) { 1473 return this.__result 1474 } 1475 } 1476 var e = Cute.FallBack.ua; 1477 var t = Cute.FallBack.DOM2D; 1478 var n = e.os.name.toLowerCase(); 1479 var r = e.browser.name.toLowerCase(); 1480 var i = false; 1481 switch (n) { 1482 case"windows": 1483 case"mac os": 1484 case"linux": 1485 case"ubuntu": 1486 if (r == "chrome" || r == "safari" || r == "chromium" || e.engine.name == "AppleWebKit") { 1487 t = Cute.FallBack.CSS3D; 1488 } 1489 else if (r == "ie" && parseInt(e.browser.major) >= 9 || r == "firefox" || r == "opera") { 1490 t = Cute.FallBack.CANVAS; 1491 } 1492 break; 1493 case"ios": 1494 t = Cute.FallBack.CSS3D; 1495 break; 1496 case"android": 1497 if (parseInt(e.os.version.charAt(0)) >= 4) { 1498 t = Cute.FallBack.CSS3D; 1499 } 1500 break; 1501 case"windows phone os": 1502 t = Cute.FallBack.DOM2D; 1503 break; 1504 default: 1505 i = true 1506 } 1507 if (window.Modernizr) { 1508 if (t == Cute.FallBack.CANVAS && !Modernizr.canvas) { 1509 t = Cute.FallBack.DOM2D; 1510 } 1511 else if (t == Cute.FallBack.CSS3D && !Modernizr.csstransforms3d) { 1512 t = Cute.FallBack.DOM2D; 1513 } 1514 else if (i) { 1515 if (Modernizr.csstransforms3d) { 1516 t = Cute.FallBack.CSS3D; 1517 } 1518 else if (Modernizr.canvas) { 1519 t = Cute.FallBack.CANVAS 1520 } 1521 } 1522 } 1523 if (n == "android" && r == "mobile safari") { 1524 t = Cute.FallBack.DOM2D; 1525 } 1526 this.__result = t; 1527 return t 1528 } 1529}; 1530Cute.FallBack.isIE = Cute.FallBack.ua.browser.name == "IE"; 1531Cute.FallBack.isIE7 = Cute.FallBack.isIE && Cute.FallBack.ua.browser.major == 7; 1532Cute.FallBack.isIE8 = Cute.FallBack.isIE && Cute.FallBack.ua.browser.major == 8; 1533Cute.FallBack.isMobileDevice = Cute.FallBack.ua.os.name.toLowerCase() == "android" || Cute.FallBack.ua.os.name.toLowerCase() == "ios" || Cute.FallBack.ua.os.name.toLowerCase() == "windows phone os", function () 1534{ 1535 if (Cute.FallBack.ua.browser.name == "IE" && parseInt(Cute.FallBack.ua.browser.major) < 9) { 1536 Date.now = function () 1537 { 1538 return (new Date).getTime() 1539 }; 1540 Array.prototype.indexOf = function (e) 1541 { 1542 for (var t = 0, n = this.length; t < n; ++t) { 1543 if (this[t] == e) { 1544 return t 1545 } 1546 } 1547 return -1 1548 } 1549 } 1550}(); 1551Cute.ModuleLoader = function (e) 1552{ 1553 this.fallBack = e 1554};
1555Cute.ModuleLoader.loadedModules = {css3d: false, canvas: false, dom2d: false}; 1556Cute.ModuleLoader.css3d_files = ["" + CSSettings.pluginPath + "/js/cute.css3d.module.js"]; 1557Cute.ModuleLoader.canvas_files = ["" + CSSettings.pluginPath + "/js/cute.canvas.module.js"]; 1558Cute.ModuleLoader.dom2d_files = ["" + CSSettings.pluginPath + "/js/cute.2d.module.js"]; 1559Cute.ModuleLoader.prototype = { 1560 onComplete: false, loadModule: function () 1561 { 1562 var e = this.fallBack.getType(); 1563 if (Cute.ModuleLoader.loadedModules[e]) { 1564 if (this.onComplete) { 1565 Cute.ModuleLoader.loadedModules[e] = true; 1566 this.onComplete.listener.call(this.onComplete.ref) 1567 } 1568 return 1569 } 1570 var t = []; 1571 switch (e) { 1572 case Cute.FallBack.CSS3D: 1573 t = Cute.ModuleLoader.css3d_files; 1574 break; 1575 case Cute.FallBack.CANVAS: 1576 t = Cute.ModuleLoader.canvas_files; 1577 break; 1578 case Cute.FallBack.DOM2D: 1579 t = Cute.ModuleLoader.dom2d_files; 1580 break 1581 } 1582 var n = this; 1583 yepnope.injectJs(t, function () 1584 { 1585 if (n.onComplete) { 1586 Cute.ModuleLoader.loadedModules[e] = true; 1587 n.onComplete.listener.call(n.onComplete.ref) 1588 } 1589 }) 1590 } 1591}; 1592window.Averta = window.Averta || {}; 1593Averta.EventDispatcher = function () 1594{ 1595 this.listeners = {} 1596}; 1597Averta.EventDispatcher.extend = function (e) 1598{ 1599 var t = new Averta.EventDispatcher; 1600 for (var n in t) { 1601 if (n != "constructor") { 1602 e[n] = Averta.EventDispatcher.prototype[n] 1603 } 1604 } 1605}; 1606Averta.EventDispatcher.prototype = { 1607 constructor : Averta.EventDispatcher, addEventListener: function (e, t, n) 1608 { 1609 if (!this.listeners[e]) { 1610 this.listeners[e] = []; 1611 } 1612 this.listeners[e].push({listener: t, ref: n}) 1613 }, removeEventListener: function (e, t, n) 1614 { 1615 if (this.listener[e.type]) { 1616 for (var r = 0, i = this.listeners[e].length; r < i; ++r) { 1617 if (t == this.listeners[e][r].listener && n == this.listeners[e][r].ref) { 1618 this.listeners[e].splice(r); 1619 } 1620 } 1621 if (this.listeners[e].length == 0) { 1622 delete this.listeners[e] 1623 } 1624 } 1625 }, dispatchEvent : function (e) 1626 { 1627 e.target = this; 1628 if (this.listeners[e.type]) { 1629 for (var t = 0, n = this.listeners[e.type].length; t < n; ++t) { 1630 this.listeners[e.type][t].listener.call(this.listeners[e.type][t].ref, e) 1631 } 1632 } 1633 } 1634}; 1635Cute.SliderEvent = function (e) 1636{ 1637 this.type = e 1638}; 1639Cute.SliderEvent.CHANGE_START = "changeStart"; 1640Cute.SliderEvent.CHANGE_END = "changeEnd"; 1641Cute.SliderEvent.WATING = "wating"; 1642Cute.SliderEvent.AUTOPLAY_CHANGE = "autoplayChange"; 1643Cute.SliderEvent.CHANGE_NEXT_SLIDE = "changeNextSlide"; 1644Cute.SliderEvent.WATING_FOR_NEXT = "watingForNextSlide"; 1645window.Averta = window.Averta || {}; 1646Averta.ScrollContainer = function (e, t) 1647{ 1648 this.element = e; 1649 this.scrollStartPosY = 0; 1650 this.scrollStartPosX = 0; 1651 this.content = t; 1652 this.lastX = 0; 1653 this.lastY = 0; 1654 this.moved = false; 1655 this.isTouch = function () 1656 { 1657 try { 1658 document.createEvent("TouchEvent"); 1659 return true 1660 } 1661 catch (e) { 1662 return false 1663 } 1664 } 1665}; 1666Averta.ScrollContainer.prototype = { 1667 constrcutor : Averta.ScrollContainer, setup: function () 1668 { 1669 function e(e) 1670 { 1671 if (s) { 1672 i.scrollStartPosX = e.touches[0].pageX; 1673 i.scrollStartPosY = e.touches[0].pageY 1674 } 1675 else { 1676 i.scrollStartPosX = e.clientX; 1677 i.scrollStartPosY = e.clientY 1678 } 1679 i.mouseDown = true; 1680 i.moved = false; 1681 if (window.addEventListener) { 1682 e.preventDefault() 1683 } 1684 } 1685 1686 function t(e) 1687 { 1688 if (!i.mouseDown) { 1689 return; 1690 } 1691 if (s) { 1692 var t = e.touches[0].pageX; 1693 var n = e.touches[0].pageY; 1694 i.move(t - i.scrollStartPosX + i.lastX, n - i.scrollStartPosY + i.lastY); 1695 i.scrollStartPosX = t; 1696 i.scrollStartPosY = n 1697 } 1698 else { 1699 i.move(e.clientX - i.scrollStartPosX + i.lastX, e.clientY - i.scrollStartPosY + i.lastY); 1700 i.scrollStartPosX = e.clientX; 1701 i.scrollStartPosY = e.clientY 1702 } 1703 if (window.addEventListener) { 1704 e.preventDefault() 1705 } 1706 } 1707 1708 function n(e) 1709 { 1710 function t(e) 1711 { 1712 var t = 0; 1713 var n = 0; 1714 while (e && !isNaN(e.offsetLeft) && !isNaN(e.offsetTop)) { 1715 t += e.offsetLeft - e.scrollLeft; 1716 n += e.offsetTop - e.scrollTop; 1717 e = e.offsetParent 1718 } 1719 return {top: n, left: t} 1720 } 1721 1722 var n = t(i.element).left; 1723 i.element.childNodes[0].style.left = -(e.clientX - n) / (i.element.offsetWidth / (i.element.childNodes[0].offsetWidth - i.element.offsetWidth)) + "px" 1724 } 1725 1726 function r(e) 1727 { 1728 if (!i.mouseDown) { 1729 return; 1730 } 1731 i.mouseDown = false;
1732 if (window.addEventListener) { 1733 e.preventDefault() 1734 } 1735 if (s) { 1736 document.removeEventListener("touchend", i.element, false); 1737 return 1738 } 1739 if (document.detachEvent) { 1740 document.detachEvent("onmousemove", i.element); 1741 } 1742 else { 1743 document.removeEventListener("mousemove", i.element, false) 1744 } 1745 } 1746 1747 if (Cute.FallBack.isIE7) { 1748 return; 1749 } 1750 var i = this; 1751 var s = this.isTouch(); 1752 if (s) { 1753 this.element.addEventListener("touchstart", e); 1754 this.element.addEventListener("touchmove", t); 1755 return 1756 } 1757 if (window.addEventListener) { 1758 this.element.addEventListener("mousemove", n, false) 1759 } 1760 else { 1761 this.element.attachEvent("onmousemove", n, false) 1762 } 1763 }, move : function (e, t) 1764 { 1765 this.moved = true; 1766 this.element.scrollTop = -t; 1767 this.element.scrollLeft = -e; 1768 this.lastX = -this.element.scrollLeft; 1769 this.lastY = -this.element.scrollTop 1770 }, translate: function (e, t) 1771 { 1772 this.move(this.lastX + (e || 0), this.lastY + (t || 0)) 1773 } 1774}; 1775Cute.ItemList = function (e) 1776{ 1777 this.frame = document.createElement("div"); 1778 this.frame.className = "il-frame"; 1779 this.content = document.createElement("div"); 1780 this.content.className = "il-content"; 1781 this.type = "vertical"; 1782 this.items = []; 1783 this.sc = new Averta.ScrollContainer(this.frame, this.content); 1784 var t = this; 1785 var n = 0; 1786 var r = false; 1787 var i = this.sc.isTouch(); 1788 this.__scrollnext = function (e) 1789 { 1790 r = true; 1791 n = 2; 1792 Cute.Ticker.add(t.__scrolling, t); 1793 if (i) { 1794 e.preventDefault() 1795 } 1796 }; 1797 this.__scrollprev = function (e) 1798 { 1799 r = true; 1800 n = -2; 1801 Cute.Ticker.add(t.__scrolling, t); 1802 if (i) { 1803 e.preventDefault() 1804 } 1805 }; 1806 this.__stopscroll = function (e) 1807 { 1808 if (!r) { 1809 return; 1810 } 1811 r = false; 1812 Cute.Ticker.remove(t.__scrolling, t); 1813 t.sc.moved = false; 1814 if (i) { 1815 e.preventDefault() 1816 } 1817 }; 1818 this.__scrolling = function () 1819 { 1820 if (t.type == "vertical") { 1821 t.sc.translate(0, n); 1822 } 1823 else { 1824 t.sc.translate(-n, 0) 1825 } 1826 }; 1827 this.upleft = document.createElement("div"); 1828 this.upleft.onmousedown = this.__scrollprev; 1829 this.downright = document.createElement("div"); 1830 this.downright.onmousedown = this.__scrollnext; 1831 document.onmouseup = this.__stopscroll; 1832 if (i) { 1833 this.upleft.addEventListener("touchstart", this.__scrollprev, false); 1834 this.downright.addEventListener("touchstart", this.__scrollnext, false); 1835 document.addEventListener("touchend", this.__stopscroll, false) 1836 } 1837 this.container = document.createElement("div"); 1838 this.container.className = "br-thumblist-container"; 1839 e.appendChild(this.container); 1840 this.container.appendChild(this.frame); 1841 this.container.appendChild(this.downright); 1842 this.container.appendChild(this.upleft); 1843 this.frame.appendChild(this.content); 1844 this.addItem = function (e) 1845 { 1846 this.content.appendChild(e); 1847 this.items.push(e) 1848 } 1849}; 1850Cute.Slide = function (e) 1851{ 1852 this.src = ""; 1853 this.delay = 0; 1854 this.slider = e; 1855 this.ready = false; 1856 this._index = 0; 1857 this.autoPlay = true; 1858 this.pluginData = {}; 1859 this.opacity = 100; 1860 this.domElement = document.createElement("div"); 1861 this.domElement.style.width = "100%"; 1862 this.domElement.style.height = "auto"; 1863 this.domElement.style.overflow = "hidden"; 1864 this.domElement.style.position = "absolute"; 1865 this.domElement.style.zIndex = "1" 1866}; 1867Cute.Slide.prototype = { 1868 constructor : Cute.Slide, loadContent: function () 1869 { 1870 if (this.src != null) { 1871 this.image = new Image; 1872 this.image.slide = this; 1873 this.image.onload = this.contentLoaded; 1874 this.image.src = this.src; 1875 this.image.style.width = "100%"; 1876 this.image.style.height = "auto" 1877 } 1878 else { 1879 this.ready = true; 1880 this.onReady.listener.call(this.onReady.ref) 1881 } 1882 }, killLoading : function () 1883 { 1884 this.image.onload = null 1885 }, addContent : function (e) 1886 { 1887 this.domElement.appendChild(e); 1888 this.image = e; 1889 this.image.style.width = "100%"; 1890 this.image.style.height = "auto"; 1891 this.ready = true; 1892 if (this.onReady) { 1893 this.onReady.listener.call(this.onReady.ref); 1894 } 1895 this.prepareToShow(); 1896 this.showIsDone() 1897 }, showIsDone : function () 1898 { 1899 }, hideIsDone : function () 1900 { 1901 }, prepareToShow: function () 1902 { 1903 }, prepareToHide: function () 1904 { 1905 }, contentLoaded: function () 1906 { 1907 this.slide.domElement.appendChild(this); 1908 this.slide.ready = true; 1909 if (this.slide.onReady) { 1910 this.slide.onReady.listener.call(this.slide.onReady.ref) 1911 } 1912 }, opacityUpdate: function () 1913 { 1914 setOpacity(this.domElement, this.opacity) 1915 } 1916}; 1917Cute.SlideManager = function () 1918{ 1919 Averta.EventDispatcher.prototype.constructor.call(this); 1920 this.width = 0; 1921 this.height = 0; 1922 this._timer = new Averta.Timer(100); 1923 this._slideList = []; 1924 this._currentSlideIndex = 0; 1925 this._delayProgress = 0; 1926 this._autoPlay = true; 1927 this._status = ""; 1928 this.domElement = document.createElement("div"); 1929 this.domElement.style.position = "relative"; 1930 this._timer.onTimer = this.onTimer; 1931 this._timer.refrence = this 1932}; 1933Cute.SlideManager.prototype = { 1934 constructor : Cute.SlideManager, startTimer: function () 1935 { 1936 if (!this._autoPlay) { 1937 return false;
1938 } 1939 this._timer.start(); 1940 return true 1941 }, skipTimer : function () 1942 { 1943 this._timer.reset(); 1944 this._delayProgress = 100; 1945 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.WATING)) 1946 }, onTimer : function (e) 1947 { 1948 if (this._timer.getTime() >= this._currentSlide.delay * 1e3) { 1949 this._timer.stop(); 1950 if (this._nextSlide.ready) { 1951 this.showSlide(this._nextSlide); 1952 } 1953 else { 1954 this.waitForNext() 1955 } 1956 } 1957 this._delayProgress = this._timer.getTime() / (this._currentSlide.delay * 10); 1958 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.WATING)) 1959 }, prepareTransition : function (e) 1960 { 1961 if (this.rotator.fallBack.getType() == Cute.FallBack.DOM2D) { 1962 return e.transitions2D[parseInt(Math.random() * e.transitions2D.length)]; 1963 } 1964 else { 1965 return e.transitions3D[parseInt(Math.random() * e.transitions3D.length)] 1966 } 1967 }, showSlide : function (e) 1968 { 1969 var t = this.prepareTransition(e); 1970 this._oldSlide = this._currentSlide; 1971 this._currentSlide = e; 1972 this._oldSlide.prepareToHide(); 1973 e.prepareToShow(); 1974 if(typeof(this._viewClass) !== 'undefined'){ 1975 this._view = new this._viewClass(t.row, t.col); 1976 } 1977 this._view.setSize(this.width, this.height); 1978 this._view.setViewPortSize(this.vpWidth, this.vpHeight); 1979 this._view.oldSource = this._oldSlide.image; 1980 this._view.newSource = e.image; 1981 this._view.setup(); 1982 if (this._view.needRendering) { 1983 Cute.Ticker.add(this._view.render, this._view); 1984 } 1985 this._engine = new Aroma.Engine(this._view); 1986 t.selector.reset(); 1987 this._engine.start(t.effect, t.selector, t.duration, t.overlapping, .45); 1988 this._engine.onComplete = {ref: this, listener: this.transitionCl}; 1989 this._replaceTween = (new TWEEN.Tween(this._oldSlide)).to({opacity: 0}, 450).onUpdate(this._oldSlide.opacityUpdate).start(); 1990 this._replaceTween.slider = this; 1991 this.newSlide = e; 1992 this._replaceTween.onComplete(function () 1993 { 1994 this.slider.domElement.removeChild(this.domElement) 1995 }); 1996 this.domElement.appendChild(this._view.viewport); 1997 this._view.viewport.style.position = "absolute"; 1998 this._view.viewport.style.zIndex = "0"; 1999 this._view.viewport.style.marginLeft = -(this.vpWidth - this.width) / 2 + "px"; 2000 this._view.viewport.style.marginTop = -(this.vpHeight - this.height) / 2 + "px"; 2001 this._currentSlideIndex = e.index; 2002 this._timer.reset(); 2003 this._delayProgress = 0; 2004 this._status = "changing"; 2005 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.WATING)); 2006 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.CHANGE_START)) 2007 }, transitionCl : function () 2008 { 2009 this._engine.reset(); 2010 this._currentSlide.opacity = 0; 2011 this.domElement.appendChild(this._currentSlide.domElement); 2012 this._replaceTween2 = (new TWEEN.Tween(this._currentSlide)).to({opacity: 100}, 450).onUpdate(this._currentSlide.opacityUpdate); 2013 TWEEN.add(this._replaceTween2); 2014 this._replaceTween2.start(); 2015 this._replaceTween2.onComplete(function () 2016 { 2017 if (this.slider._view.needRendering) { 2018 Cute.Ticker.remove(this.slider._view.render, this.slider._view); 2019 } 2020 TWEEN.remove(this.slider._replaceTween2); 2021 this.slider.domElement.removeChild(this.slider._view.viewport); 2022 this.slider._view.dispose(); 2023 this.slider._view = null; 2024 this.slider._currentSlide.showIsDone(); 2025 this.slider._oldSlide.hideIsDone(); 2026 this.slider._status = "wating"; 2027 this.slider.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.CHANGE_END)) 2028 }); 2029 this._engine = null; 2030 this.startTimer(); 2031 this.gotoSlide(this.getNextIndex()) 2032 }, readyToShow : function () 2033 { 2034 if (this._delayProgress == 100) { 2035 this.showSlide(this._nextSlide) 2036 } 2037 }, waitForNext : function () 2038 { 2039 this._status = "loading"; 2040 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.WATING_FOR_NEXT)) 2041 }, resize : function () 2042 { 2043 if (this._status == "changing") { 2044 if (this._engine) { 2045 this._engine.removeTweens(); 2046 this._engine.reset() 2047 } 2048 if (this._view) { 2049 if (this._view.needRendering) { 2050 Cute.Ticker.remove(this._view.render, this._view); 2051 } 2052 this.domElement.removeChild(this._view.viewport); 2053 this._view.dispose(); 2054 this._view = null; 2055 this._engine = null 2056 } 2057 if (this._replaceTween2) { 2058 this._replaceTween2.stop(); 2059 TWEEN.remove(this._replaceTween2) 2060 } 2061 if (!this._currentSlide.domElement.parentElement) { 2062 this.domElement.appendChild(this._currentSlide.domElement); 2063 } 2064 this._currentSlide.opacity = 100; 2065 this._currentSlide.opacityUpdate(); 2066 this._currentSlide.showIsDone(); 2067 if (this._replaceTween) { 2068 this._replaceTween.stop(); 2069 TWEEN.remove(this._replaceTween) 2070 } 2071 if (!this._oldSlide.domElement.parentElement) { 2072 this.domElement.appendChild(this._oldSlide.domElement); 2073 } 2074 this._oldSlide.opacity = 0; 2075 this._oldSlide.opacityUpdate(); 2076 this._oldSlide.hideIsDone(); 2077 this._status = "wating"; 2078 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.CHANGE_END)); 2079 this.startTimer(); 2080 this.gotoSlide(this.getNextIndex()) 2081 } 2082 }, getNextIndex : function () 2083 { 2084 if (this._currentSlideIndex + 1 == this._slideList.length) { 2085 return 0; 2086 } 2087 else { 2088 return this._currentSlideIndex + 1 2089 } 2090 }, getPreviousIndex : function () 2091 { 2092 if (this._currentSlideIndex - 1 == -1) { 2093 return this._slideList.length - 1; 2094 } 2095 else { 2096 return this._currentSlideIndex - 1 2097 } 2098 }, gotoSlide : function (e, t) 2099 { 2100 if (t) { 2101 this.skipTimer(); 2102 if (this._nextSlide && this._nextSlide.index == e) { 2103 if (this._nextSlide.ready) { 2104 this.showSlide(this._nextSlide); 2105 } 2106 else { 2107 this.waitForNext(); 2108 } 2109 return 2110 } 2111 } 2112 if (this._nextSlide && this._nextSlide.index == e) { 2113 return; 2114 } 2115 if (this._nextSlide) { 2116 this._nextSlide.killLoading(); 2117 this._nextSlide = null 2118 } 2119 this._nextSlide = this._slideList[e]; 2120 if (!this._nextSlide.ready) { 2121 if (t) { 2122 this.waitForNext(); 2123 } 2124 this._nextSlide.onReady = {listener: this.readyToShow, ref: this}; 2125 this._nextSlide.loadContent() 2126 } 2127 else if (this._delayProgress == 100) { 2128 this.showSlide(this._slideList[e]) 2129 } 2130 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.CHANGE_NEXT_SLIDE)) 2131 }, start : function () 2132 { 2133 this._currentSlide = this._slideList[this._currentSlideIndex]; 2134 this.domElement.appendChild(this._currentSlide.domElement); 2135 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.CHANGE_END)); 2136 this.startTimer(); 2137 this.gotoSlide(this.getNextIndex()); 2138 this.vpWidth = this.vpWidth || this.width; 2139 this.vpHeight = this.vpHeight || this.height 2140 }, next : function () 2141 { 2142 if (this._status == "changing") { 2143 return; 2144 } 2145 this.gotoSlide(this.getNextIndex(), true) 2146 }, previous : function () 2147 { 2148 if (this._status == "changing") { 2149 return; 2150 } 2151 this.gotoSlide(this.getPreviousIndex(), true) 2152 }, pushSlide : function (e) 2153 { 2154 this._slideList.push(e); 2155 e.index = this._slideList.length - 1; 2156 return this._slideList.length - 1 2157 }, pause : function () 2158 { 2159 this._timer.stop() 2160 }, play : function () 2161 { 2162 this._timer.start() 2163 }, getTimer : function () 2164 { 2165 return this._timer 2166 }, getSlideList : function () 2167 { 2168 return this._slideList 2169 }, getNextSlide : function () 2170 { 2171 return this._nextSlide 2172 }, getCurrentSlide : function () 2173 { 2174 return this._currentSlide 2175 }, getCurrentSlideIndex: function () 2176 { 2177 return this._currentSlideIndex 2178 }, delayProgress : function () 2179 { 2180 return this._delayProgress 2181 }, getAutoPlay : function () 2182 { 2183 return this._autoPlay 2184 }, setAutoPlay : function (e) 2185 { 2186 if (this._autoPlay == e) { 2187 return; 2188 } 2189 this._autoPlay = e; 2190 if (!this._autoPlay) { 2191 this._timer.stop(); 2192 } 2193 else { 2194 this._timer.start(); 2195 } 2196 this.dispatchEvent(new Cute.SliderEvent(Cute.SliderEvent.AUTOPLAY_CHANGE)) 2197 } 2198}; 2199Averta.EventDispatcher.extend(Cute.SlideManager.prototype); 2200Cute.rotatorControls = {}; 2201Cute.AbstractControl = function (e) 2202{ 2203 this.config = null; 2204 this.slider = e; 2205 this.domElement = null; 2206 this.disable = false;
2207 this.name = ""; 2208 this.config = {}; 2209 this.opacity = 100; 2210 this.showTween = null 2211}; 2212Cute.AbstractControl.prototype = { 2213 constructor : Cute.AbstractControl, setup: function (e) 2214 { 2215 this.config_ele = e; 2216 this.domElement.className = e.className || this.config.css_class; 2217 if (e.getAttribute("style")) { 2218 this.domElement.setAttribute("style", e.getAttribute("style")); 2219 } 2220 this.slider.addEventListener(Cute.SliderEvent.CHANGE_START, this.__effStart, this); 2221 this.slider.addEventListener(Cute.SliderEvent.CHANGE_END, this.__effEnd, this) 2222 }, opacityUpdate: function () 2223 { 2224 setOpacity(this.domElement, this.opacity) 2225 }, visible : function (e) 2226 { 2227 this.domElement.style.display = !e ? "none" : "" 2228 }, show : function () 2229 { 2230 if (this.showTween) { 2231 this.showTween.stop(); 2232 } 2233 this.showTween = (new TWEEN.Tween(this)).to({opacity: 100}, 450).onUpdate(this.opacityUpdate).start(); 2234 TWEEN.add(this.showTween) 2235 }, hide : function () 2236 { 2237 if (this.showTween) { 2238 this.showTween.stop(); 2239 } 2240 this.showTween = (new TWEEN.Tween(this)).to({opacity: 0}, 450).onUpdate(this.opacityUpdate).start(); 2241 TWEEN.add(this.showTween) 2242 }, __effEnd : function (e) 2243 { 2244 this.visible(true); 2245 if (!this.config.autoHide) { 2246 this.show(); 2247 } 2248 if (this.ap) { 2249 this.slider.setAutoPlay(true) 2250 } 2251 }, __effStart : function (e) 2252 { 2253 this.hide() 2254 } 2255}; 2256Cute.Next = function (e) 2257{ 2258 Cute.AbstractControl.prototype.constructor.call(this, e); 2259 this.domElement = document.createElement("div"); 2260 this.config = {css_class: "br-next"} 2261}; 2262Cute.rotatorControls.next = Cute.Next; 2263Cute.Next.prototype = new Cute.AbstractControl; 2264Cute.Next.prototype.constructor = Cute.Next; 2265Cute.Next.prototype.setup = function (e) 2266{ 2267 Cute.AbstractControl.prototype.setup.call(this, e); 2268 this.domElement.control = this; 2269 this.domElement.onclick = function () 2270 { 2271 this.control.slider.next() 2272 } 2273}; 2274Cute.Next.prototype.show = function () 2275{ 2276 Cute.AbstractControl.prototype.show.call(this); 2277 this.domElement.style.cursor = "pointer" 2278}; 2279Cute.Next.prototype.hide = function () 2280{ 2281 Cute.AbstractControl.prototype.hide.call(this); 2282 this.domElement.style.cursor = "" 2283}; 2284Cute.Previous = function (e) 2285{ 2286 Cute.Next.call(this, e); 2287 this.config = {css_class: "br-previous"} 2288}; 2289Cute.rotatorControls.previous = Cute.Previous; 2290Cute.Previous.prototype = new Cute.Next; 2291Cute.Previous.prototype.constructor = Cute.Previous; 2292Cute.Previous.prototype.setup = function (e) 2293{ 2294 Cute.Next.prototype.setup.call(this, e); 2295 this.domElement.onclick = function () 2296 { 2297 this.control.slider.previous() 2298 } 2299}; 2300Cute.CircleTimer = function (e) 2301{ 2302 Cute.AbstractControl.call(this, e); 2303 this.domElement = document.createElement("div"); 2304 this.lbrowser = Cute.FallBack.ua.browser.name.toLowerCase() == "ie" && parseInt(Cute.FallBack.ua.browser.major) < 9; 2305 if (this.lbrowser) { 2306 return; 2307 } 2308 this.config = {color: "#fff", stroke: 10, radius: 4, css_class: "br-circle-timer"}; 2309 this.overpause = false; 2310 this.canvas = document.createElement("canvas"); 2311 this.dot = document.createElement("div"); 2312 this.ctx = this.canvas.getContext("2d"); 2313 this.prog = 0; 2314 this.drawTween = null 2315}; 2316Cute.rotatorControls.circletimer = Cute.CircleTimer; 2317Cute.CircleTimer.prototype = new Cute.AbstractControl; 2318Cute.CircleTimer.prototype.constructor = Cute.CircleTimer; 2319Cute.CircleTimer.prototype.setup = function (e) 2320{ 2321 if (this.lbrowser) { 2322 return; 2323 } 2324 Cute.AbstractControl.prototype.setup.call(this, e); 2325 this.config.color = e.getAttribute("data-color") || this.config.color; 2326 if (e.getAttribute("data-stroke")) { 2327 this.config.stroke = parseInt(e.getAttribute("data-stroke")); 2328 } 2329 if (e.getAttribute("data-radius")) { 2330 this.config.radius = parseInt(e.getAttribute("data-radius")); 2331 } 2332 this.__w = (this.config.radius + this.config.stroke) * 2; 2333 this.canvas.width = this.__w; 2334 this.canvas.height = this.__w; 2335 this.canvas.className = "br-timer-stroke"; 2336 this.canvas.style.position = "absolute"; 2337 this.dot.className = "br-timer-dot"; 2338 this.dot.style.position = "relative"; 2339 this.dot.style.left = (this.__w - 10) * .5 + "px"; 2340 this.dot.style.top = (this.__w - 12) * .5 + "px"; 2341 this.domElement.slider = this.slider; 2342 this.domElement.onclick = function () 2343 { 2344 if (!Cute.AbstractControl.paused) { 2345 Cute.AbstractControl.paused = true; 2346 this.slider.setAutoPlay(false) 2347 } 2348 else { 2349 Cute.AbstractControl.paused = false;
2350 this.slider.setAutoPlay(true) 2351 } 2352 }; 2353 this.slider.addEventListener(Cute.SliderEvent.WATING, this.update, this); 2354 this.domElement.appendChild(this.canvas); 2355 this.domElement.appendChild(this.dot) 2356}; 2357Cute.CircleTimer.prototype.update = function (e) 2358{ 2359 if (this.drawTween) { 2360 this.drawTween.stop(); 2361 } 2362 this.drawTween = (new TWEEN.Tween(this)).to({prog: this.slider.delayProgress() * .01}, 300).easing(TWEEN.Easing.Circular.EaseOut).onUpdate(this.draw).start() 2363}; 2364Cute.CircleTimer.prototype.draw = function () 2365{ 2366 this.ctx.clearRect(0, 0, this.__w, this.__w); 2367 this.ctx.beginPath(); 2368 this.ctx.arc(this.__w * .5, this.__w * .5, this.config.radius, Math.PI * 1.5, Math.PI * 1.5 + 2 * Math.PI * this.prog, false); 2369 this.ctx.strokeStyle = this.config.color; 2370 this.ctx.lineWidth = this.config.stroke; 2371 this.ctx.stroke() 2372}; 2373Cute.CircleTimer.prototype.show = function () 2374{ 2375 Cute.AbstractControl.prototype.show.call(this); 2376 this.domElement.style.cursor = "pointer" 2377}; 2378Cute.CircleTimer.prototype.hide = function () 2379{ 2380 Cute.AbstractControl.prototype.hide.call(this); 2381 this.domElement.style.cursor = "" 2382}; 2383Cute.Thumb = function (e, t) 2384{ 2385 this.domElement = document.createElement("div"); 2386 this.domElement.className = "br-thumb-" + t; 2387 this.imgCont = document.createElement("div"); 2388 this.imgCont.className = "br-thumb-img"; 2389 this.imgCont.style.overflow = "hidden"; 2390 this.img = new Image; 2391 this.img.thumb = this; 2392 this.img.onload = this.thumbLoaded; 2393 this.img.src = e; 2394 this.img.style.position = "absolute"; 2395 this.img.style.filter = "inherit"; 2396 this.frame = document.createElement("div"); 2397 this.frame.style.position = "absolute"; 2398 this.frame.style.zIndex = "1"; 2399 this.frame.className = "br-thumb-frame"; 2400 this.frame.style.filter = "inherit"; 2401 this.thumb_pos = 1; 2402 this.imgCont.appendChild(this.img); 2403 this.domElement.appendChild(this.imgCont); 2404 this.domElement.appendChild(this.frame) 2405}; 2406Cute.Thumb.prototype = { 2407 constructor: Cute.Thumb, thumbLoaded: function () 2408 { 2409 this.thumb.imgLoaded = true; 2410 if (this.thumb.rts) { 2411 this.thumb.show() 2412 } 2413 }, ut : function () 2414 { 2415 this.img.style.transform = "scale(" + this.thumb_pos + ")"; 2416 this.img.style.webkitTransform = "scale(" + this.thumb_pos + ")"; 2417 this.img.style.MozTransform = "scale(" + this.thumb_pos + ") rotate(0.1deg)"; 2418 this.img.style.msTransform = "scale(" + this.thumb_pos + ")"; 2419 this.img.style.OTransform = "scale(" + this.thumb_pos + ")" 2420 }, show : function () 2421 { 2422 if (!this.imgLoaded) { 2423 this.rts = true; 2424 return 2425 } 2426 }, reset : function () 2427 { 2428 this.rts = false; 2429 if (this.st) { 2430 this.st.stop(); 2431 this.st = null 2432 } 2433 } 2434}; 2435Cute.SlideControl = function (e) 2436{ 2437 Cute.AbstractControl.call(this, e); 2438 this.config = {css_class: "br-slidecontrol", thumb: true, thumb_align: "bottom"}; 2439 this.domElement = document.createElement("div"); 2440 this.points_ul = document.createElement("ul"); 2441 this.points = [] 2442}; 2443Cute.rotatorControls.slidecontrol = Cute.SlideControl; 2444Cute.SlideControl.prototype = new Cute.AbstractControl; 2445Cute.SlideControl.prototype.constructor = Cute.SlideControl; 2446Cute.SlideControl.prototype.setup = function (e) 2447{ 2448 Cute.AbstractControl.prototype.setup.call(this, e); 2449 this.domElement.appendChild(this.points_ul); 2450 this.slider.addEventListener(Cute.SliderEvent.CHANGE_NEXT_SLIDE, this.update, this); 2451 this.config.thumb = e.getAttribute("data-thumb") != "false"; 2452 this.config.thumb_align = e.getAttribute("data-thumbalign") || "bottom"; 2453 var t; 2454 for (var n = 0, r = this.slider.getSlideList().length; n < r; ++n) { 2455 t = new Cute.SlideControl.Point(this.slider, this.slider.getSlideList()[n], this); 2456 if (n == this.slider.getCurrentSlideIndex()) { 2457 this.selectedPoint = t; 2458 t.select() 2459 } 2460 t.index = n; 2461 this.points_ul.appendChild(t.domElement); 2462 this.points.push(t) 2463 } 2464}; 2465Cute.SlideControl.prototype.update = function () 2466{ 2467 if (this.selectedPoint && this.slider.getCurrentSlideIndex() == this.selectedPoint.index) { 2468 return; 2469 } 2470 if (this.selectedPoint) { 2471 this.selectedPoint.unselect(); 2472 } 2473 this.selectedPoint = this.points[this.slider.getCurrentSlideIndex()]; 2474 this.selectedPoint.select() 2475}; 2476Cute.SlideControl.prototype.show = function () 2477{ 2478 Cute.AbstractControl.prototype.show.call(this); 2479 this.disable = false;
2480 this.domElement.style.cursor = "pointer" 2481}; 2482Cute.SlideControl.prototype.hide = function () 2483{ 2484 Cute.AbstractControl.prototype.hide.call(this); 2485 this.disable = true; 2486 this.domElement.style.cursor = "default" 2487}; 2488Cute.SlideControl.Point = function (e, t, n) 2489{ 2490 this.domElement = document.createElement("li"); 2491 this.slider = e; 2492 this.index = 0; 2493 this.domElement.point = this; 2494 this.sc = n; 2495 this.domElement.onclick = function () 2496 { 2497 if (this.point.sc.disable) { 2498 return; 2499 } 2500 this.point.changeSlide() 2501 }; 2502 if (Cute.FallBack.ua.browser.name == "IE") { 2503 this.domElement.style.filter = "inherit"; 2504 } 2505 this.selectedElement = document.createElement("span"); 2506 this.selectedElement.className = "br-control-selected"; 2507 this.selectOpacity = 0; 2508 this.uo(); 2509 if (n.config.thumb) { 2510 this.thumb = new Cute.Thumb(t.thumb, n.config.thumb_align); 2511 this.domElement.onmouseover = function () 2512 { 2513 this.point.showThumb() 2514 }; 2515 this.domElement.onmouseout = function () 2516 { 2517 this.point.hideThumb() 2518 }; 2519 this.thumb_pos = 0; 2520 this.drawThumb(); 2521 this.thumb.domElement.style.display = "none"; 2522 this.domElement.appendChild(this.thumb.domElement); 2523 this.thumb.align = n.config.thumb_align 2524 } 2525 this.domElement.appendChild(this.selectedElement); 2526 this.selectTween = null 2527}; 2528Cute.SlideControl.Point.prototype = { 2529 constructor : Cute.SlideControl.Point, align: "bottom", changeSlide: function () 2530 { 2531 this.slider.gotoSlide(this.index, true) 2532 }, uo : function () 2533 { 2534 }, select : function () 2535 { 2536 if (this.selectTween) { 2537 this.selectTween.stop(); 2538 } 2539 this.selectedElement.style.display = "block" 2540 }, unselect : function () 2541 { 2542 if (this.selectTween) { 2543 this.selectTween.stop(); 2544 } 2545 this.selectedElement.style.display = "none" 2546 }, drawThumb: function () 2547 { 2548 setOpacity(this.thumb.domElement, this.thumb_pos); 2549 if (this.sc.config.thumb_align == "up") { 2550 this.thumb.domElement.style.top = 10 - this.thumb.frame.offsetHeight + -this.thumb_pos * .1 + "px"; 2551 } 2552 else { 2553 this.thumb.domElement.style.top = 24 + -this.thumb_pos * .1 + "px" 2554 } 2555 }, showThumb: function () 2556 { 2557 this.domElement.style.zIndex = this.slider.getSlideList().length; 2558 if (this.thumbTween) { 2559 this.thumbTween.stop(); 2560 } 2561 this.thumb.show(); 2562 this.thumb.domElement.style.display = ""; 2563 this.thumbTween = (new TWEEN.Tween(this)).to({thumb_pos: 100}, 700).onUpdate(this.drawThumb).easing(TWEEN.Easing.Quartic.EaseOut).start() 2564 }, hideThumb: function () 2565 { 2566 this.domElement.style.zIndex = 0; 2567 if (this.thumbTween) { 2568 this.thumbTween.stop(); 2569 } 2570 this.thumb.reset(); 2571 this.thumbTween = (new TWEEN.Tween(this)).to({thumb_pos: 0}, 250).onUpdate(this.drawThumb).start().onComplete(function () 2572 { 2573 this.thumb.domElement.style.display = "none" 2574 }) 2575 } 2576}; 2577Cute.SlideInfo = function (e) 2578{ 2579 Cute.AbstractControl.call(this, e); 2580 this.config = {css_class: "br-slideinfo", align: "bottom"}; 2581 this.domElement = document.createElement("div"); 2582 this.content = document.createElement("div"); 2583 this.poition = 0 2584}; 2585Cute.rotatorControls.slideinfo = Cute.SlideInfo; 2586Cute.SlideInfo.prototype = new Cute.AbstractControl; 2587Cute.SlideInfo.prototype.constructor = Cute.SlideInfo; 2588Cute.SlideInfo.prototype.setup = function (e) 2589{ 2590 Cute.AbstractControl.prototype.setup.call(this, e); 2591 this.domElement.style.overflow = "hidden"; 2592 this.domElement.style.position = "absolute"; 2593 this.domElement.style.display = "none"; 2594 this.content.className = "br-infocontent"; 2595 this.content.style.position = "relative"; 2596 this.eff = e.getAttribute("data-effect") || "slide"; 2597 this.domElement.appendChild(this.content) 2598}; 2599Cute.SlideInfo.prototype.update = function () 2600{ 2601 if (this.data) { 2602 if (this.eff == "fade") { 2603 setOpacity(this.content, this.position); 2604 } 2605 else { 2606 this.content.style[this.data.align] = this.position + "px" 2607 } 2608 } 2609}; 2610Cute.SlideInfo.prototype.show = function () 2611{ 2612 this.domElement.style.display = ""; 2613 if (this.showTween) { 2614 this.showTween.stop(); 2615 } 2616 this.data = this.slider.getCurrentSlide().pluginData.info; 2617 if (!this.data) { 2618 this.disable = true; 2619 this.content.className = ""; 2620 this.content.innerHTML = ""; 2621 return 2622 } 2623 else { 2624 this.disable = false;
2625 } 2626 this.content.innerHTML = this.data.text; 2627 this.content.className = "br-infocontent " + this.data.align + " " + this.data._class || ""; 2628 this.domElement.style.width = this.data.align == "left" || this.data.align == "right" ? "auto" : "100%"; 2629 this.domElement.style.height = this.data.align == "bottom" || this.data.align == "top" ? "auto" : "100%"; 2630 this.domElement.style.left = ""; 2631 this.domElement.style.right = ""; 2632 this.domElement.style.bottom = ""; 2633 this.domElement.style.top = ""; 2634 this.content.style.left = ""; 2635 this.content.style.right = ""; 2636 this.content.style.bottom = ""; 2637 this.content.style.top = ""; 2638 if (this.eff == "slide") { 2639 this.position = -(this.data.align == "bottom" || this.data.align == "top" ? this.content.offsetHeight : this.content.offsetWidth); 2640 } 2641 else { 2642 this.position = 0; 2643 } 2644 this.domElement.style[this.data.align] = "0px"; 2645 this.update(); 2646 this.showTween = (new TWEEN.Tween(this)).to({position: this.eff == "slide" ? 0 : 100}, 950).delay(this.data.delay).easing(TWEEN.Easing.Quartic.EaseInOut).onUpdate(this.update).start(); 2647 TWEEN.add(this.showTween) 2648}; 2649Cute.SlideInfo.prototype.hide = function () 2650{ 2651 if (this.disable) { 2652 return; 2653 } 2654 if (this.showTween) { 2655 this.showTween.stop(); 2656 } 2657 this.showTween = (new TWEEN.Tween(this)).to({position: this.eff != "slide" ? 0 : -(this.data.align == "bottom" || this.data.align == "top" ? this.content.offsetHeight : this.content.offsetWidth)}, 850).easing(TWEEN.Easing.Quartic.EaseInOut).onUpdate(this.update).start(); 2658 TWEEN.add(this.showTween) 2659}; 2660Cute.BarTimer = function (e) 2661{ 2662 Cute.AbstractControl.call(this, e); 2663 this.config = {css_class: "br-bar-timer"}; 2664 this.domElement = document.createElement("div"); 2665 this.prog = 0 2666}; 2667Cute.rotatorControls.bartimer = Cute.BarTimer; 2668Cute.BarTimer.prototype = new Cute.AbstractControl; 2669Cute.BarTimer.prototype.constructor = Cute.BarTimer; 2670Cute.BarTimer.prototype.update = function (e) 2671{ 2672 if (this.drawTween) { 2673 this.drawTween.stop(); 2674 } 2675 this.drawTween = (new TWEEN.Tween(this)).to({prog: this.slider.delayProgress() * .0102}, 300).easing(TWEEN.Easing.Quartic.EaseOut).onUpdate(this.draw).start() 2676}; 2677Cute.BarTimer.prototype.draw = function () 2678{ 2679 var e = this.prog * this.slider.width; 2680 this.glow.style.left = e - this.glow.offsetWidth + "px"; 2681 this.bar.style.width = Math.max(0, e - 5) + "px" 2682}; 2683Cute.BarTimer.prototype.setup = function (e) 2684{ 2685 Cute.AbstractControl.prototype.setup.call(this, e); 2686 this.slider.bartimer = this; 2687 this.domElement.style.width = "100%"; 2688 this.domElement.style.overflow = "hidden"; 2689 this.glow = document.createElement("div"); 2690 this.glow.className = "br-timer-glow"; 2691 this.glow.style.position = "relative"; 2692 this.bar = document.createElement("div"); 2693 this.bar.className = "br-timer-bar"; 2694 this.domElement.appendChild(this.glow); 2695 this.domElement.appendChild(this.bar); 2696 this.slider.addEventListener(Cute.SliderEvent.WATING, this.update, this); 2697 this.draw() 2698}; 2699Cute.Captions = function (e) 2700{ 2701 Cute.AbstractControl.call(this, e); 2702 this.config = {css_class: "br-captions"}; 2703 this.domElement = document.createElement("div"); 2704 this.captions = []; 2705 this.overpause = false 2706}; 2707Cute.rotatorControls.captions = Cute.Captions; 2708Cute.Captions.prototype = new Cute.AbstractControl; 2709Cute.Captions.prototype.constructor = Cute.Captions; 2710Cute.Captions.prototype.setup = function (e) 2711{ 2712 Cute.AbstractControl.prototype.setup.call(this, e); 2713 this.domElement.style.width = "100%"; 2714 this.domElement.style.height = "100%"; 2715 this.domElement.style.position = "absolute" 2716}; 2717Cute.Captions.prototype.show = function () 2718{ 2719 this.data = this.slider.getCurrentSlide().pluginData.captions; 2720 this.slide_index = this.slider.getCurrentSlideIndex(); 2721 if (!this.captions[this.slide_index] && this.data) { 2722 this.captions[this.slide_index] = []; 2723 var e = this.data.getElementsByTagName("li"); 2724 var t; 2725 for (var n = 0, r = e.length; n < r; ++n) { 2726 t = new Cute.Caption; 2727 t.add(e[n].innerHTML, e[n].className); 2728 t.delay = Number(e[n].getAttribute("data-delay")) || 0; 2729 t.effect = e[n].getAttribute("data-effect") || "fade"; 2730 this.captions[this.slide_index].push(t) 2731 } 2732 } 2733 if (this.data) { 2734 for (var n = 0, r = this.captions[this.slide_index].length; n < r; ++n) { 2735 this.domElement.appendChild(this.captions[this.slide_index][n].domElement); 2736 this.captions[this.slide_index][n].show() 2737 } 2738 } 2739}; 2740Cute.Captions.prototype.hide = function () 2741{ 2742 if (this.captions[this.slide_index]) { 2743 for (var e = 0, t = this.captions[this.slide_index].length; e < t; ++e) { 2744 this.captions[this.slide_index][e].hide() 2745 } 2746 } 2747}; 2748Cute.Caption = function () 2749{ 2750 this.domElement = document.createElement("div"); 2751 this.content = document.createElement("div") 2752}; 2753Cute.Caption.prototype = { 2754 constructro: Cute.Caption, effect: "fade", add: function (e, t) 2755 { 2756 this.content.innerHTML = e; 2757 this.content.className = "br-caption-content"; 2758 this.content.style.position = "relative"; 2759 this.domElement.className = t; 2760 this.domElement.style.overflow = "hidden"; 2761 this.domElement.appendChild(this.content) 2762 }, fade : function () 2763 { 2764 setOpacity(this.domElement, this.show_pos) 2765 }, slide : function () 2766 { 2767 this.content.style.left = -this.domElement.offsetWidth * (1 - this.show_pos * .01) + "px" 2768 }, show : function () 2769 { 2770 if (this.showTween) { 2771 this.showTween.stop(); 2772 } 2773 this.show_pos = 0; 2774 this[this.effect](); 2775 this.showTween = (new TWEEN.Tween(this)).to({show_pos: 100}, 1e3).delay(this.delay).easing(TWEEN.Easing.Quartic.EaseInOut).onUpdate(this[this.effect]).delay(this.delay).start(); 2776 TWEEN.add(this.showTween) 2777 }, hide : function () 2778 { 2779 if (this.showTween) { 2780 this.showTween.stop(); 2781 } 2782 this.showTween = (new TWEEN.Tween(this)).to({show_pos: 0}, 1e3).easing(TWEEN.Easing.Quartic.EaseInOut).onUpdate(this[this.effect]).onComplete(this.remove).start() 2783 }, remove : function () 2784 { 2785 if (this.domElement.parentElement) { 2786 this.domElement.parentElement.removeChild(this.domElement) 2787 } 2788 } 2789}; 2790Cute.VideoControl = function (e) 2791{ 2792 Cute.AbstractControl.call(this, e); 2793 this.config = {css_class: "br-video", width: 300, height: 200}; 2794 this.domElement = document.createElement("div"); 2795 this.video_ele = document.createElement("iframe"); 2796 this.closeBtn = document.createElement("div"); 2797 this.overPlay = document.createElement("div"); 2798 this.videoContainer = document.createElement("div"); 2799 this.domElement.style.position = "absolute"; 2800 this.vopacity = 0; 2801 this.videoFade = function () 2802 { 2803 setOpacity(this.videoContainer, this.vopacity) 2804 } 2805}; 2806Cute.rotatorControls.video = Cute.VideoControl; 2807Cute.VideoControl.prototype = new Cute.AbstractControl; 2808Cute.VideoControl.prototype.constructor = Cute.VideoControl; 2809Cute.VideoControl.prototype.setup = function (e) 2810{ 2811 Cute.AbstractControl.prototype.setup.call(this, e); 2812 this.video_ele.setAttribute("allowFullScreen", ""); 2813 this.video_ele.setAttribute("frameborder", "0"); 2814 this.overPlay.targ = this; 2815 this.overPlay.onclick = function () 2816 { 2817 this.targ.showVideo() 2818 }; 2819 this.overPlay.className = "play-btn"; 2820 this.closeBtn.targ = this; 2821 this.closeBtn.onclick = function () 2822 { 2823 this.targ.hideVideo() 2824 }; 2825 this.closeBtn.className = "close-btn"; 2826 this.videoContainer.className = "video-cont"; 2827 this.domElement.style.width = "100%"; 2828 this.domElement.style.height = "100%"; 2829 this.video_ele.style.width = "100%"; 2830 this.video_ele.style.height = "100%"; 2831 this.video_ele.style.background = "black"; 2832 this.domElement.appendChild(this.overPlay); 2833 this.domElement.appendChild(this.videoContainer); 2834 this.videoContainer.appendChild(this.closeBtn); 2835 this.videoContainer.style.display = "none"; 2836 setOpacity(this.videoContainer, 0) 2837}; 2838Cute.VideoControl.prototype.showVideo = function () 2839{ 2840 this.videoContainer.style.display = ""; 2841 this.videoContainer.appendChild(this.video_ele); 2842 this.video_ele.className = this.data.className || this.config.css_class; 2843 if (this.video_ele.getAttribute("src") != this.data.getAttribute("href")) { 2844 this.video_ele.setAttribute("src", this.data.getAttribute("href") || "about:blank"); 2845 } 2846 if (this.videoTween) { 2847 this.videoTween.stop(); 2848 } 2849 this.videoTween = (new TWEEN.Tween(this)).to({vopacity: 100}, 400).onUpdate(this.videoFade).start(); 2850 this.slider.rotator.pause() 2851}; 2852Cute.VideoControl.prototype.hideVideo = function () 2853{ 2854 if (this.videoTween) { 2855 this.videoTween.stop(); 2856 } 2857 this.videoTween = (new TWEEN.Tween(this)).to({vopacity: 0}, 400).onUpdate(this.videoFade).start(); 2858 this.videoTween.onComplete(function () 2859 { 2860 this.video_ele.setAttribute("src", "about:blank"); 2861 this.videoContainer.removeChild(this.video_ele); 2862 this.videoContainer.style.display = "none" 2863 }) 2864}; 2865Cute.VideoControl.prototype.show = function () 2866{ 2867 this.data = this.slider.getCurrentSlide().pluginData.video; 2868 if (!this.data) { 2869 this.domElement.style.display = "none"; 2870 return 2871 } 2872 this.domElement.style.display = ""; 2873 Cute.AbstractControl.prototype.show.call(this) 2874}; 2875Cute.VideoControl.prototype.hide = function () 2876{ 2877 Cute.AbstractControl.prototype.hide.call(this); 2878 this.showTween.onComplete(function () 2879 { 2880 if (this.video_ele.parentElement) { 2881 this.videoContainer.removeChild(this.video_ele); 2882 } 2883 this.domElement.style.display = "none"; 2884 this.videoContainer.style.display = "none"; 2885 if (this.videoTween) { 2886 this.videoTween.stop() 2887 } 2888 }) 2889}; 2890Cute.LinkControl = function (e) 2891{ 2892 Cute.AbstractControl.call(this, e); 2893 this.config = {css_class: "br-link"}; 2894 this.domElement = document.createElement("div"); 2895 this.domElement.style.position = "absolute" 2896}; 2897Cute.rotatorControls.link = Cute.LinkControl; 2898Cute.LinkControl.prototype = new Cute.AbstractControl; 2899Cute.LinkControl.prototype.constructor = Cute.LinkControl; 2900Cute.LinkControl.prototype.setup = function (e) 2901{ 2902 Cute.AbstractControl.prototype.setup.call(this, e); 2903 this.domElement.lc = this; 2904 this.domElement.style.width = "100%"; 2905 this.domElement.style.height = "100%"; 2906 this.domElement.style.cursor = "pointer" 2907}; 2908Cute.LinkControl.prototype.gotoURL = function () 2909{ 2910 window.open(this.lc.link.href, this.lc.link.target || "_self") 2911}; 2912Cute.LinkControl.prototype.show = function () 2913{ 2914 this.link = this.slider.getCurrentSlide().pluginData.link; 2915 if (this.link) { 2916 this.domElement.style.display = ""; 2917 this.domElement.onclick = this.gotoURL 2918 } 2919 else { 2920 this.domElement.style.display = "none"; 2921 this.domElement.onclick = null 2922 } 2923}; 2924Cute.LinkControl.prototype.hide = function () 2925{ 2926 this.domElement.style.display = "none"; 2927 this.domElement.onclick = null 2928};
2929Cute.Loading = function () 2930{ 2931 this.domElement = document.createElement("div"); 2932 this.domElement.className = "br-loading"; 2933 this.domElement.style.display = "none"; 2934 this.animEle = document.createElement("div"); 2935 this.animEle.className = "img"; 2936 this.domElement.appendChild(this.animEle); 2937 this.opacity = 0 2938}; 2939Cute.Loading.prototype = { 2940 constructor: Cute.Loading, opacityUpdate: function () 2941 { 2942 setOpacity(this.domElement, this.opacity) 2943 }, show : function () 2944 { 2945 if (this.showTween) { 2946 this.showTween.stop(); 2947 } 2948 this.domElement.style.display = ""; 2949 this.showTween = (new TWEEN.Tween(this)).to({opacity: 100}, 450).onUpdate(this.opacityUpdate).start() 2950 }, hide : function () 2951 { 2952 if (this.showTween) { 2953 this.showTween.stop(); 2954 } 2955 this.showTween = (new TWEEN.Tween(this)).to({opacity: 0}, 450).onUpdate(this.opacityUpdate).start(); 2956 this.domElement.style.display = "none" 2957 } 2958}; 2959Cute.ThumbList = function (e, t) 2960{ 2961 Cute.AbstractControl.call(this, e); 2962 this.config = {css_class: "br-thumblist", type: "vertical"}; 2963 this.domElement = document.createElement("div"); 2964 this.thumbs = [] 2965}; 2966Cute.rotatorControls.thumblist = Cute.ThumbList; 2967Cute.ThumbList.prototype = new Cute.AbstractControl; 2968Cute.ThumbList.prototype.constructor = Cute.ThumbList; 2969Cute.ThumbList.prototype.setup = function (e) 2970{ 2971 Cute.AbstractControl.prototype.setup.call(this, e); 2972 this.config.type = e.getAttribute("data-dir") || "vertical"; 2973 this.config.autohide = e.getAttribute("data-autohide") == "true"; 2974 this.domElement.className += " " + this.config.type; 2975 this.list = new Cute.ItemList(this.domElement); 2976 this.list.type = this.config.type; 2977 this.list.frame.className = "br-thumblist-frame"; 2978 this.list.content.className = "br-thumblist-content"; 2979 this.list.downright.className = "br-thumblist-next"; 2980 this.list.upleft.className = "br-thumblist-previous"; 2981 this.slider.addEventListener(Cute.SliderEvent.CHANGE_NEXT_SLIDE, this.update, this); 2982 var t; 2983 for (var n = 0, r = this.slider.getSlideList().length; n < r; ++n) { 2984 t = new Cute.ListThumb(this.slider.getSlideList()[n].thumb, this.slider, this); 2985 t.index = n; 2986 this.thumbs.push(t); 2987 this.list.addItem(t.element) 2988 } 2989 this.list.sc.setup() 2990}; 2991Cute.ThumbList.prototype.update = function () 2992{ 2993 if (this.selectedThumb && this.slider.getCurrentSlideIndex() == this.selectedThumb.index) { 2994 return; 2995 } 2996 if (this.selectedThumb) { 2997 this.selectedThumb.unselect(); 2998 } 2999 this.selectedThumb = this.thumbs[this.slider.getCurrentSlideIndex()]; 3000 this.selectedThumb.select() 3001}; 3002Cute.ThumbList.prototype.show = function () 3003{ 3004 if (this.config.autohide) { 3005 Cute.AbstractControl.prototype.show.call(this); 3006 } 3007 this.disable = false 3008}; 3009Cute.ThumbList.prototype.hide = function () 3010{ 3011 if (this.config.autohide) { 3012 Cute.AbstractControl.prototype.hide.call(this); 3013 } 3014 this.disable = true 3015}; 3016Cute.ListThumb = function (e, t, n) 3017{ 3018 this.img = new Image; 3019 this.img.src = e; 3020 this.element = document.createElement("div"); 3021 this.element.className = "br-list-thumb"; 3022 this.select_ele = document.createElement("div"); 3023 this.select_ele.className = "br-list-thumb-select"; 3024 this.element.appendChild(this.img); 3025 this.element.appendChild(this.select_ele); 3026 setOpacity(this.select_ele, 0); 3027 this.opacity = 0; 3028 var r = this; 3029 if (n.list.sc.isTouch()) { 3030 this.element.addEventListener("touchend", function (e) 3031 { 3032 if (r.selected || n.disable || n.list.sc.moved) { 3033 return; 3034 } 3035 t.gotoSlide(r.index, true); 3036 e.preventDefault(); 3037 e.stopPropagation() 3038 }, false) 3039 } 3040 else { 3041 this.element.onclick = function () 3042 { 3043 if (r.selected || n.disable || n.list.sc.moved) { 3044 return; 3045 } 3046 t.gotoSlide(r.index, true) 3047 } 3048 } 3049}; 3050Cute.ListThumb.prototype = { 3051 constructor: Cute.ListThumb, opacityUpdate: function () 3052 { 3053 setOpacity(this.select_ele, this.opacity) 3054 }, select : function () 3055 { 3056 if (this.selected) { 3057 return; 3058 } 3059 this.selected = true; 3060 if (this.showTween) { 3061 this.showTween = null; 3062 } 3063 this.showTween = (new TWEEN.Tween(this)).to({opacity: 100}, 450).onUpdate(this.opacityUpdate).start() 3064 }, unselect: function () 3065 { 3066 if (!this.selected) { 3067 return; 3068 } 3069 this.selected = false;
3070 if (this.showTween) { 3071 this.showTween = null; 3072 } 3073 this.showTween = (new TWEEN.Tween(this)).to({opacity: 0}, 450).onUpdate(this.opacityUpdate).start() 3074 } 3075}; 3076Cute.InfoList = function (e, t) 3077{ 3078 Cute.AbstractControl.call(this, e); 3079 this.config = {css_class: "br-infolist", type: "vertical"}; 3080 this.domElement = document.createElement("div"); 3081 this.items = [] 3082}; 3083Cute.rotatorControls.infolist = Cute.InfoList; 3084Cute.InfoList.prototype = new Cute.AbstractControl; 3085Cute.InfoList.prototype.constructor = Cute.InfoList; 3086Cute.InfoList.prototype.setup = function (e) 3087{ 3088 Cute.AbstractControl.prototype.setup.call(this, e); 3089 this.config.type = e.getAttribute("data-dir") || "vertical"; 3090 this.config.autohide = e.getAttribute("data-autohide") == "true"; 3091 this.domElement.className += " " + this.config.type; 3092 this.list = new Cute.ItemList(this.domElement); 3093 this.list.type = this.config.type; 3094 this.list.frame.className = "br-infolist-frame"; 3095 this.list.content.className = "br-infolist-content"; 3096 this.list.downright.className = "br-infolist-next"; 3097 this.list.upleft.className = "br-infolist-previous"; 3098 this.slider.addEventListener(Cute.SliderEvent.CHANGE_NEXT_SLIDE, this.update, this); 3099 var t; 3100 for (var n = 0, r = this.slider.getSlideList().length; n < r; ++n) { 3101 t = new Cute.ListItem(this.slider.getSlideList()[n].pluginData.info, this.slider, this); 3102 t.index = n; 3103 this.items.push(t); 3104 this.list.addItem(t.element) 3105 } 3106 this.list.sc.setup() 3107}; 3108Cute.InfoList.prototype.update = function () 3109{ 3110 if (this.selectedThumb && this.slider.getCurrentSlideIndex() == this.selectedThumb.index) { 3111 return; 3112 } 3113 if (this.selectedThumb) { 3114 this.selectedThumb.unselect(); 3115 } 3116 this.selectedThumb = this.items[this.slider.getCurrentSlideIndex()]; 3117 this.selectedThumb.select() 3118}; 3119Cute.InfoList.prototype.show = function () 3120{ 3121 if (this.config.autohide) { 3122 Cute.AbstractControl.prototype.show.call(this); 3123 } 3124 this.disable = false 3125}; 3126Cute.InfoList.prototype.hide = function () 3127{ 3128 if (this.config.autohide) { 3129 Cute.AbstractControl.prototype.hide.call(this); 3130 } 3131 this.disable = true 3132}; 3133Cute.ListItem = function (e, t, n) 3134{ 3135 this.element = document.createElement("div"); 3136 this.element.className = "br-slist-item"; 3137 this.select_ele = document.createElement("div"); 3138 this.select_ele.className = "br-slist-item-select"; 3139 this.content = document.createElement("div"); 3140 this.content.innerHTML = e ? e.text : ""; 3141 this.content.className = "br-slist-item-content"; 3142 this.element.appendChild(this.select_ele); 3143 this.element.appendChild(this.content); 3144 setOpacity(this.select_ele, 0); 3145 this.opacity = 0; 3146 var r = this; 3147 if (n.list.sc.isTouch()) { 3148 this.element.addEventListener("touchend", function (e) 3149 { 3150 if (r.selected || n.disable || n.list.sc.moved) { 3151 return; 3152 } 3153 t.gotoSlide(r.index, true); 3154 e.preventDefault(); 3155 e.stopPropagation() 3156 }, false) 3157 } 3158 else { 3159 this.element.onclick = function () 3160 { 3161 if (r.selected || n.disable || n.list.sc.moved) { 3162 return; 3163 } 3164 t.gotoSlide(r.index, true) 3165 } 3166 } 3167}; 3168Cute.ListItem.prototype = { 3169 constructor: Cute.ListThumb, opacityUpdate: function () 3170 { 3171 setOpacity(this.select_ele, this.opacity) 3172 }, select : function () 3173 { 3174 if (this.selected) { 3175 return; 3176 } 3177 this.selected = true; 3178 if (this.showTween) { 3179 this.showTween = null; 3180 } 3181 this.showTween = (new TWEEN.Tween(this)).to({opacity: 100}, 450).onUpdate(this.opacityUpdate).start() 3182 }, unselect: function () 3183 { 3184 if (!this.selected) { 3185 return; 3186 } 3187 this.selected = false; 3188 if (this.showTween) { 3189 this.showTween = null; 3190 } 3191 this.showTween = (new TWEEN.Tween(this)).to({opacity: 0}, 450).onUpdate(this.opacityUpdate).start() 3192 } 3193}; 3194Cute.TouchNavigation = function (e, t) 3195{ 3196 this.isTouch = function () 3197 { 3198 try { 3199 document.createEvent("TouchEvent"); 3200 return true 3201 } 3202 catch (e) { 3203 return false 3204 } 3205 }; 3206 var n = this.isTouch(); 3207 var r = false; 3208 var i = 0; 3209 var s = 0; 3210 var o; 3211 this.__touchStart = function (e) 3212 { 3213 r = true; 3214 s = i = e.touches[0].pageX; 3215 o = setTimeout(function () 3216 { 3217 r = false 3218 }, 3e3) 3219 }; 3220 this.__touchMove = function (e) 3221 { 3222 if (!r) { 3223 return; 3224 } 3225 if (Math.abs(s - e.touches[0].pageX) >= 10) { 3226 e.preventDefault(); 3227 } 3228 s = e.touches[0].pageX 3229 }; 3230 this.__touchEnd = function (n) 3231 { 3232 if (!r) { 3233 return; 3234 } 3235 r = false;
3236 clearTimeout(o); 3237 if (s - i > e.offsetWidth / 10) { 3238 t.next(); 3239 } 3240 else if (s - i < -e.offsetWidth / 10) { 3241 t.previous(); 3242 } 3243 i = s = 0 3244 }; 3245 if (n) { 3246 e.addEventListener("touchstart", this.__touchStart); 3247 e.addEventListener("touchmove", this.__touchMove); 3248 e.addEventListener("touchend", this.__touchEnd) 3249 } 3250}; 3251Cute.Slider = function () 3252{ 3253 this.slides = []; 3254 this.controls = []; 3255 this.slideManager = new Cute.SlideManager; 3256 this.imgLoaded = false; 3257 this.mlcl = false; 3258 this.api = this.slideManager 3259}; 3260Cute.Slider.prototype = { 3261 constructor : Cute.Slider, setup: function (e, t, n) 3262 { 3263 yepnope.injectCss(n); 3264 this.fallBack = new Cute.FallBack; 3265 this.element = document.getElementById(e); 3266 this.wrapper = document.getElementById(t); 3267 if (Cute.FallBack.isIE) { 3268 this.element.className += " cute-ie"; 3269 } 3270 else if (Cute.isMobileDevice) { 3271 this.element.className += " cute-device"; 3272 } 3273 if (Cute.FallBack.isIE8) { 3274 this.element.className += " cute-ie8"; 3275 } 3276 else if (Cute.FallBack.isIE7) { 3277 this.element.className += " cute-ie7"; 3278 } 3279 this.wrapper.slider = this; 3280 window.addResizeListener(this.__onresize, this); 3281 this.aspect = Number(this.element.getAttribute("data-width")) / Number(this.element.getAttribute("data-height")); 3282 this.__setSize(); 3283 this.slideManager.resize(); 3284 this.slideManager.rotator = this; 3285 this.controlLayer = document.createElement("div"); 3286 this.controlLayer.style.visibility = "hidden"; 3287 this.contentLoading = new Cute.Loading; 3288 this.contentLoading.domElement.className = "br-large-loading"; 3289 this.contentLoading.show(); 3290 this.element.appendChild(this.contentLoading.domElement); 3291 if (this.element.getAttribute("data-force")) { 3292 this.fallBack.force = this.element.getAttribute("data-force"); 3293 } 3294 var r = this.element.getElementsByTagName("ul"); 3295 for (var i = 0, s = r.length; i < s; ++i) { 3296 if (r[i].getAttribute("data-type") == "slides") { 3297 this.slidesElement = r[i]; 3298 } 3299 else if (r[i].getAttribute("data-type") == "controls") { 3300 this; 3301 } 3302 this.controlsElement = r[i] 3303 } 3304 if (this.element.getAttribute("data-shuffle") == "true") { 3305 this.__shuffleSlides(); 3306 } 3307 this.__createSlides(); 3308 if (this.controlsElement) { 3309 this.__createControls(); 3310 } 3311 this.element.appendChild(this.slideManager.domElement); 3312 document.getElementById(e).style.visibility = "visible"; 3313 document.getElementById(e).style.overflow = "visible"; 3314 var o = new Cute.ModuleLoader(this.fallBack); 3315 o.onComplete = {listener: this.__onModuleReady, ref: this}; 3316 o.loadModule() 3317 }, __shuffleSlides : function () 3318 { 3319 var e = this.slidesElement.children; 3320 var t = e[0].getElementsByTagName("img")[0]; 3321 t.setAttribute("data-src", t.getAttribute("src")); 3322 for (var n = 0, i = e.length; n < i; ++n) { 3323 r = Math.floor(Math.random() * (i - 1)); 3324 if (n != r) { 3325 this.slidesElement.insertBefore(e[n], e[r]); 3326 e = this.slidesElement.children 3327 } 3328 } 3329 t = e[0].getElementsByTagName("img")[0]; 3330 t.setAttribute("src", t.getAttribute("data-src")) 3331 }, __setSize : function () 3332 { 3333 this.slideManager.width = this.wrapper.clientWidth; 3334 this.slideManager.height = this.wrapper.clientWidth / this.aspect; 3335 this.slideManager.vpWidth = this.slideManager.width + this.slideManager.width * .2; 3336 this.slideManager.vpHeight = this.slideManager.height + this.slideManager.height * .2; 3337 this.element.style.width = this.slideManager.width + "px"; 3338 this.element.style.height = this.slideManager.height + "px"; 3339 this.lastWidth = this.slideManager.width 3340 }, __onresize : function () 3341 { 3342 if (this.lastWidth == this.wrapper.clientWidth) { 3343 return; 3344 } 3345 this.__setSize(); 3346 this.slideManager.resize() 3347 }, __onModuleReady : function () 3348 { 3349 this.mlcl = true; 3350 if (this.imgLoaded) { 3351 this.__start() 3352 } 3353 }, __onImgLoaded : function () 3354 { 3355 this.slide.addContent(this); 3356 if (this.rotator.mlcl) { 3357 this.rotator.__start(); 3358 } 3359 this.rotator.imgLoaded = true; 3360 this.slide = null; 3361 this.rotator = null 3362 }, __start : function () 3363 { 3364 var e = this.fallBack.getType(); 3365 switch (e) { 3366 case Cute.FallBack.CANVAS: 3367 this.slideManager._viewClass = Aroma.ThreeView; 3368 break; 3369 case Cute.FallBack.CSS3D: 3370 this.slideManager._viewClass = Aroma.CSS3DView; 3371 Aroma.CSS3DCube.light = !Cute.FallBack.isMobileDevice; 3372 break; 3373 case Cute.FallBack.DOM2D: 3374 this.slideManager._viewClass = Aroma.DivView; 3375 break 3376 } 3377 this.showControls(); 3378 this.slideManager.start(); 3379 if (!Cute.Ticker.Tweenisadded) { 3380 Cute.Ticker.add(TWEEN.update, TWEEN); 3381 Cute.Ticker.Tweenisadded = true 3382 } 3383 Cute.Ticker.add(this.slideManager._timer.update, this.slideManager._timer); 3384 Cute.Ticker.start(); 3385 this.element.removeChild(this.contentLoading.domElement) 3386 }, __parseTransValues: function (e, t) 3387 { 3388 var n = []; 3389 var r = e.split(" ").join().split(","); 3390 for (var i = 0, s = r.length; i < s; i++) { 3391 if (t) { 3392 if (Transitions2D[r[i]]) { 3393 n.push(Transitions2D[r[i]]) 3394 } 3395 } 3396 else {
3397 if (Transitions3D[r[i]]) { 3398 n.push(Transitions3D[r[i]]) 3399 } 3400 } 3401 } 3402 r = null; 3403 return n 3404 }, __createSlides : function () 3405 { 3406 var e = null; 3407 var t = 0; 3408 while (this.slidesElement.children.length != 0) { 3409 var n = this.slidesElement.firstElementChild || this.slidesElement.children[0]; 3410 e = new Cute.Slide(this.slideManager); 3411 e.dataElement = n; 3412 e.delay = n.getAttribute("data-delay"); 3413 e.transitions2D = this.__parseTransValues(n.getAttribute("data-trans2d"), true); 3414 e.transitions3D = this.__parseTransValues(n.getAttribute("data-trans3d"), false); 3415 e.rotator = this; 3416 var r = n.children; 3417 for (var i = 0, s = r.length; i < s; ++i) { 3418 if (r[i].nodeName === "IMG") { 3419 if (t == 0) { 3420 e.src = r[i].getAttribute("src"); 3421 var o = new Image; 3422 o.slide = e; 3423 o.rotator = this; 3424 o.onload = this.__onImgLoaded; 3425 o.src = e.src 3426 } 3427 else { 3428 e.src = r[i].getAttribute("data-src") 3429 } 3430 e.thumb = r[i].getAttribute("data-thumb"); 3431 continue 3432 } 3433 if (r[i].nodeName === "DIV" && r[i].getAttribute("data-type") == "info") { 3434 e.pluginData.info = { 3435 text : r[i].innerHTML, 3436 _class: r[i].className, 3437 align : r[i].getAttribute("data-align") || "bottom", 3438 delay : Number(r[i].getAttribute("data-delay")) || 0 3439 }; 3440 continue 3441 } 3442 if (r[i].nodeName === "UL" && r[i].getAttribute("data-type") == "captions") { 3443 e.pluginData.captions = r[i]; 3444 continue 3445 } 3446 if (r[i].nodeName === "A" && r[i].getAttribute("data-type") == "video") { 3447 e.pluginData.video = r[i]; 3448 continue 3449 } 3450 if (r[i].nodeName === "A" && r[i].getAttribute("data-type") == "link") { 3451 e.pluginData.link = {href: r[i].getAttribute("href"), target: r[i].getAttribute("target")}; 3452 continue 3453 } 3454 } 3455 this.slides.push(e); 3456 this.slideManager.pushSlide(e); 3457 this.slidesElement.removeChild(n); 3458 t++ 3459 } 3460 this.element.removeChild(this.slidesElement) 3461 }, __createControls : function () 3462 { 3463 var e = this.controlsElement.getElementsByTagName("li"); 3464 var t; 3465 var n; 3466 this.element.appendChild(this.controlLayer); 3467 this.controlLayer.className = "br-controls"; 3468 if (this.element.getAttribute("data-overpause") != "false" && !Cute.FallBack.isMobileDevice) { 3469 this.controlLayer.slideManager = this.slideManager; 3470 this.controlLayer.rotator = this; 3471 var r = function () 3472 { 3473 if (this.slideManager._status == "changing" || this.slideManager._status == "loading") { 3474 return; 3475 } 3476 this.slideManager.setAutoPlay(false) 3477 }; 3478 var i = function () 3479 { 3480 if (!Cute.AbstractControl.paused) { 3481 if (this.slideManager._status == "changing" || this.slideManager._status == "loading") { 3482 this.rotator.ap = true; 3483 return 3484 } 3485 this.rotator.ap = false; 3486 this.slideManager.setAutoPlay(true) 3487 } 3488 }; 3489 this.controlLayer.onmouseover = r; 3490 this.controlLayer.onmouseout = i; 3491 this.slideManager.addEventListener(Cute.SliderEvent.CHANGE_END, this.__effEnd, this) 3492 } 3493 var s = new Cute.TouchNavigation(this.controlLayer, this.api); 3494 this.controlLayer.style.width = "100%"; 3495 this.controlLayer.style.height = "100%"; 3496 for (var o = 0, u = e.length; o < u; ++o) { 3497 t = e[o].getAttribute("data-type"); 3498 if (t && Cute.rotatorControls[t]) { 3499 n = new Cute.rotatorControls[t](this.slideManager); 3500 this.controlLayer.appendChild(n.domElement); 3501 n.setup(e[o]); 3502 this.controls.push(n) 3503 } 3504 } 3505 this.loading = new Cute.Loading; 3506 this.element.appendChild(this.loading.domElement); 3507 this.slideManager.addEventListener(Cute.SliderEvent.WATING_FOR_NEXT, this.showLoading, this); 3508 this.slideManager.addEventListener(Cute.SliderEvent.CHANGE_START, this.hideLoading, this); 3509 this.element.removeChild(this.controlsElement) 3510 }, __effEnd : function (e) 3511 { 3512 if (this.ap) { 3513 this.slideManager.setAutoPlay(true) 3514 } 3515 }, showLoading : function (e) 3516 { 3517 this.lis = true; 3518 this.loading.show() 3519 }, hideLoading : function (e) 3520 { 3521 if (this.lis) { 3522 this.lis = false; 3523 this.loading.hide() 3524 } 3525 }, showControls : function () 3526 { 3527 this.contentLoading.hide();
3528 this.controlLayer.style.visibility = "visible" 3529 }, play : function () 3530 { 3531 Cute.AbstractControl.paused = false; 3532 this.api.setAutoPlay(true) 3533 }, pause : function () 3534 { 3535 Cute.AbstractControl.paused = true; 3536 this.api.setAutoPlay(false) 3537 } 3538}
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.