1(function($) { 2 $.fn.pgwMenu = function(options) { 3 var defaults = { 4 mainClassName: 'pgwMenu', 5 dropDownLabel: '<span class="icon"></span>', 6 viewMoreEnabled: true, 7 viewMoreLabel: 'View more <span class="icon"></span>', 8 viewMoreMaxWidth: 480 9 }; 10 if (this.length == 0) { 11 return this; 12 } else if (this.length > 1) { 13 this.each(function() { 14 $(this).pgwMenu(options); 15 }); 16 return this; 17 } 18 var pgwMenu = this; 19 pgwMenu.plugin = this; 20 pgwMenu.config = {}; 21 pgwMenu.resizeEvent = null; 22 pgwMenu.window = $(window); 23 var init = function() { 24 pgwMenu.config = $.extend({}, defaults, options); 25 setup(); 26 pgwMenu.checkMenu(); 27 pgwMenu.window.resize(function() { 28 pgwMenu.plugin.css('overflow', 'hidden'); 29 clearTimeout(pgwMenu.resizeEvent); 30 pgwMenu.resizeEvent = setTimeout(function() { 31 pgwMenu.checkMenu(); 32 }, 100); 33 }); 34 pgwMenu.plugin.find('.pm-dropDown').click(function(e) { 35 pgwMenu.enableMobileDropDown(); 36 e.stopPropagation(); 37 }); 38 pgwMenu.plugin.find('.pm-viewMore').click(function(e) { 39 pgwMenu.enableViewMoreDropDown(); 40 e.stopPropagation(); 41 }); 42 $(document).click(function() { 43 pgwMenu.disableMobileDropDown(); 44 pgwMenu.disableViewMoreDropDown(); 45 }); 46 }; 47 var setup = function() { 48 var wrapClass = pgwMenu.config.mainClassName; 49 var defaultClass = pgwMenu.plugin.attr('class'); 50 if (defaultClass && defaultClass.indexOf('light') > -1) { 51 wrapClass += ' light'; 52 } 53 pgwMenu.plugin.removeClass().addClass('pm-links'); 54 pgwMenu.plugin.wrap('<div class="' + wrapClass + '"></div>'); 55 pgwMenu.plugin = pgwMenu.plugin.parent(); 56 pgwMenu.plugin.prepend('<div class="pm-dropDown"><a href="javascript:void(0)">' + pgwMenu.config.dropDownLabel + '</a></div>'); 57 if (pgwMenu.config.viewMoreEnabled) { 58 pgwMenu.plugin.append('<div class="pm-viewMore" style="display:inline-block"><a href="javascript:void(0)">' + pgwMenu.config.viewMoreLabel + '</a><ul></ul></div>'); 59 } 60 }; 61 pgwMenu.checkMenu = function() { 62 var pluginMaxWidth = pgwMenu.plugin.width(); 63 if (pgwMenu.config.viewMoreEnabled) { 64 var viewMoreLinkWidth = pgwMenu.plugin.find('.pm-viewMore').outerWidth(true); 65 } 66 function getContentWidth() { 67 var menuContentWidth = 0; 68 pgwMenu.plugin.find('.pm-links').removeClass('mobile').show(); 69 pgwMenu.plugin.find('.pm-links > li').each(function() { 70 menuContentWidth += $(this).outerWidth(true); 71 }); 72 return menuContentWidth; 73 } 74 function switchMenu(type) { 75 if (type == 'viewmore') { 76 var viewMoreMenuWidth = viewMoreLinkWidth; 77 pgwMenu.plugin.find('.pm-links').removeClass('mobile').show(); 78 pgwMenu.plugin.find('.pm-viewMore > ul > li').remove(); 79 pgwMenu.plugin.find('.pm-links > li').show().each(function() { 80 if (viewMoreMenuWidth + $(this).outerWidth(true) < pluginMaxWidth) { 81 viewMoreMenuWidth += $(this).outerWidth(true); 82 } else { 83 pgwMenu.plugin.find('.pm-viewMore > ul').append($(this).clone().show()); 84 $(this).hide(); 85 } 86 }); 87 pgwMenu.plugin.find('.pm-dropDown, .pm-viewMore > ul').hide(); 88 pgwMenu.plugin.find('.pm-viewMore').show(); 89 } else if (type == 'dropdown') { 90 pgwMenu.plugin.find('.pm-links > li').show(); 91 pgwMenu.plugin.find('.pm-links').addClass('mobile').hide(); 92 pgwMenu.plugin.find('.pm-viewMore, .pm-viewMore > ul').hide(); 93 pgwMenu.plugin.find('.pm-viewMore > ul > li').remove(); 94 pgwMenu.plugin.find('.pm-dropDown').show(); 95 } else { 96 pgwMenu.plugin.find('.pm-links > li').show(); 97 pgwMenu.plugin.find('.pm-links').removeClass('mobile').show(); 98 pgwMenu.plugin.find('.pm-dropDown, .pm-viewMore, .pm-viewMore > ul').hide(); 99 pgwMenu.plugin.find('.pm-viewMore > ul > li').remove(); 100 } 101 pgwMenu.plugin.find('.pm-dropDown > a, .pm-viewMore > a').removeClass('active'); 102 } 103 if (getContentWidth() > pluginMaxWidth) { 104 if (pgwMenu.config.viewMoreEnabled && (pluginMaxWidth > pgwMenu.config.viewMoreMaxWidth)) { 105 switchMenu('viewmore'); 106 } else { 107 switchMenu('dropdown'); 108 } 109 } else { 110 switchMenu('normal'); 111 } 112 pgwMenu.plugin.css('overflow', ''); 113 }; 114 pgwMenu.enableViewMoreDropDown = function() { 115 if (pgwMenu.plugin.find('.pm-viewMore > a').hasClass('active')) { 116 pgwMenu.disableViewMoreDropDown(); 117 return false; 118 } 119 pgwMenu.plugin.find('.pm-viewMore > a').addClass('active'); 120 pgwMenu.plugin.find('.pm-viewMore > ul').show(); 121 }; 122 pgwMenu.disableViewMoreDropDown = function() { 123 if (pgwMenu.plugin.find('.pm-viewMore > a').hasClass('active')) { 124 pgwMenu.plugin.find('.pm-viewMore > a').removeClass('active'); 125 pgwMenu.plugin.find('.pm-viewMore > ul').hide(); 126 } 127 }; 128 pgwMenu.enableMobileDropDown = function() { 129 if (pgwMenu.plugin.find('.pm-dropDown > a').hasClass('active')) { 130 pgwMenu.disableMobileDropDown(); 131 return false; 132 } 133 pgwMenu.plugin.find('.pm-dropDown > a').addClass('active'); 134 pgwMenu.plugin.find('.pm-links').show(); 135 }; 136 pgwMenu.disableMobileDropDown = function() { 137 if (pgwMenu.plugin.find('.pm-dropDown > a').hasClass('active')) { 138 pgwMenu.plugin.find('.pm-dropDown > a').removeClass('active'); 139 pgwMenu.plugin.find('.pm-links').hide(); 140 } 141 }; 142 init(); 143 return this; 144 } 145})(window.Zepto || window.jQuery); 146window.Rainbow = function() { 147 function A(a) { 148 var b = a.getAttribute("data-language") || a.parentNode.getAttribute("data-language"); 149 if (!b) { 150 var c = /\blang(?:uage)?-(\w+)/; 151 (a = a.className.match(c) || a.parentNode.className.match(c)) && (b = a[1]) 152 } 153 return b 154 } 155 function B(a, b) { 156 for (var c in f[d]) { 157 c = parseInt(c, 10); 158 if (a == c && b == f[d][c] ? 0 : a <= c && b >= f[d][c]) delete f[d][c], delete j[d][c]; 159 if (a >= c && a < f[d][c] || b > c && b < f[d][c]) return !0 160 } 161 return !1 162 } 163 function q(a, b) { 164 return '<span class="' + a.replace(/\./g, " ") + (l ? " " + l : "") + '">' + b + "</span>" 165 } 166 function r(a, b, c, i) { 167 if ("undefined" === typeof a || null === a) i(); 168 else { 169 var e = a.exec(c); 170 if (e) { 171 ++s; 172 !b.name && "string" == typeof b.matches[0] && (b.name = b.matches[0], delete b.matches[0]); 173 var k = e[0], 174 g = e.index, 175 t = e[0].length + g, 176 h = function() { 177 function e() { 178 r(a, b, c, i) 179 } 180 s % 100 > 0 ? e() : setTimeout(e, 0) 181 }; 182 if (B(g, t)) h(); 183 else { 184 var m = u(b.matches), 185 l = function(a, c, i) { 186 if (a >= c.length) i(k); 187 else { 188 var d = e[c[a]]; 189 if (d) { 190 var g = b.matches[c[a]], 191 f = g.language, 192 h = g.name && g.matches ? g.matches : g, 193 j = function(b, d, g) { 194 var f; 195 f = 0; 196 var h; 197 for (h = 1; h < c[a]; ++h) e[h] && (f = f + e[h].length); 198 d = g ? q(g, d) : d; 199 k = k.substr(0, f) + k.substr(f).replace(b, d); 200 l(++a, c, i) 201 }; 202 f ? n(d, f, function(a) { 203 j(d, a) 204 }) : typeof g === "string" ? j(d, d, g) : v(d, h.length ? h : [h], function(a) {
vendor: 4,439 bytes, lines 205-346
205 j(d, a, g.matches ? g.name : 0) 206 }) 207 } else l(++a, c, i) 208 } 209 }; 210 l(0, m, function(a) { 211 b.name && (a = q(b.name, a)); 212 if (!j[d]) { 213 j[d] = {}; 214 f[d] = {} 215 } 216 j[d][g] = { 217 replace: e[0], 218 "with": a 219 }; 220 f[d][g] = t; 221 h() 222 }) 223 } 224 } else i() 225 } 226 } 227 function u(a) { 228 var b = [], 229 c; 230 for (c in a) a.hasOwnProperty(c) && b.push(c); 231 return b.sort(function(a, c) { 232 return c - a 233 }) 234 } 235 function v(a, b, c) { 236 function i(b, k) { 237 k < b.length ? r(b[k].pattern, b[k], a, function() { 238 i(b, ++k) 239 }) : C(a, function(a) { 240 delete j[d]; 241 delete f[d]; 242 --d; 243 c(a) 244 }) 245 }++d; 246 i(b, 0) 247 } 248 function C(a, b) { 249 function c(a, b, i, f) { 250 if (i < b.length) { 251 ++w; 252 var h = b[i], 253 l = j[d][h], 254 a = a.substr(0, h) + a.substr(h).replace(l.replace, l["with"]), 255 h = function() { 256 c(a, b, ++i, f) 257 }; 258 0 < w % 250 ? h() : setTimeout(h, 0) 259 } else f(a) 260 } 261 var i = u(j[d]); 262 c(a, i, 0, b) 263 } 264 function n(a, b, c) { 265 var d = m[b] || [], 266 e = m[x] || [], 267 b = y[b] ? d : d.concat(e); 268 v(a.replace(/</g, "<").replace(/>/g, ">").replace(/&(?![\w\#]+;)/g, "&"), b, c) 269 } 270 function o(a, b, c) { 271 if (b < a.length) { 272 var d = a[b], 273 e = A(d); 274 return !(-1 < (" " + d.className + " ").indexOf(" rainbow ")) && e ? (e = e.toLowerCase(), d.className += d.className ? " rainbow" : "rainbow", n(d.innerHTML, e, function(k) { 275 d.innerHTML = k; 276 j = {}; 277 f = {}; 278 p && p(d, e); 279 setTimeout(function() { 280 o(a, ++b, c) 281 }, 0) 282 })) : o(a, ++b, c) 283 } 284 c && c() 285 } 286 function z(a, b) { 287 var a = a && "function" == typeof a.getElementsByTagName ? a : document, 288 c = a.getElementsByTagName("pre"), 289 d = a.getElementsByTagName("code"), 290 e, f = [], 291 g = []; 292 for (e = 0; e < c.length; ++e) c[e].getElementsByTagName("code").length ? c[e].innerHTML = c[e].innerHTML.replace(/^\s+/, "").replace(/\s+$/, "") : f.push(c[e]); 293 for (e = 0; e < d.length; ++e) g.push(d[e]); 294 o(g.concat(f), 0, b) 295 } 296 var j = {}, 297 f = {}, 298 m = {}, 299 y = {}, 300 d = 0, 301 x = 0, 302 s = 0, 303 w = 0, 304 l, p; 305 return { 306 extend: function(a, b, c) { 307 1 == arguments.length && (b = a, a = x); 308 y[a] = c; 309 m[a] = b.concat(m[a] || []) 310 }, 311 b: function(a) { 312 p = a 313 }, 314 a: function(a) { 315 l = a 316 }, 317 color: function(a, b, c) { 318 if ("string" == typeof a) return n(a, b, c); 319 if ("function" == typeof a) return z(0, a); 320 z(a, b) 321 } 322 } 323}(); 324document.addEventListener && document.addEventListener("DOMContentLoaded", Rainbow.color, !1); 325Rainbow.onHighlight = Rainbow.b; 326Rainbow.addClass = Rainbow.a; 327Rainbow.extend([{ 328 matches: { 329 1: [{ 330 name: "keyword.operator", 331 pattern: /\=|\+/g 332 }, { 333 name: "keyword.dot", 334 pattern: /\./g 335 }], 336 2: { 337 name: "string", 338 matches: { 339 name: "constant.character.escape", 340 pattern: /\\('|"){1}/g 341 } 342 } 343 }, 344 pattern: /(\(|\s|\[|\=|:|\+|\.)(('|")([^\\\1]|\\.)*?(\3))/gm 345}, { 346 name: "comment",
347 pattern: /\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm 348}, { 349 name: "constant.numeric", 350 pattern: /\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi 351}, { 352 matches: { 353 1: "keyword" 354 }, 355 pattern: /\b(and|array|as|b(ool(ean)?|reak)|c(ase|atch|har|lass|on(st|tinue))|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi 356}, { 357 name: "constant.language", 358 pattern: /true|false|null/g 359}, { 360 name: "keyword.operator", 361 pattern: /\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g 362}, { 363 matches: { 364 1: "function.call" 365 }, 366 pattern: /(\w+?)(?=\()/g 367}, { 368 matches: { 369 1: "storage.function", 370 2: "entity.name.function" 371 }, 372 pattern: /(function)\s(.*?)(?=\()/g 373}]); 374Rainbow.extend("javascript", [{ 375 name: "selector", 376 pattern: /(\s|^)\$(?=\.|\()/g 377}, { 378 name: "support", 379 pattern: /\b(window|document)\b/g 380}, { 381 matches: {
vendor: 1,314 bytes, lines 382-435
382 1: "support.property" 383 }, 384 pattern: /\.(length|node(Name|Value))\b/g 385}, { 386 matches: { 387 1: "support.function" 388 }, 389 pattern: /(setTimeout|setInterval)(?=\()/g 390}, { 391 matches: { 392 1: "support.method" 393 }, 394 pattern: /\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g 395}, { 396 name: "string.regexp", 397 matches: { 398 1: "string.regexp.open", 399 2: { 400 name: "constant.regexp.escape", 401 pattern: /\\(.){1}/g 402 }, 403 3: "string.regexp.close", 404 4: "string.regexp.modifier" 405 }, 406 pattern: /(\/)(?!\*)(.+)(\/)([igm]{0,3})/g 407}, { 408 matches: { 409 1: "storage", 410 3: "entity.function" 411 }, 412 pattern: /(var)?(\s|^)(\S*)(?=\s?=\s?function\()/g 413}, { 414 matches: { 415 1: "keyword", 416 2: "entity.function" 417 }, 418 pattern: /(new)\s+(.*)(?=\()/g 419}, { 420 name: "entity.function", 421 pattern: /(\w+)(?=:\s{0,}function)/g 422}]); 423Rainbow.extend("html", [{ 424 name: "source.php.embedded", 425 matches: { 426 2: { 427 language: "php" 428 } 429 }, 430 pattern: /<\?=?(?!xml)(php)?([\s\S]*?)(\?>)/gm 431}, { 432 name: "source.css.embedded", 433 matches: { 434 1: { 435 matches: {
436 1: "support.tag.style", 437 2: [{ 438 name: "entity.tag.style", 439 pattern: /^style/g 440 }, { 441 name: "string", 442 pattern: /('|")(.*?)(\1)/g 443 }, { 444 name: "entity.tag.style.attribute", 445 pattern: /(\w+)/g 446 }], 447 3: "support.tag.style" 448 }, 449 pattern: /(<\/?)(style.*?)(>)/g 450 }, 451 2: { 452 language: "css" 453 }, 454 3: "support.tag.style", 455 4: "entity.tag.style", 456 5: "support.tag.style" 457 }, 458 pattern: /(<style.*?>)([\s\S]*?)(<\/)(style)(>)/gm 459}, { 460 name: "source.js.embedded", 461 matches: { 462 1: { 463 matches: { 464 1: "support.tag.script", 465 2: [{ 466 name: "entity.tag.script", 467 pattern: /^script/g 468 }, { 469 name: "string", 470 pattern: /('|")(.*?)(\1)/g 471 }, { 472 name: "entity.tag.script.attribute", 473 pattern: /(\w+)/g 474 }], 475 3: "support.tag.script" 476 }, 477 pattern: /(<\/?)(script.*?)(>)/g 478 }, 479 2: { 480 language: "javascript" 481 }, 482 3: "support.tag.script", 483 4: "entity.tag.script", 484 5: "support.tag.script" 485 }, 486 pattern: /(<script(?! src).*?>)([\s\S]*?)(<\/)(script)(>)/gm 487}, { 488 name: "comment.html", 489 pattern: /<\!--[\S\s]*?-->/g 490}, { 491 matches: {
492 1: "support.tag.open", 493 2: "support.tag.close" 494 }, 495 pattern: /(<)|(\/?\??>)/g 496}, { 497 name: "support.tag", 498 matches: { 499 1: "support.tag", 500 2: "support.tag.special", 501 3: "support.tag-name" 502 }, 503 pattern: /(<\??)(\/|\!?)(\w+)/g 504}, { 505 matches: { 506 1: "support.attribute" 507 }, 508 pattern: /([a-z-]+)(?=\=)/gi 509}, { 510 matches: { 511 1: "support.operator", 512 2: "string.quote", 513 3: "string.value", 514 4: "string.quote" 515 }, 516 pattern: /(=)('|")(.*?)(\2)/g 517}, { 518 matches: { 519 1: "support.operator", 520 2: "support.value" 521 }, 522 pattern: /(=)([a-zA-Z\-0-9]*)\b/g 523}, { 524 matches: { 525 1: "support.attribute" 526 }, 527 pattern: /\s(\w+)(?=\s|>)(?![\s\S]*<)/g 528}], !0); 529(function(a) { 530 a.fn.pgwSlideshow = function(q) { 531 var i = { 532 mainClassName: "pgwSlideshow",//pgwSlideshowLight pgwSlideshow 533 transitionEffect: "fading",// slideing or fading 534 displayList: true, 535 displayControls: false, 536 touchControls: true, 537 autoSlide: true, 538 beforeSlide: false, 539 afterSlide: false, 540 maxHeight: null, 541 adaptiveDuration: 200, 542 transitionDuration: 500, 543 intervalDuration: 1000000 544 }; 545 if (this.length == 0) { 546 return this 547 } else { 548 if (this.length > 1) { 549 this.each(function() { 550 a(this).pgwSlideshow(q) 551 }); 552 return this 553 } 554 } 555 var j = this; 556 j.plugin = this; 557 j.config = {}; 558 j.data = []; 559 j.currentSlide = 0; 560 j.slideCount = 0; 561 j.resizeEvent = null; 562 j.intervalEvent = null; 563 j.touchFirstPosition = null; 564 j.touchListLastPosition = false; 565 j.window = a(window); 566 var p = function() { 567 j.config = a.extend({}, i, q); 568 g(); 569 if (j.config.displayList) { 570 b() 571 } 572 j.window.resize(function() { 573 clearTimeout(j.resizeEvent); 574 j.resizeEvent = setTimeout(function() { 575 e(); 576 var r = j.plugin.find(".ps-current > ul > li.elt_" + j.currentSlide + " img").height(); 577 h(r); 578 if (j.config.displayList) { 579 b(); 580 n() 581 } 582 }, 100) 583 }); 584 if (j.config.autoSlide) { 585 k() 586 } 587 return true 588 }; 589 var h = function(r, s) { 590 if (j.config.maxHeight) { 591 if (r + j.plugin.find(".ps-list").height() > j.config.maxHeight) { 592 r = j.config.maxHeight - j.plugin.find(".ps-list").height() 593 } 594 } 595 if (typeof j.plugin.find(".ps-current").animate == "function") { 596 r=j.plugin.find(".ps-current").width() 597 j.plugin.find(".ps-current").stop().animate({ 598 height: r 599 }, j.config.adaptiveDuration, function() { 600 if (j.config.maxHeight) { 601 j.plugin.find(".ps-current > ul > li img").css("max-height", r + "px") 602 } 603 else{ 604 j.plugin.find(".ps-current > ul > li img").css("max-height", r + "px") 605 } 606 }) 607 } else { 608 609 r=Math.round(j.plugin.find(".ps-current").width()) 610 j.plugin.find(".ps-current").css("height", r); 611 if (j.config.maxHeight) { 612 j.plugin.find(".ps-current > ul > li img").css("max-height", r + "px") 613 } 614 } 615 return true 616 }; 617 var c = function() { 618 var r = 0; 619 j.plugin.show(); 620 j.plugin.find(".ps-list > ul > li").show().each(function() { 621 r += a(this).width() 622 }); 623 j.plugin.find(".ps-list > ul").width(r); 624 return true 625 }; 626 var e = function() { 627 if (j.plugin.width() <= 480) { 628 j.plugin.addClass("narrow").removeClass("wide") 629 } else { 630 j.plugin.addClass("wide").removeClass("narrow") 631 } 632 return true 633 }; 634 var g = function() { 635 j.plugin.removeClass("pgwSlideshow").removeClass(j.config.mainClassName); 636 j.plugin.wrap('<div class="ps-list"></div>'); 637 j.plugin = j.plugin.parent(); 638 j.plugin.wrap('<div class="' + j.config.mainClassName + '"></div>'); 639 j.plugin = j.plugin.parent(); 640 j.plugin.prepend('<div class="ps-current"><ul></ul><span class="ps-caption"></span></div>'); 641 j.slideCount = j.plugin.find(".ps-list > ul > li").length; 642 if (j.slideCount == 0) { 643 throw new Error("pgwSlideshow - No slider item has been found"); 644 return false 645 } 646 if (j.slideCount > 1) { 647 if (j.config.displayControls) { 648 j.plugin.find(".ps-current").prepend('<span class="ps-prev"><span class="ps-prevIcon"></span></span>'); 649 j.plugin.find(".ps-current").append('<span class="ps-next"><span class="ps-nextIcon"></span></span>'); 650 j.plugin.find(".ps-current .ps-prev").click(function() { 651 j.previousSlide() 652 }); 653 j.plugin.find(".ps-current .ps-next").click(function() { 654 j.nextSlide() 655 }) 656 }
657 if (j.config.touchControls) { 658 j.plugin.find(".ps-current").on("touchstart", function(s) { 659 try { 660 if (s.originalEvent.touches[0].clientX && j.touchFirstPosition == null) { 661 j.touchFirstPosition = s.originalEvent.touches[0].clientX 662 } 663 } catch (s) { 664 j.touchFirstPosition = null 665 } 666 }); 667 j.plugin.find(".ps-current").on("touchmove", function(s) { 668 try { 669 if (s.originalEvent.touches[0].clientX && j.touchFirstPosition != null) { 670 if (s.originalEvent.touches[0].clientX > (j.touchFirstPosition + 50)) { 671 j.touchFirstPosition = null; 672 j.previousSlide() 673 } else { 674 if (s.originalEvent.touches[0].clientX < (j.touchFirstPosition - 50)) { 675 j.touchFirstPosition = null; 676 j.nextSlide() 677 } 678 } 679 } 680 } catch (s) { 681 j.touchFirstPosition = null 682 } 683 }); 684 j.plugin.find(".ps-current").on("touchend", function(s) { 685 j.touchFirstPosition = null 686 }) 687 } 688 } 689 var r = 1; 690 j.plugin.find(".ps-list > ul > li").each(function() { 691 var t = d(a(this)); 692 t.id = r; 693 j.data.push(t); 694 a(this).addClass("elt_" + t.id); 695 a(this).wrapInner('<span class="ps-item' + (r == 1 ? " ps-selected" : "") + '"></span>'); 696 var s = a('<li class="elt_' + r + '"></li>'); 697 if (t.image) { 698 s.html('<img src="' + t.image + '" alt="' + (t.title ? t.title : "") + '">') 699 } else { 700 if (t.thumbnail) { 701 s.html('<img src="' + t.thumbnail + '" alt="' + (t.title ? t.title : "") + '">') 702 } 703 } 704 if (t.link) { 705 s.html('<a href="' + t.link + '"' + (t.linkTarget ? ' target="' + t.linkTarget + '"' : "") + ">" + s.html() + "</a>") 706 } 707 j.plugin.find(".ps-current > ul").append(s); 708 a(this).css("cursor", "pointer").click(function(u) { 709 u.preventDefault(); 710 l(t.id) 711 }); 712 r++ 713 }); 714 if (j.config.displayList) { 715 c(); 716 j.plugin.find(".ps-list").prepend('<span class="ps-prev"><span class="ps-prevIcon"></span></span>'); 717 j.plugin.find(".ps-list").append('<span class="ps-next"><span class="ps-nextIcon"></span></span>'); 718 j.plugin.find(".ps-list").show() 719 } else { 720 j.plugin.find(".ps-list").hide() 721 } 722 if (j.config.autoSlide) { 723 j.plugin.on("mouseenter", function() { 724 clearInterval(j.intervalEvent); 725 j.intervalEvent = null 726 }).on("mouseleave", function() { 727 k() 728 }) 729 } 730 // j.plugin.find(".ps-current > ul > li").hide(); oldCode è°æ´äº§åå±ç¤ºé¡µæ¾ç¤º 2018.09.19 chs 731 j.plugin.find(".ps-current > ul > li").css("display","table");//è°æ´äº§åå±ç¤ºé¡µæ¾ç¤º 2018.09.19 chs 732 l(1); 733 j.plugin.find(".ps-current > ul > li.elt_1 img").on("load", function() { 734 e(); 735 var s = j.plugin.find(".ps-current > ul > li.elt_1 img").height(); 736 h(s) 737 }); 738 e(); 739 j.plugin.show(); 740 return true 741 }; 742 var d = function(x) { 743 var v = {}; 744 var t = x.find("a").attr("href"); 745 if ((typeof t != "undefined") && (t != "")) { 746 v.link = t; 747 var u = x.find("a").attr("target"); 748 if ((typeof u != "undefined") && (u != "")) { 749 v.linkTarget = u 750 } 751 } 752 var s = x.find("img").attr("src"); 753 if ((typeof s != "undefined") && (s != "")) { 754 v.thumbnail = s 755 } 756 var y = x.find("img").attr("data-large-src"); 757 if ((typeof y != "undefined") && (y != "")) { 758 v.image = y 759 } 760 var r = x.find("img").attr("alt"); 761 if ((typeof r != "undefined") && (r != "")) { 762 v.title = r 763 } 764 var w = x.find("img").attr("data-description"); 765 if ((typeof w != "undefined") && (w != "")) { 766 v.description = w 767 } 768 return v 769 }; 770 var m = function(r) { 771 var t = ""; 772 if (r.title) { 773 t += "<b>" + r.title + "</b>" 774 } 775 if (r.description) { 776 if (t != "") { 777 t += "<br>" 778 } 779 t += r.description 780 } 781 if (t != "") { 782 if (r.link) { 783 t = '<a href="' + r.link + '"' + (r.linkTarget ? ' target="' + r.linkTarget + '"' : "") + ">" + t + "</a>" 784 } 785 if (typeof j.plugin.find(".ps-caption").fadeIn == "function") { 786 j.plugin.find(".ps-caption").html(t); 787 j.plugin.find(".ps-caption").fadeIn(j.config.transitionDuration / 2) 788 } else { 789 j.plugin.find(".ps-caption").html(t); 790 j.plugin.find(".ps-caption").show() 791 } 792 } 793 j.plugin.find(".ps-list > ul > li .ps-item").removeClass("ps-selected"); 794 j.plugin.find(".ps-list > ul > li.elt_" + r.id + " .ps-item").addClass("ps-selected"); 795 if (j.config.displayList) { 796 b(); 797 n() 798 } 799 if (j.config.displayControls) { 800 if (typeof j.plugin.find(".ps-current > .ps-prev").fadeIn == "function") { 801 j.plugin.find(".ps-current > .ps-prev, .ps-current > .ps-next").fadeIn(j.config.transitionDuration / 2) 802 } else { 803 j.plugin.find(".ps-current > .ps-prev, .ps-current > .ps-next").show() 804 } 805 } 806 if (typeof j.config.afterSlide == "function") { 807 j.config.afterSlide(r.id) 808 } 809 var s = j.plugin.find(".ps-current .elt_" + r.id + " img").height(); 810 h(s, true); 811 return true 812 }; 813 var f = function(u) { 814 var t = j.plugin.find(".ps-current > ul"); 815 t.find("li").not(".elt_" + j.currentSlide).not(".elt_" + u.id).each(function() { 816 if (typeof a(this).stop == "function") { 817 a(this).stop() 818 } 819 // a(this).css("position", "").css("z-index", 1).css("display","table") //oldCode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 820 a(this).css("position", "").css("z-index", 1).css("display","table") //newCcode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 821 }); 822 if (j.currentSlide > 0) { 823 var r = t.find(".elt_" + j.currentSlide); 824 if (typeof r.animate != "function") { 825 r.animate = function(v, w, x) { 826 r.css(v); 827 if (x) { 828 x() 829 } 830 } 831 } 832 if (typeof r.stop == "function") { 833 r.stop() 834 } 835 r.css("position", "absolute").animate({ 836 opacity: 0 837 }, j.config.transitionDuration, function() { 838 // r.css("position", "").css("z-index", 1).hide() //oldCode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 839 r.css("position", "").css("z-index", 1).css("display","table") //newCcode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 840 }) 841 }
842 j.currentSlide = u.id; 843 var s = t.find(".elt_" + u.id); 844 if (typeof s.animate != "function") { 845 s.animate = function(v, w, x) { 846 s.css(v); 847 if (x) { 848 x() 849 } 850 } 851 } 852 if (typeof s.stop == "function") { 853 s.stop() 854 } 855 s.css("position", "absolute").show().animate({ 856 opacity: 1 857 }, j.config.transitionDuration, function() { 858 // s.css("position", "").css("z-index", 2).css("display", "table"); //oldCode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 859 s.css("position", "").css("z-index", 2).css("display", "table"); //newCcode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 860 m(u) 861 }); 862 return true 863 }; 864 var o = function(v, y) { 865 var u = j.plugin.find(".ps-current > ul"); 866 if (typeof y == "undefined") { 867 y = "left" 868 } 869 if (j.currentSlide == 0) { 870 u.find(".elt_1").css({ 871 position: "", 872 left: "", 873 opacity: 1, 874 "z-index": 2, 875 display:"table" 876 }); 877 j.plugin.find(".ps-list > li.elt_1").css("opacity", "1"); 878 m(v) 879 } else { 880 if (j.transitionInProgress) { 881 return false 882 } 883 j.transitionInProgress = true; 884 var x = u.width(); 885 if (y == "left") { 886 var r = -x; 887 var w = x 888 } else { 889 var r = x; 890 var w = -x 891 } 892 var s = u.find(".elt_" + j.currentSlide); 893 if (typeof s.animate != "function") { 894 s.animate = function(z, A, B) { 895 s.css(z); 896 if (B) { 897 B() 898 } 899 } 900 } 901 s.css("position", "absolute").animate({ 902 left: r 903 }, j.config.transitionDuration, function() { 904 // s.css("position", "").css("z-index", 1).css("left", "").css("opacity", 0).css("display","table") //oldCode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 905 s.css("position", "").css("z-index", 1).css("left", "").css("opacity", 0).css("display","table") //newCcode è°æ´äº§åæ¾ç¤ºæ¹å¼ chs 2018.09.19 906 }); 907 var t = u.find(".elt_" + v.id); 908 if (typeof t.animate != "function") { 909 t.animate = function(z, A, B) { 910 t.css(z); 911 if (B) { 912 B() 913 } 914 } 915 } 916 t.css("position", "absolute").css("left", w).css("opacity", 1).show().animate({ 917 left: 0 918 }, j.config.transitionDuration, function() { 919 t.css("position", "").css("left", "").css("z-index", 2).show(); 920 j.transitionInProgress = false; 921 m(v) 922 }) 923 } 924 j.currentSlide = v.id; 925 return true 926 }; 927 var l = function(r, t, u) { 928 if (r == j.currentSlide) { 929 return false 930 } 931 var s = j.data[r - 1]; 932 if (typeof s == "undefined") { 933 throw new Error("pgwSlideshow - The element " + r + " is undefined"); 934 return false 935 } 936 if (typeof u == "undefined") { 937 u = "left" 938 } 939 if (typeof j.config.beforeSlide == "function") { 940 j.config.beforeSlide(r) 941 } 942 if (typeof j.plugin.find(".ps-caption").fadeOut == "function") { 943 j.plugin.find(".ps-caption, .ps-prev, .ps-next").fadeOut(j.config.transitionDuration / 2) 944 } else { 945 j.plugin.find(".ps-caption, .ps-prev, .ps-next").hide() 946 } 947 if (j.config.transitionEffect == "sliding") { 948 o(s, u) 949 } else { 950 f(s) 951 } 952 if (typeof t != "undefined" && j.config.autoSlide) { 953 k() 954 } 955 return true 956 }; 957 var k = function() { 958 clearInterval(j.intervalEvent); 959 if (j.slideCount > 1 && j.config.autoSlide) { 960 j.intervalEvent = setInterval(function() { 961 if (j.currentSlide + 1 <= j.slideCount) { 962 var r = j.currentSlide + 1 963 } else { 964 var r = 1 965 } 966 l(r) 967 }, j.config.intervalDuration) 968 } 969 return true 970 }; 971 var b = function() { 972 if (!j.config.displayList) { 973 return false 974 } 975 c(); 976 var w = j.plugin.find(".ps-list"); 977 var u = w.width(); 978 var r = j.plugin.find(".ps-list > ul"); 979 var v = r.width(); 980 if (v > u) { 981 r.css("margin", "0 25px"); 982 var t = parseInt(r.css("margin-left")); 983 var s = parseInt(r.css("margin-right")); 984 u -= (t + s); 985 w.find(".ps-prev").show().unbind("click").click(function() { 986 var y = parseInt(r.css("left")); 987 var x = y + u; 988 if (y == 0) { 989 x = -(v - u) 990 } else { 991 if (x > 0) { 992 x = 0 993 } 994 } 995 if (typeof r.animate == "function") { 996 r.animate({ 997 left: x 998 }, j.config.transitionDuration) 999 } else { 1000 1001 r.css("left", x) 1002 } 1003 }); 1004 w.find(".ps-next").show().unbind("click").click(function() { 1005 var y = parseInt(r.css("left")); 1006 var x = y - u; 1007 var z = -(v - u); 1008 if (y == z) { 1009 x = 0 1010 } else { 1011 if (x < z) { 1012 x = z 1013 } 1014 } 1015 if (typeof r.animate == "function") { 1016 r.animate({ 1017 left: x 1018 }, j.config.transitionDuration) 1019 } else { 1020 1021 r.css("left", x) 1022 } 1023 });
1024 if (j.config.touchControls) { 1025 j.plugin.find(".ps-list > ul").on("touchmove", function(C) { 1026 try { 1027 if (C.originalEvent.touches[0].clientX) { 1028 var G = (j.touchListLastPosition == false ? 0 : j.touchListLastPosition); 1029 nbPixels = (j.touchListLastPosition == false ? 1 : Math.abs(G - C.originalEvent.touches[0].clientX)); 1030 j.touchListLastPosition = C.originalEvent.touches[0].clientX; 1031 var x = ""; 1032 if (G > C.originalEvent.touches[0].clientX) { 1033 x = "left" 1034 } else { 1035 if (G < C.originalEvent.touches[0].clientX) { 1036 x = "right" 1037 } 1038 } 1039 } 1040 var F = parseInt(r.css("left")); 1041 if (x == "left") { 1042 var E = w.width(); 1043 var D = r.width(); 1044 var z = parseInt(r.css("margin-left")); 1045 var B = parseInt(r.css("margin-right")); 1046 E -= (z + B); 1047 var A = -(D - E); 1048 var y = F - nbPixels; 1049 if (y > A) { 1050 console.log("r") 1051 1052 r.css("left", y) 1053 } 1054 } else { 1055 if (x == "right") { 1056 var y = F + nbPixels; 1057 if (y < 0) { 1058 1059 r.css("left", y) 1060 } else { 1061 console.log("r") 1062 1063 r.css("left", 0) 1064 } 1065 } 1066 } 1067 } catch (C) { 1068 j.touchListLastPosition = false 1069 } 1070 }); 1071 j.plugin.find(".ps-list > ul").on("touchend", function(x) { 1072 j.touchListLastPosition = false 1073 }) 1074 } 1075 } else { 1076 var t = parseInt((u - v) / 2); 1077 1078 r.css("left", 0).css("margin-left", t); 1079 w.find(".ps-prev").hide(); 1080 w.find(".ps-next").hide(); 1081 j.plugin.find(".ps-list > ul").unbind("touchstart touchmove touchend") 1082 } 1083 return true 1084 }; 1085 var n = function() { 1086 var A = j.plugin.find(".ps-list").width(); 1087 var y = j.plugin.find(".ps-list > ul"); 1088 var z = y.width(); 1089 var t = parseInt(y.css("margin-left")); 1090 var x = parseInt(y.css("margin-right")); 1091 A -= (t + x); 1092 var w = Math.abs(parseInt(y.css("left"))); 1093 var r = w + A; 1094 var u = j.plugin.find(".ps-list .ps-selected").position().left; 1095 var s = u + j.plugin.find(".ps-list .ps-selected").width(); 1096 if ((u < w) || (s > r) || (z > A && r > s)) { 1097 var v = -(z - A); 1098 if (-u < v) { 1099 y.css("left", 0) 1100 //è°æ´äº§åå±ç¤ºå¾æ¾ç¤ºbug 2018.09.26 1101 //oldcord =y.css("left", 0) 1102 } else { 1103 y.css("left", -u) 1104 } 1105 } 1106 return true 1107 }; 1108 j.startSlide = function() { 1109 j.config.autoSlide = true; 1110 k(); 1111 return true 1112 }; 1113 j.stopSlide = function() { 1114 j.config.autoSlide = false; 1115 clearInterval(j.intervalEvent); 1116 return true 1117 }; 1118 j.getCurrentSlide = function() { 1119 return j.currentSlide 1120 }; 1121 j.getSlideCount = function() { 1122 return j.slideCount 1123 }; 1124 j.displaySlide = function(r) { 1125 l(r, true); 1126 return true 1127 }; 1128 j.nextSlide = function() { 1129 if (j.currentSlide + 1 <= j.slideCount) { 1130 var r = j.currentSlide + 1 1131 } else { 1132 var r = 1 1133 } 1134 l(r, true, "left"); 1135 return true 1136 }; 1137 j.previousSlide = function() { 1138 if (j.currentSlide - 1 >= 1) { 1139 var r = j.currentSlide - 1 1140 } else { 1141 var r = j.slideCount 1142 } 1143 l(r, true, "right"); 1144 return true 1145 }; 1146 j.destroy = function(r) { 1147 clearInterval(j.intervalEvent); 1148 if (typeof r != "undefined") { 1149 j.plugin.find(".ps-list > ul > li").each(function() { 1150 a(this).attr("style", null).removeClass().unbind("click"); 1151 a(this).html(a(this).find("span").html()) 1152 }); 1153 j.plugin.find(".ps-current").remove(); 1154 j.plugin.find(".ps-list").find(".ps-prev, .ps-next").remove(); 1155 j.plugin.find(".ps-list > ul").addClass(j.config.mainClassName).attr("style", ""); 1156 j.plugin.find(".ps-list > ul").unwrap().unwrap(); 1157 j.hide() 1158 } else { 1159 j.parent().parent().remove() 1160 } 1161 j.plugin = null; 1162 j.data = []; 1163 j.config = {}; 1164 j.currentSlide = 0; 1165 j.slideCount = 0; 1166 j.resizeEvent = null; 1167 j.intervalEvent = null; 1168 j.touchFirstPosition = null; 1169 j.window = null; 1170 return true 1171 }; 1172 j.reload = function(r) { 1173 j.destroy(true); 1174 j = this; 1175 j.plugin = this; 1176 j.window = a(window); 1177 j.plugin.show(); 1178 j.config = a.extend({}, i, r); 1179 g(); 1180 j.window.resize(function() { 1181 clearTimeout(j.resizeEvent); 1182 j.resizeEvent = setTimeout(function() { 1183 e(); 1184 var s = j.plugin.find(".ps-current > ul > li.elt_" + j.currentSlide + " img").css("max-height", "").height(); 1185 h(s); 1186 if (j.config.displayList) { 1187 b(); 1188 n() 1189 } 1190 }, 100) 1191 }); 1192 if (j.config.autoSlide) { 1193 k() 1194 } 1195 return true 1196 }; 1197 p(); 1198 return this 1199 } 1200})(window.Zepto || window.jQuery); 1201 1202// $('.pgwMenu').pgwMenu(); 1203 1204var pgwSlideshow = $('.pgwSlideshow').pgwSlideshow(); 1205 1206// function reloadSlideshow() { 1207// var newConfig = {}; 1208// var style = $('input[name=\"style\"]:checked').val(); 1209// if (style == 'light') { 1210// newConfig.mainClassName = 'pgwSlideshowLight'; 1211// } 1212// var listPosition = $('input[name=\"listPosition\"]:checked').val(); 1213// if (listPosition == 'none') { 1214// newConfig.displayList = false; 1215// } else { 1216// newConfig.listPosition = listPosition; 1217// } 1218// newConfig.transitionEffect = $('input[name=\"transitionEffect\"]:checked').val(); 1219// if ($('#displayList:checked').val() == 'true') { 1220// newConfig.displayList = true; 1221// } else { 1222// newConfig.displayList = false; 1223// } 1224// if ($('#displayControls:checked').val() == 'true') { 1225// newConfig.displayControls = true; 1226// } else { 1227// newConfig.displayControls = false; 1228// } 1229// if ($('#maxHeight:checked').val() == 'true') { 1230// newConfig.maxHeight = 450; 1231// } 1232// pgwSlideshow.reload(newConfig); 1233// } 1234// $('.slideshowConfig input').bind('change', function() { 1235// reloadSlideshow() 1236// });
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.