1(function (factory){ 2if(typeof define==="function"&&define.amd){ 3define('ui/version.js', ["jquery"], factory); 4}else{ 5factory(jQuery); 6}}(function ($){ 7$.ui=$.ui||{}; 8return $.ui.version="@VERSION"; 9})); 10(function (factory){ 11if(typeof define==="function"&&define.amd){ 12define('ui/data', ["jquery", "./version"], factory); 13}else{ 14factory(jQuery); 15}}(function ($){ 16return $.extend($.expr[":"], { 17data: $.expr.createPseudo ? 18$.expr.createPseudo(function (dataName){ 19return function (elem){ 20return !!$.data(elem, dataName); 21};}) : 22function (elem, i, match){ 23return !!$.data(elem, match[3]); 24}}); 25})); 26(function (factory){ 27if(typeof define==="function"&&define.amd){ 28define('ui/disable-selection', ["jquery", "./version"], factory); 29}else{ 30factory(jQuery); 31}}(function ($){ 32return $.fn.extend({ 33disableSelection: (function (){ 34var eventType="onselectstart" in document.createElement("div") ? 35"selectstart" : 36"mousedown"; 37return function (){ 38return this.on(eventType + ".ui-disableSelection", function (event){ 39event.preventDefault(); 40}); 41};})(), 42enableSelection: function (){ 43return this.off(".ui-disableSelection"); 44}}); 45})); 46(function (factory){ 47if(typeof define==="function"&&define.amd){ 48define('ui/effect', ["jquery", "./version"], factory); 49}else{ 50factory(jQuery); 51}}(function ($){ 52var dataSpace="ui-effects-", 53dataSpaceStyle="ui-effects-style", 54dataSpaceAnimated="ui-effects-animated", 55jQuery=$; 56$.effects={ 57effect: {}}; 58(function (jQuery, undefined){ 59var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", 60rplusequals=/^([\-+])=\s*(\d+\.?\d*)/, 61stringParsers=[{ 62re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 63parse: function (execResult){ 64return [ 65execResult[1], 66execResult[2], 67execResult[3], 68execResult[4] 69]; 70}}, { 71re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 72parse: function (execResult){ 73return [ 74execResult[1] * 2.55, 75execResult[2] * 2.55, 76execResult[3] * 2.55, 77execResult[4] 78]; 79}}, { 80re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, 81parse: function (execResult){ 82return [ 83parseInt(execResult[1], 16), 84parseInt(execResult[2], 16), 85parseInt(execResult[3], 16) 86]; 87}}, { 88re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, 89parse: function (execResult){ 90return [ 91parseInt(execResult[1] + execResult[1], 16), 92parseInt(execResult[2] + execResult[2], 16), 93parseInt(execResult[3] + execResult[3], 16) 94]; 95}}, { 96re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 97space: "hsla", 98parse: function (execResult){ 99return [ 100execResult[1], 101execResult[2] / 100, 102execResult[3] / 100, 103execResult[4] 104]; 105}}], 106color=jQuery.Color=function (color, green, blue, alpha){ 107return new jQuery.Color.fn.parse(color, green, blue, alpha); 108}, 109spaces={ 110rgba: { 111props: { 112red: { 113idx: 0, 114type: "byte" 115}, 116green: { 117idx: 1, 118type: "byte" 119}, 120blue: { 121idx: 2, 122type: "byte" 123}} 124}, 125hsla: { 126props: { 127hue: { 128idx: 0, 129type: "degrees" 130}, 131saturation: { 132idx: 1, 133type: "percent" 134}, 135lightness: { 136idx: 2, 137type: "percent" 138}} 139}}, 140propTypes={ 141"byte": { 142floor: true, 143max: 255 144}, 145"percent": { 146max: 1 147}, 148"degrees": { 149mod: 360, 150floor: true 151}}, 152support=color.support={}, 153supportElem=jQuery("<p>")[0], 154colors, 155each=jQuery.each; 156supportElem.style.cssText="background-color:rgba(1,1,1,.5)"; 157support.rgba=supportElem.style.backgroundColor.indexOf("rgba") > -1; 158each(spaces, function (spaceName, space){ 159space.cache="_" + spaceName; 160space.props.alpha={ 161idx: 3, 162type: "percent", 163def: 1 164};}); 165function clamp(value, prop, allowEmpty){ 166var type=propTypes[prop.type]||{}; 167if(value==null){ 168return (allowEmpty||!prop.def) ? null:prop.def; 169} 170value=type.floor ? ~~value:parseFloat(value); 171if(isNaN(value)){ 172return prop.def; 173} 174if(type.mod){ 175return (value + type.mod) % type.mod; 176} 177return 0 > value ? 0:type.max < value ? type.max:value; 178} 179function stringParse(string){ 180var inst=color(), 181rgba=inst._rgba=[]; 182string=string.toLowerCase(); 183each(stringParsers, function (i, parser){ 184var parsed, 185match=parser.re.exec(string), 186values=match&&parser.parse(match), 187spaceName=parser.space||"rgba"; 188if(values){ 189parsed=inst[spaceName](values);
vendor: 5,337 bytes, lines 190-444
190inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache]; 191rgba=inst._rgba=parsed._rgba; 192return false; 193}}); 194if(rgba.length){ 195if(rgba.join()==="0,0,0,0"){ 196jQuery.extend(rgba, colors.transparent); 197} 198return inst; 199} 200return colors[string]; 201} 202color.fn=jQuery.extend(color.prototype, { 203parse: function (red, green, blue, alpha){ 204if(red===undefined){ 205this._rgba=[null, null, null, null]; 206return this; 207} 208if(red.jquery||red.nodeType){ 209red=jQuery(red).css(green); 210green=undefined; 211} 212var inst=this, 213type=jQuery.type(red), 214rgba=this._rgba=[]; 215if(green!==undefined){ 216red=[red, green, blue, alpha]; 217type="array"; 218} 219if(type==="string"){ 220return this.parse(stringParse(red)||colors._default); 221} 222if(type==="array"){ 223each(spaces.rgba.props, function (key, prop){ 224rgba[prop.idx]=clamp(red[prop.idx], prop); 225}); 226return this; 227} 228if(type==="object"){ 229if(red instanceof color){ 230each(spaces, function (spaceName, space){ 231if(red[space.cache]){ 232inst[space.cache]=red[space.cache].slice(); 233}}); 234}else{ 235each(spaces, function (spaceName, space){ 236var cache=space.cache; 237each(space.props, function (key, prop){ 238if(!inst[cache]&&space.to){ 239if(key==="alpha"||red[key]==null){ 240return; 241} 242inst[cache]=space.to(inst._rgba); 243} 244inst[cache][prop.idx]=clamp(red[key], prop, true); 245}); 246if(inst[cache]&&jQuery.inArray(null, inst[cache].slice(0, 3)) < 0){ 247inst[cache][3]=1; 248if(space.from){ 249inst._rgba=space.from(inst[cache]); 250}} 251}); 252} 253return this; 254}}, 255is: function (compare){ 256var is=color(compare), 257same=true, 258inst=this; 259each(spaces, function (_, space){ 260var localCache, 261isCache=is[space.cache]; 262if(isCache){ 263localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[]; 264each(space.props, function (_, prop){ 265if(isCache[prop.idx]!=null){ 266same=(isCache[prop.idx]===localCache[prop.idx]); 267return same; 268}}); 269} 270return same; 271}); 272return same; 273}, 274_space: function (){ 275var used=[], 276inst=this; 277each(spaces, function (spaceName, space){ 278if(inst[space.cache]){ 279used.push(spaceName); 280}}); 281return used.pop(); 282}, 283transition: function (other, distance){ 284var end=color(other), 285spaceName=end._space(), 286space=spaces[spaceName], 287startColor=this.alpha()===0 ? color("transparent"):this, 288start=startColor[space.cache]||space.to(startColor._rgba), 289result=start.slice(); 290end=end[space.cache]; 291each(space.props, function (key, prop){ 292var index=prop.idx, 293startValue=start[index], 294endValue=end[index], 295type=propTypes[prop.type]||{}; 296if(endValue===null){ 297return; 298} 299if(startValue===null){ 300result[index]=endValue; 301}else{ 302if(type.mod){ 303if(endValue - startValue > type.mod / 2){ 304startValue +=type.mod; 305}else if(startValue - endValue > type.mod / 2){ 306startValue -=type.mod; 307}} 308result[index]=clamp((endValue - startValue) * distance + startValue, prop); 309}}); 310return this[spaceName](result); 311}, 312blend: function (opaque){ 313if(this._rgba[3]===1){ 314return this; 315} 316var rgb=this._rgba.slice(), 317a=rgb.pop(), 318blend=color(opaque)._rgba; 319return color(jQuery.map(rgb, function (v, i){ 320return (1 - a) * blend[i] + a * v; 321})); 322}, 323toRgbaString: function (){ 324var prefix="rgba(", 325rgba=jQuery.map(this._rgba, function (v, i){ 326return v==null ? (i > 2 ? 1:0):v; 327}); 328if(rgba[3]===1){ 329rgba.pop(); 330prefix="rgb("; 331} 332return prefix + rgba.join() + ")"; 333}, 334toHslaString: function (){ 335var prefix="hsla(", 336hsla=jQuery.map(this.hsla(), function (v, i){ 337if(v==null){ 338v=i > 2 ? 1:0; 339} 340if(i&&i < 3){ 341v=Math.round(v * 100) + "%"; 342} 343return v; 344}); 345if(hsla[3]===1){ 346hsla.pop(); 347prefix="hsl("; 348} 349return prefix + hsla.join() + ")"; 350}, 351toHexString: function (includeAlpha){ 352var rgba=this._rgba.slice(), 353alpha=rgba.pop(); 354if(includeAlpha){ 355rgba.push(~~(alpha * 255)); 356} 357return "#" + jQuery.map(rgba, function (v){ 358v=(v||0).toString(16); 359return v.length===1 ? "0" + v:v; 360}).join(""); 361}, 362toString: function (){ 363return this._rgba[3]===0 ? "transparent":this.toRgbaString(); 364}}); 365color.fn.parse.prototype=color.fn; 366function hue2rgb(p, q, h){ 367h=(h + 1) % 1; 368if(h * 6 < 1){ 369return p + (q - p) * h * 6; 370} 371if(h * 2 < 1){ 372return q; 373} 374if(h * 3 < 2){ 375return p + (q - p) * ((2 / 3) - h) * 6; 376} 377return p; 378} 379spaces.hsla.to=function (rgba){ 380if(rgba[0]==null||rgba[1]==null||rgba[2]==null){ 381return [null, null, null, rgba[3]]; 382} 383var r=rgba[0] / 255, 384g=rgba[1] / 255, 385b=rgba[2] / 255, 386a=rgba[3], 387max=Math.max(r, g, b), 388min=Math.min(r, g, b), 389diff=max - min, 390add=max + min, 391l=add * 0.5, 392h, s; 393if(min===max){ 394h=0; 395}else if(r===max){ 396h=(60 * (g - b) / diff) + 360; 397}else if(g===max){ 398h=(60 * (b - r) / diff) + 120; 399}else{ 400h=(60 * (r - g) / diff) + 240; 401} 402if(diff===0){ 403s=0; 404}else if(l <=0.5){ 405s=diff / add; 406}else{ 407s=diff / (2 - add); 408} 409return [Math.round(h) % 360, s, l, a==null ? 1:a]; 410}; 411spaces.hsla.from=function (hsla){ 412if(hsla[0]==null||hsla[1]==null||hsla[2]==null){ 413return [null, null, null, hsla[3]]; 414} 415var h=hsla[0] / 360, 416s=hsla[1], 417l=hsla[2], 418a=hsla[3], 419q=l <=0.5 ? l * (1 + s):l + s - l * s, 420p=2 * l - q; 421return [ 422Math.round(hue2rgb(p, q, h + (1 / 3)) * 255), 423Math.round(hue2rgb(p, q, h) * 255), 424Math.round(hue2rgb(p, q, h - (1 / 3)) * 255), 425a 426]; 427}; 428each(spaces, function (spaceName, space){ 429var props=space.props, 430cache=space.cache, 431to=space.to, 432from=space.from; 433color.fn[spaceName]=function (value){ 434if(to&&!this[cache]){ 435this[cache]=to(this._rgba); 436} 437if(value===undefined){ 438return this[cache].slice(); 439} 440var ret, 441type=jQuery.type(value), 442arr=(type==="array"||type==="object") ? value:arguments, 443local=this[cache].slice(); 444each(props, function (key, prop){
vendor: 35,552 bytes, lines 445-1877
445var val=arr[type==="object" ? key:prop.idx]; 446if(val==null){ 447val=local[prop.idx]; 448} 449local[prop.idx]=clamp(val, prop); 450}); 451if(from){ 452ret=color(from(local)); 453ret[cache]=local; 454return ret; 455}else{ 456return color(local); 457}}; 458each(props, function (key, prop){ 459if(color.fn[key]){ 460return; 461} 462color.fn[key]=function (value){ 463var vtype=jQuery.type(value), 464fn=(key==="alpha" ? (this._hsla ? "hsla":"rgba"):spaceName), 465local=this[fn](), 466cur=local[prop.idx], 467match; 468if(vtype==="undefined"){ 469return cur; 470} 471if(vtype==="function"){ 472value=value.call(this, cur); 473vtype=jQuery.type(value); 474} 475if(value==null&&prop.empty){ 476return this; 477} 478if(vtype==="string"){ 479match=rplusequals.exec(value); 480if(match){ 481value=cur + parseFloat(match[2]) * (match[1]==="+" ? 1:-1); 482}} 483local[prop.idx]=value; 484return this[fn](local); 485};}); 486}); 487color.hook=function (hook){ 488var hooks=hook.split(" "); 489each(hooks, function (i, hook){ 490jQuery.cssHooks[hook]={ 491set: function (elem, value){ 492var parsed, curElem, 493backgroundColor=""; 494if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){ 495value=color(parsed||value); 496if(!support.rgba&&value._rgba[3]!==1){ 497curElem=hook==="backgroundColor" ? elem.parentNode:elem; 498while ( 499(backgroundColor===""||backgroundColor==="transparent") && 500curElem&&curElem.style 501){ 502try { 503backgroundColor=jQuery.css(curElem, "backgroundColor"); 504curElem=curElem.parentNode; 505} catch (e){ 506}} 507value=value.blend(backgroundColor&&backgroundColor!=="transparent" ? 508backgroundColor : 509"_default"); 510} 511value=value.toRgbaString(); 512} 513try { 514elem.style[hook]=value; 515} catch (e){ 516}} 517}; 518jQuery.fx.step[hook]=function (fx){ 519if(!fx.colorInit){ 520fx.start=color(fx.elem, hook); 521fx.end=color(fx.end); 522fx.colorInit=true; 523} 524jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos)); 525};}); 526}; 527color.hook(stepHooks); 528jQuery.cssHooks.borderColor={ 529expand: function (value){ 530var expanded={}; 531each(["Top", "Right", "Bottom", "Left"], function (i, part){ 532expanded["border" + part + "Color"]=value; 533}); 534return expanded; 535}}; 536colors=jQuery.Color.names={ 537aqua: "#00ffff", 538black: "#000000", 539blue: "#0000ff", 540fuchsia: "#ff00ff", 541gray: "#808080", 542green: "#008000", 543lime: "#00ff00", 544maroon: "#800000", 545navy: "#000080", 546olive: "#808000", 547purple: "#800080", 548red: "#ff0000", 549silver: "#c0c0c0", 550teal: "#008080", 551white: "#ffffff", 552yellow: "#ffff00", 553transparent: [null, null, null, 0], 554_default: "#ffffff" 555};})(jQuery); 556(function (){ 557var classAnimationActions=["add", "remove", "toggle"], 558shorthandStyles={ 559border: 1, 560borderBottom: 1, 561borderColor: 1, 562borderLeft: 1, 563borderRight: 1, 564borderTop: 1, 565borderWidth: 1, 566margin: 1, 567padding: 1 568}; 569$.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (_, prop){ 570$.fx.step[prop]=function (fx){ 571if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){ 572jQuery.style(fx.elem, prop, fx.end); 573fx.setAttr=true; 574}};}); 575function getElementStyles(elem){ 576var key, len, 577style=elem.ownerDocument.defaultView ? 578elem.ownerDocument.defaultView.getComputedStyle(elem, null) : 579elem.currentStyle, 580styles={}; 581if(style&&style.length&&style[0]&&style[style[0]]){ 582len=style.length; 583while (len--){ 584key=style[len]; 585if(typeof style[key]==="string"){ 586styles[$.camelCase(key)]=style[key]; 587}} 588}else{ 589for (key in style){ 590if(typeof style[key]==="string"){ 591styles[key]=style[key]; 592}} 593} 594return styles; 595} 596function styleDifference(oldStyle, newStyle){ 597var diff={}, 598name, value; 599for (name in newStyle){ 600value=newStyle[name]; 601if(oldStyle[name]!==value){ 602if(!shorthandStyles[name]){ 603if($.fx.step[name]||!isNaN(parseFloat(value))){ 604diff[name]=value; 605}} 606}} 607return diff; 608} 609if(!$.fn.addBack){ 610$.fn.addBack=function (selector){ 611return this.add(selector==null ? 612this.prevObject:this.prevObject.filter(selector) 613); 614};} 615$.effects.animateClass=function (value, duration, easing, callback){ 616var o=$.speed(duration, easing, callback); 617return this.queue(function (){ 618var animated=$(this), 619baseClass=animated.attr("class")||"", 620applyClassChange, 621allAnimations=o.children ? animated.find("*").addBack():animated; 622allAnimations=allAnimations.map(function (){ 623var el=$(this); 624return { 625el: el, 626start: getElementStyles(this) 627};}); 628applyClassChange=function (){ 629$.each(classAnimationActions, function (i, action){ 630if(value[action]){ 631animated[action + "Class"](value[action]); 632}}); 633}; 634applyClassChange(); 635allAnimations=allAnimations.map(function (){ 636this.end=getElementStyles(this.el[0]); 637this.diff=styleDifference(this.start, this.end); 638return this; 639}); 640animated.attr("class", baseClass); 641allAnimations=allAnimations.map(function (){ 642var styleInfo=this, 643dfd=$.Deferred(), 644opts=$.extend({}, o, { 645queue: false, 646complete: function (){ 647dfd.resolve(styleInfo); 648}}); 649this.el.animate(this.diff, opts); 650return dfd.promise(); 651}); 652$.when.apply($, allAnimations.get()).done(function (){ 653applyClassChange(); 654$.each(arguments, function (){ 655var el=this.el; 656$.each(this.diff, function (key){ 657el.css(key, ""); 658}); 659}); 660o.complete.call(animated[0]); 661}); 662}); 663}; 664$.fn.extend({ 665addClass: (function (orig){ 666return function (classNames, speed, easing, callback){ 667return speed ? 668$.effects.animateClass.call(this, 669{ add: classNames }, speed, easing, callback) : 670orig.apply(this, arguments); 671};})($.fn.addClass), 672removeClass: (function (orig){ 673return function (classNames, speed, easing, callback){ 674return arguments.length > 1 ? 675$.effects.animateClass.call(this, 676{ remove: classNames }, speed, easing, callback) : 677orig.apply(this, arguments); 678};})($.fn.removeClass), 679toggleClass: (function (orig){ 680return function (classNames, force, speed, easing, callback){ 681if(typeof force==="boolean"||force===undefined){ 682if(!speed){ 683return orig.apply(this, arguments); 684}else{ 685return $.effects.animateClass.call(this, 686(force ? { add: classNames }:{ remove: classNames }), 687speed, easing, callback); 688}}else{ 689return $.effects.animateClass.call(this, 690{ toggle: classNames }, force, speed, easing); 691}};})($.fn.toggleClass), 692switchClass: function (remove, add, speed, easing, callback){ 693return $.effects.animateClass.call(this, { 694add: add, 695remove: remove 696}, speed, easing, callback); 697}}); 698})(); 699(function (){ 700if($.expr&&$.expr.filters&&$.expr.filters.animated){ 701$.expr.filters.animated=(function (orig){ 702return function (elem){ 703return !!$(elem).data(dataSpaceAnimated)||orig(elem); 704};})($.expr.filters.animated); 705} 706if($.uiBackCompat!==false){ 707$.extend($.effects, { 708save: function (element, set){ 709var i=0, length=set.length; 710for (; i < length; i++){ 711if(set[i]!==null){ 712element.data(dataSpace + set[i], element[0].style[set[i]]); 713}} 714}, 715restore: function (element, set){ 716var val, i=0, length=set.length; 717for (; i < length; i++){ 718if(set[i]!==null){ 719val=element.data(dataSpace + set[i]); 720element.css(set[i], val); 721}} 722}, 723setMode: function (el, mode){ 724if(mode==="toggle"){ 725mode=el.is(":hidden") ? "show":"hide"; 726} 727return mode; 728}, 729createWrapper: function (element){ 730if(element.parent().is(".ui-effects-wrapper")){ 731return element.parent(); 732} 733var props={ 734width: element.outerWidth(true), 735height: element.outerHeight(true), 736"float": element.css("float") 737}, 738wrapper=$("<div></div>") 739.addClass("ui-effects-wrapper") 740.css({ 741fontSize: "100%", 742background: "transparent", 743border: "none", 744margin: 0, 745padding: 0 746}), 747size={ 748width: element.width(), 749height: element.height() 750}, 751active=document.activeElement; 752try { 753active.id; 754} catch (e){ 755active=document.body; 756} 757element.wrap(wrapper); 758if(element[0]===active||$.contains(element[0], active)){ 759$(active).trigger("focus"); 760} 761wrapper=element.parent(); 762if(element.css("position")==="static"){ 763wrapper.css({ position: "relative" }); 764element.css({ position: "relative" }); 765}else{ 766$.extend(props, { 767position: element.css("position"), 768zIndex: element.css("z-index") 769}); 770$.each(["top", "left", "bottom", "right"], function (i, pos){ 771props[pos]=element.css(pos); 772if(isNaN(parseInt(props[pos], 10))){ 773props[pos]="auto"; 774}}); 775element.css({ 776position: "relative", 777top: 0, 778left: 0, 779right: "auto", 780bottom: "auto" 781}); 782} 783element.css(size); 784return wrapper.css(props).show(); 785}, 786removeWrapper: function (element){ 787var active=document.activeElement; 788if(element.parent().is(".ui-effects-wrapper")){ 789element.parent().replaceWith(element); 790if(element[0]===active||$.contains(element[0], active)){ 791$(active).trigger("focus"); 792}} 793return element; 794}}); 795} 796$.extend($.effects, { 797version: "@VERSION", 798define: function (name, mode, effect){ 799if(!effect){ 800effect=mode; 801mode="effect"; 802} 803$.effects.effect[name]=effect; 804$.effects.effect[name].mode=mode; 805return effect; 806}, 807scaledDimensions: function (element, percent, direction){ 808if(percent===0){ 809return { 810height: 0, 811width: 0, 812outerHeight: 0, 813outerWidth: 0 814};} 815var x=direction!=="horizontal" ? ((percent||100) / 100):1, 816y=direction!=="vertical" ? ((percent||100) / 100):1; 817return { 818height: element.height() * y, 819width: element.width() * x, 820outerHeight: element.outerHeight() * y, 821outerWidth: element.outerWidth() * x 822};}, 823clipToBox: function (animation){ 824return { 825width: animation.clip.right - animation.clip.left, 826height: animation.clip.bottom - animation.clip.top, 827left: animation.clip.left, 828top: animation.clip.top 829};}, 830unshift: function (element, queueLength, count){ 831var queue=element.queue(); 832if(queueLength > 1){ 833queue.splice.apply(queue, 834[1, 0].concat(queue.splice(queueLength, count))); 835} 836element.dequeue(); 837}, 838saveStyle: function (element){ 839element.data(dataSpaceStyle, element[0].style.cssText); 840}, 841restoreStyle: function (element){ 842element[0].style.cssText=element.data(dataSpaceStyle)||""; 843element.removeData(dataSpaceStyle); 844}, 845mode: function (element, mode){ 846var hidden=element.is(":hidden"); 847if(mode==="toggle"){ 848mode=hidden ? "show":"hide"; 849} 850if(hidden ? mode==="hide":mode==="show"){ 851mode="none"; 852} 853return mode; 854}, 855getBaseline: function (origin, original){ 856var y, x; 857switch (origin[0]){ 858case "top": 859y=0; 860break; 861case "middle": 862y=0.5; 863break; 864case "bottom": 865y=1; 866break; 867default: 868y=origin[0] / original.height; 869} 870switch (origin[1]){ 871case "left": 872x=0; 873break; 874case "center": 875x=0.5; 876break; 877case "right": 878x=1; 879break; 880default: 881x=origin[1] / original.width; 882} 883return { 884x: x, 885y: y 886};}, 887createPlaceholder: function (element){ 888var placeholder, 889cssPosition=element.css("position"), 890position=element.position(); 891element.css({ 892marginTop: element.css("marginTop"), 893marginBottom: element.css("marginBottom"), 894marginLeft: element.css("marginLeft"), 895marginRight: element.css("marginRight") 896}) 897.outerWidth(element.outerWidth()) 898.outerHeight(element.outerHeight()); 899if(/^(static|relative)/.test(cssPosition)){ 900cssPosition="absolute"; 901placeholder=$("<" + element[0].nodeName + ">").insertAfter(element).css({ 902display: /^(inline|ruby)/.test(element.css("display")) ? "inline-block":"block", 903visibility: "hidden", 904marginTop: element.css("marginTop"), 905marginBottom: element.css("marginBottom"), 906marginLeft: element.css("marginLeft"), 907marginRight: element.css("marginRight"), 908"float": element.css("float") 909}) 910.outerWidth(element.outerWidth()) 911.outerHeight(element.outerHeight()) 912.addClass("ui-effects-placeholder"); 913element.data(dataSpace + "placeholder", placeholder); 914} 915element.css({ 916position: cssPosition, 917left: position.left, 918top: position.top 919}); 920return placeholder; 921}, 922removePlaceholder: function (element){ 923var dataKey=dataSpace + "placeholder", 924placeholder=element.data(dataKey); 925if(placeholder){ 926placeholder.remove(); 927element.removeData(dataKey); 928}}, 929cleanUp: function (element){ 930$.effects.restoreStyle(element); 931$.effects.removePlaceholder(element); 932}, 933setTransition: function (element, list, factor, value){ 934value=value||{}; 935$.each(list, function (i, x){ 936var unit=element.cssUnit(x); 937if(unit[0] > 0){ 938value[x]=unit[0] * factor + unit[1]; 939}}); 940return value; 941}}); 942function _normalizeArguments(effect, options, speed, callback){ 943if($.isPlainObject(effect)){ 944options=effect; 945effect=effect.effect; 946} 947effect={ effect: effect }; 948if(options==null){ 949options={};} 950if($.isFunction(options)){ 951callback=options; 952speed=null; 953options={};} 954if(typeof options==="number"||$.fx.speeds[options]){ 955callback=speed; 956speed=options; 957options={};} 958if($.isFunction(speed)){ 959callback=speed; 960speed=null; 961} 962if(options){ 963$.extend(effect, options); 964} 965speed=speed||options.duration; 966effect.duration=$.fx.off ? 0 : 967typeof speed==="number" ? speed : 968speed in $.fx.speeds ? $.fx.speeds[speed] : 969$.fx.speeds._default; 970effect.complete=callback||options.complete; 971return effect; 972} 973function standardAnimationOption(option){ 974if(!option||typeof option==="number"||$.fx.speeds[option]){ 975return true; 976} 977if(typeof option==="string"&&!$.effects.effect[option]){ 978return true; 979} 980if($.isFunction(option)){ 981return true; 982} 983if(typeof option==="object"&&!option.effect){ 984return true; 985} 986return false; 987} 988$.fn.extend({ 989effect: function(){ 990var args=_normalizeArguments.apply(this, arguments), 991effectMethod=$.effects.effect[args.effect], 992defaultMode=effectMethod.mode, 993queue=args.queue, 994queueName=queue||"fx", 995complete=args.complete, 996mode=args.mode, 997modes=[], 998prefilter=function (next){ 999var el=$(this), 1000normalizedMode=$.effects.mode(el, mode)||defaultMode; 1001el.data(dataSpaceAnimated, true); 1002modes.push(normalizedMode); 1003if(defaultMode&&(normalizedMode==="show" || 1004(normalizedMode===defaultMode&&normalizedMode==="hide"))){ 1005el.show(); 1006} 1007if(!defaultMode||normalizedMode!=="none"){ 1008$.effects.saveStyle(el); 1009} 1010if($.isFunction(next)){ 1011next(); 1012}}; 1013if($.fx.off||!effectMethod){ 1014if(mode){ 1015return this[mode](args.duration, complete); 1016}else{ 1017return this.each(function (){ 1018if(complete){ 1019complete.call(this); 1020}}); 1021}} 1022function run(next){ 1023var elem=$(this); 1024function cleanup(){ 1025elem.removeData(dataSpaceAnimated); 1026$.effects.cleanUp(elem); 1027if(args.mode==="hide"){ 1028elem.hide(); 1029} 1030done(); 1031} 1032function done(){ 1033if($.isFunction(complete)){ 1034complete.call(elem[0]); 1035} 1036if($.isFunction(next)){ 1037next(); 1038}} 1039args.mode=modes.shift(); 1040if($.uiBackCompat!==false&&!defaultMode){ 1041if(elem.is(":hidden") ? mode==="hide":mode==="show"){ 1042elem[mode](); 1043done(); 1044}else{ 1045effectMethod.call(elem[0], args, done); 1046}}else{ 1047if(args.mode==="none"){ 1048elem[mode](); 1049done(); 1050}else{ 1051effectMethod.call(elem[0], args, cleanup); 1052}} 1053} 1054return queue===false ? 1055this.each(prefilter).each(run) : 1056this.queue(queueName, prefilter).queue(queueName, run); 1057}, 1058show: (function (orig){ 1059return function (option){ 1060if(standardAnimationOption(option)){ 1061return orig.apply(this, arguments); 1062}else{ 1063var args=_normalizeArguments.apply(this, arguments); 1064args.mode="show"; 1065return this.effect.call(this, args); 1066}};})($.fn.show), 1067hide: (function (orig){ 1068return function (option){ 1069if(standardAnimationOption(option)){ 1070return orig.apply(this, arguments); 1071}else{ 1072var args=_normalizeArguments.apply(this, arguments); 1073args.mode="hide"; 1074return this.effect.call(this, args); 1075}};})($.fn.hide), 1076toggle: (function (orig){ 1077return function (option){ 1078if(standardAnimationOption(option)||typeof option==="boolean"){ 1079return orig.apply(this, arguments); 1080}else{ 1081var args=_normalizeArguments.apply(this, arguments); 1082args.mode="toggle"; 1083return this.effect.call(this, args); 1084}};})($.fn.toggle), 1085cssUnit: function (key){ 1086var style=this.css(key), 1087val=[]; 1088$.each(["em", "px", "%", "pt"], function (i, unit){ 1089if(style.indexOf(unit) > 0){ 1090val=[parseFloat(style), unit]; 1091}}); 1092return val; 1093}, 1094cssClip: function (clipObj){ 1095return clipObj ? 1096this.css("clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + clipObj.bottom + "px " + clipObj.left + "px)") : 1097parseClip(this.css("clip"), this); 1098}, 1099transfer: function (options, done){ 1100var element=$(this), 1101target=$(options.to), 1102targetFixed=target.css("position")==="fixed", 1103body=$("body"), 1104fixTop=targetFixed ? body.scrollTop():0, 1105fixLeft=targetFixed ? body.scrollLeft():0, 1106endPosition=target.offset(), 1107animation={ 1108top: endPosition.top - fixTop, 1109left: endPosition.left - fixLeft, 1110height: target.innerHeight(), 1111width: target.innerWidth() 1112}, 1113startPosition=element.offset(), 1114transfer=$("<div class='ui-effects-transfer'></div>") 1115.appendTo("body") 1116.addClass(options.className) 1117.css({ 1118top: startPosition.top - fixTop, 1119left: startPosition.left - fixLeft, 1120height: element.innerHeight(), 1121width: element.innerWidth(), 1122position: targetFixed ? "fixed":"absolute" 1123}) 1124.animate(animation, options.duration, options.easing, function (){ 1125transfer.remove(); 1126if($.isFunction(done)){ 1127done(); 1128}}); 1129}}); 1130function parseClip(str, element){ 1131var outerWidth=element.outerWidth(), 1132outerHeight=element.outerHeight(), 1133clipRegex=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/, 1134values=clipRegex.exec(str)||["", 0, outerWidth, outerHeight, 0]; 1135return { 1136top: parseFloat(values[1])||0, 1137right: values[2]==="auto" ? outerWidth:parseFloat(values[2]), 1138bottom: values[3]==="auto" ? outerHeight:parseFloat(values[3]), 1139left: parseFloat(values[4])||0 1140};} 1141$.fx.step.clip=function (fx){ 1142if(!fx.clipInit){ 1143fx.start=$(fx.elem).cssClip(); 1144if(typeof fx.end==="string"){ 1145fx.end=parseClip(fx.end, fx.elem); 1146} 1147fx.clipInit=true; 1148} 1149$(fx.elem).cssClip({ 1150top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top, 1151right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right, 1152bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom, 1153left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left 1154}); 1155};})(); 1156(function (){ 1157var baseEasings={}; 1158$.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (i, name){ 1159baseEasings[name]=function (p){ 1160return Math.pow(p, i + 2); 1161};}); 1162$.extend(baseEasings, { 1163Sine: function (p){ 1164return 1 - Math.cos(p * Math.PI / 2); 1165}, 1166Circ: function (p){ 1167return 1 - Math.sqrt(1 - p * p); 1168}, 1169Elastic: function (p){ 1170return p===0||p===1 ? p : 1171-Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15); 1172}, 1173Back: function (p){ 1174return p * p * (3 * p - 2); 1175}, 1176Bounce: function (p){ 1177var pow2, 1178bounce=4; 1179while (p < ((pow2=Math.pow(2, --bounce)) - 1) / 11){ } 1180return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2); 1181}}); 1182$.each(baseEasings, function (name, easeIn){ 1183$.easing["easeIn" + name]=easeIn; 1184$.easing["easeOut" + name]=function (p){ 1185return 1 - easeIn(1 - p); 1186}; 1187$.easing["easeInOut" + name]=function (p){ 1188return p < 0.5 ? 1189easeIn(p * 2) / 2 : 11901 - easeIn(p * -2 + 2) / 2; 1191};}); 1192})(); 1193return $.effects; 1194})); 1195(function (factory){ 1196if(typeof define==="function"&&define.amd){ 1197define('ui/effects/effect-blind.js', [ 1198"jquery", 1199"../version", 1200"../effect" 1201], factory); 1202}else{ 1203factory(jQuery); 1204}}(function ($){ 1205return $.effects.define("blind", "hide", function (options, done){ 1206var map={ 1207up: ["bottom", "top"], 1208vertical: ["bottom", "top"], 1209down: ["top", "bottom"], 1210left: ["right", "left"], 1211horizontal: ["right", "left"], 1212right: ["left", "right"] 1213}, 1214element=$(this), 1215direction=options.direction||"up", 1216start=element.cssClip(), 1217animate={ clip: $.extend({}, start) }, 1218placeholder=$.effects.createPlaceholder(element); 1219animate.clip[map[direction][0]]=animate.clip[map[direction][1]]; 1220if(options.mode==="show"){ 1221element.cssClip(animate.clip); 1222if(placeholder){ 1223placeholder.css($.effects.clipToBox(animate)); 1224} 1225animate.clip=start; 1226} 1227if(placeholder){ 1228placeholder.animate($.effects.clipToBox(animate), options.duration, options.easing); 1229} 1230element.animate(animate, { 1231queue: false, 1232duration: options.duration, 1233easing: options.easing, 1234complete: done 1235}); 1236}); 1237})); 1238(function (factory){ 1239if(typeof define==="function"&&define.amd){ 1240define('ui/effects/effect-bounce.js', [ 1241"jquery", 1242"../version", 1243"../effect" 1244], factory); 1245}else{ 1246factory(jQuery); 1247}}(function ($){ 1248return $.effects.define("bounce", function (options, done){ 1249var upAnim, downAnim, refValue, 1250element=$(this), 1251mode=options.mode, 1252hide=mode==="hide", 1253show=mode==="show", 1254direction=options.direction||"up", 1255distance=options.distance, 1256times=options.times||5, 1257anims=times * 2 + (show||hide ? 1:0), 1258speed=options.duration / anims, 1259easing=options.easing, 1260ref=(direction==="up"||direction==="down") ? "top":"left", 1261motion=(direction==="up"||direction==="left"), 1262i=0, 1263queuelen=element.queue().length; 1264$.effects.createPlaceholder(element); 1265refValue=element.css(ref); 1266if(!distance){ 1267distance=element[ref==="top" ? "outerHeight":"outerWidth"]() / 3; 1268} 1269if(show){ 1270downAnim={ opacity: 1 }; 1271downAnim[ref]=refValue; 1272element 1273.css("opacity", 0) 1274.css(ref, motion ? -distance * 2:distance * 2) 1275.animate(downAnim, speed, easing); 1276} 1277if(hide){ 1278distance=distance / Math.pow(2, times - 1); 1279} 1280downAnim={}; 1281downAnim[ref]=refValue; 1282for (; i < times; i++){ 1283upAnim={}; 1284upAnim[ref]=(motion ? "-=":"+=") + distance; 1285element 1286.animate(upAnim, speed, easing) 1287.animate(downAnim, speed, easing); 1288distance=hide ? distance * 2:distance / 2; 1289} 1290if(hide){ 1291upAnim={ opacity: 0 }; 1292upAnim[ref]=(motion ? "-=":"+=") + distance; 1293element.animate(upAnim, speed, easing); 1294} 1295element.queue(done); 1296$.effects.unshift(element, queuelen, anims + 1); 1297}); 1298})); 1299(function (factory){ 1300if(typeof define==="function"&&define.amd){ 1301define('ui/effects/effect-clip.js', [ 1302"jquery", 1303"../version", 1304"../effect" 1305], factory); 1306}else{ 1307factory(jQuery); 1308}}(function ($){ 1309return $.effects.define("clip", "hide", function (options, done){ 1310var start, 1311animate={}, 1312element=$(this), 1313direction=options.direction||"vertical", 1314both=direction==="both", 1315horizontal=both||direction==="horizontal", 1316vertical=both||direction==="vertical"; 1317start=element.cssClip(); 1318animate.clip={ 1319top: vertical ? (start.bottom - start.top) / 2:start.top, 1320right: horizontal ? (start.right - start.left) / 2:start.right, 1321bottom: vertical ? (start.bottom - start.top) / 2:start.bottom, 1322left: horizontal ? (start.right - start.left) / 2:start.left 1323}; 1324$.effects.createPlaceholder(element); 1325if(options.mode==="show"){ 1326element.cssClip(animate.clip); 1327animate.clip=start; 1328} 1329element.animate(animate, { 1330queue: false, 1331duration: options.duration, 1332easing: options.easing, 1333complete: done 1334}); 1335}); 1336})); 1337(function (factory){ 1338if(typeof define==="function"&&define.amd){ 1339define('ui/effects/effect-drop.js', [ 1340"jquery", 1341"../version", 1342"../effect" 1343], factory); 1344}else{ 1345factory(jQuery); 1346}}(function ($){ 1347return $.effects.define("drop", "hide", function (options, done){ 1348var distance, 1349element=$(this), 1350mode=options.mode, 1351show=mode==="show", 1352direction=options.direction||"left", 1353ref=(direction==="up"||direction==="down") ? "top":"left", 1354motion=(direction==="up"||direction==="left") ? "-=":"+=", 1355oppositeMotion=(motion==="+=") ? "-=":"+=", 1356animation={ 1357opacity: 0 1358}; 1359$.effects.createPlaceholder(element); 1360distance=options.distance||element[ref==="top" ? "outerHeight":"outerWidth"](true) / 2; 1361animation[ref]=motion + distance; 1362if(show){ 1363element.css(animation); 1364animation[ref]=oppositeMotion + distance; 1365animation.opacity=1; 1366} 1367element.animate(animation, { 1368queue: false, 1369duration: options.duration, 1370easing: options.easing, 1371complete: done 1372}); 1373}); 1374})); 1375(function (factory){ 1376if(typeof define==="function"&&define.amd){ 1377define('ui/effects/effect-explode.js', [ 1378"jquery", 1379"../version", 1380"../effect" 1381], factory); 1382}else{ 1383factory(jQuery); 1384}}(function ($){ 1385return $.effects.define("explode", "hide", function (options, done){ 1386var i, j, left, top, mx, my, 1387rows=options.pieces ? Math.round(Math.sqrt(options.pieces)):3, 1388cells=rows, 1389element=$(this), 1390mode=options.mode, 1391show=mode==="show", 1392offset=element.show().css("visibility", "hidden").offset(), 1393width=Math.ceil(element.outerWidth() / cells), 1394height=Math.ceil(element.outerHeight() / rows), 1395pieces=[]; 1396function childComplete(){ 1397pieces.push(this); 1398if(pieces.length===rows * cells){ 1399animComplete(); 1400}} 1401for (i=0; i < rows; i++){ 1402top=offset.top + i * height; 1403my=i - (rows - 1) / 2; 1404for (j=0; j < cells; j++){ 1405left=offset.left + j * width; 1406mx=j - (cells - 1) / 2; 1407element 1408.clone() 1409.appendTo("body") 1410.wrap("<div></div>") 1411.css({ 1412position: "absolute", 1413visibility: "visible", 1414left: -j * width, 1415top: -i * height 1416}) 1417.parent() 1418.addClass("ui-effects-explode") 1419.css({ 1420position: "absolute", 1421overflow: "hidden", 1422width: width, 1423height: height, 1424left: left + (show ? mx * width:0), 1425top: top + (show ? my * height:0), 1426opacity: show ? 0:1 1427}) 1428.animate({ 1429left: left + (show ? 0:mx * width), 1430top: top + (show ? 0:my * height), 1431opacity: show ? 1:0 1432}, options.duration||500, options.easing, childComplete); 1433}} 1434function animComplete(){ 1435element.css({ 1436visibility: "visible" 1437}); 1438$(pieces).remove(); 1439done(); 1440}}); 1441})); 1442(function (factory){ 1443if(typeof define==="function"&&define.amd){ 1444define('ui/effects/effect-fade.js', [ 1445"jquery", 1446"../version", 1447"../effect" 1448], factory); 1449}else{ 1450factory(jQuery); 1451}}(function ($){ 1452return $.effects.define("fade", "toggle", function (options, done){ 1453var show=options.mode==="show"; 1454$(this) 1455.css("opacity", show ? 0:1) 1456.animate({ 1457opacity: show ? 1:0 1458}, { 1459queue: false, 1460duration: options.duration, 1461easing: options.easing, 1462complete: done 1463}); 1464}); 1465})); 1466(function (factory){ 1467if(typeof define==="function"&&define.amd){ 1468define('ui/effects/effect-fold.js', [ 1469"jquery", 1470"../version", 1471"../effect" 1472], factory); 1473}else{ 1474factory(jQuery); 1475}}(function ($){ 1476return $.effects.define("fold", "hide", function (options, done){ 1477var element=$(this), 1478mode=options.mode, 1479show=mode==="show", 1480hide=mode==="hide", 1481size=options.size||15, 1482percent=/([0-9]+)%/.exec(size), 1483horizFirst = !!options.horizFirst, 1484ref=horizFirst ? ["right", "bottom"]:["bottom", "right"], 1485duration=options.duration / 2, 1486placeholder=$.effects.createPlaceholder(element), 1487start=element.cssClip(), 1488animation1={ clip: $.extend({}, start) }, 1489animation2={ clip: $.extend({}, start) }, 1490distance=[start[ref[0]], start[ref[1]]], 1491queuelen=element.queue().length; 1492if(percent){ 1493size=parseInt(percent[1], 10) / 100 * distance[hide ? 0:1]; 1494} 1495animation1.clip[ref[0]]=size; 1496animation2.clip[ref[0]]=size; 1497animation2.clip[ref[1]]=0; 1498if(show){ 1499element.cssClip(animation2.clip); 1500if(placeholder){ 1501placeholder.css($.effects.clipToBox(animation2)); 1502} 1503animation2.clip=start; 1504} 1505element 1506.queue(function (next){ 1507if(placeholder){ 1508placeholder 1509.animate($.effects.clipToBox(animation1), duration, options.easing) 1510.animate($.effects.clipToBox(animation2), duration, options.easing); 1511} 1512next(); 1513}) 1514.animate(animation1, duration, options.easing) 1515.animate(animation2, duration, options.easing) 1516.queue(done); 1517$.effects.unshift(element, queuelen, 4); 1518}); 1519})); 1520(function (factory){ 1521if(typeof define==="function"&&define.amd){ 1522define('ui/effects/effect-highlight.js', [ 1523"jquery", 1524"../version", 1525"../effect" 1526], factory); 1527}else{ 1528factory(jQuery); 1529}}(function ($){ 1530return $.effects.define("highlight", "show", function (options, done){ 1531var element=$(this), 1532animation={ 1533backgroundColor: element.css("backgroundColor") 1534}; 1535if(options.mode==="hide"){ 1536animation.opacity=0; 1537} 1538$.effects.saveStyle(element); 1539element 1540.css({ 1541backgroundImage: "none", 1542backgroundColor: options.color||"#ffff99" 1543}) 1544.animate(animation, { 1545queue: false, 1546duration: options.duration, 1547easing: options.easing, 1548complete: done 1549}); 1550}); 1551})); 1552(function (factory){ 1553if(typeof define==="function"&&define.amd){ 1554define('ui/effects/effect-size.js', [ 1555"jquery", 1556"../version", 1557"../effect" 1558], factory); 1559}else{ 1560factory(jQuery); 1561}}(function ($){ 1562return $.effects.define("size", function (options, done){ 1563var baseline, factor, temp, 1564element=$(this), 1565cProps=["fontSize"], 1566vProps=["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 1567hProps=["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], 1568mode=options.mode, 1569restore=mode!=="effect", 1570scale=options.scale||"both", 1571origin=options.origin||["middle", "center"], 1572position=element.css("position"), 1573pos=element.position(), 1574original=$.effects.scaledDimensions(element), 1575from=options.from||original, 1576to=options.to||$.effects.scaledDimensions(element, 0); 1577$.effects.createPlaceholder(element); 1578if(mode==="show"){ 1579temp=from; 1580from=to; 1581to=temp; 1582} 1583factor={ 1584from: { 1585y: from.height / original.height, 1586x: from.width / original.width 1587}, 1588to: { 1589y: to.height / original.height, 1590x: to.width / original.width 1591}}; 1592if(scale==="box"||scale==="both"){ 1593if(factor.from.y!==factor.to.y){ 1594from=$.effects.setTransition(element, vProps, factor.from.y, from); 1595to=$.effects.setTransition(element, vProps, factor.to.y, to); 1596} 1597if(factor.from.x!==factor.to.x){ 1598from=$.effects.setTransition(element, hProps, factor.from.x, from); 1599to=$.effects.setTransition(element, hProps, factor.to.x, to); 1600}} 1601if(scale==="content"||scale==="both"){ 1602if(factor.from.y!==factor.to.y){ 1603from=$.effects.setTransition(element, cProps, factor.from.y, from); 1604to=$.effects.setTransition(element, cProps, factor.to.y, to); 1605}} 1606if(origin){ 1607baseline=$.effects.getBaseline(origin, original); 1608from.top=(original.outerHeight - from.outerHeight) * baseline.y + pos.top; 1609from.left=(original.outerWidth - from.outerWidth) * baseline.x + pos.left; 1610to.top=(original.outerHeight - to.outerHeight) * baseline.y + pos.top; 1611to.left=(original.outerWidth - to.outerWidth) * baseline.x + pos.left; 1612} 1613element.css(from); 1614if(scale==="content"||scale==="both"){ 1615vProps=vProps.concat(["marginTop", "marginBottom"]).concat(cProps); 1616hProps=hProps.concat(["marginLeft", "marginRight"]); 1617element.find("*[width]").each(function (){ 1618var child=$(this), 1619childOriginal=$.effects.scaledDimensions(child), 1620childFrom={ 1621height: childOriginal.height * factor.from.y, 1622width: childOriginal.width * factor.from.x, 1623outerHeight: childOriginal.outerHeight * factor.from.y, 1624outerWidth: childOriginal.outerWidth * factor.from.x 1625}, 1626childTo={ 1627height: childOriginal.height * factor.to.y, 1628width: childOriginal.width * factor.to.x, 1629outerHeight: childOriginal.height * factor.to.y, 1630outerWidth: childOriginal.width * factor.to.x 1631}; 1632if(factor.from.y!==factor.to.y){ 1633childFrom=$.effects.setTransition(child, vProps, factor.from.y, childFrom); 1634childTo=$.effects.setTransition(child, vProps, factor.to.y, childTo); 1635} 1636if(factor.from.x!==factor.to.x){ 1637childFrom=$.effects.setTransition(child, hProps, factor.from.x, childFrom); 1638childTo=$.effects.setTransition(child, hProps, factor.to.x, childTo); 1639} 1640if(restore){ 1641$.effects.saveStyle(child); 1642} 1643child.css(childFrom); 1644child.animate(childTo, options.duration, options.easing, function (){ 1645if(restore){ 1646$.effects.restoreStyle(child); 1647}}); 1648}); 1649} 1650element.animate(to, { 1651queue: false, 1652duration: options.duration, 1653easing: options.easing, 1654complete: function (){ 1655var offset=element.offset(); 1656if(to.opacity===0){ 1657element.css("opacity", from.opacity); 1658} 1659if(!restore){ 1660element 1661.css("position", position==="static" ? "relative":position) 1662.offset(offset); 1663$.effects.saveStyle(element); 1664} 1665done(); 1666}}); 1667}); 1668})); 1669(function (factory){ 1670if(typeof define==="function"&&define.amd){ 1671define('ui/effects/effect-scale.js', [ 1672"jquery", 1673"../version", 1674"../effect", 1675"./effect-size" 1676], factory); 1677}else{ 1678factory(jQuery); 1679}}(function ($){ 1680return $.effects.define("scale", function (options, done){ 1681var el=$(this), 1682mode=options.mode, 1683percent=parseInt(options.percent, 10) || 1684(parseInt(options.percent, 10)===0 ? 0:(mode!=="effect" ? 0:100)), 1685newOptions=$.extend(true, { 1686from: $.effects.scaledDimensions(el), 1687to: $.effects.scaledDimensions(el, percent, options.direction||"both"), 1688origin: options.origin||["middle", "center"] 1689}, options); 1690if(options.fade){ 1691newOptions.from.opacity=1; 1692newOptions.to.opacity=0; 1693} 1694$.effects.effect.size.call(this, newOptions, done); 1695}); 1696})); 1697(function (factory){ 1698if(typeof define==="function"&&define.amd){ 1699define('ui/effects/effect-puff.js', [ 1700"jquery", 1701"../version", 1702"../effect", 1703"./effect-scale" 1704], factory); 1705}else{ 1706factory(jQuery); 1707}}(function ($){ 1708return $.effects.define("puff", "hide", function (options, done){ 1709var newOptions=$.extend(true, {}, options, { 1710fade: true, 1711percent: parseInt(options.percent, 10)||150 1712}); 1713$.effects.effect.scale.call(this, newOptions, done); 1714}); 1715})); 1716(function (factory){ 1717if(typeof define==="function"&&define.amd){ 1718define('ui/effects/effect-pulsate.js', [ 1719"jquery", 1720"../version", 1721"../effect" 1722], factory); 1723}else{ 1724factory(jQuery); 1725}}(function ($){ 1726return $.effects.define("pulsate", "show", function (options, done){ 1727var element=$(this), 1728mode=options.mode, 1729show=mode==="show", 1730hide=mode==="hide", 1731showhide=show||hide, 1732anims=((options.times||5) * 2) + (showhide ? 1:0), 1733duration=options.duration / anims, 1734animateTo=0, 1735i=1, 1736queuelen=element.queue().length; 1737if(show||!element.is(":visible")){ 1738element.css("opacity", 0).show(); 1739animateTo=1; 1740} 1741for (; i < anims; i++){ 1742element.animate({ opacity: animateTo }, duration, options.easing); 1743animateTo=1 - animateTo; 1744} 1745element.animate({ opacity: animateTo }, duration, options.easing); 1746element.queue(done); 1747$.effects.unshift(element, queuelen, anims + 1); 1748}); 1749})); 1750(function (factory){ 1751if(typeof define==="function"&&define.amd){ 1752define('ui/effects/effect-shake.js', [ 1753"jquery", 1754"../version", 1755"../effect" 1756], factory); 1757}else{ 1758factory(jQuery); 1759}}(function ($){ 1760return $.effects.define("shake", function (options, done){ 1761var i=1, 1762element=$(this), 1763direction=options.direction||"left", 1764distance=options.distance||20, 1765times=options.times||3, 1766anims=times * 2 + 1, 1767speed=Math.round(options.duration / anims), 1768ref=(direction==="up"||direction==="down") ? "top":"left", 1769positiveMotion=(direction==="up"||direction==="left"), 1770animation={}, 1771animation1={}, 1772animation2={}, 1773queuelen=element.queue().length; 1774$.effects.createPlaceholder(element); 1775animation[ref]=(positiveMotion ? "-=":"+=") + distance; 1776animation1[ref]=(positiveMotion ? "+=":"-=") + distance * 2; 1777animation2[ref]=(positiveMotion ? "-=":"+=") + distance * 2; 1778element.animate(animation, speed, options.easing); 1779for (; i < times; i++){ 1780element.animate(animation1, speed, options.easing).animate(animation2, speed, options.easing); 1781} 1782element 1783.animate(animation1, speed, options.easing) 1784.animate(animation, speed / 2, options.easing) 1785.queue(done); 1786$.effects.unshift(element, queuelen, anims + 1); 1787}); 1788})); 1789(function (factory){ 1790if(typeof define==="function"&&define.amd){ 1791define('ui/effects/effect-slide.js', [ 1792"jquery", 1793"../version", 1794"../effect" 1795], factory); 1796}else{ 1797factory(jQuery); 1798}}(function ($){ 1799return $.effects.define("slide", "show", function (options, done){ 1800var startClip, startRef, 1801element=$(this), 1802map={ 1803up: ["bottom", "top"], 1804down: ["top", "bottom"], 1805left: ["right", "left"], 1806right: ["left", "right"] 1807}, 1808mode=options.mode, 1809direction=options.direction||"left", 1810ref=(direction==="up"||direction==="down") ? "top":"left", 1811positiveMotion=(direction==="up"||direction==="left"), 1812distance=options.distance||element[ref==="top" ? "outerHeight":"outerWidth"](true), 1813animation={}; 1814$.effects.createPlaceholder(element); 1815startClip=element.cssClip(); 1816startRef=element.position()[ref]; 1817animation[ref]=(positiveMotion ? -1:1) * distance + startRef; 1818animation.clip=element.cssClip(); 1819animation.clip[map[direction][1]]=animation.clip[map[direction][0]]; 1820if(mode==="show"){ 1821element.cssClip(animation.clip); 1822element.css(ref, animation[ref]); 1823animation.clip=startClip; 1824animation[ref]=startRef; 1825} 1826element.animate(animation, { 1827queue: false, 1828duration: options.duration, 1829easing: options.easing, 1830complete: done 1831}); 1832}); 1833})); 1834(function (factory){ 1835if(typeof define==="function"&&define.amd){ 1836define('ui/effects/effect-transfer.js', [ 1837"jquery", 1838"../version", 1839"../effect" 1840], factory); 1841}else{ 1842factory(jQuery); 1843}}(function ($){ 1844var effect; 1845if($.uiBackCompat!==false){ 1846effect=$.effects.define("transfer", function (options, done){ 1847$(this).transfer(options, done); 1848}); 1849} 1850return effect; 1851})); 1852(function (factory){ 1853if(typeof define==="function"&&define.amd){ 1854define('ui/escape-selector', ["jquery", "./version"], factory); 1855}else{ 1856factory(jQuery); 1857}}(function ($){ 1858return $.ui.escapeSelector=(function (){ 1859var selectorEscape=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g; 1860return function (selector){ 1861return selector.replace(selectorEscape, "\\$1"); 1862};})(); 1863})); 1864(function (factory){ 1865if(typeof define==="function"&&define.amd){ 1866define('ui/focusable', ["jquery", "./version"], factory); 1867}else{ 1868factory(jQuery); 1869}}(function ($){ 1870$.ui.focusable=function (element, hasTabindex){ 1871var map, mapName, img, 1872nodeName=element.nodeName.toLowerCase(); 1873if("area"===nodeName){ 1874map=element.parentNode; 1875mapName=map.name; 1876if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){ 1877return false;
1878} 1879img=$("img[usemap='#" + mapName + "']"); 1880return img.length > 0&&img.is(":visible"); 1881} 1882return (/^(input|select|textarea|button|object)$/.test(nodeName) ? 1883!element.disabled : 1884"a"===nodeName ? 1885element.href||hasTabindex : 1886hasTabindex) && 1887$(element).is(":visible")&&visible($(element)); 1888}; 1889function visible(element){ 1890var visibility=element.css("visibility"); 1891while (visibility==="inherit"){ 1892element=element.parent(); 1893visibility=element.css("visibility"); 1894} 1895return visibility!=="hidden"; 1896} 1897$.extend($.expr[":"], { 1898focusable: function (element){ 1899return $.ui.focusable(element, $.attr(element, "tabindex")!=null); 1900}}); 1901return $.ui.focusable; 1902})); 1903(function (factory){ 1904if(typeof define==="function"&&define.amd){ 1905define('ui/form.js', ["jquery", "./version"], factory); 1906}else{ 1907factory(jQuery); 1908}}(function ($){ 1909return $.fn.form=function (){ 1910return typeof this[0].form==="string" ? this.closest("form"):$(this[0].form); 1911};})); 1912(function (factory){ 1913if(typeof define==="function"&&define.amd){ 1914define('ui/form-reset-mixin', [ 1915"jquery", 1916"./form", 1917"./version" 1918], factory); 1919}else{ 1920factory(jQuery); 1921}}(function ($){ 1922return $.ui.formResetMixin={ 1923_formResetHandler: function (){ 1924var form=$(this); 1925setTimeout(function (){ 1926var instances=form.data("ui-form-reset-instances"); 1927$.each(instances, function (){ 1928this.refresh(); 1929}); 1930}); 1931}, 1932_bindFormResetHandler: function (){ 1933this.form=this.element.form(); 1934if(!this.form.length){ 1935return; 1936} 1937var instances=this.form.data("ui-form-reset-instances")||[]; 1938if(!instances.length){ 1939this.form.on("reset.ui-form-reset", this._formResetHandler); 1940} 1941instances.push(this); 1942this.form.data("ui-form-reset-instances", instances); 1943}, 1944_unbindFormResetHandler: function (){ 1945if(!this.form.length){ 1946return; 1947} 1948var instances=this.form.data("ui-form-reset-instances"); 1949instances.splice($.inArray(this, instances), 1); 1950if(instances.length){ 1951this.form.data("ui-form-reset-instances", instances); 1952}else{ 1953this.form 1954.removeData("ui-form-reset-instances") 1955.off("reset.ui-form-reset"); 1956}} 1957};})); 1958(function (factory){ 1959if(typeof define==="function"&&define.amd){ 1960define('ui/ie', ["jquery", "./version"], factory); 1961}else{ 1962factory(jQuery); 1963}}(function ($){ 1964return $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); 1965})); 1966(function (factory){ 1967if(typeof define==="function"&&define.amd){ 1968define('ui/jquery-1-7.js', ["jquery", "./version"], factory); 1969}else{ 1970factory(jQuery); 1971}}(function ($){ 1972if($.fn.jquery.substring(0, 3)==="1.7"){ 1973$.each(["Width", "Height"], function (i, name){ 1974var side=name==="Width" ? ["Left", "Right"]:["Top", "Bottom"], 1975type=name.toLowerCase(), 1976orig={ 1977innerWidth: $.fn.innerWidth, 1978innerHeight: $.fn.innerHeight, 1979outerWidth: $.fn.outerWidth, 1980outerHeight: $.fn.outerHeight 1981}; 1982function reduce(elem, size, border, margin){ 1983$.each(side, function (){ 1984size -=parseFloat($.css(elem, "padding" + this))||0; 1985if(border){ 1986size -=parseFloat($.css(elem, "border" + this + "Width"))||0; 1987} 1988if(margin){ 1989size -=parseFloat($.css(elem, "margin" + this))||0; 1990}}); 1991return size; 1992} 1993$.fn["inner" + name]=function (size){ 1994if(size===undefined){ 1995return orig["inner" + name].call(this); 1996} 1997return this.each(function (){ 1998$(this).css(type, reduce(this, size) + "px"); 1999}); 2000}; 2001$.fn["outer" + name]=function (size, margin){ 2002if(typeof size!=="number"){ 2003return orig["outer" + name].call(this, size); 2004} 2005return this.each(function (){ 2006$(this).css(type, reduce(this, size, true, margin) + "px"); 2007}); 2008};}); 2009$.fn.addBack=function (selector){ 2010return this.add(selector==null ? 2011this.prevObject:this.prevObject.filter(selector) 2012); 2013};}})); 2014(function (factory){ 2015if(typeof define==="function"&&define.amd){ 2016define('ui/keycode', ["jquery", "./version"], factory); 2017}else{ 2018factory(jQuery); 2019}}(function ($){ 2020return $.ui.keyCode={ 2021BACKSPACE: 8, 2022COMMA: 188, 2023DELETE: 46, 2024DOWN: 40, 2025END: 35, 2026ENTER: 13, 2027ESCAPE: 27, 2028HOME: 36, 2029LEFT: 37, 2030PAGE_DOWN: 34, 2031PAGE_UP: 33, 2032PERIOD: 190, 2033RIGHT: 39, 2034SPACE: 32, 2035TAB: 9, 2036UP: 38 2037};})); 2038(function (factory){ 2039if(typeof define==="function"&&define.amd){ 2040define('ui/labels', ["jquery", "./version", "./escape-selector"], factory); 2041}else{ 2042factory(jQuery); 2043}}(function ($){ 2044return $.fn.labels=function (){ 2045var ancestor, selector, id, labels, ancestors; 2046if(this[0].labels&&this[0].labels.length){ 2047return this.pushStack(this[0].labels); 2048} 2049labels=this.eq(0).parents("label"); 2050id=this.attr("id"); 2051if(id){
vendor: 5,268 bytes, lines 2052-2241
2052ancestor=this.eq(0).parents().last(); 2053ancestors=ancestor.add(ancestor.length ? ancestor.siblings():this.siblings()); 2054selector="label[for='" + $.ui.escapeSelector(id) + "']"; 2055labels=labels.add(ancestors.find(selector).addBack(selector)); 2056} 2057return this.pushStack(labels); 2058};})); 2059(function (factory){ 2060if(typeof define==="function"&&define.amd){ 2061define('ui/plugin', ["jquery", "./version"], factory); 2062}else{ 2063factory(jQuery); 2064}}(function ($){ 2065return $.ui.plugin={ 2066add: function (module, option, set){ 2067var i, 2068proto=$.ui[module].prototype; 2069for (i in set){ 2070proto.plugins[i]=proto.plugins[i]||[]; 2071proto.plugins[i].push([option, set[i]]); 2072}}, 2073call: function (instance, name, args, allowDisconnected){ 2074var i, 2075set=instance.plugins[name]; 2076if(!set){ 2077return; 2078} 2079if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){ 2080return; 2081} 2082for (i=0; i < set.length; i++){ 2083if(instance.options[set[i][0]]){ 2084set[i][1].apply(instance.element, args); 2085}} 2086}};})); 2087(function (factory){ 2088if(typeof define==="function"&&define.amd){ 2089define('ui/position', ["jquery", "./version"], factory); 2090}else{ 2091factory(jQuery); 2092}}(function ($){ 2093(function (){ 2094var cachedScrollbarWidth, supportsOffsetFractions, 2095max=Math.max, 2096abs=Math.abs, 2097round=Math.round, 2098rhorizontal=/left|center|right/, 2099rvertical=/top|center|bottom/, 2100roffset=/[\+\-]\d+(\.[\d]+)?%?/, 2101rposition=/^\w+/, 2102rpercent=/%$/, 2103_position=$.fn.position; 2104supportsOffsetFractions=function (){ 2105var element=$("<div>") 2106.css("position", "absolute") 2107.appendTo("body") 2108.offset({ 2109top: 1.5, 2110left: 1.5 2111}), 2112support=element.offset().top===1.5; 2113element.remove(); 2114supportsOffsetFractions=function (){ 2115return support; 2116}; 2117return support; 2118}; 2119function getOffsets(offsets, width, height){ 2120return [ 2121parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100:1), 2122parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100:1) 2123]; 2124} 2125function parseCss(element, property){ 2126return parseInt($.css(element, property), 10)||0; 2127} 2128function getDimensions(elem){ 2129var raw=elem[0]; 2130if(raw.nodeType===9){ 2131return { 2132width: elem.width(), 2133height: elem.height(), 2134offset: { top: 0, left: 0 }};} 2135if($.isWindow(raw)){ 2136return { 2137width: elem.width(), 2138height: elem.height(), 2139offset: { top: elem.scrollTop(), left: elem.scrollLeft() }};} 2140if(raw.preventDefault){ 2141return { 2142width: 0, 2143height: 0, 2144offset: { top: raw.pageY, left: raw.pageX }};} 2145return { 2146width: elem.outerWidth(), 2147height: elem.outerHeight(), 2148offset: elem.offset() 2149};} 2150$.position={ 2151scrollbarWidth: function (){ 2152if(cachedScrollbarWidth!==undefined){ 2153return cachedScrollbarWidth; 2154} 2155var w1, w2, 2156div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), 2157innerDiv=div.children()[0]; 2158$("body").append(div); 2159w1=innerDiv.offsetWidth; 2160div.css("overflow", "scroll"); 2161w2=innerDiv.offsetWidth; 2162if(w1===w2){ 2163w2=div[0].clientWidth; 2164} 2165div.remove(); 2166return (cachedScrollbarWidth=w1 - w2); 2167}, 2168getScrollInfo: function (within){ 2169var overflowX=within.isWindow||within.isDocument ? "" : 2170within.element.css("overflow-x"), 2171overflowY=within.isWindow||within.isDocument ? "" : 2172within.element.css("overflow-y"), 2173hasOverflowX=overflowX==="scroll" || 2174(overflowX==="auto"&&within.width < within.element[0].scrollWidth), 2175hasOverflowY=overflowY==="scroll" || 2176(overflowY==="auto"&&within.height < within.element[0].scrollHeight); 2177return { 2178width: hasOverflowY ? $.position.scrollbarWidth():0, 2179height: hasOverflowX ? $.position.scrollbarWidth():0 2180};}, 2181getWithinInfo: function (element){ 2182var withinElement=$(element||window), 2183isWindow=$.isWindow(withinElement[0]), 2184isDocument = !!withinElement[0]&&withinElement[0].nodeType===9, 2185hasOffset = !isWindow&&!isDocument; 2186return { 2187element: withinElement, 2188isWindow: isWindow, 2189isDocument: isDocument, 2190offset: hasOffset ? $(element).offset():{ left: 0, top: 0 }, 2191scrollLeft: withinElement.scrollLeft(), 2192scrollTop: withinElement.scrollTop(), 2193width: withinElement.outerWidth(), 2194height: withinElement.outerHeight() 2195};}}; 2196$.fn.position=function (options){ 2197if(!options||!options.of){ 2198return _position.apply(this, arguments); 2199} 2200options=$.extend({}, options); 2201var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 2202target=$(options.of), 2203within=$.position.getWithinInfo(options.within), 2204scrollInfo=$.position.getScrollInfo(within), 2205collision=(options.collision||"flip").split(" "), 2206offsets={}; 2207dimensions=getDimensions(target); 2208if(target[0].preventDefault){ 2209options.at="left top"; 2210} 2211targetWidth=dimensions.width; 2212targetHeight=dimensions.height; 2213targetOffset=dimensions.offset; 2214basePosition=$.extend({}, targetOffset); 2215$.each(["my", "at"], function (){ 2216var pos=(options[this]||"").split(" "), 2217horizontalOffset, 2218verticalOffset; 2219if(pos.length===1){ 2220pos=rhorizontal.test(pos[0]) ? 2221pos.concat(["center"]) : 2222rvertical.test(pos[0]) ? 2223["center"].concat(pos) : 2224["center", "center"]; 2225} 2226pos[0]=rhorizontal.test(pos[0]) ? pos[0]:"center"; 2227pos[1]=rvertical.test(pos[1]) ? pos[1]:"center"; 2228horizontalOffset=roffset.exec(pos[0]); 2229verticalOffset=roffset.exec(pos[1]); 2230offsets[this]=[ 2231horizontalOffset ? horizontalOffset[0]:0, 2232verticalOffset ? verticalOffset[0]:0 2233]; 2234options[this]=[ 2235rposition.exec(pos[0])[0], 2236rposition.exec(pos[1])[0] 2237]; 2238}); 2239if(collision.length===1){ 2240collision[1]=collision[0]; 2241}
vendor: 5,209 bytes, lines 2242-2413
2242if(options.at[0]==="right"){ 2243basePosition.left +=targetWidth; 2244}else if(options.at[0]==="center"){ 2245basePosition.left +=targetWidth / 2; 2246} 2247if(options.at[1]==="bottom"){ 2248basePosition.top +=targetHeight; 2249}else if(options.at[1]==="center"){ 2250basePosition.top +=targetHeight / 2; 2251} 2252atOffset=getOffsets(offsets.at, targetWidth, targetHeight); 2253basePosition.left +=atOffset[0]; 2254basePosition.top +=atOffset[1]; 2255return this.each(function (){ 2256var collisionPosition, using, 2257elem=$(this), 2258elemWidth=elem.outerWidth(), 2259elemHeight=elem.outerHeight(), 2260marginLeft=parseCss(this, "marginLeft"), 2261marginTop=parseCss(this, "marginTop"), 2262collisionWidth=elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width, 2263collisionHeight=elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height, 2264position=$.extend({}, basePosition), 2265myOffset=getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight()); 2266if(options.my[0]==="right"){ 2267position.left -=elemWidth; 2268}else if(options.my[0]==="center"){ 2269position.left -=elemWidth / 2; 2270} 2271if(options.my[1]==="bottom"){ 2272position.top -=elemHeight; 2273}else if(options.my[1]==="center"){ 2274position.top -=elemHeight / 2; 2275} 2276position.left +=myOffset[0]; 2277position.top +=myOffset[1]; 2278if(!supportsOffsetFractions()){ 2279position.left=round(position.left); 2280position.top=round(position.top); 2281} 2282collisionPosition={ 2283marginLeft: marginLeft, 2284marginTop: marginTop 2285}; 2286$.each(["left", "top"], function (i, dir){ 2287if($.ui.position[collision[i]]){ 2288$.ui.position[collision[i]][dir](position, { 2289targetWidth: targetWidth, 2290targetHeight: targetHeight, 2291elemWidth: elemWidth, 2292elemHeight: elemHeight, 2293collisionPosition: collisionPosition, 2294collisionWidth: collisionWidth, 2295collisionHeight: collisionHeight, 2296offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]], 2297my: options.my, 2298at: options.at, 2299within: within, 2300elem: elem 2301}); 2302}}); 2303if(options.using){ 2304using=function (props){ 2305var left=targetOffset.left - position.left, 2306right=left + targetWidth - elemWidth, 2307top=targetOffset.top - position.top, 2308bottom=top + targetHeight - elemHeight, 2309feedback={ 2310target: { 2311element: target, 2312left: targetOffset.left, 2313top: targetOffset.top, 2314width: targetWidth, 2315height: targetHeight 2316}, 2317element: { 2318element: elem, 2319left: position.left, 2320top: position.top, 2321width: elemWidth, 2322height: elemHeight 2323}, 2324horizontal: right < 0 ? "left":left > 0 ? "right":"center", 2325vertical: bottom < 0 ? "top":top > 0 ? "bottom":"middle" 2326}; 2327if(targetWidth < elemWidth&&abs(left + right) < targetWidth){ 2328feedback.horizontal="center"; 2329} 2330if(targetHeight < elemHeight&&abs(top + bottom) < targetHeight){ 2331feedback.vertical="middle"; 2332} 2333if(max(abs(left), abs(right)) > max(abs(top), abs(bottom))){ 2334feedback.important="horizontal"; 2335}else{ 2336feedback.important="vertical"; 2337} 2338options.using.call(this, props, feedback); 2339};} 2340elem.offset($.extend(position, { using: using })); 2341}); 2342}; 2343$.ui.position={ 2344fit: { 2345left: function (position, data){ 2346var within=data.within, 2347withinOffset=within.isWindow ? within.scrollLeft:within.offset.left, 2348outerWidth=within.width, 2349collisionPosLeft=position.left - data.collisionPosition.marginLeft, 2350overLeft=withinOffset - collisionPosLeft, 2351overRight=collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 2352newOverRight; 2353if(data.collisionWidth > outerWidth){ 2354if(overLeft > 0&&overRight <=0){ 2355newOverRight=position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; 2356position.left +=overLeft - newOverRight; 2357}else if(overRight > 0&&overLeft <=0){ 2358position.left=withinOffset; 2359}else{ 2360if(overLeft > overRight){ 2361position.left=withinOffset + outerWidth - data.collisionWidth; 2362}else{ 2363position.left=withinOffset; 2364}} 2365}else if(overLeft > 0){ 2366position.left +=overLeft; 2367}else if(overRight > 0){ 2368position.left -=overRight; 2369}else{ 2370position.left=max(position.left - collisionPosLeft, position.left); 2371}}, 2372top: function (position, data){ 2373var within=data.within, 2374withinOffset=within.isWindow ? within.scrollTop:within.offset.top, 2375outerHeight=data.within.height, 2376collisionPosTop=position.top - data.collisionPosition.marginTop, 2377overTop=withinOffset - collisionPosTop, 2378overBottom=collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 2379newOverBottom; 2380if(data.collisionHeight > outerHeight){ 2381if(overTop > 0&&overBottom <=0){ 2382newOverBottom=position.top + overTop + data.collisionHeight - outerHeight - withinOffset; 2383position.top +=overTop - newOverBottom; 2384}else if(overBottom > 0&&overTop <=0){ 2385position.top=withinOffset; 2386}else{ 2387if(overTop > overBottom){ 2388position.top=withinOffset + outerHeight - data.collisionHeight; 2389}else{ 2390position.top=withinOffset; 2391}} 2392}else if(overTop > 0){ 2393position.top +=overTop; 2394}else if(overBottom > 0){ 2395position.top -=overBottom; 2396}else{ 2397position.top=max(position.top - collisionPosTop, position.top); 2398}} 2399}, 2400flip: { 2401left: function (position, data){ 2402var within=data.within, 2403withinOffset=within.offset.left + within.scrollLeft, 2404outerWidth=within.width, 2405offsetLeft=within.isWindow ? within.scrollLeft:within.offset.left, 2406collisionPosLeft=position.left - data.collisionPosition.marginLeft, 2407overLeft=collisionPosLeft - offsetLeft, 2408overRight=collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 2409myOffset=data.my[0]==="left" ? 2410-data.elemWidth : 2411data.my[0]==="right" ? 2412data.elemWidth : 24130,
2414atOffset=data.at[0]==="left" ? 2415data.targetWidth : 2416data.at[0]==="right" ? 2417-data.targetWidth : 24180, 2419offset=-2 * data.offset[0], 2420newOverRight, 2421newOverLeft; 2422if(overLeft < 0){ 2423newOverRight=position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; 2424if(newOverRight < 0||newOverRight < abs(overLeft)){ 2425position.left +=myOffset + atOffset + offset; 2426}}else if(overRight > 0){ 2427newOverLeft=position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; 2428if(newOverLeft > 0||abs(newOverLeft) < overRight){ 2429position.left +=myOffset + atOffset + offset; 2430}} 2431}, 2432top: function (position, data){ 2433var within=data.within, 2434withinOffset=within.offset.top + within.scrollTop, 2435outerHeight=within.height, 2436offsetTop=within.isWindow ? within.scrollTop:within.offset.top, 2437collisionPosTop=position.top - data.collisionPosition.marginTop, 2438overTop=collisionPosTop - offsetTop, 2439overBottom=collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 2440top=data.my[1]==="top", 2441myOffset=top ? 2442-data.elemHeight : 2443data.my[1]==="bottom" ? 2444data.elemHeight : 24450, 2446atOffset=data.at[1]==="top" ? 2447data.targetHeight : 2448data.at[1]==="bottom" ? 2449-data.targetHeight : 24500, 2451offset=-2 * data.offset[1], 2452newOverTop, 2453newOverBottom; 2454if(overTop < 0){ 2455newOverBottom=position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; 2456if(newOverBottom < 0||newOverBottom < abs(overTop)){ 2457position.top +=myOffset + atOffset + offset; 2458}}else if(overBottom > 0){ 2459newOverTop=position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; 2460if(newOverTop > 0||abs(newOverTop) < overBottom){ 2461position.top +=myOffset + atOffset + offset; 2462}} 2463}}, 2464flipfit: { 2465left: function (){ 2466$.ui.position.flip.left.apply(this, arguments); 2467$.ui.position.fit.left.apply(this, arguments); 2468}, 2469top: function (){ 2470$.ui.position.flip.top.apply(this, arguments); 2471$.ui.position.fit.top.apply(this, arguments); 2472}} 2473};})(); 2474return $.ui.position; 2475})); 2476(function (factory){ 2477if(typeof define==="function"&&define.amd){ 2478define('ui/safe-active-element', ["jquery", "./version"], factory); 2479}else{ 2480factory(jQuery); 2481}}(function ($){ 2482return $.ui.safeActiveElement=function (document){ 2483var activeElement; 2484try { 2485activeElement=document.activeElement; 2486} catch (error){ 2487activeElement=document.body; 2488} 2489if(!activeElement){ 2490activeElement=document.body; 2491} 2492if(!activeElement.nodeName){ 2493activeElement=document.body; 2494} 2495return activeElement; 2496};})); 2497(function (factory){ 2498if(typeof define==="function"&&define.amd){ 2499define('ui/safe-blur', ["jquery", "./version"], factory); 2500}else{ 2501factory(jQuery); 2502}}(function ($){ 2503return $.ui.safeBlur=function (element){ 2504if(element&&element.nodeName.toLowerCase()!=="body"){ 2505$(element).trigger("blur"); 2506}};})); 2507(function (factory){ 2508if(typeof define==="function"&&define.amd){ 2509define('ui/scroll-parent', ["jquery", "./version"], factory); 2510}else{ 2511factory(jQuery); 2512}}(function ($){ 2513return $.fn.scrollParent=function (includeHidden){ 2514var position=this.css("position"), 2515excludeStaticParent=position==="absolute", 2516overflowRegex=includeHidden ? /(auto|scroll|hidden)/:/(auto|scroll)/, 2517scrollParent=this.parents().filter(function (){ 2518var parent=$(this); 2519if(excludeStaticParent&&parent.css("position")==="static"){ 2520return false; 2521} 2522return overflowRegex.test(parent.css("overflow") + parent.css("overflow-y") + parent.css("overflow-x")); 2523}).eq(0); 2524return position==="fixed"||!scrollParent.length ? $(this[0].ownerDocument||document):scrollParent; 2525};})); 2526(function (factory){ 2527if(typeof define==="function"&&define.amd){ 2528define('ui/tabbable', ["jquery", "./version", "./focusable"], factory); 2529}else{ 2530factory(jQuery); 2531}}(function ($){ 2532return $.extend($.expr[":"], { 2533tabbable: function (element){ 2534var tabIndex=$.attr(element, "tabindex"), 2535hasTabindex=tabIndex!=null; 2536return (!hasTabindex||tabIndex >=0)&&$.ui.focusable(element, hasTabindex); 2537}}); 2538})); 2539(function (factory){ 2540if(typeof define==="function"&&define.amd){ 2541define('ui/unique-id', ["jquery", "./version"], factory); 2542}else{ 2543factory(jQuery); 2544}}(function ($){ 2545return $.fn.extend({ 2546uniqueId: (function (){ 2547var uuid=0; 2548return function (){ 2549return this.each(function (){ 2550if(!this.id){ 2551this.id="ui-id-" + (++uuid); 2552}}); 2553};})(), 2554removeUniqueId: function (){ 2555return this.each(function (){
vendor: 4,113 bytes, lines 2556-2703
2556if(/^ui-id-\d+$/.test(this.id)){ 2557$(this).removeAttr("id"); 2558}}); 2559}}); 2560})); 2561(function (factory){ 2562if(typeof define==="function"&&define.amd){ 2563define('ui/widget', ["jquery", "./version"], factory); 2564}else{ 2565factory(jQuery); 2566}}(function ($){ 2567var widgetUuid=0; 2568var widgetSlice=Array.prototype.slice; 2569$.cleanData=(function (orig){ 2570return function (elems){ 2571var events, elem, i; 2572for (i=0; (elem=elems[i])!=null; i++){ 2573try { 2574events=$._data(elem, "events"); 2575if(events&&events.remove){ 2576$(elem).triggerHandler("remove"); 2577}} catch (e){ }} 2578orig(elems); 2579};})($.cleanData); 2580$.widget=function (name, base, prototype){ 2581var existingConstructor, constructor, basePrototype; 2582var proxiedPrototype={}; 2583var namespace=name.split(".")[0]; 2584name=name.split(".")[1]; 2585var fullName=namespace + "-" + name; 2586if(!prototype){ 2587prototype=base; 2588base=$.Widget; 2589} 2590if($.isArray(prototype)){ 2591prototype=$.extend.apply(null, [{}].concat(prototype)); 2592} 2593$.expr[":"][fullName.toLowerCase()]=function (elem){ 2594return !!$.data(elem, fullName); 2595}; 2596$[namespace]=$[namespace]||{}; 2597existingConstructor=$[namespace][name]; 2598constructor=$[namespace][name]=function (options, element){ 2599if(!this._createWidget){ 2600return new constructor(options, element); 2601} 2602if(arguments.length){ 2603this._createWidget(options, element); 2604}}; 2605$.extend(constructor, existingConstructor, { 2606version: prototype.version, 2607_proto: $.extend({}, prototype), 2608_childConstructors: [] 2609}); 2610basePrototype=new base(); 2611basePrototype.options=$.widget.extend({}, basePrototype.options); 2612$.each(prototype, function (prop, value){ 2613if(!$.isFunction(value)){ 2614proxiedPrototype[prop]=value; 2615return; 2616} 2617proxiedPrototype[prop]=(function (){ 2618function _super(){ 2619return base.prototype[prop].apply(this, arguments); 2620} 2621function _superApply(args){ 2622return base.prototype[prop].apply(this, args); 2623} 2624return function (){ 2625var __super=this._super; 2626var __superApply=this._superApply; 2627var returnValue; 2628this._super=_super; 2629this._superApply=_superApply; 2630returnValue=value.apply(this, arguments); 2631this._super=__super; 2632this._superApply=__superApply; 2633return returnValue; 2634};})(); 2635}); 2636constructor.prototype=$.widget.extend(basePrototype, { 2637widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix||name):name 2638}, proxiedPrototype, { 2639constructor: constructor, 2640namespace: namespace, 2641widgetName: name, 2642widgetFullName: fullName 2643}); 2644if(existingConstructor){ 2645$.each(existingConstructor._childConstructors, function (i, child){ 2646var childPrototype=child.prototype; 2647$.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, 2648child._proto); 2649}); 2650delete existingConstructor._childConstructors; 2651}else{ 2652base._childConstructors.push(constructor); 2653} 2654$.widget.bridge(name, constructor); 2655return constructor; 2656}; 2657$.widget.extend=function (target){ 2658var input=widgetSlice.call(arguments, 1); 2659var inputIndex=0; 2660var inputLength=input.length; 2661var key; 2662var value; 2663for (; inputIndex < inputLength; inputIndex++){ 2664for (key in input[inputIndex]){ 2665value=input[inputIndex][key]; 2666if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){ 2667if($.isPlainObject(value)){ 2668target[key]=$.isPlainObject(target[key]) ? 2669$.widget.extend({}, target[key], value) : 2670$.widget.extend({}, value); 2671}else{ 2672target[key]=value; 2673}} 2674}} 2675return target; 2676}; 2677$.widget.bridge=function (name, object){ 2678var fullName=object.prototype.widgetFullName||name; 2679$.fn[name]=function (options){ 2680var isMethodCall=typeof options==="string"; 2681var args=widgetSlice.call(arguments, 1); 2682var returnValue=this; 2683if(isMethodCall){ 2684this.each(function (){ 2685var methodValue; 2686var instance=$.data(this, fullName); 2687if(options==="instance"){ 2688returnValue=instance; 2689return false; 2690} 2691if(!instance){ 2692return $.error("cannot call methods on " + name + " prior to initialization; " + 2693"attempted to call method '" + options + "'"); 2694} 2695if(!$.isFunction(instance[options])||options.charAt(0)==="_"){ 2696return $.error("no such method '" + options + "' for " + name + " widget instance"); 2697} 2698methodValue=instance[options].apply(instance, args); 2699if(methodValue!==instance&&methodValue!==undefined){ 2700returnValue=methodValue&&methodValue.jquery ? 2701returnValue.pushStack(methodValue.get()) : 2702methodValue; 2703return false;
vendor: 6,966 bytes, lines 2704-2978
2704}}); 2705}else{ 2706if(args.length){ 2707options=$.widget.extend.apply(null, [options].concat(args)); 2708} 2709this.each(function (){ 2710var instance=$.data(this, fullName); 2711if(instance){ 2712instance.option(options||{}); 2713if(instance._init){ 2714instance._init(); 2715}}else{ 2716$.data(this, fullName, new object(options, this)); 2717}}); 2718} 2719return returnValue; 2720};}; 2721$.Widget=function(){ }; 2722$.Widget._childConstructors=[]; 2723$.Widget.prototype={ 2724widgetName: "widget", 2725widgetEventPrefix: "", 2726defaultElement: "<div>", 2727options: { 2728classes: {}, 2729disabled: false, 2730create: null 2731}, 2732_createWidget: function (options, element){ 2733element=$(element||this.defaultElement||this)[0]; 2734this.element=$(element); 2735this.uuid=widgetUuid++; 2736this.eventNamespace="." + this.widgetName + this.uuid; 2737this.bindings=$(); 2738this.hoverable=$(); 2739this.focusable=$(); 2740this.classesElementLookup={}; 2741if(element!==this){ 2742$.data(element, this.widgetFullName, this); 2743this._on(true, this.element, { 2744remove: function (event){ 2745if(event.target===element){ 2746this.destroy(); 2747}} 2748}); 2749this.document=$(element.style ? 2750element.ownerDocument : 2751element.document||element); 2752this.window=$(this.document[0].defaultView||this.document[0].parentWindow); 2753} 2754this.options=$.widget.extend({}, 2755this.options, 2756this._getCreateOptions(), 2757options); 2758this._create(); 2759if(this.options.disabled){ 2760this._setOptionDisabled(this.options.disabled); 2761} 2762this._trigger("create", null, this._getCreateEventData()); 2763this._init(); 2764}, 2765_getCreateOptions: function (){ 2766return {};}, 2767_getCreateEventData: $.noop, 2768_create: $.noop, 2769_init: $.noop, 2770destroy: function (){ 2771var that=this; 2772this._destroy(); 2773$.each(this.classesElementLookup, function (key, value){ 2774that._removeClass(value, key); 2775}); 2776this.element 2777.off(this.eventNamespace) 2778.removeData(this.widgetFullName); 2779this.widget() 2780.off(this.eventNamespace) 2781.removeAttr("aria-disabled"); 2782this.bindings.off(this.eventNamespace); 2783}, 2784_destroy: $.noop, 2785widget: function (){ 2786return this.element; 2787}, 2788option: function (key, value){ 2789var options=key; 2790var parts; 2791var curOption; 2792var i; 2793if(arguments.length===0){ 2794return $.widget.extend({}, this.options); 2795} 2796if(typeof key==="string"){ 2797options={}; 2798parts=key.split("."); 2799key=parts.shift(); 2800if(parts.length){ 2801curOption=options[key]=$.widget.extend({}, this.options[key]); 2802for (i=0; i < parts.length - 1; i++){ 2803curOption[parts[i]]=curOption[parts[i]]||{}; 2804curOption=curOption[parts[i]]; 2805} 2806key=parts.pop(); 2807if(arguments.length===1){ 2808return curOption[key]===undefined ? null:curOption[key]; 2809} 2810curOption[key]=value; 2811}else{ 2812if(arguments.length===1){ 2813return this.options[key]===undefined ? null:this.options[key]; 2814} 2815options[key]=value; 2816}} 2817this._setOptions(options); 2818return this; 2819}, 2820_setOptions: function (options){ 2821var key; 2822for (key in options){ 2823this._setOption(key, options[key]); 2824} 2825return this; 2826}, 2827_setOption: function (key, value){ 2828if(key==="classes"){ 2829this._setOptionClasses(value); 2830} 2831this.options[key]=value; 2832if(key==="disabled"){ 2833this._setOptionDisabled(value); 2834} 2835return this; 2836}, 2837_setOptionClasses: function (value){ 2838var classKey, elements, currentElements; 2839for (classKey in value){ 2840currentElements=this.classesElementLookup[classKey]; 2841if(value[classKey]===this.options.classes[classKey] || 2842!currentElements || 2843!currentElements.length){ 2844continue; 2845} 2846elements=$(currentElements.get()); 2847this._removeClass(currentElements, classKey); 2848elements.addClass(this._classes({ 2849element: elements, 2850keys: classKey, 2851classes: value, 2852add: true 2853})); 2854}}, 2855_setOptionDisabled: function (value){ 2856this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, !!value); 2857if(value){ 2858this._removeClass(this.hoverable, null, "ui-state-hover"); 2859this._removeClass(this.focusable, null, "ui-state-focus"); 2860}}, 2861enable: function (){ 2862return this._setOptions({ disabled: false }); 2863}, 2864disable: function (){ 2865return this._setOptions({ disabled: true }); 2866}, 2867_classes: function (options){ 2868var full=[]; 2869var that=this; 2870options=$.extend({ 2871element: this.element, 2872classes: this.options.classes||{}}, options); 2873function processClassString(classes, checkOption){ 2874var current, i; 2875for (i=0; i < classes.length; i++){ 2876current=that.classesElementLookup[classes[i]]||$(); 2877if(options.add){ 2878current=$($.unique(current.get().concat(options.element.get()))); 2879}else{ 2880current=$(current.not(options.element).get()); 2881} 2882that.classesElementLookup[classes[i]]=current; 2883full.push(classes[i]); 2884if(checkOption&&options.classes[classes[i]]){ 2885full.push(options.classes[classes[i]]); 2886}} 2887} 2888if(options.keys){ 2889processClassString(options.keys.match(/\S+/g)||[], true); 2890} 2891if(options.extra){ 2892processClassString(options.extra.match(/\S+/g)||[]); 2893} 2894return full.join(" "); 2895}, 2896_removeClass: function (element, keys, extra){ 2897return this._toggleClass(element, keys, extra, false); 2898}, 2899_addClass: function (element, keys, extra){ 2900return this._toggleClass(element, keys, extra, true); 2901}, 2902_toggleClass: function (element, keys, extra, add){ 2903add=(typeof add==="boolean") ? add:extra; 2904var shift=(typeof element==="string"||element===null), 2905options={ 2906extra: shift ? keys:extra, 2907keys: shift ? element:keys, 2908element: shift ? this.element:element, 2909add: add 2910}; 2911options.element.toggleClass(this._classes(options), add); 2912return this; 2913}, 2914_on: function (suppressDisabledCheck, element, handlers){ 2915var delegateElement; 2916var instance=this; 2917if(typeof suppressDisabledCheck!=="boolean"){ 2918handlers=element; 2919element=suppressDisabledCheck; 2920suppressDisabledCheck=false; 2921} 2922if(!handlers){ 2923handlers=element; 2924element=this.element; 2925delegateElement=this.widget(); 2926}else{ 2927element=delegateElement=$(element); 2928this.bindings=this.bindings.add(element); 2929} 2930$.each(handlers, function (event, handler){ 2931function handlerProxy(){ 2932if(!suppressDisabledCheck && 2933(instance.options.disabled===true || 2934$(this).hasClass("ui-state-disabled"))){ 2935return; 2936} 2937return (typeof handler==="string" ? instance[handler]:handler) 2938.apply(instance, arguments); 2939} 2940if(typeof handler!=="string"){ 2941handlerProxy.guid=handler.guid = 2942handler.guid||handlerProxy.guid||$.guid++; 2943} 2944var match=event.match(/^([\w:-]*)\s*(.*)$/); 2945var eventName=match[1] + instance.eventNamespace; 2946var selector=match[2]; 2947if(selector){ 2948delegateElement.on(eventName, selector, handlerProxy); 2949}else{ 2950element.on(eventName, handlerProxy); 2951}}); 2952}, 2953_off: function (element, eventName){ 2954eventName=(eventName||"").split(" ").join(this.eventNamespace + " ") + 2955this.eventNamespace; 2956element.off(eventName).off(eventName); 2957this.bindings=$(this.bindings.not(element).get()); 2958this.focusable=$(this.focusable.not(element).get()); 2959this.hoverable=$(this.hoverable.not(element).get()); 2960}, 2961_delay: function (handler, delay){ 2962function handlerProxy(){ 2963return (typeof handler==="string" ? instance[handler]:handler) 2964.apply(instance, arguments); 2965} 2966var instance=this; 2967return setTimeout(handlerProxy, delay||0); 2968}, 2969_hoverable: function (element){ 2970this.hoverable=this.hoverable.add(element); 2971this._on(element, { 2972mouseenter: function (event){ 2973this._addClass($(event.currentTarget), null, "ui-state-hover"); 2974}, 2975mouseleave: function (event){ 2976this._removeClass($(event.currentTarget), null, "ui-state-hover"); 2977}}); 2978},
vendor: 11,470 bytes, lines 2979-3424
2979_focusable: function (element){ 2980this.focusable=this.focusable.add(element); 2981this._on(element, { 2982focusin: function (event){ 2983this._addClass($(event.currentTarget), null, "ui-state-focus"); 2984}, 2985focusout: function (event){ 2986this._removeClass($(event.currentTarget), null, "ui-state-focus"); 2987}}); 2988}, 2989_trigger: function (type, event, data){ 2990var prop, orig; 2991var callback=this.options[type]; 2992data=data||{}; 2993event=$.Event(event); 2994event.type=(type===this.widgetEventPrefix ? 2995type : 2996this.widgetEventPrefix + type).toLowerCase(); 2997event.target=this.element[0]; 2998orig=event.originalEvent; 2999if(orig){ 3000for (prop in orig){ 3001if(!(prop in event)){ 3002event[prop]=orig[prop]; 3003}} 3004} 3005this.element.trigger(event, data); 3006return !($.isFunction(callback) && 3007callback.apply(this.element[0], [event].concat(data))===false || 3008event.isDefaultPrevented()); 3009}}; 3010$.each({ show: "fadeIn", hide: "fadeOut" }, function (method, defaultEffect){ 3011$.Widget.prototype["_" + method]=function (element, options, callback){ 3012if(typeof options==="string"){ 3013options={ effect: options };} 3014var hasOptions; 3015var effectName = !options ? 3016method : 3017options===true||typeof options==="number" ? 3018defaultEffect : 3019options.effect||defaultEffect; 3020options=options||{}; 3021if(typeof options==="number"){ 3022options={ duration: options };} 3023hasOptions = !$.isEmptyObject(options); 3024options.complete=callback; 3025if(options.delay){ 3026element.delay(options.delay); 3027} 3028if(hasOptions&&$.effects&&$.effects.effect[effectName]){ 3029element[method](options); 3030}else if(effectName!==method&&element[effectName]){ 3031element[effectName](options.duration, options.easing, callback); 3032}else{ 3033element.queue(function (next){ 3034$(this)[method](); 3035if(callback){ 3036callback.call(element[0]); 3037} 3038next(); 3039}); 3040}};}); 3041return $.widget; 3042})); 3043(function (factory){ 3044if(typeof define==="function"&&define.amd){ 3045define('ui/widgets/accordion.js', [ 3046"jquery", 3047"../version", 3048"../keycode", 3049"../unique-id", 3050"../widget" 3051], factory); 3052}else{ 3053factory(jQuery); 3054}}(function ($){ 3055return $.widget("ui.accordion", { 3056version: "@VERSION", 3057options: { 3058active: 0, 3059animate: {}, 3060classes: { 3061"ui-accordion-header": "ui-corner-top", 3062"ui-accordion-header-collapsed": "ui-corner-all", 3063"ui-accordion-content": "ui-corner-bottom" 3064}, 3065collapsible: false, 3066event: "click", 3067header: "> li > :first-child, > :not(li):even", 3068heightStyle: "auto", 3069icons: { 3070activeHeader: "ui-icon-triangle-1-s", 3071header: "ui-icon-triangle-1-e" 3072}, 3073activate: null, 3074beforeActivate: null 3075}, 3076hideProps: { 3077borderTopWidth: "hide", 3078borderBottomWidth: "hide", 3079paddingTop: "hide", 3080paddingBottom: "hide", 3081height: "hide" 3082}, 3083showProps: { 3084borderTopWidth: "show", 3085borderBottomWidth: "show", 3086paddingTop: "show", 3087paddingBottom: "show", 3088height: "show" 3089}, 3090_create: function (){ 3091var options=this.options; 3092this.prevShow=this.prevHide=$(); 3093this._addClass("ui-accordion", "ui-widget ui-helper-reset"); 3094this.element.attr("role", "tablist"); 3095if(!options.collapsible&&(options.active===false||options.active==null)){ 3096options.active=0; 3097} 3098this._processPanels(); 3099if(options.active < 0){ 3100options.active +=this.headers.length; 3101} 3102this._refresh(); 3103}, 3104_getCreateEventData: function (){ 3105return { 3106header: this.active, 3107panel: !this.active.length ? $():this.active.next() 3108};}, 3109_createIcons: function (){ 3110var icon, children, 3111icons=this.options.icons; 3112if(icons){ 3113icon=$("<span>"); 3114this._addClass(icon, "ui-accordion-header-icon", "ui-icon " + icons.header); 3115icon.prependTo(this.headers); 3116children=this.active.children(".ui-accordion-header-icon"); 3117this._removeClass(children, icons.header) 3118._addClass(children, null, icons.activeHeader) 3119._addClass(this.headers, "ui-accordion-icons"); 3120}}, 3121_destroyIcons: function (){ 3122this._removeClass(this.headers, "ui-accordion-icons"); 3123this.headers.children(".ui-accordion-header-icon").remove(); 3124}, 3125_destroy: function (){ 3126var contents; 3127this.element.removeAttr("role"); 3128this.headers 3129.removeAttr("role aria-expanded aria-selected aria-controls tabIndex") 3130.removeUniqueId(); 3131this._destroyIcons(); 3132contents=this.headers.next() 3133.css("display", "") 3134.removeAttr("role aria-hidden aria-labelledby") 3135.removeUniqueId(); 3136if(this.options.heightStyle!=="content"){ 3137contents.css("height", ""); 3138}}, 3139_setOption: function (key, value){ 3140if(key==="active"){ 3141this._activate(value); 3142return; 3143} 3144if(key==="event"){ 3145if(this.options.event){ 3146this._off(this.headers, this.options.event); 3147} 3148this._setupEvents(value); 3149} 3150this._super(key, value); 3151if(key==="collapsible"&&!value&&this.options.active===false){ 3152this._activate(0); 3153} 3154if(key==="icons"){ 3155this._destroyIcons(); 3156if(value){ 3157this._createIcons(); 3158}} 3159}, 3160_setOptionDisabled: function (value){ 3161this._super(value); 3162this.element.attr("aria-disabled", value); 3163this._toggleClass(null, "ui-state-disabled", !!value); 3164this._toggleClass(this.headers.add(this.headers.next()), null, "ui-state-disabled", 3165!!value); 3166}, 3167_keydown: function (event){ 3168if(event.altKey||event.ctrlKey){ 3169return; 3170} 3171var keyCode=$.ui.keyCode, 3172length=this.headers.length, 3173currentIndex=this.headers.index(event.target), 3174toFocus=false; 3175switch (event.keyCode){ 3176case keyCode.RIGHT: 3177case keyCode.DOWN: 3178toFocus=this.headers[(currentIndex + 1) % length]; 3179break; 3180case keyCode.LEFT: 3181case keyCode.UP: 3182toFocus=this.headers[(currentIndex - 1 + length) % length]; 3183break; 3184case keyCode.SPACE: 3185case keyCode.ENTER: 3186this._eventHandler(event); 3187break; 3188case keyCode.HOME: 3189toFocus=this.headers[0]; 3190break; 3191case keyCode.END: 3192toFocus=this.headers[length - 1]; 3193break; 3194} 3195if(toFocus){ 3196$(event.target).attr("tabIndex", -1); 3197$(toFocus).attr("tabIndex", 0); 3198$(toFocus).trigger("focus"); 3199event.preventDefault(); 3200}}, 3201_panelKeyDown: function (event){ 3202if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){ 3203$(event.currentTarget).prev().trigger("focus"); 3204}}, 3205refresh: function (){ 3206var options=this.options; 3207this._processPanels(); 3208if((options.active===false&&options.collapsible===true)||!this.headers.length){ 3209options.active=false; 3210this.active=$(); 3211}else if(options.active===false){ 3212this._activate(0); 3213}else if(this.active.length&&!$.contains(this.element[0], this.active[0])){ 3214if(this.headers.length===this.headers.find(".ui-state-disabled").length){ 3215options.active=false; 3216this.active=$(); 3217}else{ 3218this._activate(Math.max(0, options.active - 1)); 3219}}else{ 3220options.active=this.headers.index(this.active); 3221} 3222this._destroyIcons(); 3223this._refresh(); 3224}, 3225_processPanels: function (){ 3226var prevHeaders=this.headers, 3227prevPanels=this.panels; 3228this.headers=this.element.find(this.options.header); 3229this._addClass(this.headers, "ui-accordion-header ui-accordion-header-collapsed", 3230"ui-state-default"); 3231this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(); 3232this._addClass(this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content"); 3233if(prevPanels){ 3234this._off(prevHeaders.not(this.headers)); 3235this._off(prevPanels.not(this.panels)); 3236}}, 3237_refresh: function (){ 3238var maxHeight, 3239options=this.options, 3240heightStyle=options.heightStyle, 3241parent=this.element.parent(); 3242this.active=this._findActive(options.active); 3243this._addClass(this.active, "ui-accordion-header-active", "ui-state-active") 3244._removeClass(this.active, "ui-accordion-header-collapsed"); 3245this._addClass(this.active.next(), "ui-accordion-content-active"); 3246this.active.next().show(); 3247this.headers 3248.attr("role", "tab") 3249.each(function (){ 3250var header=$(this), 3251headerId=header.uniqueId().attr("id"), 3252panel=header.next(), 3253panelId=panel.uniqueId().attr("id"); 3254header.attr("aria-controls", panelId); 3255panel.attr("aria-labelledby", headerId); 3256}) 3257.next() 3258.attr("role", "tabpanel"); 3259this.headers 3260.not(this.active) 3261.attr({ 3262"aria-selected": "false", 3263"aria-expanded": "false", 3264tabIndex: -1 3265}) 3266.next() 3267.attr({ 3268"aria-hidden": "true" 3269}) 3270.hide(); 3271if(!this.active.length){ 3272this.headers.eq(0).attr("tabIndex", 0); 3273}else{ 3274this.active.attr({ 3275"aria-selected": "true", 3276"aria-expanded": "true", 3277tabIndex: 0 3278}) 3279.next() 3280.attr({ 3281"aria-hidden": "false" 3282}); 3283} 3284this._createIcons(); 3285this._setupEvents(options.event); 3286if(heightStyle==="fill"){ 3287maxHeight=parent.height(); 3288this.element.siblings(":visible").each(function (){ 3289var elem=$(this), 3290position=elem.css("position"); 3291if(position==="absolute"||position==="fixed"){ 3292return; 3293} 3294maxHeight -=elem.outerHeight(true); 3295}); 3296this.headers.each(function (){ 3297maxHeight -=$(this).outerHeight(true); 3298}); 3299this.headers.next() 3300.each(function (){ 3301$(this).height(Math.max(0, maxHeight - 3302$(this).innerHeight() + $(this).height())); 3303}) 3304.css("overflow", "auto"); 3305}else if(heightStyle==="auto"){ 3306maxHeight=0; 3307this.headers.next() 3308.each(function (){ 3309maxHeight=Math.max(maxHeight, $(this).css("height", "").height()); 3310}) 3311.height(maxHeight); 3312}}, 3313_activate: function (index){ 3314var active=this._findActive(index)[0]; 3315if(active===this.active[0]){ 3316return; 3317} 3318active=active||this.active[0]; 3319this._eventHandler({ 3320target: active, 3321currentTarget: active, 3322preventDefault: $.noop 3323}); 3324}, 3325_findActive: function (selector){ 3326return typeof selector==="number" ? this.headers.eq(selector):$(); 3327}, 3328_setupEvents: function (event){ 3329var events={ 3330keydown: "_keydown" 3331}; 3332if(event){ 3333$.each(event.split(" "), function (index, eventName){ 3334events[eventName]="_eventHandler"; 3335}); 3336} 3337this._off(this.headers.add(this.headers.next())); 3338this._on(this.headers, events); 3339this._on(this.headers.next(), { keydown: "_panelKeyDown" }); 3340this._hoverable(this.headers); 3341this._focusable(this.headers); 3342}, 3343_eventHandler: function (event){ 3344var activeChildren, clickedChildren, 3345options=this.options, 3346active=this.active, 3347clicked=$(event.currentTarget), 3348clickedIsActive=clicked[0]===active[0], 3349collapsing=clickedIsActive&&options.collapsible, 3350toShow=collapsing ? $():clicked.next(), 3351toHide=active.next(), 3352eventData={ 3353oldHeader: active, 3354oldPanel: toHide, 3355newHeader: collapsing ? $():clicked, 3356newPanel: toShow 3357}; 3358event.preventDefault(); 3359if((clickedIsActive&&!options.collapsible) || 3360(this._trigger("beforeActivate", event, eventData)===false)){ 3361return; 3362} 3363options.active=collapsing ? false:this.headers.index(clicked); 3364this.active=clickedIsActive ? $():clicked; 3365this._toggle(eventData); 3366this._removeClass(active, "ui-accordion-header-active", "ui-state-active"); 3367if(options.icons){ 3368activeChildren=active.children(".ui-accordion-header-icon"); 3369this._removeClass(activeChildren, null, options.icons.activeHeader) 3370._addClass(activeChildren, null, options.icons.header); 3371} 3372if(!clickedIsActive){ 3373this._removeClass(clicked, "ui-accordion-header-collapsed") 3374._addClass(clicked, "ui-accordion-header-active", "ui-state-active"); 3375if(options.icons){ 3376clickedChildren=clicked.children(".ui-accordion-header-icon"); 3377this._removeClass(clickedChildren, null, options.icons.header) 3378._addClass(clickedChildren, null, options.icons.activeHeader); 3379} 3380this._addClass(clicked.next(), "ui-accordion-content-active"); 3381}}, 3382_toggle: function (data){ 3383var toShow=data.newPanel, 3384toHide=this.prevShow.length ? this.prevShow:data.oldPanel; 3385this.prevShow.add(this.prevHide).stop(true, true); 3386this.prevShow=toShow; 3387this.prevHide=toHide; 3388if(this.options.animate){ 3389this._animate(toShow, toHide, data); 3390}else{ 3391toHide.hide(); 3392toShow.show(); 3393this._toggleComplete(data); 3394} 3395toHide.attr({ 3396"aria-hidden": "true" 3397}); 3398toHide.prev().attr({ 3399"aria-selected": "false", 3400"aria-expanded": "false" 3401}); 3402if(toShow.length&&toHide.length){ 3403toHide.prev().attr({ 3404"tabIndex": -1, 3405"aria-expanded": "false" 3406}); 3407}else if(toShow.length){ 3408this.headers.filter(function (){ 3409return parseInt($(this).attr("tabIndex"), 10)===0; 3410}) 3411.attr("tabIndex", -1); 3412} 3413toShow 3414.attr("aria-hidden", "false") 3415.prev() 3416.attr({ 3417"aria-selected": "true", 3418"aria-expanded": "true", 3419tabIndex: 0 3420}); 3421}, 3422_animate: function (toShow, toHide, data){ 3423var total, easing, duration, 3424that=this,
3425adjust=0, 3426boxSizing=toShow.css("box-sizing"), 3427down=toShow.length && 3428(!toHide.length||(toShow.index() < toHide.index())), 3429animate=this.options.animate||{}, 3430options=down&&animate.down||animate, 3431complete=function (){ 3432that._toggleComplete(data); 3433}; 3434if(typeof options==="number"){ 3435duration=options; 3436} 3437if(typeof options==="string"){ 3438easing=options; 3439} 3440easing=easing||options.easing||animate.easing; 3441duration=duration||options.duration||animate.duration; 3442if(!toHide.length){ 3443return toShow.animate(this.showProps, duration, easing, complete); 3444} 3445if(!toShow.length){ 3446return toHide.animate(this.hideProps, duration, easing, complete); 3447} 3448total=toShow.show().outerHeight(); 3449toHide.animate(this.hideProps, { 3450duration: duration, 3451easing: easing, 3452step: function (now, fx){ 3453fx.now=Math.round(now); 3454}}); 3455toShow 3456.hide() 3457.animate(this.showProps, { 3458duration: duration, 3459easing: easing, 3460complete: complete, 3461step: function (now, fx){ 3462fx.now=Math.round(now); 3463if(fx.prop!=="height"){ 3464if(boxSizing==="content-box"){ 3465adjust +=fx.now; 3466}}else if(that.options.heightStyle!=="content"){ 3467fx.now=Math.round(total - toHide.outerHeight() - adjust); 3468adjust=0; 3469}} 3470}); 3471}, 3472_toggleComplete: function (data){ 3473var toHide=data.oldPanel, 3474prev=toHide.prev(); 3475this._removeClass(toHide, "ui-accordion-content-active"); 3476this._removeClass(prev, "ui-accordion-header-active") 3477._addClass(prev, "ui-accordion-header-collapsed"); 3478if(toHide.length){ 3479toHide.parent()[0].className=toHide.parent()[0].className; 3480} 3481this._trigger("activate", null, data); 3482}}); 3483})); 3484(function (factory){ 3485if(typeof define==="function"&&define.amd){ 3486define('ui/widgets/menu.js', [ 3487"jquery", 3488"../keycode", 3489"../position", 3490"../safe-active-element", 3491"../unique-id", 3492"../version", 3493"../widget" 3494], factory); 3495}else{ 3496factory(jQuery); 3497}}(function ($){ 3498return $.widget("ui.menu", { 3499version: "@VERSION", 3500defaultElement: "<ul>", 3501delay: 300, 3502options: { 3503icons: { 3504submenu: "ui-icon-caret-1-e" 3505}, 3506items: "> *", 3507menus: "ul", 3508position: { 3509my: "left top", 3510at: "right top" 3511}, 3512role: "menu", 3513blur: null, 3514focus: null, 3515select: null 3516}, 3517_create: function (){ 3518this.activeMenu=this.element; 3519this.mouseHandled=false; 3520this.element 3521.uniqueId() 3522.attr({ 3523role: this.options.role, 3524tabIndex: 0 3525}); 3526this._addClass("ui-menu", "ui-widget ui-widget-content"); 3527this._on({ 3528"mousedown .ui-menu-item": function (event){ 3529event.preventDefault(); 3530}, 3531"click .ui-menu-item": function (event){ 3532var target=$(event.target); 3533if(!this.mouseHandled&&target.not(".ui-state-disabled").length){ 3534this.select(event); 3535if(!event.isPropagationStopped()){ 3536this.mouseHandled=true; 3537} 3538if(target.has(".ui-menu").length){ 3539this.expand (event); 3540}else if(!this.element.is(":focus")&&$($.ui.safeActiveElement(this.document[0])).closest(".ui-menu").length){ 3541this.element.trigger("focus", [true]); 3542if(this.active&&this.active.parents(".ui-menu").length===1){ 3543clearTimeout(this.timer); 3544}} 3545}}, 3546"mouseenter .ui-menu-item": function (event){ 3547if(this.previousFilter){ 3548return; 3549} 3550var actualTarget=$(event.target).closest(".ui-menu-item"), 3551target=$(event.currentTarget); 3552if(actualTarget[0]!==target[0]){ 3553return; 3554} 3555this._removeClass(target.siblings().children(".ui-state-active"), 3556null, "ui-state-active"); 3557this.focus(event, target); 3558}, 3559mouseleave: "collapseAll", 3560"mouseleave .ui-menu": "collapseAll", 3561focus: function (event, keepActiveItem){ 3562var item=this.active||this.element.find(this.options.items).eq(0); 3563if(!keepActiveItem){ 3564this.focus(event, item); 3565}}, 3566blur: function (event){ 3567this._delay(function (){ 3568if(!$.contains(this.element[0], $.ui.safeActiveElement(this.document[0]))){ 3569this.collapseAll(event); 3570}}); 3571}, 3572keydown: "_keydown" 3573}); 3574this.refresh(); 3575this._on(this.document, { 3576click: function (event){ 3577if(this._closeOnDocumentClick(event)){ 3578this.collapseAll(event); 3579} 3580this.mouseHandled=false; 3581}}); 3582}, 3583_destroy: function (){ 3584var items=this.element.find(".ui-menu-item") 3585.removeAttr("role aria-disabled"), 3586submenus=items.children(".ui-menu-item-wrapper") 3587.removeUniqueId() 3588.removeAttr("tabIndex role aria-haspopup"); 3589this.element 3590.removeAttr("aria-activedescendant") 3591.find(".ui-menu").addBack() 3592.removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled " + 3593"tabIndex") 3594.removeUniqueId() 3595.show(); 3596submenus.children().each(function (){ 3597var elem=$(this); 3598if(elem.data("ui-menu-submenu-caret")){ 3599elem.remove(); 3600}}); 3601}, 3602_keydown: function (event){ 3603var match, prev, character, skip, 3604preventDefault=true; 3605switch (event.keyCode){ 3606case $.ui.keyCode.PAGE_UP: 3607this.previousPage(event); 3608break; 3609case $.ui.keyCode.PAGE_DOWN: 3610this.nextPage(event); 3611break; 3612case $.ui.keyCode.HOME: 3613this._move("first", "first", event); 3614break; 3615case $.ui.keyCode.END: 3616this._move("last", "last", event); 3617break; 3618case $.ui.keyCode.UP: 3619this.previous(event); 3620break; 3621case $.ui.keyCode.DOWN: 3622this.next(event); 3623break; 3624case $.ui.keyCode.LEFT: 3625this.collapse(event); 3626break; 3627case $.ui.keyCode.RIGHT: 3628if(this.active&&!this.active.is(".ui-state-disabled")){ 3629this.expand (event); 3630} 3631break; 3632case $.ui.keyCode.ENTER: 3633case $.ui.keyCode.SPACE: 3634this._activate(event); 3635break; 3636case $.ui.keyCode.ESCAPE: 3637this.collapse(event); 3638break; 3639default: 3640preventDefault=false; 3641prev=this.previousFilter||""; 3642character=String.fromCharCode(event.keyCode); 3643skip=false; 3644clearTimeout(this.filterTimer); 3645if(character===prev){ 3646skip=true; 3647}else{
vendor: 16,496 bytes, lines 3648-4315
3648character=prev + character; 3649} 3650match=this._filterMenuItems(character); 3651match=skip&&match.index(this.active.next())!==-1 ? 3652this.active.nextAll(".ui-menu-item") : 3653match; 3654if(!match.length){ 3655character=String.fromCharCode(event.keyCode); 3656match=this._filterMenuItems(character); 3657} 3658if(match.length){ 3659this.focus(event, match); 3660this.previousFilter=character; 3661this.filterTimer=this._delay(function (){ 3662delete this.previousFilter; 3663}, 1000); 3664}else{ 3665delete this.previousFilter; 3666}} 3667if(preventDefault){ 3668event.preventDefault(); 3669}}, 3670_activate: function (event){ 3671if(!this.active.is(".ui-state-disabled")){ 3672if(this.active.children("[aria-haspopup='true']").length){ 3673this.expand (event); 3674}else{ 3675this.select(event); 3676}} 3677}, 3678refresh: function (){ 3679var menus, items, newSubmenus, newItems, newWrappers, 3680that=this, 3681icon=this.options.icons.submenu, 3682submenus=this.element.find(this.options.menus); 3683this._toggleClass("ui-menu-icons", null, !!this.element.find(".ui-icon").length); 3684newSubmenus=submenus.filter(":not(.ui-menu)") 3685.hide() 3686.attr({ 3687role: this.options.role, 3688"aria-hidden": "true", 3689"aria-expanded": "false" 3690}) 3691.each(function (){ 3692var menu=$(this), 3693item=menu.prev(), 3694submenuCaret=$("<span>").data("ui-menu-submenu-caret", true); 3695that._addClass(submenuCaret, "ui-menu-icon", "ui-icon " + icon); 3696item 3697.attr("aria-haspopup", "true") 3698.prepend(submenuCaret); 3699menu.attr("aria-labelledby", item.attr("id")); 3700}); 3701this._addClass(newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front"); 3702menus=submenus.add(this.element); 3703items=menus.find(this.options.items); 3704items.not(".ui-menu-item").each(function (){ 3705var item=$(this); 3706if(that._isDivider(item)){ 3707that._addClass(item, "ui-menu-divider", "ui-widget-content"); 3708}}); 3709newItems=items.not(".ui-menu-item, .ui-menu-divider"); 3710newWrappers=newItems.children() 3711.not(".ui-menu") 3712.uniqueId() 3713.attr({ 3714tabIndex: -1, 3715role: this._itemRole() 3716}); 3717this._addClass(newItems, "ui-menu-item") 3718._addClass(newWrappers, "ui-menu-item-wrapper"); 3719items.filter(".ui-state-disabled").attr("aria-disabled", "true"); 3720if(this.active&&!$.contains(this.element[0], this.active[0])){ 3721this.blur(); 3722}}, 3723_itemRole: function (){ 3724return { 3725menu: "menuitem", 3726listbox: "option" 3727}[this.options.role]; 3728}, 3729_setOption: function (key, value){ 3730if(key==="icons"){ 3731var icons=this.element.find(".ui-menu-icon"); 3732this._removeClass(icons, null, this.options.icons.submenu) 3733._addClass(icons, null, value.submenu); 3734} 3735this._super(key, value); 3736}, 3737_setOptionDisabled: function (value){ 3738this._super(value); 3739this.element.attr("aria-disabled", String(value)); 3740this._toggleClass(null, "ui-state-disabled", !!value); 3741}, 3742focus: function (event, item){ 3743var nested, focused, activeParent; 3744this.blur(event, event&&event.type==="focus"); 3745this._scrollIntoView(item); 3746this.active=item.first(); 3747focused=this.active.children(".ui-menu-item-wrapper"); 3748this._addClass(focused, null, "ui-state-active"); 3749if(this.options.role){ 3750this.element.attr("aria-activedescendant", focused.attr("id")); 3751} 3752activeParent=this.active 3753.parent() 3754.closest(".ui-menu-item") 3755.children(".ui-menu-item-wrapper"); 3756this._addClass(activeParent, null, "ui-state-active"); 3757if(event&&event.type==="keydown"){ 3758this._close(); 3759}else{ 3760this.timer=this._delay(function (){ 3761this._close(); 3762}, this.delay); 3763} 3764nested=item.children(".ui-menu"); 3765if(nested.length&&event&&(/^mouse/.test(event.type))){ 3766this._startOpening(nested); 3767} 3768this.activeMenu=item.parent(); 3769this._trigger("focus", event, { item: item }); 3770}, 3771_scrollIntoView: function (item){ 3772var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; 3773if(this._hasScroll()){ 3774borderTop=parseFloat($.css(this.activeMenu[0], "borderTopWidth"))||0; 3775paddingTop=parseFloat($.css(this.activeMenu[0], "paddingTop"))||0; 3776offset=item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; 3777scroll=this.activeMenu.scrollTop(); 3778elementHeight=this.activeMenu.height(); 3779itemHeight=item.outerHeight(); 3780if(offset < 0){ 3781this.activeMenu.scrollTop(scroll + offset); 3782}else if(offset + itemHeight > elementHeight){ 3783this.activeMenu.scrollTop(scroll + offset - elementHeight + itemHeight); 3784}} 3785}, 3786blur: function (event, fromFocus){ 3787if(!fromFocus){ 3788clearTimeout(this.timer); 3789} 3790if(!this.active){ 3791return; 3792} 3793this._removeClass(this.active.children(".ui-menu-item-wrapper"), 3794null, "ui-state-active"); 3795this.active=null; 3796this._trigger("blur", event, { item: this.active }); 3797}, 3798_startOpening: function (submenu){ 3799clearTimeout(this.timer); 3800if(submenu.attr("aria-hidden")!=="true"){ 3801return; 3802} 3803this.timer=this._delay(function (){ 3804this._close(); 3805this._open(submenu); 3806}, this.delay); 3807}, 3808_open: function (submenu){ 3809var position=$.extend({ 3810of: this.active 3811}, this.options.position); 3812clearTimeout(this.timer); 3813this.element.find(".ui-menu").not(submenu.parents(".ui-menu")) 3814.hide() 3815.attr("aria-hidden", "true"); 3816submenu 3817.show() 3818.removeAttr("aria-hidden") 3819.attr("aria-expanded", "true") 3820.position(position); 3821}, 3822collapseAll: function (event, all){ 3823clearTimeout(this.timer); 3824this.timer=this._delay(function (){ 3825var currentMenu=all ? this.element : 3826$(event&&event.target).closest(this.element.find(".ui-menu")); 3827if(!currentMenu.length){ 3828currentMenu=this.element; 3829} 3830this._close(currentMenu); 3831this.blur(event); 3832this.activeMenu=currentMenu; 3833}, this.delay); 3834}, 3835_close: function (startMenu){ 3836if(!startMenu){ 3837startMenu=this.active ? this.active.parent():this.element; 3838} 3839var active=startMenu 3840.find(".ui-menu") 3841.hide() 3842.attr("aria-hidden", "true") 3843.attr("aria-expanded", "false") 3844.end() 3845.find(".ui-state-active").not(".ui-menu-item-wrapper"); 3846this._removeClass(active, null, "ui-state-active"); 3847}, 3848_closeOnDocumentClick: function (event){ 3849return !$(event.target).closest(".ui-menu").length; 3850}, 3851_isDivider: function (item){ 3852return !/[^\-\u2014\u2013\s]/.test(item.text()); 3853}, 3854collapse: function (event){ 3855var newItem=this.active && 3856this.active.parent().closest(".ui-menu-item", this.element); 3857if(newItem&&newItem.length){ 3858this._close(); 3859this.focus(event, newItem); 3860}}, 3861expand: function (event){ 3862var newItem=this.active && 3863this.active 3864.children(".ui-menu ") 3865.find(this.options.items) 3866.first(); 3867if(newItem&&newItem.length){ 3868this._open(newItem.parent()); 3869this._delay(function (){ 3870this.focus(event, newItem); 3871}); 3872}}, 3873next: function (event){ 3874this._move("next", "first", event); 3875}, 3876previous: function (event){ 3877this._move("prev", "last", event); 3878}, 3879isFirstItem: function (){ 3880return this.active&&!this.active.prevAll(".ui-menu-item").length; 3881}, 3882isLastItem: function (){ 3883return this.active&&!this.active.nextAll(".ui-menu-item").length; 3884}, 3885_move: function (direction, filter, event){ 3886var next; 3887if(this.active){ 3888if(direction==="first"||direction==="last"){ 3889next=this.active 3890[direction==="first" ? "prevAll":"nextAll"](".ui-menu-item") 3891.eq(-1); 3892}else{ 3893next=this.active 3894[direction + "All"](".ui-menu-item") 3895.eq(0); 3896}} 3897if(!next||!next.length||!this.active){ 3898next=this.activeMenu.find(this.options.items)[filter](); 3899} 3900this.focus(event, next); 3901}, 3902nextPage: function (event){ 3903var item, base, height; 3904if(!this.active){ 3905this.next(event); 3906return; 3907} 3908if(this.isLastItem()){ 3909return; 3910} 3911if(this._hasScroll()){ 3912base=this.active.offset().top; 3913height=this.element.height(); 3914this.active.nextAll(".ui-menu-item").each(function (){ 3915item=$(this); 3916return item.offset().top - base - height < 0; 3917}); 3918this.focus(event, item); 3919}else{ 3920this.focus(event, this.activeMenu.find(this.options.items) 3921[!this.active ? "first":"last"]()); 3922}}, 3923previousPage: function (event){ 3924var item, base, height; 3925if(!this.active){ 3926this.next(event); 3927return; 3928} 3929if(this.isFirstItem()){ 3930return; 3931} 3932if(this._hasScroll()){ 3933base=this.active.offset().top; 3934height=this.element.height(); 3935this.active.prevAll(".ui-menu-item").each(function (){ 3936item=$(this); 3937return item.offset().top - base + height > 0; 3938}); 3939this.focus(event, item); 3940}else{ 3941this.focus(event, this.activeMenu.find(this.options.items).first()); 3942}}, 3943_hasScroll: function (){ 3944return this.element.outerHeight() < this.element.prop("scrollHeight"); 3945}, 3946select: function (event){ 3947this.active=this.active||$(event.target).closest(".ui-menu-item"); 3948var ui={ item: this.active }; 3949if(!this.active.has(".ui-menu").length){ 3950this.collapseAll(event, true); 3951} 3952this._trigger("select", event, ui); 3953}, 3954_filterMenuItems: function (character){ 3955var escapedCharacter=character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"), 3956regex=new RegExp("^" + escapedCharacter, "i"); 3957return this.activeMenu 3958.find(this.options.items) 3959.filter(".ui-menu-item") 3960.filter(function (){ 3961return regex.test($.trim($(this).children(".ui-menu-item-wrapper").text())); 3962}); 3963}}); 3964})); 3965(function (factory){ 3966if(typeof define==="function"&&define.amd){ 3967define('ui/widgets/autocomplete.js', [ 3968"jquery", 3969"./menu", 3970"../keycode", 3971"../position", 3972"../safe-active-element", 3973"../version", 3974"../widget" 3975], factory); 3976}else{ 3977factory(jQuery); 3978}}(function ($){ 3979$.widget("ui.autocomplete", { 3980version: "@VERSION", 3981defaultElement: "<input>", 3982options: { 3983appendTo: null, 3984autoFocus: false, 3985delay: 300, 3986minLength: 1, 3987position: { 3988my: "left top", 3989at: "left bottom", 3990collision: "none" 3991}, 3992source: null, 3993change: null, 3994close: null, 3995focus: null, 3996open: null, 3997response: null, 3998search: null, 3999select: null 4000}, 4001requestIndex: 0, 4002pending: 0, 4003_create: function (){ 4004var suppressKeyPress, suppressKeyPressRepeat, suppressInput, 4005nodeName=this.element[0].nodeName.toLowerCase(), 4006isTextarea=nodeName==="textarea", 4007isInput=nodeName==="input"; 4008this.isMultiLine=isTextarea||!isInput&&this.element.prop("isContentEditable"); 4009this.valueMethod=this.element[isTextarea||isInput ? "val":"text"]; 4010this.isNewMenu=true; 4011this._addClass("ui-autocomplete-input"); 4012this.element.attr("autocomplete", "off"); 4013this._on(this.element, { 4014keydown: function (event){ 4015if(this.element.prop("readOnly")){ 4016suppressKeyPress=true; 4017suppressInput=true; 4018suppressKeyPressRepeat=true; 4019return; 4020} 4021suppressKeyPress=false; 4022suppressInput=false; 4023suppressKeyPressRepeat=false; 4024var keyCode=$.ui.keyCode; 4025switch (event.keyCode){ 4026case keyCode.PAGE_UP: 4027suppressKeyPress=true; 4028this._move("previousPage", event); 4029break; 4030case keyCode.PAGE_DOWN: 4031suppressKeyPress=true; 4032this._move("nextPage", event); 4033break; 4034case keyCode.UP: 4035suppressKeyPress=true; 4036this._keyEvent("previous", event); 4037break; 4038case keyCode.DOWN: 4039suppressKeyPress=true; 4040this._keyEvent("next", event); 4041break; 4042case keyCode.ENTER: 4043if(this.menu.active){ 4044suppressKeyPress=true; 4045event.preventDefault(); 4046this.menu.select(event); 4047} 4048break; 4049case keyCode.TAB: 4050if(this.menu.active){ 4051this.menu.select(event); 4052} 4053break; 4054case keyCode.ESCAPE: 4055if(this.menu.element.is(":visible")){ 4056if(!this.isMultiLine){ 4057this._value(this.term); 4058} 4059this.close(event); 4060event.preventDefault(); 4061} 4062break; 4063default: 4064suppressKeyPressRepeat=true; 4065this._searchTimeout(event); 4066break; 4067}}, 4068keypress: function (event){ 4069if(suppressKeyPress){ 4070suppressKeyPress=false; 4071if(!this.isMultiLine||this.menu.element.is(":visible")){ 4072event.preventDefault(); 4073} 4074return; 4075} 4076if(suppressKeyPressRepeat){ 4077return; 4078} 4079var keyCode=$.ui.keyCode; 4080switch (event.keyCode){ 4081case keyCode.PAGE_UP: 4082this._move("previousPage", event); 4083break; 4084case keyCode.PAGE_DOWN: 4085this._move("nextPage", event); 4086break; 4087case keyCode.UP: 4088this._keyEvent("previous", event); 4089break; 4090case keyCode.DOWN: 4091this._keyEvent("next", event); 4092break; 4093}}, 4094input: function (event){ 4095if(suppressInput){ 4096suppressInput=false; 4097event.preventDefault(); 4098return; 4099} 4100this._searchTimeout(event); 4101}, 4102focus: function (){ 4103this.selectedItem=null; 4104this.previous=this._value(); 4105}, 4106blur: function (event){ 4107if(this.cancelBlur){ 4108delete this.cancelBlur; 4109return; 4110} 4111clearTimeout(this.searching); 4112this.close(event); 4113this._change(event); 4114}}); 4115this._initSource(); 4116this.menu=$("<ul>") 4117.appendTo(this._appendTo()) 4118.menu({ 4119role: null 4120}) 4121.hide() 4122.menu("instance"); 4123this._addClass(this.menu.element, "ui-autocomplete", "ui-front"); 4124this._on(this.menu.element, { 4125mousedown: function (event){ 4126event.preventDefault(); 4127this.cancelBlur=true; 4128this._delay(function (){ 4129delete this.cancelBlur; 4130if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){ 4131this.element.trigger("focus"); 4132}}); 4133}, 4134menufocus: function (event, ui){ 4135var label, item; 4136if(this.isNewMenu){ 4137this.isNewMenu=false; 4138if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){ 4139this.menu.blur(); 4140this.document.one("mousemove", function (){ 4141$(event.target).trigger(event.originalEvent); 4142}); 4143return; 4144}} 4145item=ui.item.data("ui-autocomplete-item"); 4146if(false!==this._trigger("focus", event, { item: item })){ 4147if(event.originalEvent&&/^key/.test(event.originalEvent.type)){ 4148this._value(item.value); 4149}} 4150label=ui.item.attr("aria-label")||item.value; 4151if(label&&$.trim(label).length){ 4152this.liveRegion.children().hide(); 4153$("<div>").text(label).appendTo(this.liveRegion); 4154}}, 4155menuselect: function (event, ui){ 4156var item=ui.item.data("ui-autocomplete-item"), 4157previous=this.previous; 4158if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){ 4159this.element.trigger("focus"); 4160this.previous=previous; 4161this._delay(function (){ 4162this.previous=previous; 4163this.selectedItem=item; 4164}); 4165} 4166if(false!==this._trigger("select", event, { item: item })){ 4167this._value(item.value); 4168} 4169this.term=this._value(); 4170this.close(event); 4171this.selectedItem=item; 4172}}); 4173this.liveRegion=$("<div>", { 4174role: "status", 4175"aria-live": "assertive", 4176"aria-relevant": "additions" 4177}) 4178.appendTo(this.document[0].body); 4179this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"); 4180this._on(this.window, { 4181beforeunload: function (){ 4182this.element.removeAttr("autocomplete"); 4183}}); 4184}, 4185_destroy: function (){ 4186clearTimeout(this.searching); 4187this.element.removeAttr("autocomplete"); 4188this.menu.element.remove(); 4189this.liveRegion.remove(); 4190}, 4191_setOption: function (key, value){ 4192this._super(key, value); 4193if(key==="source"){ 4194this._initSource(); 4195} 4196if(key==="appendTo"){ 4197this.menu.element.appendTo(this._appendTo()); 4198} 4199if(key==="disabled"&&value&&this.xhr){ 4200this.xhr.abort(); 4201}}, 4202_isEventTargetInWidget: function (event){ 4203var menuElement=this.menu.element[0]; 4204return event.target===this.element[0] || 4205event.target===menuElement || 4206$.contains(menuElement, event.target); 4207}, 4208_closeOnClickOutside: function (event){ 4209if(!this._isEventTargetInWidget(event)){ 4210this.close(); 4211}}, 4212_appendTo: function (){ 4213var element=this.options.appendTo; 4214if(element){ 4215element=element.jquery||element.nodeType ? 4216$(element) : 4217this.document.find(element).eq(0); 4218} 4219if(!element||!element[0]){ 4220element=this.element.closest(".ui-front, dialog"); 4221} 4222if(!element.length){ 4223element=this.document[0].body; 4224} 4225return element; 4226}, 4227_initSource: function (){ 4228var array, url, 4229that=this; 4230if($.isArray(this.options.source)){ 4231array=this.options.source; 4232this.source=function (request, response){ 4233response($.ui.autocomplete.filter(array, request.term)); 4234};}else if(typeof this.options.source==="string"){ 4235url=this.options.source; 4236this.source=function (request, response){ 4237if(that.xhr){ 4238that.xhr.abort(); 4239} 4240that.xhr=$.ajax({ 4241url: url, 4242data: request, 4243dataType: "json", 4244success: function (data){ 4245response(data); 4246}, 4247error: function (){ 4248response([]); 4249}}); 4250};}else{ 4251this.source=this.options.source; 4252}}, 4253_searchTimeout: function (event){ 4254clearTimeout(this.searching); 4255this.searching=this._delay(function (){ 4256var equalValues=this.term===this._value(), 4257menuVisible=this.menu.element.is(":visible"), 4258modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey; 4259if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){ 4260this.selectedItem=null; 4261this.search(null, event); 4262}}, this.options.delay); 4263}, 4264search: function (value, event){ 4265value=value!=null ? value:this._value(); 4266this.term=this._value(); 4267if(value.length < this.options.minLength){ 4268return this.close(event); 4269} 4270if(this._trigger("search", event)===false){ 4271return; 4272} 4273return this._search(value); 4274}, 4275_search: function (value){ 4276this.pending++; 4277this._addClass("ui-autocomplete-loading"); 4278this.cancelSearch=false; 4279this.source({ term: value }, this._response()); 4280}, 4281_response: function (){ 4282var index=++this.requestIndex; 4283return $.proxy(function (content){ 4284if(index===this.requestIndex){ 4285this.__response(content); 4286} 4287this.pending--; 4288if(!this.pending){ 4289this._removeClass("ui-autocomplete-loading"); 4290}}, this); 4291}, 4292__response: function (content){ 4293if(content){ 4294content=this._normalize(content); 4295} 4296this._trigger("response", null, { content: content }); 4297if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){ 4298this._suggest(content); 4299this._trigger("open"); 4300}else{ 4301this._close(); 4302}}, 4303close: function (event){ 4304this.cancelSearch=true; 4305this._close(event); 4306}, 4307_close: function (event){ 4308this._off(this.document, "mousedown"); 4309if(this.menu.element.is(":visible")){ 4310this.menu.element.hide(); 4311this.menu.blur(); 4312this.isNewMenu=true; 4313this._trigger("close", event); 4314}}, 4315_change: function (event){
4316if(this.previous!==this._value()){ 4317this._trigger("change", event, { item: this.selectedItem }); 4318}}, 4319_normalize: function (items){ 4320if(items.length&&items[0].label&&items[0].value){ 4321return items; 4322} 4323return $.map(items, function (item){ 4324if(typeof item==="string"){ 4325return { 4326label: item, 4327value: item 4328};} 4329return $.extend({}, item, { 4330label: item.label||item.value, 4331value: item.value||item.label 4332}); 4333}); 4334}, 4335_suggest: function (items){ 4336var ul=this.menu.element.empty(); 4337this._renderMenu(ul, items); 4338this.isNewMenu=true; 4339this.menu.refresh(); 4340ul.show(); 4341this._resizeMenu(); 4342ul.position($.extend({ 4343of: this.element 4344}, this.options.position)); 4345if(this.options.autoFocus){ 4346this.menu.next(); 4347} 4348this._on(this.document, { 4349mousedown: "_closeOnClickOutside" 4350}); 4351}, 4352_resizeMenu: function (){ 4353var ul=this.menu.element; 4354ul.outerWidth(Math.max(ul.width("").outerWidth() + 1, 4355this.element.outerWidth() 4356)); 4357}, 4358_renderMenu: function (ul, items){ 4359var that=this; 4360$.each(items, function (index, item){ 4361that._renderItemData(ul, item); 4362}); 4363}, 4364_renderItemData: function (ul, item){ 4365return this._renderItem(ul, item).data("ui-autocomplete-item", item); 4366}, 4367_renderItem: function (ul, item){ 4368return $("<li>") 4369.append($("<div>").text(item.label)) 4370.appendTo(ul); 4371}, 4372_move: function (direction, event){ 4373if(!this.menu.element.is(":visible")){ 4374this.search(null, event); 4375return; 4376} 4377if(this.menu.isFirstItem()&&/^previous/.test(direction) || 4378this.menu.isLastItem()&&/^next/.test(direction)){ 4379if(!this.isMultiLine){ 4380this._value(this.term); 4381} 4382this.menu.blur(); 4383return; 4384} 4385this.menu[direction](event); 4386}, 4387widget: function (){ 4388return this.menu.element; 4389}, 4390_value: function (){ 4391return this.valueMethod.apply(this.element, arguments); 4392}, 4393_keyEvent: function (keyEvent, event){ 4394if(!this.isMultiLine||this.menu.element.is(":visible")){ 4395this._move(keyEvent, event); 4396event.preventDefault(); 4397}} 4398}); 4399$.extend($.ui.autocomplete, { 4400escapeRegex: function (value){ 4401return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); 4402}, 4403filter: function (array, term){ 4404var matcher=new RegExp($.ui.autocomplete.escapeRegex(term), "i"); 4405return $.grep(array, function (value){ 4406return matcher.test(value.label||value.value||value); 4407}); 4408}}); 4409$.widget("ui.autocomplete", $.ui.autocomplete, { 4410options: { 4411messages: { 4412noResults: "No search results.", 4413results: function (amount){ 4414return amount + (amount > 1 ? " results are":" result is") + 4415" available, use up and down arrow keys to navigate."; 4416}} 4417}, 4418__response: function (content){ 4419var message; 4420this._superApply(arguments); 4421if(this.options.disabled||this.cancelSearch){ 4422return; 4423} 4424if(content&&content.length){ 4425message=this.options.messages.results(content.length); 4426}else{ 4427message=this.options.messages.noResults; 4428} 4429this.liveRegion.children().hide(); 4430$("<div>").text(message).appendTo(this.liveRegion); 4431}}); 4432return $.ui.autocomplete; 4433})); 4434(function (factory){ 4435if(typeof define==="function"&&define.amd){ 4436define('ui/widgets/controlgroup.js', [ 4437"jquery", 4438"../widget" 4439], factory); 4440}else{ 4441factory(jQuery); 4442}}(function ($){ 4443return $.widget("ui.controlgroup", { 4444version: "@VERSION", 4445defaultElement: "<div>", 4446options: { 4447direction: "horizontal", 4448disabled: null, 4449onlyVisible: true, 4450items: { 4451"button": "input[type=button], input[type=submit], input[type=reset], button, a", 4452"controlgroupLabel": ".ui-controlgroup-label", 4453"checkboxradio": "input[type='checkbox'], input[type='radio']", 4454"selectmenu": "select", 4455"spinner": ".ui-spinner-input" 4456}}, 4457_create: function (){ 4458this._enhance(); 4459}, 4460_enhance: function (){ 4461this.element.attr("role", "toolbar"); 4462this.refresh(); 4463}, 4464_destroy: function (){ 4465this._callChildMethod("destroy"); 4466this.childWidgets.removeData("ui-controlgroup-data"); 4467this.element.removeAttr("role"); 4468if(this.options.items.controlgroupLabel){ 4469this.element 4470.find(this.options.items.controlgroupLabel) 4471.find(".ui-controlgroup-label-contents") 4472.contents().unwrap(); 4473}}, 4474_initWidgets: function (){ 4475var that=this, 4476childWidgets=[]; 4477$.each(this.options.items, function (widget, selector){ 4478var labels; 4479var options={}; 4480if(!selector){ 4481return; 4482} 4483if(widget==="controlgroupLabel"){ 4484labels=that.element.find(selector); 4485labels.each(function (){ 4486$(this).contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>"); 4487}); 4488that._addClass(labels, null, "ui-widget ui-widget-content ui-state-default"); 4489childWidgets=childWidgets.concat(labels.get()); 4490return; 4491} 4492if(!$.fn[widget]){ 4493return; 4494} 4495if(that["_" + widget + "Options"]){ 4496options=that["_" + widget + "Options"]("middle"); 4497} 4498that.element 4499.find(selector)[widget](options) 4500.each(function (){ 4501var element=$(this); 4502var widgetElement=element[widget]("widget"); 4503$.data(widgetElement[0], "ui-controlgroup-data", 4504element[widget]("instance")); 4505childWidgets.push(widgetElement[0]); 4506}); 4507}); 4508this.childWidgets=$($.unique(childWidgets)); 4509this._addClass(this.childWidgets, "ui-controlgroup-item"); 4510}, 4511_callChildMethod: function (method){ 4512this.childWidgets.each(function (){ 4513var element=$(this), 4514data=element.data("ui-controlgroup-data"); 4515if(data&&data[method]){ 4516data[method](); 4517}}); 4518}, 4519_updateCornerClass: function (element, position){ 4520var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right"; 4521var add=this._buildSimpleOptions(position, "label").classes.label; 4522this._removeClass(element, null, remove); 4523this._addClass(element, null, add); 4524}, 4525_buildSimpleOptions: function (position, key){ 4526var direction=this.options.direction==="vertical"; 4527var result={ 4528classes: {}}; 4529result.classes[key]={ 4530"middle": null, 4531"first": "ui-corner-" + (direction ? "top":"left"), 4532"last": "ui-corner-" + (direction ? "bottom":"right") 4533}[position]; 4534return result; 4535}, 4536_spinnerOptions: function (position){ 4537var options=this._buildSimpleOptions(position, "ui-spinner"); 4538options.classes["ui-spinner-up"]=""; 4539options.classes["ui-spinner-down"]=""; 4540return options; 4541}, 4542_buttonOptions: function (position){ 4543return this._buildSimpleOptions(position, "ui-button"); 4544}, 4545_checkboxradioOptions: function (position){ 4546return this._buildSimpleOptions(position, "ui-checkboxradio-label"); 4547}, 4548_selectmenuOptions: function (position){ 4549var direction=this.options.direction==="vertical"; 4550return { 4551width: direction ? "auto":false, 4552classes: { 4553middle: { 4554"ui-selectmenu-button-open": null, 4555"ui-selectmenu-button-closed": null 4556}, 4557first: { 4558"ui-selectmenu-button-open": "ui-corner-" + (direction ? "top":"tl"), 4559"ui-selectmenu-button-closed": "ui-corner-" + (direction ? "top":"left") 4560}, 4561last: { 4562"ui-selectmenu-button-open": direction ? null:"ui-corner-tr", 4563"ui-selectmenu-button-closed": "ui-corner-" + (direction ? "bottom":"right") 4564}}[position] 4565};}, 4566_setOption: function (key, value){ 4567if(key==="direction"){ 4568this._removeClass("ui-controlgroup-" + this.options.direction); 4569} 4570this._super(key, value); 4571if(key==="disabled"){ 4572this._callChildMethod(value ? "disable":"enable"); 4573return; 4574} 4575this.refresh(); 4576}, 4577refresh: function (){ 4578var children, 4579that=this; 4580this._addClass("ui-controlgroup ui-controlgroup-" + this.options.direction); 4581if(this.options.direction==="horizontal"){ 4582this._addClass(null, "ui-helper-clearfix"); 4583} 4584this._initWidgets(); 4585children=this.childWidgets; 4586if(this.options.onlyVisible){ 4587children=children.filter(":visible"); 4588} 4589if(children.length){ 4590$.each(["first", "last"], function (index, value){ 4591var instance=children[value]().data("ui-controlgroup-data"); 4592if(instance&&that["_" + instance.widgetName + "Options"]){ 4593instance.element[instance.widgetName]( 4594that["_" + instance.widgetName + "Options"](value) 4595); 4596}else{ 4597that._updateCornerClass(children[value](), value); 4598}}); 4599this._callChildMethod("refresh"); 4600}} 4601}); 4602})); 4603(function (factory){ 4604if(typeof define==="function"&&define.amd){ 4605define('ui/widgets/checkboxradio.js', [ 4606"jquery", 4607"../escape-selector", 4608"../form-reset-mixin", 4609"../labels", 4610"../widget" 4611], factory); 4612}else{ 4613factory(jQuery); 4614}}(function ($){ 4615$.widget("ui.checkboxradio", [$.ui.formResetMixin, { 4616version: "@VERSION", 4617options: { 4618disabled: null, 4619label: null, 4620icon: true, 4621classes: { 4622"ui-checkboxradio-label": "ui-corner-all", 4623"ui-checkboxradio-icon": "ui-corner-all" 4624}}, 4625_getCreateOptions: function (){ 4626var disabled, labels; 4627var that=this; 4628var options=this._super()||{}; 4629this._readType(); 4630labels=this.element.labels(); 4631this.label=$(labels[labels.length - 1]); 4632if(!this.label.length){ 4633$.error("No label found for checkboxradio widget"); 4634} 4635this.originalLabel=""; 4636this.label.contents().not(this.element).each(function (){ 4637that.originalLabel +=this.nodeType===3 ? $(this).text():this.outerHTML; 4638}); 4639if(this.originalLabel){ 4640options.label=this.originalLabel; 4641} 4642disabled=this.element[0].disabled; 4643if(disabled!=null){ 4644options.disabled=disabled; 4645} 4646return options; 4647}, 4648_create: function (){ 4649var checked=this.element[0].checked; 4650this._bindFormResetHandler(); 4651if(this.options.disabled==null){ 4652this.options.disabled=this.element[0].disabled; 4653} 4654this._setOption("disabled", this.options.disabled); 4655this._addClass("ui-checkboxradio", "ui-helper-hidden-accessible"); 4656this._addClass(this.label, "ui-checkboxradio-label", "ui-button ui-widget");
vendor: 2,483 bytes, lines 4657-4747
4657if(this.type==="radio"){ 4658this._addClass(this.label, "ui-checkboxradio-radio-label"); 4659} 4660if(this.options.label&&this.options.label!==this.originalLabel){ 4661this._updateLabel(); 4662}else if(this.originalLabel){ 4663this.options.label=this.originalLabel; 4664} 4665this._enhance(); 4666if(checked){ 4667this._addClass(this.label, "ui-checkboxradio-checked", "ui-state-active"); 4668this._addClass(this.icon, null, "ui-state-hover"); 4669} 4670this._on({ 4671change: "_toggleClasses", 4672focus: function (){ 4673this._addClass(this.label, null, "ui-state-focus ui-visual-focus"); 4674}, 4675blur: function (){ 4676this._removeClass(this.label, null, "ui-state-focus ui-visual-focus"); 4677}}); 4678}, 4679_readType: function (){ 4680var nodeName=this.element[0].nodeName.toLowerCase(); 4681this.type=this.element[0].type; 4682if(nodeName!=="input"||!/radio|checkbox/.test(this.type)){ 4683$.error("Can't create checkboxradio on element.nodeName=" + nodeName + 4684" and element.type=" + this.type); 4685}}, 4686_enhance: function (){ 4687this._updateIcon(this.element[0].checked); 4688}, 4689widget: function (){ 4690return this.label; 4691}, 4692_getRadioGroup: function (){ 4693var group; 4694var name=this.element[0].name; 4695var nameSelector="input[name='" + $.ui.escapeSelector(name) + "']"; 4696if(!name){ 4697return $([]); 4698} 4699if(this.form.length){ 4700group=$(this.form[0].elements).filter(nameSelector); 4701}else{ 4702group=$(nameSelector).filter(function (){ 4703return $(this).form().length===0; 4704}); 4705} 4706return group.not(this.element); 4707}, 4708_toggleClasses: function (){ 4709var checked=this.element[0].checked; 4710this._toggleClass(this.label, "ui-checkboxradio-checked", "ui-state-active", checked); 4711if(this.options.icon&&this.type==="checkbox"){ 4712this._toggleClass(this.icon, null, "ui-icon-check ui-state-highlight", checked) 4713._toggleClass(this.icon, null, "ui-icon-blank", !checked); 4714} 4715if(this.type==="radio"){ 4716this._getRadioGroup() 4717.each(function (){ 4718var instance=$(this).checkboxradio("instance"); 4719if(instance){ 4720instance._removeClass(instance.label, 4721"ui-checkboxradio-checked", "ui-state-active"); 4722}}); 4723}}, 4724_destroy: function (){ 4725this._unbindFormResetHandler(); 4726if(this.icon){ 4727this.icon.remove(); 4728this.iconSpace.remove(); 4729}}, 4730_setOption: function (key, value){ 4731if(key==="label"&&!value){ 4732return; 4733} 4734this._super(key, value); 4735if(key==="disabled"){ 4736this._toggleClass(this.label, null, "ui-state-disabled", value); 4737this.element[0].disabled=value; 4738return; 4739} 4740this.refresh(); 4741}, 4742_updateIcon: function (checked){ 4743var toAdd="ui-icon ui-icon-background "; 4744if(this.options.icon){ 4745if(!this.icon){ 4746this.icon=$("<span>"); 4747this.iconSpace=$("<span> </span>");
vendor: 17,876 bytes, lines 4748-5374
4748this._addClass(this.iconSpace, "ui-checkboxradio-icon-space"); 4749} 4750if(this.type==="checkbox"){ 4751toAdd +=checked ? "ui-icon-check ui-state-highlight":"ui-icon-blank"; 4752this._removeClass(this.icon, null, checked ? "ui-icon-blank":"ui-icon-check"); 4753}else{ 4754toAdd +="ui-icon-blank"; 4755} 4756this._addClass(this.icon, "ui-checkboxradio-icon", toAdd); 4757if(!checked){ 4758this._removeClass(this.icon, null, "ui-icon-check ui-state-highlight"); 4759} 4760this.icon.prependTo(this.label).after(this.iconSpace); 4761}else if(this.icon!==undefined){ 4762this.icon.remove(); 4763this.iconSpace.remove(); 4764delete this.icon; 4765}}, 4766_updateLabel: function (){ 4767this.label.contents().not(this.element.add(this.icon).add(this.iconSpace)).remove(); 4768this.label.append(this.options.label); 4769}, 4770refresh: function (){ 4771var checked=this.element[0].checked, 4772isDisabled=this.element[0].disabled; 4773this._updateIcon(checked); 4774this._toggleClass(this.label, "ui-checkboxradio-checked", "ui-state-active", checked); 4775if(this.options.label!==null){ 4776this._updateLabel(); 4777} 4778if(isDisabled!==this.options.disabled){ 4779this._setOptions({ "disabled": isDisabled }); 4780}} 4781}]); 4782return $.ui.checkboxradio; 4783})); 4784(function (factory){ 4785if(typeof define==="function"&&define.amd){ 4786define('ui/widgets/button', [ 4787"jquery", 4788"./controlgroup", 4789"./checkboxradio", 4790"../keycode", 4791"../widget" 4792], factory); 4793}else{ 4794factory(jQuery); 4795}}(function ($){ 4796$.widget("ui.button", { 4797version: "@VERSION", 4798defaultElement: "<button>", 4799options: { 4800classes: { 4801"ui-button": "ui-corner-all" 4802}, 4803disabled: null, 4804icon: null, 4805iconPosition: "beginning", 4806label: null, 4807showLabel: true 4808}, 4809_getCreateOptions: function (){ 4810var disabled, 4811options=this._super()||{}; 4812this.isInput=this.element.is("input"); 4813disabled=this.element[0].disabled; 4814if(disabled!=null){ 4815options.disabled=disabled; 4816} 4817this.originalLabel=this.isInput ? this.element.val():this.element.html(); 4818if(this.originalLabel){ 4819options.label=this.originalLabel; 4820} 4821return options; 4822}, 4823_create: function (){ 4824if(!this.option.showLabel & !this.options.icon){ 4825this.options.showLabel=true; 4826} 4827if(this.options.disabled==null){ 4828this.options.disabled=this.element[0].disabled||false; 4829} 4830this.hasTitle = !!this.element.attr("title"); 4831if(this.options.label&&this.options.label!==this.originalLabel){ 4832if(this.isInput){ 4833this.element.val(this.options.label); 4834}else{ 4835this.element.html(this.options.label); 4836}} 4837this._addClass("ui-button", "ui-widget"); 4838this._setOption("disabled", this.options.disabled); 4839this._enhance(); 4840if(this.element.is("a")){ 4841this._on({ 4842"keyup": function (event){ 4843if(event.keyCode===$.ui.keyCode.SPACE){ 4844event.preventDefault(); 4845if(this.element[0].click){ 4846this.element[0].click(); 4847}else{ 4848this.element.trigger("click"); 4849}} 4850}}); 4851}}, 4852_enhance: function (){ 4853if(!this.element.is("button")){ 4854this.element.attr("role", "button"); 4855} 4856if(this.options.icon){ 4857this._updateIcon("icon", this.options.icon); 4858this._updateTooltip(); 4859}}, 4860_updateTooltip: function (){ 4861this.title=this.element.attr("title"); 4862if(!this.options.showLabel&&!this.title){ 4863this.element.attr("title", this.options.label); 4864}}, 4865_updateIcon: function (option, value){ 4866var icon=option!=="iconPosition", 4867position=icon ? this.options.iconPosition:value, 4868displayBlock=position==="top"||position==="bottom"; 4869if(!this.icon){ 4870this.icon=$("<span>"); 4871this._addClass(this.icon, "ui-button-icon", "ui-icon"); 4872if(!this.options.showLabel){ 4873this._addClass("ui-button-icon-only"); 4874}}else if(icon){ 4875this._removeClass(this.icon, null, this.options.icon); 4876} 4877if(icon){ 4878this._addClass(this.icon, null, value); 4879} 4880this._attachIcon(position); 4881if(displayBlock){ 4882this._addClass(this.icon, null, "ui-widget-icon-block"); 4883if(this.iconSpace){ 4884this.iconSpace.remove(); 4885}}else{ 4886if(!this.iconSpace){ 4887this.iconSpace=$("<span> </span>"); 4888this._addClass(this.iconSpace, "ui-button-icon-space"); 4889} 4890this._removeClass(this.icon, null, "ui-wiget-icon-block"); 4891this._attachIconSpace(position); 4892}}, 4893_destroy: function (){ 4894this.element.removeAttr("role"); 4895if(this.icon){ 4896this.icon.remove(); 4897} 4898if(this.iconSpace){ 4899this.iconSpace.remove(); 4900} 4901if(!this.hasTitle){ 4902this.element.removeAttr("title"); 4903}}, 4904_attachIconSpace: function (iconPosition){ 4905this.icon[/^(?:end|bottom)/.test(iconPosition) ? "before":"after"](this.iconSpace); 4906}, 4907_attachIcon: function (iconPosition){ 4908this.element[/^(?:end|bottom)/.test(iconPosition) ? "append":"prepend"](this.icon); 4909}, 4910_setOptions: function (options){ 4911var newShowLabel=options.showLabel===undefined ? 4912this.options.showLabel : 4913options.showLabel, 4914newIcon=options.icon===undefined ? this.options.icon:options.icon; 4915if(!newShowLabel&&!newIcon){ 4916options.showLabel=true; 4917} 4918this._super(options); 4919}, 4920_setOption: function (key, value){ 4921if(key==="icon"){ 4922if(value){ 4923this._updateIcon(key, value); 4924}else if(this.icon){ 4925this.icon.remove(); 4926if(this.iconSpace){ 4927this.iconSpace.remove(); 4928}} 4929} 4930if(key==="iconPosition"){ 4931this._updateIcon(key, value); 4932} 4933if(key==="showLabel"){ 4934this._toggleClass("ui-button-icon-only", null, !value); 4935this._updateTooltip(); 4936} 4937if(key==="label"){ 4938if(this.isInput){ 4939this.element.val(value); 4940}else{ 4941this.element.html(value); 4942if(this.icon){ 4943this._attachIcon(this.options.iconPosition); 4944this._attachIconSpace(this.options.iconPosition); 4945}} 4946} 4947this._super(key, value); 4948if(key==="disabled"){ 4949this._toggleClass(null, "ui-state-disabled", value); 4950this.element[0].disabled=value; 4951if(value){ 4952this.element.blur(); 4953}} 4954}, 4955refresh: function (){ 4956var isDisabled=this.element.is("input, button") ? 4957this.element[0].disabled:this.element.hasClass("ui-button-disabled"); 4958if(isDisabled!==this.options.disabled){ 4959this._setOptions({ disabled: isDisabled }); 4960} 4961this._updateTooltip(); 4962}}); 4963if($.uiBackCompat!==false){ 4964$.widget("ui.button", $.ui.button, { 4965options: { 4966text: true, 4967icons: { 4968primary: null, 4969secondary: null 4970}}, 4971_create: function (){ 4972if(this.options.showLabel&&!this.options.text){ 4973this.options.showLabel=this.options.text; 4974} 4975if(!this.options.showLabel&&this.options.text){ 4976this.options.text=this.options.showLabel; 4977} 4978if(!this.options.icon&&(this.options.icons.primary || 4979this.options.icons.secondary)){ 4980if(this.options.icons.primary){ 4981this.options.icon=this.options.icons.primary; 4982}else{ 4983this.options.icon=this.options.icons.secondary; 4984this.options.iconPosition="end"; 4985}}else if(this.options.icon){ 4986this.options.icons.primary=this.options.icon; 4987} 4988this._super(); 4989}, 4990_setOption: function (key, value){ 4991if(key==="text"){ 4992this._super("showLabel", value); 4993return; 4994} 4995if(key==="showLabel"){ 4996this.options.text=value; 4997} 4998if(key==="icon"){ 4999this.options.icons.primary=value; 5000} 5001if(key==="icons"){ 5002if(value.primary){ 5003this._super("icon", value.primary); 5004this._super("iconPosition", "beginning"); 5005}else if(value.secondary){ 5006this._super("icon", value.secondary); 5007this._super("iconPosition", "end"); 5008}} 5009this._superApply(arguments); 5010}}); 5011$.fn.button=(function (orig){ 5012return function (){ 5013if(!this.length||(this.length&&this[0].tagName!=="INPUT") || 5014(this.length&&this[0].tagName==="INPUT"&&( 5015this.attr("type")!=="checkbox"&&this.attr("type")!=="radio" 5016))){ 5017return orig.apply(this, arguments); 5018} 5019if(!$.ui.checkboxradio){ 5020$.error("Checkboxradio widget missing"); 5021} 5022if(arguments.length===0){ 5023return this.checkboxradio({ 5024"icon": false 5025}); 5026} 5027return this.checkboxradio.apply(this, arguments); 5028};})($.fn.button); 5029$.fn.buttonset=function (){ 5030if(!$.ui.controlgroup){ 5031$.error("Controlgroup widget missing"); 5032} 5033if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){ 5034return this.controlgroup.apply(this, 5035[arguments[0], "items.button", arguments[2]]); 5036} 5037if(arguments[0]==="option"&&arguments[1]==="items"){ 5038return this.controlgroup.apply(this, [arguments[0], "items.button"]); 5039} 5040if(typeof arguments[0]==="object"&&arguments[0].items){ 5041arguments[0].items={ 5042button: arguments[0].items 5043};} 5044return this.controlgroup.apply(this, arguments); 5045};} 5046return $.ui.button; 5047})); 5048(function (factory){ 5049if(typeof define==="function"&&define.amd){ 5050define('ui/widgets/datepicker.js', [ 5051"jquery", 5052"../version", 5053"../keycode" 5054], factory); 5055}else{ 5056factory(jQuery); 5057}}(function ($){ 5058$.extend($.ui, { datepicker: { version: "@VERSION" }}); 5059var datepicker_instActive; 5060function datepicker_getZindex(elem){ 5061var position, value; 5062while (elem.length&&elem[0]!==document){ 5063position=elem.css("position"); 5064if(position==="absolute"||position==="relative"||position==="fixed"){ 5065value=parseInt(elem.css("zIndex"), 10); 5066if(!isNaN(value)&&value!==0){ 5067return value; 5068}} 5069elem=elem.parent(); 5070} 5071return 0; 5072} 5073function Datepicker(){ 5074this._curInst=null; 5075this._keyEvent=false; 5076this._disabledInputs=[]; 5077this._datepickerShowing=false; 5078this._inDialog=false; 5079this._mainDivId="ui-datepicker-div"; 5080this._inlineClass="ui-datepicker-inline"; 5081this._appendClass="ui-datepicker-append"; 5082this._triggerClass="ui-datepicker-trigger"; 5083this._dialogClass="ui-datepicker-dialog"; 5084this._disableClass="ui-datepicker-disabled"; 5085this._unselectableClass="ui-datepicker-unselectable"; 5086this._currentClass="ui-datepicker-current-day"; 5087this._dayOverClass="ui-datepicker-days-cell-over"; 5088this.regional=[]; 5089this.regional[""]={ 5090closeText: "Done", 5091prevText: "Prev", 5092nextText: "Next", 5093currentText: "Today", 5094monthNames: ["January", "February", "March", "April", "May", "June", 5095"July", "August", "September", "October", "November", "December"], 5096monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 5097dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], 5098dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 5099dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], 5100weekHeader: "Wk", 5101dateFormat: "mm/dd/yy", 5102firstDay: 0, 5103isRTL: false, 5104showMonthAfterYear: false, 5105yearSuffix: "" 5106}; 5107this._defaults={ 5108showOn: "focus", // "focus" for popup on focus, 5109showAnim: "fadeIn", 5110showOptions: {}, 5111defaultDate: null, 5112appendText: "", 5113buttonText: "...", 5114buttonImage: "", 5115buttonImageOnly: false, 5116hideIfNoPrevNext: false, 5117navigationAsDateFormat: false, 5118gotoCurrent: false, 5119changeMonth: false, 5120changeYear: false, 5121yearRange: "c-10:c+10", 5122showOtherMonths: false, 5123selectOtherMonths: false, 5124showWeek: false, 5125calculateWeek: this.iso8601Week, 5126shortYearCutoff: "+10", 5127minDate: null, 5128maxDate: null, 5129duration: "fast", 5130beforeShowDay: null, 5131beforeShow: null, 5132onSelect: null, 5133onChangeMonthYear: null, 5134onClose: null, 5135numberOfMonths: 1, 5136showCurrentAtPos: 0, 5137stepMonths: 1, 5138stepBigMonths: 12, 5139altField: "", 5140altFormat: "", 5141constrainInput: true, 5142showButtonPanel: false, 5143autoSize: false, 5144disabled: false 5145}; 5146$.extend(this._defaults, this.regional[""]); 5147this.regional.en=$.extend(true, {}, this.regional[""]); 5148this.regional["en-US"]=$.extend(true, {}, this.regional.en); 5149this.dpDiv=datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")); 5150} 5151$.extend(Datepicker.prototype, { 5152markerClassName: "hasDatepicker", 5153maxRows: 4, 5154_widgetDatepicker: function (){ 5155return this.dpDiv; 5156}, 5157setDefaults: function (settings){ 5158datepicker_extendRemove(this._defaults, settings||{}); 5159return this; 5160}, 5161_attachDatepicker: function (target, settings){ 5162var nodeName, inline, inst; 5163nodeName=target.nodeName.toLowerCase(); 5164inline=(nodeName==="div"||nodeName==="span"); 5165if(!target.id){ 5166this.uuid +=1; 5167target.id="dp" + this.uuid; 5168} 5169inst=this._newInst($(target), inline); 5170inst.settings=$.extend({}, settings||{}); 5171if(nodeName==="input"){ 5172this._connectDatepicker(target, inst); 5173}else if(inline){ 5174this._inlineDatepicker(target, inst); 5175}}, 5176_newInst: function (target, inline){ 5177var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); 5178return { 5179id: id, input: target, 5180selectedDay: 0, selectedMonth: 0, selectedYear: 0, 5181drawMonth: 0, drawYear: 0, 5182inline: inline, 5183dpDiv: (!inline ? this.dpDiv : 5184datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))) 5185};}, 5186_connectDatepicker: function (target, inst){ 5187var input=$(target); 5188inst.append=$([]); 5189inst.trigger=$([]); 5190if(input.hasClass(this.markerClassName)){ 5191return; 5192} 5193this._attachments(input, inst); 5194input.addClass(this.markerClassName).on("keydown", this._doKeyDown). 5195on("keypress", this._doKeyPress).on("keyup", this._doKeyUp); 5196this._autoSize(inst); 5197$.data(target, "datepicker", inst); 5198if(inst.settings.disabled){ 5199this._disableDatepicker(target); 5200}}, 5201_attachments: function (input, inst){ 5202var showOn, buttonText, buttonImage, 5203appendText=this._get(inst, "appendText"), 5204isRTL=this._get(inst, "isRTL"); 5205if(inst.append){ 5206inst.append.remove(); 5207} 5208if(appendText){ 5209inst.append=$("<span class='" + this._appendClass + "'>" + appendText + "</span>"); 5210input[isRTL ? "before":"after"](inst.append); 5211} 5212input.off("focus", this._showDatepicker); 5213if(inst.trigger){ 5214inst.trigger.remove(); 5215} 5216showOn=this._get(inst, "showOn"); 5217if(showOn==="focus"||showOn==="both"){ 5218input.on("focus", this._showDatepicker); 5219} 5220if(showOn==="button"||showOn==="both"){ 5221buttonText=this._get(inst, "buttonText"); 5222buttonImage=this._get(inst, "buttonImage"); 5223inst.trigger=$(this._get(inst, "buttonImageOnly") ? 5224$("<img/>").addClass(this._triggerClass). 5225attr({ src: buttonImage, alt: buttonText, title: buttonText }) : 5226$("<button type='button'></button>").addClass(this._triggerClass). 5227html(!buttonImage ? buttonText:$("<img/>").attr({ src: buttonImage, alt: buttonText, title: buttonText }))); 5228input[isRTL ? "before":"after"](inst.trigger); 5229inst.trigger.on("click", function (){ 5230if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){ 5231$.datepicker._hideDatepicker(); 5232}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){ 5233$.datepicker._hideDatepicker(); 5234$.datepicker._showDatepicker(input[0]); 5235}else{ 5236$.datepicker._showDatepicker(input[0]); 5237} 5238return false; 5239}); 5240}}, 5241_autoSize: function (inst){ 5242if(this._get(inst, "autoSize")&&!inst.inline){ 5243var findMax, max, maxI, i, 5244date=new Date(2009, 12 - 1, 20), 5245dateFormat=this._get(inst, "dateFormat"); 5246if(dateFormat.match(/[DM]/)){ 5247findMax=function (names){ 5248max=0; 5249maxI=0; 5250for (i=0; i < names.length; i++){ 5251if(names[i].length > max){ 5252max=names[i].length; 5253maxI=i; 5254}} 5255return maxI; 5256}; 5257date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? 5258"monthNames":"monthNamesShort")))); 5259date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? 5260"dayNames":"dayNamesShort"))) + 20 - date.getDay()); 5261} 5262inst.input.attr("size", this._formatDate(inst, date).length); 5263}}, 5264_inlineDatepicker: function (target, inst){ 5265var divSpan=$(target); 5266if(divSpan.hasClass(this.markerClassName)){ 5267return; 5268} 5269divSpan.addClass(this.markerClassName).append(inst.dpDiv); 5270$.data(target, "datepicker", inst); 5271this._setDate(inst, this._getDefaultDate(inst), true); 5272this._updateDatepicker(inst); 5273this._updateAlternate(inst); 5274if(inst.settings.disabled){ 5275this._disableDatepicker(target); 5276} 5277inst.dpDiv.css("display", "block"); 5278}, 5279_dialogDatepicker: function (input, date, onSelect, settings, pos){ 5280var id, browserWidth, browserHeight, scrollX, scrollY, 5281inst=this._dialogInst; 5282if(!inst){ 5283this.uuid +=1; 5284id="dp" + this.uuid; 5285this._dialogInput=$("<input type='text' id='" + id + 5286"' style='position: absolute; top: -100px; width: 0px;'/>"); 5287this._dialogInput.on("keydown", this._doKeyDown); 5288$("body").append(this._dialogInput); 5289inst=this._dialogInst=this._newInst(this._dialogInput, false); 5290inst.settings={}; 5291$.data(this._dialogInput[0], "datepicker", inst); 5292} 5293datepicker_extendRemove(inst.settings, settings||{}); 5294date=(date&&date.constructor===Date ? this._formatDate(inst, date):date); 5295this._dialogInput.val(date); 5296this._pos=(pos ? (pos.length ? pos:[pos.pageX, pos.pageY]):null); 5297if(!this._pos){ 5298browserWidth=document.documentElement.clientWidth; 5299browserHeight=document.documentElement.clientHeight; 5300scrollX=document.documentElement.scrollLeft||document.body.scrollLeft; 5301scrollY=document.documentElement.scrollTop||document.body.scrollTop; 5302this._pos = 5303[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; 5304} 5305this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); 5306inst.settings.onSelect=onSelect; 5307this._inDialog=true; 5308this.dpDiv.addClass(this._dialogClass); 5309this._showDatepicker(this._dialogInput[0]); 5310if($.blockUI){ 5311$.blockUI(this.dpDiv); 5312} 5313$.data(this._dialogInput[0], "datepicker", inst); 5314return this; 5315}, 5316_destroyDatepicker: function (target){ 5317var nodeName, 5318$target=$(target), 5319inst=$.data(target, "datepicker"); 5320if(!$target.hasClass(this.markerClassName)){ 5321return; 5322} 5323nodeName=target.nodeName.toLowerCase(); 5324$.removeData(target, "datepicker"); 5325if(nodeName==="input"){ 5326inst.append.remove(); 5327inst.trigger.remove(); 5328$target.removeClass(this.markerClassName). 5329off("focus", this._showDatepicker). 5330off("keydown", this._doKeyDown). 5331off("keypress", this._doKeyPress). 5332off("keyup", this._doKeyUp); 5333}else if(nodeName==="div"||nodeName==="span"){ 5334$target.removeClass(this.markerClassName).empty(); 5335} 5336if(datepicker_instActive===inst){ 5337datepicker_instActive=null; 5338}}, 5339_enableDatepicker: function (target){ 5340var nodeName, inline, 5341$target=$(target), 5342inst=$.data(target, "datepicker"); 5343if(!$target.hasClass(this.markerClassName)){ 5344return; 5345} 5346nodeName=target.nodeName.toLowerCase(); 5347if(nodeName==="input"){ 5348target.disabled=false; 5349inst.trigger.filter("button"). 5350each(function (){ this.disabled=false; }).end(). 5351filter("img").css({ opacity: "1.0", cursor: "" }); 5352}else if(nodeName==="div"||nodeName==="span"){ 5353inline=$target.children("." + this._inlineClass); 5354inline.children().removeClass("ui-state-disabled"); 5355inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). 5356prop("disabled", false); 5357} 5358this._disabledInputs=$.map(this._disabledInputs, 5359function (value){ return (value===target ? null:value); }); 5360}, 5361_disableDatepicker: function (target){ 5362var nodeName, inline, 5363$target=$(target), 5364inst=$.data(target, "datepicker"); 5365if(!$target.hasClass(this.markerClassName)){ 5366return; 5367} 5368nodeName=target.nodeName.toLowerCase(); 5369if(nodeName==="input"){ 5370target.disabled=true; 5371inst.trigger.filter("button"). 5372each(function (){ this.disabled=true; }).end(). 5373filter("img").css({ opacity: "0.5", cursor: "default" }); 5374}
vendor: 8,203 bytes, lines 5374-5642
5374else if(nodeName==="div"||nodeName==="span"){ 5375inline=$target.children("." + this._inlineClass); 5376inline.children().addClass("ui-state-disabled"); 5377inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). 5378prop("disabled", true); 5379} 5380this._disabledInputs=$.map(this._disabledInputs, 5381function (value){ return (value===target ? null:value); }); 5382this._disabledInputs[this._disabledInputs.length]=target; 5383}, 5384_isDisabledDatepicker: function (target){ 5385if(!target){ 5386return false; 5387} 5388for (var i=0; i < this._disabledInputs.length; i++){ 5389if(this._disabledInputs[i]===target){ 5390return true; 5391}} 5392return false; 5393}, 5394_getInst: function (target){ 5395try { 5396return $.data(target, "datepicker"); 5397} 5398catch (err){ 5399throw "Missing instance data for this datepicker"; 5400}}, 5401_optionDatepicker: function (target, name, value){ 5402var settings, date, minDate, maxDate, 5403inst=this._getInst(target); 5404if(arguments.length===2&&typeof name==="string"){ 5405return (name==="defaults" ? $.extend({}, $.datepicker._defaults) : 5406(inst ? (name==="all" ? $.extend({}, inst.settings) : 5407this._get(inst, name)):null)); 5408} 5409settings=name||{}; 5410if(typeof name==="string"){ 5411settings={}; 5412settings[name]=value; 5413} 5414if(inst){ 5415if(this._curInst===inst){ 5416this._hideDatepicker(); 5417} 5418date=this._getDateDatepicker(target, true); 5419minDate=this._getMinMaxDate(inst, "min"); 5420maxDate=this._getMinMaxDate(inst, "max"); 5421datepicker_extendRemove(inst.settings, settings); 5422if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){ 5423inst.settings.minDate=this._formatDate(inst, minDate); 5424} 5425if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){ 5426inst.settings.maxDate=this._formatDate(inst, maxDate); 5427} 5428if("disabled" in settings){ 5429if(settings.disabled){ 5430this._disableDatepicker(target); 5431}else{ 5432this._enableDatepicker(target); 5433}} 5434this._attachments($(target), inst); 5435this._autoSize(inst); 5436this._setDate(inst, date); 5437this._updateAlternate(inst); 5438this._updateDatepicker(inst); 5439}}, 5440_changeDatepicker: function (target, name, value){ 5441this._optionDatepicker(target, name, value); 5442}, 5443_refreshDatepicker: function (target){ 5444var inst=this._getInst(target); 5445if(inst){ 5446this._updateDatepicker(inst); 5447}}, 5448_setDateDatepicker: function (target, date){ 5449var inst=this._getInst(target); 5450if(inst){ 5451this._setDate(inst, date); 5452this._updateDatepicker(inst); 5453this._updateAlternate(inst); 5454}}, 5455_getDateDatepicker: function (target, noDefault){ 5456var inst=this._getInst(target); 5457if(inst&&!inst.inline){ 5458this._setDateFromField(inst, noDefault); 5459} 5460return (inst ? this._getDate(inst):null); 5461}, 5462_doKeyDown: function (event){ 5463var onSelect, dateStr, sel, 5464inst=$.datepicker._getInst(event.target), 5465handled=true, 5466isRTL=inst.dpDiv.is(".ui-datepicker-rtl"); 5467inst._keyEvent=true; 5468if($.datepicker._datepickerShowing){ 5469switch (event.keyCode){ 5470case 9: $.datepicker._hideDatepicker(); 5471handled=false; 5472break; 5473case 13: sel=$("td." + $.datepicker._dayOverClass + ":not(." + 5474$.datepicker._currentClass + ")", inst.dpDiv); 5475if(sel[0]){ 5476$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); 5477} 5478onSelect=$.datepicker._get(inst, "onSelect"); 5479if(onSelect){ 5480dateStr=$.datepicker._formatDate(inst); 5481onSelect.apply((inst.input ? inst.input[0]:null), [dateStr, inst]); 5482}else{ 5483$.datepicker._hideDatepicker(); 5484} 5485return false; 5486case 27: $.datepicker._hideDatepicker(); 5487break; 5488case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? 5489-$.datepicker._get(inst, "stepBigMonths") : 5490-$.datepicker._get(inst, "stepMonths")), "M"); 5491break; 5492case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? 5493+$.datepicker._get(inst, "stepBigMonths") : 5494+$.datepicker._get(inst, "stepMonths")), "M"); 5495break; 5496case 35: if(event.ctrlKey||event.metaKey){ 5497$.datepicker._clearDate(event.target); 5498} 5499handled=event.ctrlKey||event.metaKey; 5500break; 5501case 36: if(event.ctrlKey||event.metaKey){ 5502$.datepicker._gotoToday(event.target); 5503} 5504handled=event.ctrlKey||event.metaKey; 5505break; 5506case 37: if(event.ctrlKey||event.metaKey){ 5507$.datepicker._adjustDate(event.target, (isRTL ? +1:-1), "D"); 5508} 5509handled=event.ctrlKey||event.metaKey; 5510if(event.originalEvent.altKey){ 5511$.datepicker._adjustDate(event.target, (event.ctrlKey ? 5512-$.datepicker._get(inst, "stepBigMonths") : 5513-$.datepicker._get(inst, "stepMonths")), "M"); 5514} 5515break; 5516case 38: if(event.ctrlKey||event.metaKey){ 5517$.datepicker._adjustDate(event.target, -7, "D"); 5518} 5519handled=event.ctrlKey||event.metaKey; 5520break; 5521case 39: if(event.ctrlKey||event.metaKey){ 5522$.datepicker._adjustDate(event.target, (isRTL ? -1:+1), "D"); 5523} 5524handled=event.ctrlKey||event.metaKey; 5525if(event.originalEvent.altKey){ 5526$.datepicker._adjustDate(event.target, (event.ctrlKey ? 5527+$.datepicker._get(inst, "stepBigMonths") : 5528+$.datepicker._get(inst, "stepMonths")), "M"); 5529} 5530break; 5531case 40: if(event.ctrlKey||event.metaKey){ 5532$.datepicker._adjustDate(event.target, +7, "D"); 5533} 5534handled=event.ctrlKey||event.metaKey; 5535break; 5536default: handled=false; 5537}}else if(event.keyCode===36&&event.ctrlKey){ 5538$.datepicker._showDatepicker(this); 5539}else{ 5540handled=false; 5541} 5542if(handled){ 5543event.preventDefault(); 5544event.stopPropagation(); 5545}}, 5546_doKeyPress: function (event){ 5547var chars, chr, 5548inst=$.datepicker._getInst(event.target); 5549if($.datepicker._get(inst, "constrainInput")){ 5550chars=$.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); 5551chr=String.fromCharCode(event.charCode==null ? event.keyCode:event.charCode); 5552return event.ctrlKey||event.metaKey||(chr < " "||!chars||chars.indexOf(chr) > -1); 5553}}, 5554_doKeyUp: function (event){ 5555var date, 5556inst=$.datepicker._getInst(event.target); 5557if(inst.input.val()!==inst.lastVal){ 5558try { 5559date=$.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), 5560(inst.input ? inst.input.val():null), 5561$.datepicker._getFormatConfig(inst)); 5562if(date){ 5563$.datepicker._setDateFromField(inst); 5564$.datepicker._updateAlternate(inst); 5565$.datepicker._updateDatepicker(inst); 5566}} 5567catch (err){ 5568}} 5569return true; 5570}, 5571_showDatepicker: function (input){ 5572input=input.target||input; 5573if(input.nodeName.toLowerCase()!=="input"){ 5574input=$("input", input.parentNode)[0]; 5575} 5576if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){ 5577return; 5578} 5579var inst, beforeShow, beforeShowSettings, isFixed, 5580offset, showAnim, duration; 5581inst=$.datepicker._getInst(input); 5582if($.datepicker._curInst&&$.datepicker._curInst!==inst){ 5583$.datepicker._curInst.dpDiv.stop(true, true); 5584if(inst&&$.datepicker._datepickerShowing){ 5585$.datepicker._hideDatepicker($.datepicker._curInst.input[0]); 5586}} 5587beforeShow=$.datepicker._get(inst, "beforeShow"); 5588beforeShowSettings=beforeShow ? beforeShow.apply(input, [input, inst]):{}; 5589if(beforeShowSettings===false){ 5590return; 5591} 5592datepicker_extendRemove(inst.settings, beforeShowSettings); 5593inst.lastVal=null; 5594$.datepicker._lastInput=input; 5595$.datepicker._setDateFromField(inst); 5596if($.datepicker._inDialog){ 5597input.value=""; 5598} 5599if(!$.datepicker._pos){ 5600$.datepicker._pos=$.datepicker._findPos(input); 5601$.datepicker._pos[1] +=input.offsetHeight; 5602} 5603isFixed=false; 5604$(input).parents().each(function (){ 5605isFixed |=$(this).css("position")==="fixed"; 5606return !isFixed; 5607}); 5608offset={ left: $.datepicker._pos[0], top: $.datepicker._pos[1] }; 5609$.datepicker._pos=null; 5610inst.dpDiv.empty(); 5611inst.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }); 5612$.datepicker._updateDatepicker(inst); 5613offset=$.datepicker._checkOffset(inst, offset, isFixed); 5614inst.dpDiv.css({ 5615position: ($.datepicker._inDialog&&$.blockUI ? 5616"static":(isFixed ? "fixed":"absolute")), display: "none", 5617left: offset.left + "px", top: offset.top + "px" 5618}); 5619if(!inst.inline){ 5620showAnim=$.datepicker._get(inst, "showAnim"); 5621duration=$.datepicker._get(inst, "duration"); 5622inst.dpDiv.css("z-index", datepicker_getZindex($(input)) + 1); 5623$.datepicker._datepickerShowing=true; 5624if($.effects&&$.effects.effect[showAnim]){ 5625inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration); 5626}else{ 5627inst.dpDiv[showAnim||"show"](showAnim ? duration:null); 5628} 5629if($.datepicker._shouldFocusInput(inst)){ 5630inst.input.trigger("focus"); 5631} 5632$.datepicker._curInst=inst; 5633}}, 5634_updateDatepicker: function (inst){ 5635this.maxRows=4; 5636datepicker_instActive=inst; 5637inst.dpDiv.empty().append(this._generateHTML(inst)); 5638this._attachHandlers(inst); 5639var origyearshtml, 5640numMonths=this._getNumberOfMonths(inst), 5641cols=numMonths[1], 5642width=17,
vendor: 3,026 bytes, lines 5643-5717
5643activeCell=inst.dpDiv.find("." + this._dayOverClass + " a"); 5644if(activeCell.length > 0){ 5645datepicker_handleMouseover.apply(activeCell.get(0)); 5646} 5647inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); 5648if(cols > 1){ 5649inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); 5650} 5651inst.dpDiv[(numMonths[0]!==1||numMonths[1]!==1 ? "add":"remove") + 5652"Class"]("ui-datepicker-multi"); 5653inst.dpDiv[(this._get(inst, "isRTL") ? "add":"remove") + 5654"Class"]("ui-datepicker-rtl"); 5655if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)){ 5656inst.input.trigger("focus"); 5657} 5658if(inst.yearshtml){ 5659origyearshtml=inst.yearshtml; 5660setTimeout(function (){ 5661if(origyearshtml===inst.yearshtml&&inst.yearshtml){ 5662inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); 5663} 5664origyearshtml=inst.yearshtml=null; 5665}, 0); 5666}}, 5667_shouldFocusInput: function (inst){ 5668return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus"); 5669}, 5670_checkOffset: function (inst, offset, isFixed){ 5671var dpWidth=inst.dpDiv.outerWidth(), 5672dpHeight=inst.dpDiv.outerHeight(), 5673inputWidth=inst.input ? inst.input.outerWidth():0, 5674inputHeight=inst.input ? inst.input.outerHeight():0, 5675viewWidth=document.documentElement.clientWidth + (isFixed ? 0:$(document).scrollLeft()), 5676viewHeight=document.documentElement.clientHeight + (isFixed ? 0:$(document).scrollTop()); 5677offset.left -=(this._get(inst, "isRTL") ? (dpWidth - inputWidth):0); 5678offset.left -=(isFixed&&offset.left===inst.input.offset().left) ? $(document).scrollLeft():0; 5679offset.top -=(isFixed&&offset.top===(inst.input.offset().top + inputHeight)) ? $(document).scrollTop():0; 5680offset.left -=Math.min(offset.left, (offset.left + dpWidth > viewWidth&&viewWidth > dpWidth) ? 5681Math.abs(offset.left + dpWidth - viewWidth):0); 5682offset.top -=Math.min(offset.top, (offset.top + dpHeight > viewHeight&&viewHeight > dpHeight) ? 5683Math.abs(dpHeight + inputHeight):0); 5684return offset; 5685}, 5686_findPos: function (obj){ 5687var position, 5688inst=this._getInst(obj), 5689isRTL=this._get(inst, "isRTL"); 5690while (obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.filters.hidden(obj))){ 5691obj=obj[isRTL ? "previousSibling":"nextSibling"]; 5692} 5693position=$(obj).offset(); 5694return [position.left, position.top]; 5695}, 5696_hideDatepicker: function (input){ 5697var showAnim, duration, postProcess, onClose, 5698inst=this._curInst; 5699if(!inst||(input&&inst!==$.data(input, "datepicker"))){ 5700return; 5701} 5702if(this._datepickerShowing){ 5703showAnim=this._get(inst, "showAnim"); 5704duration=this._get(inst, "duration"); 5705postProcess=function (){ 5706$.datepicker._tidyDialog(inst); 5707}; 5708if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){ 5709inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess); 5710}else{ 5711inst.dpDiv[(showAnim==="slideDown" ? "slideUp" : 5712(showAnim==="fadeIn" ? "fadeOut":"hide"))]((showAnim ? duration:null), postProcess); 5713} 5714if(!showAnim){ 5715postProcess(); 5716} 5717this._datepickerShowing=false;
vendor: 4,240 bytes, lines 5718-5859
5718onClose=this._get(inst, "onClose"); 5719if(onClose){ 5720onClose.apply((inst.input ? inst.input[0]:null), [(inst.input ? inst.input.val():""), inst]); 5721} 5722this._lastInput=null; 5723if(this._inDialog){ 5724this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); 5725if($.blockUI){ 5726$.unblockUI(); 5727$("body").append(this.dpDiv); 5728}} 5729this._inDialog=false; 5730}}, 5731_tidyDialog: function (inst){ 5732inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar"); 5733}, 5734_checkExternalClick: function (event){ 5735if(!$.datepicker._curInst){ 5736return; 5737} 5738var $target=$(event.target), 5739inst=$.datepicker._getInst($target[0]); 5740if((($target[0].id!==$.datepicker._mainDivId && 5741$target.parents("#" + $.datepicker._mainDivId).length===0 && 5742!$target.hasClass($.datepicker.markerClassName) && 5743!$target.closest("." + $.datepicker._triggerClass).length && 5744$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))) || 5745($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst)){ 5746$.datepicker._hideDatepicker(); 5747}}, 5748_adjustDate: function (id, offset, period){ 5749var target=$(id), 5750inst=this._getInst(target[0]); 5751if(this._isDisabledDatepicker(target[0])){ 5752return; 5753} 5754this._adjustInstDate(inst, offset + 5755(period==="M" ? this._get(inst, "showCurrentAtPos"):0), 5756period); 5757this._updateDatepicker(inst); 5758}, 5759_gotoToday: function (id){ 5760var date, 5761target=$(id), 5762inst=this._getInst(target[0]); 5763if(this._get(inst, "gotoCurrent")&&inst.currentDay){ 5764inst.selectedDay=inst.currentDay; 5765inst.drawMonth=inst.selectedMonth=inst.currentMonth; 5766inst.drawYear=inst.selectedYear=inst.currentYear; 5767}else{ 5768date=new Date(); 5769inst.selectedDay=date.getDate(); 5770inst.drawMonth=inst.selectedMonth=date.getMonth(); 5771inst.drawYear=inst.selectedYear=date.getFullYear(); 5772} 5773this._notifyChange(inst); 5774this._adjustDate(target); 5775}, 5776_selectMonthYear: function (id, select, period){ 5777var target=$(id), 5778inst=this._getInst(target[0]); 5779inst["selected" + (period==="M" ? "Month":"Year")] = 5780inst["draw" + (period==="M" ? "Month":"Year")] = 5781parseInt(select.options[select.selectedIndex].value, 10); 5782this._notifyChange(inst); 5783this._adjustDate(target); 5784}, 5785_selectDay: function (id, month, year, td){ 5786var inst, 5787target=$(id); 5788if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){ 5789return; 5790} 5791inst=this._getInst(target[0]); 5792inst.selectedDay=inst.currentDay=$("a", td).html(); 5793inst.selectedMonth=inst.currentMonth=month; 5794inst.selectedYear=inst.currentYear=year; 5795this._selectDate(id, this._formatDate(inst, 5796inst.currentDay, inst.currentMonth, inst.currentYear)); 5797}, 5798_clearDate: function (id){ 5799var target=$(id); 5800this._selectDate(target, ""); 5801}, 5802_selectDate: function (id, dateStr){ 5803var onSelect, 5804target=$(id), 5805inst=this._getInst(target[0]); 5806dateStr=(dateStr!=null ? dateStr:this._formatDate(inst)); 5807if(inst.input){ 5808inst.input.val(dateStr); 5809} 5810this._updateAlternate(inst); 5811onSelect=this._get(inst, "onSelect"); 5812if(onSelect){ 5813onSelect.apply((inst.input ? inst.input[0]:null), [dateStr, inst]); 5814}else if(inst.input){ 5815inst.input.trigger("change"); 5816} 5817if(inst.inline){ 5818this._updateDatepicker(inst); 5819}else{ 5820this._hideDatepicker(); 5821this._lastInput=inst.input[0]; 5822if(typeof (inst.input[0])!=="object"){ 5823inst.input.trigger("focus"); 5824} 5825this._lastInput=null; 5826}}, 5827_updateAlternate: function (inst){ 5828var altFormat, date, dateStr, 5829altField=this._get(inst, "altField"); 5830if(altField){ 5831altFormat=this._get(inst, "altFormat")||this._get(inst, "dateFormat"); 5832date=this._getDate(inst); 5833dateStr=this.formatDate(altFormat, date, this._getFormatConfig(inst)); 5834$(altField).val(dateStr); 5835}}, 5836noWeekends: function (date){ 5837var day=date.getDay(); 5838return [(day > 0&&day < 6), ""]; 5839}, 5840iso8601Week: function (date){ 5841var time, 5842checkDate=new Date(date.getTime()); 5843checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay()||7)); 5844time=checkDate.getTime(); 5845checkDate.setMonth(0); 5846checkDate.setDate(1); 5847return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; 5848}, 5849parseDate: function (format, value, settings){ 5850if(format==null||value==null){ 5851throw "Invalid arguments"; 5852} 5853value=(typeof value==="object" ? value.toString():value + ""); 5854if(value===""){ 5855return null; 5856} 5857var iFormat, dim, extra, 5858iValue=0, 5859shortYearCutoffTemp=(settings ? settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,
vendor: 9,749 bytes, lines 5860-6233
5860shortYearCutoff=(typeof shortYearCutoffTemp!=="string" ? shortYearCutoffTemp : 5861new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), 5862dayNamesShort=(settings ? settings.dayNamesShort:null)||this._defaults.dayNamesShort, 5863dayNames=(settings ? settings.dayNames:null)||this._defaults.dayNames, 5864monthNamesShort=(settings ? settings.monthNamesShort:null)||this._defaults.monthNamesShort, 5865monthNames=(settings ? settings.monthNames:null)||this._defaults.monthNames, 5866year=-1, 5867month=-1, 5868day=-1, 5869doy=-1, 5870literal=false, 5871date, 5872lookAhead=function (match){ 5873var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match); 5874if(matches){ 5875iFormat++; 5876} 5877return matches; 5878}, 5879getNumber=function (match){ 5880var isDoubled=lookAhead(match), 5881size=(match==="@" ? 14:(match==="!" ? 20 : 5882(match==="y"&&isDoubled ? 4:(match==="o" ? 3:2)))), 5883minSize=(match==="y" ? size:1), 5884digits=new RegExp("^\\d{" + minSize + "," + size + "}"), 5885num=value.substring(iValue).match(digits); 5886if(!num){ 5887throw "Missing number at position " + iValue; 5888} 5889iValue +=num[0].length; 5890return parseInt(num[0], 10); 5891}, 5892getName=function (match, shortNames, longNames){ 5893var index=-1, 5894names=$.map(lookAhead(match) ? longNames:shortNames, function (v, k){ 5895return [[k, v]]; 5896}).sort(function (a, b){ 5897return -(a[1].length - b[1].length); 5898}); 5899$.each(names, function (i, pair){ 5900var name=pair[1]; 5901if(value.substr(iValue, name.length).toLowerCase()===name.toLowerCase()){ 5902index=pair[0]; 5903iValue +=name.length; 5904return false; 5905}}); 5906if(index!==-1){ 5907return index + 1; 5908}else{ 5909throw "Unknown name at position " + iValue; 5910}}, 5911checkLiteral=function (){ 5912if(value.charAt(iValue)!==format.charAt(iFormat)){ 5913throw "Unexpected literal at position " + iValue; 5914} 5915iValue++; 5916}; 5917for (iFormat=0; iFormat < format.length; iFormat++){ 5918if(literal){ 5919if(format.charAt(iFormat)==="'"&&!lookAhead("'")){ 5920literal=false; 5921}else{ 5922checkLiteral(); 5923}}else{ 5924switch (format.charAt(iFormat)){ 5925case "d": 5926day=getNumber("d"); 5927break; 5928case "D": 5929getName("D", dayNamesShort, dayNames); 5930break; 5931case "o": 5932doy=getNumber("o"); 5933break; 5934case "m": 5935month=getNumber("m"); 5936break; 5937case "M": 5938month=getName("M", monthNamesShort, monthNames); 5939break; 5940case "y": 5941year=getNumber("y"); 5942break; 5943case "@": 5944date=new Date(getNumber("@")); 5945year=date.getFullYear(); 5946month=date.getMonth() + 1; 5947day=date.getDate(); 5948break; 5949case "!": 5950date=new Date((getNumber("!") - this._ticksTo1970) / 10000); 5951year=date.getFullYear(); 5952month=date.getMonth() + 1; 5953day=date.getDate(); 5954break; 5955case "'": 5956if(lookAhead("'")){ 5957checkLiteral(); 5958}else{ 5959literal=true; 5960} 5961break; 5962default: 5963checkLiteral(); 5964}} 5965} 5966if(iValue < value.length){ 5967extra=value.substr(iValue); 5968if(!/^\s+/.test(extra)){ 5969throw "Extra/unparsed characters found in date: " + extra; 5970}} 5971if(year===-1){ 5972year=new Date().getFullYear(); 5973}else if(year < 100){ 5974year +=new Date().getFullYear() - new Date().getFullYear() % 100 + 5975(year <=shortYearCutoff ? 0:-100); 5976} 5977if(doy > -1){ 5978month=1; 5979day=doy; 5980do { 5981dim=this._getDaysInMonth(year, month - 1); 5982if(day <=dim){ 5983break; 5984} 5985month++; 5986day -=dim; 5987} while (true); 5988} 5989date=this._daylightSavingAdjust(new Date(year, month - 1, day)); 5990if(date.getFullYear()!==year||date.getMonth() + 1!==month||date.getDate()!==day){ 5991throw "Invalid date"; 5992} 5993return date; 5994}, 5995ATOM: "yy-mm-dd", 5996COOKIE: "D, dd M yy", 5997ISO_8601: "yy-mm-dd", 5998RFC_822: "D, d M y", 5999RFC_850: "DD, dd-M-y", 6000RFC_1036: "D, d M y", 6001RFC_1123: "D, d M yy", 6002RFC_2822: "D, d M yy", 6003RSS: "D, d M y", 6004TICKS: "!", 6005TIMESTAMP: "@", 6006W3C: "yy-mm-dd", 6007_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + 6008Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), 6009formatDate: function (format, date, settings){ 6010if(!date){ 6011return ""; 6012} 6013var iFormat, 6014dayNamesShort=(settings ? settings.dayNamesShort:null)||this._defaults.dayNamesShort, 6015dayNames=(settings ? settings.dayNames:null)||this._defaults.dayNames, 6016monthNamesShort=(settings ? settings.monthNamesShort:null)||this._defaults.monthNamesShort, 6017monthNames=(settings ? settings.monthNames:null)||this._defaults.monthNames, 6018lookAhead=function (match){ 6019var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match); 6020if(matches){ 6021iFormat++; 6022} 6023return matches; 6024}, 6025formatNumber=function (match, value, len){ 6026var num="" + value; 6027if(lookAhead(match)){ 6028while (num.length < len){ 6029num="0" + num; 6030}} 6031return num; 6032}, 6033formatName=function (match, value, shortNames, longNames){ 6034return (lookAhead(match) ? longNames[value]:shortNames[value]); 6035}, 6036output="", 6037literal=false; 6038if(date){ 6039for (iFormat=0; iFormat < format.length; iFormat++){ 6040if(literal){ 6041if(format.charAt(iFormat)==="'"&&!lookAhead("'")){ 6042literal=false; 6043}else{ 6044output +=format.charAt(iFormat); 6045}}else{ 6046switch (format.charAt(iFormat)){ 6047case "d": 6048output +=formatNumber("d", date.getDate(), 2); 6049break; 6050case "D": 6051output +=formatName("D", date.getDay(), dayNamesShort, dayNames); 6052break; 6053case "o": 6054output +=formatNumber("o", 6055Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); 6056break; 6057case "m": 6058output +=formatNumber("m", date.getMonth() + 1, 2); 6059break; 6060case "M": 6061output +=formatName("M", date.getMonth(), monthNamesShort, monthNames); 6062break; 6063case "y": 6064output +=(lookAhead("y") ? date.getFullYear() : 6065(date.getYear() % 100 < 10 ? "0":"") + date.getYear() % 100); 6066break; 6067case "@": 6068output +=date.getTime(); 6069break; 6070case "!": 6071output +=date.getTime() * 10000 + this._ticksTo1970; 6072break; 6073case "'": 6074if(lookAhead("'")){ 6075output +="'"; 6076}else{ 6077literal=true; 6078} 6079break; 6080default: 6081output +=format.charAt(iFormat); 6082}} 6083}} 6084return output; 6085}, 6086_possibleChars: function (format){ 6087var iFormat, 6088chars="", 6089literal=false, 6090lookAhead=function (match){ 6091var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match); 6092if(matches){ 6093iFormat++; 6094} 6095return matches; 6096}; 6097for (iFormat=0; iFormat < format.length; iFormat++){ 6098if(literal){ 6099if(format.charAt(iFormat)==="'"&&!lookAhead("'")){ 6100literal=false; 6101}else{ 6102chars +=format.charAt(iFormat); 6103}}else{ 6104switch (format.charAt(iFormat)){ 6105case "d": case "m": case "y": case "@": 6106chars +="0123456789"; 6107break; 6108case "D": case "M": 6109return null; 6110case "'": 6111if(lookAhead("'")){ 6112chars +="'"; 6113}else{ 6114literal=true; 6115} 6116break; 6117default: 6118chars +=format.charAt(iFormat); 6119}} 6120} 6121return chars; 6122}, 6123_get: function (inst, name){ 6124return inst.settings[name]!==undefined ? 6125inst.settings[name]:this._defaults[name]; 6126}, 6127_setDateFromField: function (inst, noDefault){ 6128if(inst.input.val()===inst.lastVal){ 6129return; 6130} 6131var dateFormat=this._get(inst, "dateFormat"), 6132dates=inst.lastVal=inst.input ? inst.input.val():null, 6133defaultDate=this._getDefaultDate(inst), 6134date=defaultDate, 6135settings=this._getFormatConfig(inst); 6136try { 6137date=this.parseDate(dateFormat, dates, settings)||defaultDate; 6138} catch (event){ 6139dates=(noDefault ? "":dates); 6140} 6141inst.selectedDay=date.getDate(); 6142inst.drawMonth=inst.selectedMonth=date.getMonth(); 6143inst.drawYear=inst.selectedYear=date.getFullYear(); 6144inst.currentDay=(dates ? date.getDate():0); 6145inst.currentMonth=(dates ? date.getMonth():0); 6146inst.currentYear=(dates ? date.getFullYear():0); 6147this._adjustInstDate(inst); 6148}, 6149_getDefaultDate: function (inst){ 6150return this._restrictMinMax(inst, 6151this._determineDate(inst, this._get(inst, "defaultDate"), new Date())); 6152}, 6153_determineDate: function (inst, date, defaultDate){ 6154var offsetNumeric=function (offset){ 6155var date=new Date(); 6156date.setDate(date.getDate() + offset); 6157return date; 6158}, 6159offsetString=function (offset){ 6160try { 6161return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), 6162offset, $.datepicker._getFormatConfig(inst)); 6163} 6164catch (e){ 6165} 6166var date=(offset.toLowerCase().match(/^c/) ? 6167$.datepicker._getDate(inst):null)||new Date(), 6168year=date.getFullYear(), 6169month=date.getMonth(), 6170day=date.getDate(), 6171pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, 6172matches=pattern.exec(offset); 6173while (matches){ 6174switch (matches[2]||"d"){ 6175case "d": case "D": 6176day +=parseInt(matches[1], 10); break; 6177case "w": case "W": 6178day +=parseInt(matches[1], 10) * 7; break; 6179case "m": case "M": 6180month +=parseInt(matches[1], 10); 6181day=Math.min(day, $.datepicker._getDaysInMonth(year, month)); 6182break; 6183case "y": case "Y": 6184year +=parseInt(matches[1], 10); 6185day=Math.min(day, $.datepicker._getDaysInMonth(year, month)); 6186break; 6187} 6188matches=pattern.exec(offset); 6189} 6190return new Date(year, month, day); 6191}, 6192newDate=(date==null||date==="" ? defaultDate:(typeof date==="string" ? offsetString(date) : 6193(typeof date==="number" ? (isNaN(date) ? defaultDate:offsetNumeric(date)):new Date(date.getTime())))); 6194newDate=(newDate&&newDate.toString()==="Invalid Date" ? defaultDate:newDate); 6195if(newDate){ 6196newDate.setHours(0); 6197newDate.setMinutes(0); 6198newDate.setSeconds(0); 6199newDate.setMilliseconds(0); 6200} 6201return this._daylightSavingAdjust(newDate); 6202}, 6203_daylightSavingAdjust: function (date){ 6204if(!date){ 6205return null; 6206} 6207date.setHours(date.getHours() > 12 ? date.getHours() + 2:0); 6208return date; 6209}, 6210_setDate: function (inst, date, noChange){ 6211var clear = !date, 6212origMonth=inst.selectedMonth, 6213origYear=inst.selectedYear, 6214newDate=this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); 6215inst.selectedDay=inst.currentDay=newDate.getDate(); 6216inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth(); 6217inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear(); 6218if((origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){ 6219this._notifyChange(inst); 6220} 6221this._adjustInstDate(inst); 6222if(inst.input){ 6223inst.input.val(clear ? "":this._formatDate(inst)); 6224}}, 6225_getDate: function (inst){ 6226var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="") ? null : 6227this._daylightSavingAdjust(new Date( 6228inst.currentYear, inst.currentMonth, inst.currentDay))); 6229return startDate; 6230}, 6231_attachHandlers: function (inst){ 6232var stepMonths=this._get(inst, "stepMonths"), 6233id="#" + inst.id.replace(/\\\\/g, "\\");
vendor: 4,107 bytes, lines 6234-6322
6234inst.dpDiv.find("[data-handler]").map(function (){ 6235var handler={ 6236prev: function (){ 6237$.datepicker._adjustDate(id, -stepMonths, "M"); 6238}, 6239next: function (){ 6240$.datepicker._adjustDate(id, +stepMonths, "M"); 6241}, 6242hide: function (){ 6243$.datepicker._hideDatepicker(); 6244}, 6245today: function (){ 6246$.datepicker._gotoToday(id); 6247}, 6248selectDay: function (){ 6249$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); 6250return false; 6251}, 6252selectMonth: function (){ 6253$.datepicker._selectMonthYear(id, this, "M"); 6254return false; 6255}, 6256selectYear: function (){ 6257$.datepicker._selectMonthYear(id, this, "Y"); 6258return false; 6259}}; 6260$(this).on(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]); 6261}); 6262}, 6263_generateHTML: function (inst){ 6264var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, 6265controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, 6266monthNames, monthNamesShort, beforeShowDay, showOtherMonths, 6267selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, 6268cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, 6269printDate, dRow, tbody, daySettings, otherMonth, unselectable, 6270tempDate=new Date(), 6271today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), 6272isRTL=this._get(inst, "isRTL"), 6273showButtonPanel=this._get(inst, "showButtonPanel"), 6274hideIfNoPrevNext=this._get(inst, "hideIfNoPrevNext"), 6275navigationAsDateFormat=this._get(inst, "navigationAsDateFormat"), 6276numMonths=this._getNumberOfMonths(inst), 6277showCurrentAtPos=this._get(inst, "showCurrentAtPos"), 6278stepMonths=this._get(inst, "stepMonths"), 6279isMultiMonth=(numMonths[0]!==1||numMonths[1]!==1), 6280currentDate=this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : 6281new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), 6282minDate=this._getMinMaxDate(inst, "min"), 6283maxDate=this._getMinMaxDate(inst, "max"), 6284drawMonth=inst.drawMonth - showCurrentAtPos, 6285drawYear=inst.drawYear; 6286if(drawMonth < 0){ 6287drawMonth +=12; 6288drawYear--; 6289} 6290if(maxDate){ 6291maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(), 6292maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); 6293maxDraw=(minDate&&maxDraw < minDate ? minDate:maxDraw); 6294while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw){ 6295drawMonth--; 6296if(drawMonth < 0){ 6297drawMonth=11; 6298drawYear--; 6299}} 6300} 6301inst.drawMonth=drawMonth; 6302inst.drawYear=drawYear; 6303prevText=this._get(inst, "prevText"); 6304prevText=(!navigationAsDateFormat ? prevText:this.formatDate(prevText, 6305this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), 6306this._getFormatConfig(inst))); 6307prev=(this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? 6308"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + 6309" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e":"w") + "'>" + prevText + "</span></a>" : 6310(hideIfNoPrevNext ? "":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e":"w") + "'>" + prevText + "</span></a>")); 6311nextText=this._get(inst, "nextText"); 6312nextText=(!navigationAsDateFormat ? nextText:this.formatDate(nextText, 6313this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), 6314this._getFormatConfig(inst))); 6315next=(this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? 6316"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + 6317" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w":"e") + "'>" + nextText + "</span></a>" : 6318(hideIfNoPrevNext ? "":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w":"e") + "'>" + nextText + "</span></a>")); 6319currentText=this._get(inst, "currentText"); 6320gotoDate=(this._get(inst, "gotoCurrent")&&inst.currentDay ? currentDate:today); 6321currentText=(!navigationAsDateFormat ? currentText : 6322this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
vendor: 26,568 bytes, lines 6323-7109
6323controls=(!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + 6324this._get(inst, "closeText") + "</button>":""); 6325buttonPanel=(showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls:"") + 6326(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + 6327">" + currentText + "</button>":"") + (isRTL ? "":controls) + "</div>":""; 6328firstDay=parseInt(this._get(inst, "firstDay"), 10); 6329firstDay=(isNaN(firstDay) ? 0:firstDay); 6330showWeek=this._get(inst, "showWeek"); 6331dayNames=this._get(inst, "dayNames"); 6332dayNamesMin=this._get(inst, "dayNamesMin"); 6333monthNames=this._get(inst, "monthNames"); 6334monthNamesShort=this._get(inst, "monthNamesShort"); 6335beforeShowDay=this._get(inst, "beforeShowDay"); 6336showOtherMonths=this._get(inst, "showOtherMonths"); 6337selectOtherMonths=this._get(inst, "selectOtherMonths"); 6338defaultDate=this._getDefaultDate(inst); 6339html=""; 6340for (row=0; row < numMonths[0]; row++){ 6341group=""; 6342this.maxRows=4; 6343for (col=0; col < numMonths[1]; col++){ 6344selectedDate=this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); 6345cornerClass=" ui-corner-all"; 6346calender=""; 6347if(isMultiMonth){ 6348calender +="<div class='ui-datepicker-group"; 6349if(numMonths[1] > 1){ 6350switch (col){ 6351case 0: calender +=" ui-datepicker-group-first"; 6352cornerClass=" ui-corner-" + (isRTL ? "right":"left"); break; 6353case numMonths[1] - 1: calender +=" ui-datepicker-group-last"; 6354cornerClass=" ui-corner-" + (isRTL ? "left":"right"); break; 6355default: calender +=" ui-datepicker-group-middle"; cornerClass=""; break; 6356}} 6357calender +="'>"; 6358} 6359calender +="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + 6360(/all|left/.test(cornerClass)&&row===0 ? (isRTL ? next:prev):"") + 6361(/all|right/.test(cornerClass)&&row===0 ? (isRTL ? prev:next):"") + 6362this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, 6363row > 0||col > 0, monthNames, monthNamesShort) + 6364"</div><table class='ui-datepicker-calendar'><thead>" + 6365"<tr>"; 6366thead=(showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>":""); 6367for (dow=0; dow < 7; dow++){ 6368day=(dow + firstDay) % 7; 6369thead +="<th scope='col'" + ((dow + firstDay + 6) % 7 >=5 ? " class='ui-datepicker-week-end'":"") + ">" + 6370"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>"; 6371} 6372calender +=thead + "</tr></thead><tbody>"; 6373daysInMonth=this._getDaysInMonth(drawYear, drawMonth); 6374if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){ 6375inst.selectedDay=Math.min(inst.selectedDay, daysInMonth); 6376} 6377leadDays=(this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; 6378curRows=Math.ceil((leadDays + daysInMonth) / 7); 6379numRows=(isMultiMonth ? this.maxRows > curRows ? this.maxRows:curRows:curRows); 6380this.maxRows=numRows; 6381printDate=this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); 6382for (dRow=0; dRow < numRows; dRow++){ 6383calender +="<tr>"; 6384tbody=(!showWeek ? "":"<td class='ui-datepicker-week-col'>" + 6385this._get(inst, "calculateWeek")(printDate) + "</td>"); 6386for (dow=0; dow < 7; dow++){ 6387daySettings=(beforeShowDay ? 6388beforeShowDay.apply((inst.input ? inst.input[0]:null), [printDate]):[true, ""]); 6389otherMonth=(printDate.getMonth()!==drawMonth); 6390unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0] || 6391(minDate&&printDate < minDate)||(maxDate&&printDate > maxDate); 6392tbody +="<td class='" + 6393((dow + firstDay + 6) % 7 >=5 ? " ui-datepicker-week-end":"") + 6394(otherMonth ? " ui-datepicker-other-month":"") + 6395((printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent) || 6396(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime()) ? 6397" " + this._dayOverClass:"") + 6398(unselectable ? " " + this._unselectableClass + " ui-state-disabled":"") + 6399(otherMonth&&!showOtherMonths ? "":" " + daySettings[1] + 6400(printDate.getTime()===currentDate.getTime() ? " " + this._currentClass:"") + 6401(printDate.getTime()===today.getTime() ? " ui-datepicker-today":"")) + "'" + 6402((!otherMonth||showOtherMonths)&&daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "'") + "'":"") + 6403(unselectable ? "":" data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + 6404(otherMonth&&!showOtherMonths ? " " : 6405(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>":"<a class='ui-state-default" + 6406(printDate.getTime()===today.getTime() ? " ui-state-highlight":"") + 6407(printDate.getTime()===currentDate.getTime() ? " ui-state-active":"") + 6408(otherMonth ? " ui-priority-secondary":"") + 6409"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; 6410printDate.setDate(printDate.getDate() + 1); 6411printDate=this._daylightSavingAdjust(printDate); 6412} 6413calender +=tbody + "</tr>"; 6414} 6415drawMonth++; 6416if(drawMonth > 11){ 6417drawMonth=0; 6418drawYear++; 6419} 6420calender +="</tbody></table>" + (isMultiMonth ? "</div>" + 6421((numMonths[0] > 0&&col===numMonths[1] - 1) ? "<div class='ui-datepicker-row-break'></div>":""):""); 6422group +=calender; 6423} 6424html +=group; 6425} 6426html +=buttonPanel; 6427inst._keyEvent=false; 6428return html; 6429}, 6430_generateMonthYearHeader: function (inst, drawMonth, drawYear, minDate, maxDate, 6431secondary, monthNames, monthNamesShort){ 6432var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, 6433changeMonth=this._get(inst, "changeMonth"), 6434changeYear=this._get(inst, "changeYear"), 6435showMonthAfterYear=this._get(inst, "showMonthAfterYear"), 6436html="<div class='ui-datepicker-title'>", 6437monthHtml=""; 6438if(secondary||!changeMonth){ 6439monthHtml +="<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>"; 6440}else{ 6441inMinYear=(minDate&&minDate.getFullYear()===drawYear); 6442inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear); 6443monthHtml +="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>"; 6444for (month=0; month < 12; month++){ 6445if((!inMinYear||month >=minDate.getMonth())&&(!inMaxYear||month <=maxDate.getMonth())){ 6446monthHtml +="<option value='" + month + "'" + 6447(month===drawMonth ? " selected='selected'":"") + 6448">" + monthNamesShort[month] + "</option>"; 6449}} 6450monthHtml +="</select>"; 6451} 6452if(!showMonthAfterYear){ 6453html +=monthHtml + (secondary||!(changeMonth&&changeYear) ? " ":""); 6454} 6455if(!inst.yearshtml){ 6456inst.yearshtml=""; 6457if(secondary||!changeYear){ 6458html +="<span class='ui-datepicker-year'>" + drawYear + "</span>"; 6459}else{ 6460years=this._get(inst, "yearRange").split(":"); 6461thisYear=new Date().getFullYear(); 6462determineYear=function (value){ 6463var year=(value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : 6464(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : 6465parseInt(value, 10))); 6466return (isNaN(year) ? thisYear:year); 6467}; 6468year=determineYear(years[0]); 6469endYear=Math.max(year, determineYear(years[1]||"")); 6470year=(minDate ? Math.max(year, minDate.getFullYear()):year); 6471endYear=(maxDate ? Math.min(endYear, maxDate.getFullYear()):endYear); 6472inst.yearshtml +="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; 6473for (; year <=endYear; year++){ 6474inst.yearshtml +="<option value='" + year + "'" + 6475(year===drawYear ? " selected='selected'":"") + 6476">" + year + "</option>"; 6477} 6478inst.yearshtml +="</select>"; 6479html +=inst.yearshtml; 6480inst.yearshtml=null; 6481}} 6482html +=this._get(inst, "yearSuffix"); 6483if(showMonthAfterYear){ 6484html +=(secondary||!(changeMonth&&changeYear) ? " ":"") + monthHtml; 6485} 6486html +="</div>"; 6487return html; 6488}, 6489_adjustInstDate: function (inst, offset, period){ 6490var year=inst.drawYear + (period==="Y" ? offset:0), 6491month=inst.drawMonth + (period==="M" ? offset:0), 6492day=Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period==="D" ? offset:0), 6493date=this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); 6494inst.selectedDay=date.getDate(); 6495inst.drawMonth=inst.selectedMonth=date.getMonth(); 6496inst.drawYear=inst.selectedYear=date.getFullYear(); 6497if(period==="M"||period==="Y"){ 6498this._notifyChange(inst); 6499}}, 6500_restrictMinMax: function (inst, date){ 6501var minDate=this._getMinMaxDate(inst, "min"), 6502maxDate=this._getMinMaxDate(inst, "max"), 6503newDate=(minDate&&date < minDate ? minDate:date); 6504return (maxDate&&newDate > maxDate ? maxDate:newDate); 6505}, 6506_notifyChange: function (inst){ 6507var onChange=this._get(inst, "onChangeMonthYear"); 6508if(onChange){ 6509onChange.apply((inst.input ? inst.input[0]:null), 6510[inst.selectedYear, inst.selectedMonth + 1, inst]); 6511}}, 6512_getNumberOfMonths: function (inst){ 6513var numMonths=this._get(inst, "numberOfMonths"); 6514return (numMonths==null ? [1, 1]:(typeof numMonths==="number" ? [1, numMonths]:numMonths)); 6515}, 6516_getMinMaxDate: function (inst, minMax){ 6517return this._determineDate(inst, this._get(inst, minMax + "Date"), null); 6518}, 6519_getDaysInMonth: function (year, month){ 6520return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); 6521}, 6522_getFirstDayOfMonth: function (year, month){ 6523return new Date(year, month, 1).getDay(); 6524}, 6525_canAdjustMonth: function (inst, offset, curYear, curMonth){ 6526var numMonths=this._getNumberOfMonths(inst), 6527date=this._daylightSavingAdjust(new Date(curYear, 6528curMonth + (offset < 0 ? offset:numMonths[0] * numMonths[1]), 1)); 6529if(offset < 0){ 6530date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); 6531} 6532return this._isInRange(inst, date); 6533}, 6534_isInRange: function (inst, date){ 6535var yearSplit, currentYear, 6536minDate=this._getMinMaxDate(inst, "min"), 6537maxDate=this._getMinMaxDate(inst, "max"), 6538minYear=null, 6539maxYear=null, 6540years=this._get(inst, "yearRange"); 6541if(years){ 6542yearSplit=years.split(":"); 6543currentYear=new Date().getFullYear(); 6544minYear=parseInt(yearSplit[0], 10); 6545maxYear=parseInt(yearSplit[1], 10); 6546if(yearSplit[0].match(/[+\-].*/)){ 6547minYear +=currentYear; 6548} 6549if(yearSplit[1].match(/[+\-].*/)){ 6550maxYear +=currentYear; 6551}} 6552return ((!minDate||date.getTime() >=minDate.getTime()) && 6553(!maxDate||date.getTime() <=maxDate.getTime()) && 6554(!minYear||date.getFullYear() >=minYear) && 6555(!maxYear||date.getFullYear() <=maxYear)); 6556}, 6557_getFormatConfig: function (inst){ 6558var shortYearCutoff=this._get(inst, "shortYearCutoff"); 6559shortYearCutoff=(typeof shortYearCutoff!=="string" ? shortYearCutoff : 6560new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); 6561return { 6562shortYearCutoff: shortYearCutoff, 6563dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), 6564monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames") 6565};}, 6566_formatDate: function (inst, day, month, year){ 6567if(!day){ 6568inst.currentDay=inst.selectedDay; 6569inst.currentMonth=inst.selectedMonth; 6570inst.currentYear=inst.selectedYear; 6571} 6572var date=(day ? (typeof day==="object" ? day : 6573this._daylightSavingAdjust(new Date(year, month, day))) : 6574this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); 6575return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); 6576}}); 6577function datepicker_bindHover(dpDiv){ 6578var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; 6579return dpDiv.on("mouseout", selector, function (){ 6580$(this).removeClass("ui-state-hover"); 6581if(this.className.indexOf("ui-datepicker-prev")!==-1){ 6582$(this).removeClass("ui-datepicker-prev-hover"); 6583} 6584if(this.className.indexOf("ui-datepicker-next")!==-1){ 6585$(this).removeClass("ui-datepicker-next-hover"); 6586}}) 6587.on("mouseover", selector, datepicker_handleMouseover); 6588} 6589function datepicker_handleMouseover(){ 6590if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])){ 6591$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); 6592$(this).addClass("ui-state-hover"); 6593if(this.className.indexOf("ui-datepicker-prev")!==-1){ 6594$(this).addClass("ui-datepicker-prev-hover"); 6595} 6596if(this.className.indexOf("ui-datepicker-next")!==-1){ 6597$(this).addClass("ui-datepicker-next-hover"); 6598}} 6599} 6600function datepicker_extendRemove(target, props){ 6601$.extend(target, props); 6602for (var name in props){ 6603if(props[name]==null){ 6604target[name]=props[name]; 6605}} 6606return target; 6607} 6608$.fn.datepicker=function (options){ 6609if(!this.length){ 6610return this; 6611} 6612if(!$.datepicker.initialized){ 6613$(document).on("mousedown", $.datepicker._checkExternalClick); 6614$.datepicker.initialized=true; 6615} 6616if($("#" + $.datepicker._mainDivId).length===0){ 6617$("body").append($.datepicker.dpDiv); 6618} 6619var otherArgs=Array.prototype.slice.call(arguments, 1); 6620if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){ 6621return $.datepicker["_" + options + "Datepicker"]. 6622apply($.datepicker, [this[0]].concat(otherArgs)); 6623} 6624if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){ 6625return $.datepicker["_" + options + "Datepicker"]. 6626apply($.datepicker, [this[0]].concat(otherArgs)); 6627} 6628return this.each(function (){ 6629typeof options==="string" ? 6630$.datepicker["_" + options + "Datepicker"]. 6631apply($.datepicker, [this].concat(otherArgs)) : 6632$.datepicker._attachDatepicker(this, options); 6633}); 6634}; 6635$.datepicker=new Datepicker(); 6636$.datepicker.initialized=false; 6637$.datepicker.uuid=new Date().getTime(); 6638$.datepicker.version="@VERSION"; 6639return $.datepicker; 6640})); 6641(function (factory){ 6642if(typeof define==="function"&&define.amd){ 6643define('ui/widgets/mouse.js', [ 6644"jquery", 6645"../ie", 6646"../version", 6647"../widget" 6648], factory); 6649}else{ 6650factory(jQuery); 6651}}(function ($){ 6652var mouseHandled=false; 6653$(document).on("mouseup", function (){ 6654mouseHandled=false; 6655}); 6656return $.widget("ui.mouse", { 6657version: "@VERSION", 6658options: { 6659cancel: "input, textarea, button, select, option", 6660distance: 1, 6661delay: 0 6662}, 6663_mouseInit: function (){ 6664var that=this; 6665this.element 6666.on("mousedown." + this.widgetName, function (event){ 6667return that._mouseDown(event); 6668}) 6669.on("click." + this.widgetName, function (event){ 6670if(true===$.data(event.target, that.widgetName + ".preventClickEvent")){ 6671$.removeData(event.target, that.widgetName + ".preventClickEvent"); 6672event.stopImmediatePropagation(); 6673return false; 6674}}); 6675this.started=false; 6676}, 6677_mouseDestroy: function (){ 6678this.element.off("." + this.widgetName); 6679if(this._mouseMoveDelegate){ 6680this.document 6681.off("mousemove." + this.widgetName, this._mouseMoveDelegate) 6682.off("mouseup." + this.widgetName, this._mouseUpDelegate); 6683}}, 6684_mouseDown: function (event){ 6685if(mouseHandled){ 6686return; 6687} 6688this._mouseMoved=false; 6689(this._mouseStarted&&this._mouseUp(event)); 6690this._mouseDownEvent=event; 6691var that=this, 6692btnIsLeft=(event.which===1), 6693elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName ? $(event.target).closest(this.options.cancel).length:false); 6694if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){ 6695return true; 6696} 6697this.mouseDelayMet = !this.options.delay; 6698if(!this.mouseDelayMet){ 6699this._mouseDelayTimer=setTimeout(function (){ 6700that.mouseDelayMet=true; 6701}, this.options.delay); 6702} 6703if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){ 6704this._mouseStarted=(this._mouseStart(event)!==false); 6705if(!this._mouseStarted){ 6706event.preventDefault(); 6707return true; 6708}} 6709if(true===$.data(event.target, this.widgetName + ".preventClickEvent")){ 6710$.removeData(event.target, this.widgetName + ".preventClickEvent"); 6711} 6712this._mouseMoveDelegate=function (event){ 6713return that._mouseMove(event); 6714}; 6715this._mouseUpDelegate=function (event){ 6716return that._mouseUp(event); 6717}; 6718this.document 6719.on("mousemove." + this.widgetName, this._mouseMoveDelegate) 6720.on("mouseup." + this.widgetName, this._mouseUpDelegate); 6721event.preventDefault(); 6722mouseHandled=true; 6723return true; 6724}, 6725_mouseMove: function (event){ 6726if(this._mouseMoved){ 6727if($.ui.ie&&(!document.documentMode||document.documentMode < 9)&&!event.button){ 6728return this._mouseUp(event); 6729}else if(!event.which){ 6730if(event.originalEvent.altKey||event.originalEvent.ctrlKey || 6731event.originalEvent.metaKey||event.originalEvent.shiftKey){ 6732this.ignoreMissingWhich=true; 6733}else if(!this.ignoreMissingWhich){ 6734return this._mouseUp(event); 6735}} 6736} 6737if(event.which||event.button){ 6738this._mouseMoved=true; 6739} 6740if(this._mouseStarted){ 6741this._mouseDrag(event); 6742return event.preventDefault(); 6743} 6744if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){ 6745this._mouseStarted = 6746(this._mouseStart(this._mouseDownEvent, event)!==false); 6747(this._mouseStarted ? this._mouseDrag(event):this._mouseUp(event)); 6748} 6749return !this._mouseStarted; 6750}, 6751_mouseUp: function (event){ 6752this.document 6753.off("mousemove." + this.widgetName, this._mouseMoveDelegate) 6754.off("mouseup." + this.widgetName, this._mouseUpDelegate); 6755if(this._mouseStarted){ 6756this._mouseStarted=false; 6757if(event.target===this._mouseDownEvent.target){ 6758$.data(event.target, this.widgetName + ".preventClickEvent", true); 6759} 6760this._mouseStop(event); 6761} 6762if(this._mouseDelayTimer){ 6763clearTimeout(this._mouseDelayTimer); 6764delete this._mouseDelayTimer; 6765} 6766this.ignoreMissingWhich=false; 6767mouseHandled=false; 6768event.preventDefault(); 6769}, 6770_mouseDistanceMet: function (event){ 6771return (Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), 6772Math.abs(this._mouseDownEvent.pageY - event.pageY) 6773) >=this.options.distance 6774); 6775}, 6776_mouseDelayMet: function(){ 6777return this.mouseDelayMet; 6778}, 6779_mouseStart: function(){ }, 6780_mouseDrag: function(){ }, 6781_mouseStop: function(){ }, 6782_mouseCapture: function(){ return true; }}); 6783})); 6784(function (factory){ 6785if(typeof define==="function"&&define.amd){ 6786define('ui/widgets/draggable.js', [ 6787"jquery", 6788"./mouse", 6789"../data", 6790"../plugin", 6791"../safe-active-element", 6792"../safe-blur", 6793"../scroll-parent", 6794"../version", 6795"../widget" 6796], factory); 6797}else{ 6798factory(jQuery); 6799}}(function ($){ 6800$.widget("ui.draggable", $.ui.mouse, { 6801version: "@VERSION", 6802widgetEventPrefix: "drag", 6803options: { 6804addClasses: true, 6805appendTo: "parent", 6806axis: false, 6807connectToSortable: false, 6808containment: false, 6809cursor: "auto", 6810cursorAt: false, 6811grid: false, 6812handle: false, 6813helper: "original", 6814iframeFix: false, 6815opacity: false, 6816refreshPositions: false, 6817revert: false, 6818revertDuration: 500, 6819scope: "default", 6820scroll: true, 6821scrollSensitivity: 20, 6822scrollSpeed: 20, 6823snap: false, 6824snapMode: "both", 6825snapTolerance: 20, 6826stack: false, 6827zIndex: false, 6828drag: null, 6829start: null, 6830stop: null 6831}, 6832_create: function (){ 6833if(this.options.helper==="original"){ 6834this._setPositionRelative(); 6835} 6836if(this.options.addClasses){ 6837this._addClass("ui-draggable"); 6838} 6839this._setHandleClassName(); 6840this._mouseInit(); 6841}, 6842_setOption: function (key, value){ 6843this._super(key, value); 6844if(key==="handle"){ 6845this._removeHandleClassName(); 6846this._setHandleClassName(); 6847}}, 6848_destroy: function (){ 6849if((this.helper||this.element).is(".ui-draggable-dragging")){ 6850this.destroyOnClear=true; 6851return; 6852} 6853this._removeHandleClassName(); 6854this._mouseDestroy(); 6855}, 6856_mouseCapture: function (event){ 6857var o=this.options; 6858this._blurActiveElement(event); 6859if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length > 0){ 6860return false; 6861} 6862this.handle=this._getHandle(event); 6863if(!this.handle){ 6864return false; 6865} 6866this._blockFrames(o.iframeFix===true ? "iframe":o.iframeFix); 6867return true; 6868}, 6869_blockFrames: function (selector){ 6870this.iframeBlocks=this.document.find(selector).map(function (){ 6871var iframe=$(this); 6872return $("<div>") 6873.css("position", "absolute") 6874.appendTo(iframe.parent()) 6875.outerWidth(iframe.outerWidth()) 6876.outerHeight(iframe.outerHeight()) 6877.offset(iframe.offset())[0]; 6878}); 6879}, 6880_unblockFrames: function (){ 6881if(this.iframeBlocks){ 6882this.iframeBlocks.remove(); 6883delete this.iframeBlocks; 6884}}, 6885_blurActiveElement: function (event){ 6886var activeElement=$.ui.safeActiveElement(this.document[0]), 6887target=$(event.target); 6888if(this._getHandle(event)&&target.closest(activeElement).length){ 6889return; 6890} 6891$.ui.safeBlur(activeElement); 6892}, 6893_mouseStart: function (event){ 6894var o=this.options; 6895this.helper=this._createHelper(event); 6896this._addClass(this.helper, "ui-draggable-dragging"); 6897this._cacheHelperProportions(); 6898if($.ui.ddmanager){ 6899$.ui.ddmanager.current=this; 6900} 6901this._cacheMargins(); 6902this.cssPosition=this.helper.css("position"); 6903this.scrollParent=this.helper.scrollParent(true); 6904this.offsetParent=this.helper.offsetParent(); 6905this.hasFixedAncestor=this.helper.parents().filter(function (){ 6906return $(this).css("position")==="fixed"; 6907}).length > 0; 6908this.positionAbs=this.element.offset(); 6909this._refreshOffsets(event); 6910this.originalPosition=this.position=this._generatePosition(event, false); 6911this.originalPageX=event.pageX; 6912this.originalPageY=event.pageY; 6913(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt)); 6914this._setContainment(); 6915if(this._trigger("start", event)===false){ 6916this._clear(); 6917return false; 6918} 6919this._cacheHelperProportions(); 6920if($.ui.ddmanager&&!o.dropBehaviour){ 6921$.ui.ddmanager.prepareOffsets(this, event); 6922} 6923this._mouseDrag(event, true); 6924if($.ui.ddmanager){ 6925$.ui.ddmanager.dragStart(this, event); 6926} 6927return true; 6928}, 6929_refreshOffsets: function (event){ 6930this.offset={ 6931top: this.positionAbs.top - this.margins.top, 6932left: this.positionAbs.left - this.margins.left, 6933scroll: false, 6934parent: this._getParentOffset(), 6935relative: this._getRelativeOffset() 6936}; 6937this.offset.click={ 6938left: event.pageX - this.offset.left, 6939top: event.pageY - this.offset.top 6940};}, 6941_mouseDrag: function (event, noPropagation){ 6942if(this.hasFixedAncestor){ 6943this.offset.parent=this._getParentOffset(); 6944} 6945this.position=this._generatePosition(event, true); 6946this.positionAbs=this._convertPositionTo("absolute"); 6947if(!noPropagation){ 6948var ui=this._uiHash(); 6949if(this._trigger("drag", event, ui)===false){ 6950this._mouseUp(new $.Event("mouseup", event)); 6951return false; 6952} 6953this.position=ui.position; 6954} 6955this.helper[0].style.left=this.position.left + "px"; 6956this.helper[0].style.top=this.position.top + "px"; 6957if($.ui.ddmanager){ 6958$.ui.ddmanager.drag(this, event); 6959} 6960return false; 6961}, 6962_mouseStop: function (event){ 6963var that=this, 6964dropped=false; 6965if($.ui.ddmanager&&!this.options.dropBehaviour){ 6966dropped=$.ui.ddmanager.drop(this, event); 6967} 6968if(this.dropped){ 6969dropped=this.dropped; 6970this.dropped=false; 6971} 6972if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element, dropped))){ 6973$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function (){ 6974if(that._trigger("stop", event)!==false){ 6975that._clear(); 6976}}); 6977}else{ 6978if(this._trigger("stop", event)!==false){ 6979this._clear(); 6980}} 6981return false; 6982}, 6983_mouseUp: function (event){ 6984this._unblockFrames(); 6985if($.ui.ddmanager){ 6986$.ui.ddmanager.dragStop(this, event); 6987} 6988if(this.handleElement.is(event.target)){ 6989this.element.trigger("focus"); 6990} 6991return $.ui.mouse.prototype._mouseUp.call(this, event); 6992}, 6993cancel: function (){ 6994if(this.helper.is(".ui-draggable-dragging")){ 6995this._mouseUp(new $.Event("mouseup", { target: this.element[0] })); 6996}else{ 6997this._clear(); 6998} 6999return this; 7000}, 7001_getHandle: function (event){ 7002return this.options.handle ? 7003!!$(event.target).closest(this.element.find(this.options.handle)).length : 7004true; 7005}, 7006_setHandleClassName: function (){ 7007this.handleElement=this.options.handle ? 7008this.element.find(this.options.handle):this.element; 7009this._addClass(this.handleElement, "ui-draggable-handle"); 7010}, 7011_removeHandleClassName: function (){ 7012this._removeClass(this.handleElement, "ui-draggable-handle"); 7013}, 7014_createHelper: function (event){ 7015var o=this.options, 7016helperIsFunction=$.isFunction(o.helper), 7017helper=helperIsFunction ? 7018$(o.helper.apply(this.element[0], [event])) : 7019(o.helper==="clone" ? 7020this.element.clone().removeAttr("id") : 7021this.element); 7022if(!helper.parents("body").length){ 7023helper.appendTo((o.appendTo==="parent" ? this.element[0].parentNode:o.appendTo)); 7024} 7025if(helperIsFunction&&helper[0]===this.element[0]){ 7026this._setPositionRelative(); 7027} 7028if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){ 7029helper.css("position", "absolute"); 7030} 7031return helper; 7032}, 7033_setPositionRelative: function (){ 7034if(!(/^(?:r|a|f)/).test(this.element.css("position"))){ 7035this.element[0].style.position="relative"; 7036}}, 7037_adjustOffsetFromHelper: function (obj){ 7038if(typeof obj==="string"){ 7039obj=obj.split(" "); 7040} 7041if($.isArray(obj)){ 7042obj={ left: +obj[0], top: +obj[1]||0 };} 7043if("left" in obj){ 7044this.offset.click.left=obj.left + this.margins.left; 7045} 7046if("right" in obj){ 7047this.offset.click.left=this.helperProportions.width - obj.right + this.margins.left; 7048} 7049if("top" in obj){ 7050this.offset.click.top=obj.top + this.margins.top; 7051} 7052if("bottom" in obj){ 7053this.offset.click.top=this.helperProportions.height - obj.bottom + this.margins.top; 7054}}, 7055_isRootNode: function (element){ 7056return (/(html|body)/i).test(element.tagName)||element===this.document[0]; 7057}, 7058_getParentOffset: function (){ 7059var po=this.offsetParent.offset(), 7060document=this.document[0]; 7061if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0], this.offsetParent[0])){ 7062po.left +=this.scrollParent.scrollLeft(); 7063po.top +=this.scrollParent.scrollTop(); 7064} 7065if(this._isRootNode(this.offsetParent[0])){ 7066po={ top: 0, left: 0 };} 7067return { 7068top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10)||0), 7069left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0) 7070};}, 7071_getRelativeOffset: function (){ 7072if(this.cssPosition!=="relative"){ 7073return { top: 0, left: 0 };} 7074var p=this.element.position(), 7075scrollIsRootNode=this._isRootNode(this.scrollParent[0]); 7076return { 7077top: p.top - (parseInt(this.helper.css("top"), 10)||0) + (!scrollIsRootNode ? this.scrollParent.scrollTop():0), 7078left: p.left - (parseInt(this.helper.css("left"), 10)||0) + (!scrollIsRootNode ? this.scrollParent.scrollLeft():0) 7079};}, 7080_cacheMargins: function (){ 7081this.margins={ 7082left: (parseInt(this.element.css("marginLeft"), 10)||0), 7083top: (parseInt(this.element.css("marginTop"), 10)||0), 7084right: (parseInt(this.element.css("marginRight"), 10)||0), 7085bottom: (parseInt(this.element.css("marginBottom"), 10)||0) 7086};}, 7087_cacheHelperProportions: function (){ 7088this.helperProportions={ 7089width: this.helper.outerWidth(), 7090height: this.helper.outerHeight() 7091};}, 7092_setContainment: function (){ 7093var isUserScrollable, c, ce, 7094o=this.options, 7095document=this.document[0]; 7096this.relativeContainer=null; 7097if(!o.containment){ 7098this.containment=null; 7099return; 7100} 7101if(o.containment==="window"){ 7102this.containment=[ 7103$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, 7104$(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, 7105$(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, 7106$(window).scrollTop() + ($(window).height()||document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top 7107]; 7108return; 7109}
vendor: 10,987 bytes, lines 7110-7451
7110if(o.containment==="document"){ 7111this.containment=[ 71120, 71130, 7114$(document).width() - this.helperProportions.width - this.margins.left, 7115($(document).height()||document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top 7116]; 7117return; 7118} 7119if(o.containment.constructor===Array){ 7120this.containment=o.containment; 7121return; 7122} 7123if(o.containment==="parent"){ 7124o.containment=this.helper[0].parentNode; 7125} 7126c=$(o.containment); 7127ce=c[0]; 7128if(!ce){ 7129return; 7130} 7131isUserScrollable=/(scroll|auto)/.test(c.css("overflow")); 7132this.containment=[ 7133(parseInt(c.css("borderLeftWidth"), 10)||0) + (parseInt(c.css("paddingLeft"), 10)||0), 7134(parseInt(c.css("borderTopWidth"), 10)||0) + (parseInt(c.css("paddingTop"), 10)||0), 7135(isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth):ce.offsetWidth) - 7136(parseInt(c.css("borderRightWidth"), 10)||0) - 7137(parseInt(c.css("paddingRight"), 10)||0) - 7138this.helperProportions.width - 7139this.margins.left - 7140this.margins.right, 7141(isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight):ce.offsetHeight) - 7142(parseInt(c.css("borderBottomWidth"), 10)||0) - 7143(parseInt(c.css("paddingBottom"), 10)||0) - 7144this.helperProportions.height - 7145this.margins.top - 7146this.margins.bottom 7147]; 7148this.relativeContainer=c; 7149}, 7150_convertPositionTo: function (d, pos){ 7151if(!pos){ 7152pos=this.position; 7153} 7154var mod=d==="absolute" ? 1:-1, 7155scrollIsRootNode=this._isRootNode(this.scrollParent[0]); 7156return { 7157top: ( 7158pos.top + 7159this.offset.relative.top * mod + 7160this.offset.parent.top * mod - 7161((this.cssPosition==="fixed" ? -this.offset.scroll.top:(scrollIsRootNode ? 0:this.offset.scroll.top)) * mod) 7162), 7163left: ( 7164pos.left + 7165this.offset.relative.left * mod + 7166this.offset.parent.left * mod - 7167((this.cssPosition==="fixed" ? -this.offset.scroll.left:(scrollIsRootNode ? 0:this.offset.scroll.left)) * mod) 7168) 7169};}, 7170_generatePosition: function (event, constrainPosition){ 7171var containment, co, top, left, 7172o=this.options, 7173scrollIsRootNode=this._isRootNode(this.scrollParent[0]), 7174pageX=event.pageX, 7175pageY=event.pageY; 7176if(!scrollIsRootNode||!this.offset.scroll){ 7177this.offset.scroll={ 7178top: this.scrollParent.scrollTop(), 7179left: this.scrollParent.scrollLeft() 7180};} 7181if(constrainPosition){ 7182if(this.containment){ 7183if(this.relativeContainer){ 7184co=this.relativeContainer.offset(); 7185containment=[ 7186this.containment[0] + co.left, 7187this.containment[1] + co.top, 7188this.containment[2] + co.left, 7189this.containment[3] + co.top 7190]; 7191}else{ 7192containment=this.containment; 7193} 7194if(event.pageX - this.offset.click.left < containment[0]){ 7195pageX=containment[0] + this.offset.click.left; 7196} 7197if(event.pageY - this.offset.click.top < containment[1]){ 7198pageY=containment[1] + this.offset.click.top; 7199} 7200if(event.pageX - this.offset.click.left > containment[2]){ 7201pageX=containment[2] + this.offset.click.left; 7202} 7203if(event.pageY - this.offset.click.top > containment[3]){ 7204pageY=containment[3] + this.offset.click.top; 7205}} 7206if(o.grid){ 7207top=o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]:this.originalPageY; 7208pageY=containment ? ((top - this.offset.click.top >=containment[1]||top - this.offset.click.top > containment[3]) ? top:((top - this.offset.click.top >=containment[1]) ? top - o.grid[1]:top + o.grid[1])):top; 7209left=o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]:this.originalPageX; 7210pageX=containment ? ((left - this.offset.click.left >=containment[0]||left - this.offset.click.left > containment[2]) ? left:((left - this.offset.click.left >=containment[0]) ? left - o.grid[0]:left + o.grid[0])):left; 7211} 7212if(o.axis==="y"){ 7213pageX=this.originalPageX; 7214} 7215if(o.axis==="x"){ 7216pageY=this.originalPageY; 7217}} 7218return { 7219top: ( 7220pageY - 7221this.offset.click.top - 7222this.offset.relative.top - 7223this.offset.parent.top + 7224(this.cssPosition==="fixed" ? -this.offset.scroll.top:(scrollIsRootNode ? 0:this.offset.scroll.top)) 7225), 7226left: ( 7227pageX - 7228this.offset.click.left - 7229this.offset.relative.left - 7230this.offset.parent.left + 7231(this.cssPosition==="fixed" ? -this.offset.scroll.left:(scrollIsRootNode ? 0:this.offset.scroll.left)) 7232) 7233};}, 7234_clear: function (){ 7235this._removeClass(this.helper, "ui-draggable-dragging"); 7236if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){ 7237this.helper.remove(); 7238} 7239this.helper=null; 7240this.cancelHelperRemoval=false; 7241if(this.destroyOnClear){ 7242this.destroy(); 7243}}, 7244_trigger: function (type, event, ui){ 7245ui=ui||this._uiHash(); 7246$.ui.plugin.call(this, type, [event, ui, this], true); 7247if(/^(drag|start|stop)/.test(type)){ 7248this.positionAbs=this._convertPositionTo("absolute"); 7249ui.offset=this.positionAbs; 7250} 7251return $.Widget.prototype._trigger.call(this, type, event, ui); 7252}, 7253plugins: {}, 7254_uiHash: function (){ 7255return { 7256helper: this.helper, 7257position: this.position, 7258originalPosition: this.originalPosition, 7259offset: this.positionAbs 7260};}}); 7261$.ui.plugin.add("draggable", "connectToSortable", { 7262start: function (event, ui, draggable){ 7263var uiSortable=$.extend({}, ui, { 7264item: draggable.element 7265}); 7266draggable.sortables=[]; 7267$(draggable.options.connectToSortable).each(function (){ 7268var sortable=$(this).sortable("instance"); 7269if(sortable&&!sortable.options.disabled){ 7270draggable.sortables.push(sortable); 7271sortable.refreshPositions(); 7272sortable._trigger("activate", event, uiSortable); 7273}}); 7274}, 7275stop: function (event, ui, draggable){ 7276var uiSortable=$.extend({}, ui, { 7277item: draggable.element 7278}); 7279draggable.cancelHelperRemoval=false; 7280$.each(draggable.sortables, function (){ 7281var sortable=this; 7282if(sortable.isOver){ 7283sortable.isOver=0; 7284draggable.cancelHelperRemoval=true; 7285sortable.cancelHelperRemoval=false; 7286sortable._storedCSS={ 7287position: sortable.placeholder.css("position"), 7288top: sortable.placeholder.css("top"), 7289left: sortable.placeholder.css("left") 7290}; 7291sortable._mouseStop(event); 7292sortable.options.helper=sortable.options._helper; 7293}else{ 7294sortable.cancelHelperRemoval=true; 7295sortable._trigger("deactivate", event, uiSortable); 7296}}); 7297}, 7298drag: function (event, ui, draggable){ 7299$.each(draggable.sortables, function (){ 7300var innermostIntersecting=false, 7301sortable=this; 7302sortable.positionAbs=draggable.positionAbs; 7303sortable.helperProportions=draggable.helperProportions; 7304sortable.offset.click=draggable.offset.click; 7305if(sortable._intersectsWith(sortable.containerCache)){ 7306innermostIntersecting=true; 7307$.each(draggable.sortables, function (){ 7308this.positionAbs=draggable.positionAbs; 7309this.helperProportions=draggable.helperProportions; 7310this.offset.click=draggable.offset.click; 7311if(this!==sortable && 7312this._intersectsWith(this.containerCache) && 7313$.contains(sortable.element[0], this.element[0])){ 7314innermostIntersecting=false; 7315} 7316return innermostIntersecting; 7317}); 7318} 7319if(innermostIntersecting){ 7320if(!sortable.isOver){ 7321sortable.isOver=1; 7322draggable._parent=ui.helper.parent(); 7323sortable.currentItem=ui.helper 7324.appendTo(sortable.element) 7325.data("ui-sortable-item", true); 7326sortable.options._helper=sortable.options.helper; 7327sortable.options.helper=function (){ 7328return ui.helper[0]; 7329}; 7330event.target=sortable.currentItem[0]; 7331sortable._mouseCapture(event, true); 7332sortable._mouseStart(event, true, true); 7333sortable.offset.click.top=draggable.offset.click.top; 7334sortable.offset.click.left=draggable.offset.click.left; 7335sortable.offset.parent.left -=draggable.offset.parent.left - 7336sortable.offset.parent.left; 7337sortable.offset.parent.top -=draggable.offset.parent.top - 7338sortable.offset.parent.top; 7339draggable._trigger("toSortable", event); 7340draggable.dropped=sortable.element; 7341$.each(draggable.sortables, function (){ 7342this.refreshPositions(); 7343}); 7344draggable.currentItem=draggable.element; 7345sortable.fromOutside=draggable; 7346} 7347if(sortable.currentItem){ 7348sortable._mouseDrag(event); 7349ui.position=sortable.position; 7350}}else{ 7351if(sortable.isOver){ 7352sortable.isOver=0; 7353sortable.cancelHelperRemoval=true; 7354sortable.options._revert=sortable.options.revert; 7355sortable.options.revert=false; 7356sortable._trigger("out", event, sortable._uiHash(sortable)); 7357sortable._mouseStop(event, true); 7358sortable.options.revert=sortable.options._revert; 7359sortable.options.helper=sortable.options._helper; 7360if(sortable.placeholder){ 7361sortable.placeholder.remove(); 7362} 7363ui.helper.appendTo(draggable._parent); 7364draggable._refreshOffsets(event); 7365ui.position=draggable._generatePosition(event, true); 7366draggable._trigger("fromSortable", event); 7367draggable.dropped=false; 7368$.each(draggable.sortables, function (){ 7369this.refreshPositions(); 7370}); 7371}} 7372}); 7373}}); 7374$.ui.plugin.add("draggable", "cursor", { 7375start: function (event, ui, instance){ 7376var t=$("body"), 7377o=instance.options; 7378if(t.css("cursor")){ 7379o._cursor=t.css("cursor"); 7380} 7381t.css("cursor", o.cursor); 7382}, 7383stop: function (event, ui, instance){ 7384var o=instance.options; 7385if(o._cursor){ 7386$("body").css("cursor", o._cursor); 7387}} 7388}); 7389$.ui.plugin.add("draggable", "opacity", { 7390start: function (event, ui, instance){ 7391var t=$(ui.helper), 7392o=instance.options; 7393if(t.css("opacity")){ 7394o._opacity=t.css("opacity"); 7395} 7396t.css("opacity", o.opacity); 7397}, 7398stop: function (event, ui, instance){ 7399var o=instance.options; 7400if(o._opacity){ 7401$(ui.helper).css("opacity", o._opacity); 7402}} 7403}); 7404$.ui.plugin.add("draggable", "scroll", { 7405start: function (event, ui, i){ 7406if(!i.scrollParentNotHidden){ 7407i.scrollParentNotHidden=i.helper.scrollParent(false); 7408} 7409if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){ 7410i.overflowOffset=i.scrollParentNotHidden.offset(); 7411}}, 7412drag: function (event, ui, i){ 7413var o=i.options, 7414scrolled=false, 7415scrollParent=i.scrollParentNotHidden[0], 7416document=i.document[0]; 7417if(scrollParent!==document&&scrollParent.tagName!=="HTML"){ 7418if(!o.axis||o.axis!=="x"){ 7419if((i.overflowOffset.top + scrollParent.offsetHeight) - event.pageY < o.scrollSensitivity){ 7420scrollParent.scrollTop=scrolled=scrollParent.scrollTop + o.scrollSpeed; 7421}else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity){ 7422scrollParent.scrollTop=scrolled=scrollParent.scrollTop - o.scrollSpeed; 7423}} 7424if(!o.axis||o.axis!=="y"){ 7425if((i.overflowOffset.left + scrollParent.offsetWidth) - event.pageX < o.scrollSensitivity){ 7426scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft + o.scrollSpeed; 7427}else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity){ 7428scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft - o.scrollSpeed; 7429}} 7430}else{ 7431if(!o.axis||o.axis!=="x"){ 7432if(event.pageY - $(document).scrollTop() < o.scrollSensitivity){ 7433scrolled=$(document).scrollTop($(document).scrollTop() - o.scrollSpeed); 7434}else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity){ 7435scrolled=$(document).scrollTop($(document).scrollTop() + o.scrollSpeed); 7436}} 7437if(!o.axis||o.axis!=="y"){ 7438if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity){ 7439scrolled=$(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); 7440}else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity){ 7441scrolled=$(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); 7442}} 7443} 7444if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){ 7445$.ui.ddmanager.prepareOffsets(i, event); 7446}} 7447}); 7448$.ui.plugin.add("draggable", "snap", { 7449start: function (event, ui, i){ 7450var o=i.options; 7451i.snapElements=[];
vendor: 56,026 bytes, lines 7452-9605
7452$(o.snap.constructor!==String ? (o.snap.items||":data(ui-draggable)"):o.snap).each(function (){ 7453var $t=$(this), 7454$o=$t.offset(); 7455if(this!==i.element[0]){ 7456i.snapElements.push({ 7457item: this, 7458width: $t.outerWidth(), height: $t.outerHeight(), 7459top: $o.top, left: $o.left 7460}); 7461}}); 7462}, 7463drag: function (event, ui, inst){ 7464var ts, bs, ls, rs, l, r, t, b, i, first, 7465o=inst.options, 7466d=o.snapTolerance, 7467x1=ui.offset.left, x2=x1 + inst.helperProportions.width, 7468y1=ui.offset.top, y2=y1 + inst.helperProportions.height; 7469for (i=inst.snapElements.length - 1; i >=0; i--){ 7470l=inst.snapElements[i].left - inst.margins.left; 7471r=l + inst.snapElements[i].width; 7472t=inst.snapElements[i].top - inst.margins.top; 7473b=t + inst.snapElements[i].height; 7474if(x2 < l - d||x1 > r + d||y2 < t - d||y1 > b + d||!$.contains(inst.snapElements[i].item.ownerDocument, inst.snapElements[i].item)){ 7475if(inst.snapElements[i].snapping){ 7476(inst.options.snap.release&&inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); 7477} 7478inst.snapElements[i].snapping=false; 7479continue; 7480} 7481if(o.snapMode!=="inner"){ 7482ts=Math.abs(t - y2) <=d; 7483bs=Math.abs(b - y1) <=d; 7484ls=Math.abs(l - x2) <=d; 7485rs=Math.abs(r - x1) <=d; 7486if(ts){ 7487ui.position.top=inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top; 7488} 7489if(bs){ 7490ui.position.top=inst._convertPositionTo("relative", { top: b, left: 0 }).top; 7491} 7492if(ls){ 7493ui.position.left=inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left; 7494} 7495if(rs){ 7496ui.position.left=inst._convertPositionTo("relative", { top: 0, left: r }).left; 7497}} 7498first=(ts||bs||ls||rs); 7499if(o.snapMode!=="outer"){ 7500ts=Math.abs(t - y1) <=d; 7501bs=Math.abs(b - y2) <=d; 7502ls=Math.abs(l - x1) <=d; 7503rs=Math.abs(r - x2) <=d; 7504if(ts){ 7505ui.position.top=inst._convertPositionTo("relative", { top: t, left: 0 }).top; 7506} 7507if(bs){ 7508ui.position.top=inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top; 7509} 7510if(ls){ 7511ui.position.left=inst._convertPositionTo("relative", { top: 0, left: l }).left; 7512} 7513if(rs){ 7514ui.position.left=inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left; 7515}} 7516if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){ 7517(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); 7518} 7519inst.snapElements[i].snapping=(ts||bs||ls||rs||first); 7520}} 7521}); 7522$.ui.plugin.add("draggable", "stack", { 7523start: function (event, ui, instance){ 7524var min, 7525o=instance.options, 7526group=$.makeArray($(o.stack)).sort(function (a, b){ 7527return (parseInt($(a).css("zIndex"), 10)||0) - (parseInt($(b).css("zIndex"), 10)||0); 7528}); 7529if(!group.length){ return; } 7530min=parseInt($(group[0]).css("zIndex"), 10)||0; 7531$(group).each(function (i){ 7532$(this).css("zIndex", min + i); 7533}); 7534this.css("zIndex", (min + group.length)); 7535}}); 7536$.ui.plugin.add("draggable", "zIndex", { 7537start: function (event, ui, instance){ 7538var t=$(ui.helper), 7539o=instance.options; 7540if(t.css("zIndex")){ 7541o._zIndex=t.css("zIndex"); 7542} 7543t.css("zIndex", o.zIndex); 7544}, 7545stop: function (event, ui, instance){ 7546var o=instance.options; 7547if(o._zIndex){ 7548$(ui.helper).css("zIndex", o._zIndex); 7549}} 7550}); 7551return $.ui.draggable; 7552})); 7553(function (factory){ 7554if(typeof define==="function"&&define.amd){ 7555define('ui/widgets/resizable.js', [ 7556"jquery", 7557"./mouse", 7558"../disable-selection", 7559"../plugin", 7560"../version", 7561"../widget" 7562], factory); 7563}else{ 7564factory(jQuery); 7565}}(function ($){ 7566$.widget("ui.resizable", $.ui.mouse, { 7567version: "@VERSION", 7568widgetEventPrefix: "resize", 7569options: { 7570alsoResize: false, 7571animate: false, 7572animateDuration: "slow", 7573animateEasing: "swing", 7574aspectRatio: false, 7575autoHide: false, 7576classes: { 7577"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" 7578}, 7579containment: false, 7580ghost: false, 7581grid: false, 7582handles: "e,s,se", 7583helper: false, 7584maxHeight: null, 7585maxWidth: null, 7586minHeight: 10, 7587minWidth: 10, 7588zIndex: 90, 7589resize: null, 7590start: null, 7591stop: null 7592}, 7593_num: function (value){ 7594return parseFloat(value)||0; 7595}, 7596_isNumber: function (value){ 7597return !isNaN(parseFloat(value)); 7598}, 7599_hasScroll: function (el, a){ 7600if($(el).css("overflow")==="hidden"){ 7601return false; 7602} 7603var scroll=(a&&a==="left") ? "scrollLeft":"scrollTop", 7604has=false; 7605if(el[scroll] > 0){ 7606return true; 7607} 7608el[scroll]=1; 7609has=(el[scroll] > 0); 7610el[scroll]=0; 7611return has; 7612}, 7613_create: function (){ 7614var n, i, handle, axis, hname, margins, 7615that=this, 7616o=this.options; 7617this._addClass("ui-resizable"); 7618$.extend(this, { 7619_aspectRatio: !!(o.aspectRatio), 7620aspectRatio: o.aspectRatio, 7621originalElement: this.element, 7622_proportionallyResizeElements: [], 7623_helper: o.helper||o.ghost||o.animate ? o.helper||"ui-resizable-helper":null 7624}); 7625if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){ 7626this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({ 7627position: this.element.css("position"), 7628width: this.element.outerWidth(), 7629height: this.element.outerHeight(), 7630top: this.element.css("top"), 7631left: this.element.css("left") 7632}) 7633); 7634this.element=this.element.parent().data("ui-resizable", this.element.resizable("instance") 7635); 7636this.elementIsWrapper=true; 7637margins={ 7638marginTop: this.originalElement.css("marginTop"), 7639marginRight: this.originalElement.css("marginRight"), 7640marginBottom: this.originalElement.css("marginBottom"), 7641marginLeft: this.originalElement.css("marginLeft") 7642}; 7643this.element.css(margins); 7644this.originalElement.css("margin", 0); 7645this.originalResizeStyle=this.originalElement.css("resize"); 7646this.originalElement.css("resize", "none"); 7647this._proportionallyResizeElements.push(this.originalElement.css({ 7648position: "static", 7649zoom: 1, 7650display: "block" 7651})); 7652this.originalElement.css(margins); 7653this._proportionallyResize(); 7654} 7655this.handles=o.handles || 7656(!$(".ui-resizable-handle", this.element).length ? 7657"e,s,se":{ 7658n: ".ui-resizable-n", 7659e: ".ui-resizable-e", 7660s: ".ui-resizable-s", 7661w: ".ui-resizable-w", 7662se: ".ui-resizable-se", 7663sw: ".ui-resizable-sw", 7664ne: ".ui-resizable-ne", 7665nw: ".ui-resizable-nw" 7666}); 7667this._handles=$(); 7668if(this.handles.constructor===String){ 7669if(this.handles==="all"){ 7670this.handles="n,e,s,w,se,sw,ne,nw"; 7671} 7672n=this.handles.split(","); 7673this.handles={}; 7674for (i=0; i < n.length; i++){ 7675handle=$.trim(n[i]); 7676hname="ui-resizable-" + handle; 7677axis=$("<div>"); 7678this._addClass(axis, "ui-resizable-handle " + hname); 7679axis.css({ zIndex: o.zIndex }); 7680this.handles[handle]=".ui-resizable-" + handle; 7681this.element.append(axis); 7682}} 7683this._renderAxis=function (target){ 7684var i, axis, padPos, padWrapper; 7685target=target||this.element; 7686for (i in this.handles){ 7687if(this.handles[i].constructor===String){ 7688this.handles[i]=this.element.children(this.handles[i]).first().show(); 7689}else if(this.handles[i].jquery||this.handles[i].nodeType){ 7690this.handles[i]=$(this.handles[i]); 7691this._on(this.handles[i], { "mousedown": that._mouseDown }); 7692} 7693if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){ 7694axis=$(this.handles[i], this.element); 7695padWrapper=/sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight():axis.outerWidth(); 7696padPos=["padding", 7697/ne|nw|n/.test(i) ? "Top" : 7698/se|sw|s/.test(i) ? "Bottom" : 7699/^e$/.test(i) ? "Right":"Left"].join(""); 7700target.css(padPos, padWrapper); 7701this._proportionallyResize(); 7702} 7703this._handles=this._handles.add(this.handles[i]); 7704}}; 7705this._renderAxis(this.element); 7706this._handles=this._handles.add(this.element.find(".ui-resizable-handle")); 7707this._handles.disableSelection(); 7708this._handles.on("mouseover", function (){ 7709if(!that.resizing){ 7710if(this.className){ 7711axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); 7712} 7713that.axis=axis&&axis[1] ? axis[1]:"se"; 7714}}); 7715if(o.autoHide){ 7716this._handles.hide(); 7717this._addClass("ui-resizable-autohide"); 7718$(this.element) 7719.on("mouseenter", function (){ 7720if(o.disabled){ 7721return; 7722} 7723that._removeClass("ui-resizable-autohide"); 7724that._handles.show(); 7725}) 7726.on("mouseleave", function (){ 7727if(o.disabled){ 7728return; 7729} 7730if(!that.resizing){ 7731that._addClass("ui-resizable-autohide"); 7732that._handles.hide(); 7733}}); 7734} 7735this._mouseInit(); 7736}, 7737_destroy: function (){ 7738this._mouseDestroy(); 7739var wrapper, 7740_destroy=function (exp){ 7741$(exp) 7742.removeData("resizable") 7743.removeData("ui-resizable") 7744.off(".resizable") 7745.find(".ui-resizable-handle") 7746.remove(); 7747}; 7748if(this.elementIsWrapper){ 7749_destroy(this.element); 7750wrapper=this.element; 7751this.originalElement.css({ 7752position: wrapper.css("position"), 7753width: wrapper.outerWidth(), 7754height: wrapper.outerHeight(), 7755top: wrapper.css("top"), 7756left: wrapper.css("left") 7757}).insertAfter(wrapper); 7758wrapper.remove(); 7759} 7760this.originalElement.css("resize", this.originalResizeStyle); 7761_destroy(this.originalElement); 7762return this; 7763}, 7764_mouseCapture: function (event){ 7765var i, handle, 7766capture=false; 7767for (i in this.handles){ 7768handle=$(this.handles[i])[0]; 7769if(handle===event.target||$.contains(handle, event.target)){ 7770capture=true; 7771}} 7772return !this.options.disabled&&capture; 7773}, 7774_mouseStart: function (event){ 7775var curleft, curtop, cursor, 7776o=this.options, 7777el=this.element; 7778this.resizing=true; 7779this._renderProxy(); 7780curleft=this._num(this.helper.css("left")); 7781curtop=this._num(this.helper.css("top")); 7782if(o.containment){ 7783curleft +=$(o.containment).scrollLeft()||0; 7784curtop +=$(o.containment).scrollTop()||0; 7785} 7786this.offset=this.helper.offset(); 7787this.position={ left: curleft, top: curtop }; 7788this.size=this._helper ? { 7789width: this.helper.width(), 7790height: this.helper.height() 7791}:{ 7792width: el.width(), 7793height: el.height() 7794}; 7795this.originalSize=this._helper ? { 7796width: el.outerWidth(), 7797height: el.outerHeight() 7798}:{ 7799width: el.width(), 7800height: el.height() 7801}; 7802this.sizeDiff={ 7803width: el.outerWidth() - el.width(), 7804height: el.outerHeight() - el.height() 7805}; 7806this.originalPosition={ left: curleft, top: curtop }; 7807this.originalMousePosition={ left: event.pageX, top: event.pageY }; 7808this.aspectRatio=(typeof o.aspectRatio==="number") ? 7809o.aspectRatio : 7810((this.originalSize.width / this.originalSize.height)||1); 7811cursor=$(".ui-resizable-" + this.axis).css("cursor"); 7812$("body").css("cursor", cursor==="auto" ? this.axis + "-resize":cursor); 7813this._addClass("ui-resizable-resizing"); 7814this._propagate("start", event); 7815return true; 7816}, 7817_mouseDrag: function (event){ 7818var data, props, 7819smp=this.originalMousePosition, 7820a=this.axis, 7821dx=(event.pageX - smp.left)||0, 7822dy=(event.pageY - smp.top)||0, 7823trigger=this._change[a]; 7824this._updatePrevProperties(); 7825if(!trigger){ 7826return false; 7827} 7828data=trigger.apply(this, [event, dx, dy]); 7829this._updateVirtualBoundaries(event.shiftKey); 7830if(this._aspectRatio||event.shiftKey){ 7831data=this._updateRatio(data, event); 7832} 7833data=this._respectSize(data, event); 7834this._updateCache(data); 7835this._propagate("resize", event); 7836props=this._applyChanges(); 7837if(!this._helper&&this._proportionallyResizeElements.length){ 7838this._proportionallyResize(); 7839} 7840if(!$.isEmptyObject(props)){ 7841this._updatePrevProperties(); 7842this._trigger("resize", event, this.ui()); 7843this._applyChanges(); 7844} 7845return false; 7846}, 7847_mouseStop: function (event){ 7848this.resizing=false; 7849var pr, ista, soffseth, soffsetw, s, left, top, 7850o=this.options, that=this; 7851if(this._helper){ 7852pr=this._proportionallyResizeElements; 7853ista=pr.length&&(/textarea/i).test(pr[0].nodeName); 7854soffseth=ista&&this._hasScroll(pr[0], "left") ? 0:that.sizeDiff.height; 7855soffsetw=ista ? 0:that.sizeDiff.width; 7856s={ 7857width: (that.helper.width() - soffsetw), 7858height: (that.helper.height() - soffseth) 7859}; 7860left=(parseFloat(that.element.css("left")) + 7861(that.position.left - that.originalPosition.left))||null; 7862top=(parseFloat(that.element.css("top")) + 7863(that.position.top - that.originalPosition.top))||null; 7864if(!o.animate){ 7865this.element.css($.extend(s, { top: top, left: left })); 7866} 7867that.helper.height(that.size.height); 7868that.helper.width(that.size.width); 7869if(this._helper&&!o.animate){ 7870this._proportionallyResize(); 7871}} 7872$("body").css("cursor", "auto"); 7873this._removeClass("ui-resizable-resizing"); 7874this._propagate("stop", event); 7875if(this._helper){ 7876this.helper.remove(); 7877} 7878return false; 7879}, 7880_updatePrevProperties: function (){ 7881this.prevPosition={ 7882top: this.position.top, 7883left: this.position.left 7884}; 7885this.prevSize={ 7886width: this.size.width, 7887height: this.size.height 7888};}, 7889_applyChanges: function (){ 7890var props={}; 7891if(this.position.top!==this.prevPosition.top){ 7892props.top=this.position.top + "px"; 7893} 7894if(this.position.left!==this.prevPosition.left){ 7895props.left=this.position.left + "px"; 7896} 7897if(this.size.width!==this.prevSize.width){ 7898props.width=this.size.width + "px"; 7899} 7900if(this.size.height!==this.prevSize.height){ 7901props.height=this.size.height + "px"; 7902} 7903this.helper.css(props); 7904return props; 7905}, 7906_updateVirtualBoundaries: function (forceAspectRatio){ 7907var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, 7908o=this.options; 7909b={ 7910minWidth: this._isNumber(o.minWidth) ? o.minWidth:0, 7911maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth:Infinity, 7912minHeight: this._isNumber(o.minHeight) ? o.minHeight:0, 7913maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight:Infinity 7914}; 7915if(this._aspectRatio||forceAspectRatio){ 7916pMinWidth=b.minHeight * this.aspectRatio; 7917pMinHeight=b.minWidth / this.aspectRatio; 7918pMaxWidth=b.maxHeight * this.aspectRatio; 7919pMaxHeight=b.maxWidth / this.aspectRatio; 7920if(pMinWidth > b.minWidth){ 7921b.minWidth=pMinWidth; 7922} 7923if(pMinHeight > b.minHeight){ 7924b.minHeight=pMinHeight; 7925} 7926if(pMaxWidth < b.maxWidth){ 7927b.maxWidth=pMaxWidth; 7928} 7929if(pMaxHeight < b.maxHeight){ 7930b.maxHeight=pMaxHeight; 7931}} 7932this._vBoundaries=b; 7933}, 7934_updateCache: function (data){ 7935this.offset=this.helper.offset(); 7936if(this._isNumber(data.left)){ 7937this.position.left=data.left; 7938} 7939if(this._isNumber(data.top)){ 7940this.position.top=data.top; 7941} 7942if(this._isNumber(data.height)){ 7943this.size.height=data.height; 7944} 7945if(this._isNumber(data.width)){ 7946this.size.width=data.width; 7947}}, 7948_updateRatio: function (data){ 7949var cpos=this.position, 7950csize=this.size, 7951a=this.axis; 7952if(this._isNumber(data.height)){ 7953data.width=(data.height * this.aspectRatio); 7954}else if(this._isNumber(data.width)){ 7955data.height=(data.width / this.aspectRatio); 7956} 7957if(a==="sw"){ 7958data.left=cpos.left + (csize.width - data.width); 7959data.top=null; 7960} 7961if(a==="nw"){ 7962data.top=cpos.top + (csize.height - data.height); 7963data.left=cpos.left + (csize.width - data.width); 7964} 7965return data; 7966}, 7967_respectSize: function (data){ 7968var o=this._vBoundaries, 7969a=this.axis, 7970ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth < data.width), 7971ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight < data.height), 7972isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth > data.width), 7973isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight > data.height), 7974dw=this.originalPosition.left + this.originalSize.width, 7975dh=this.position.top + this.size.height, 7976cw=/sw|nw|w/.test(a), ch=/nw|ne|n/.test(a); 7977if(isminw){ 7978data.width=o.minWidth; 7979} 7980if(isminh){ 7981data.height=o.minHeight; 7982} 7983if(ismaxw){ 7984data.width=o.maxWidth; 7985} 7986if(ismaxh){ 7987data.height=o.maxHeight; 7988} 7989if(isminw&&cw){ 7990data.left=dw - o.minWidth; 7991} 7992if(ismaxw&&cw){ 7993data.left=dw - o.maxWidth; 7994} 7995if(isminh&&ch){ 7996data.top=dh - o.minHeight; 7997} 7998if(ismaxh&&ch){ 7999data.top=dh - o.maxHeight; 8000} 8001if(!data.width&&!data.height&&!data.left&&data.top){ 8002data.top=null; 8003}else if(!data.width&&!data.height&&!data.top&&data.left){ 8004data.left=null; 8005} 8006return data; 8007}, 8008_getPaddingPlusBorderDimensions: function (element){ 8009var i=0, 8010widths=[], 8011borders=[ 8012element.css("borderTopWidth"), 8013element.css("borderRightWidth"), 8014element.css("borderBottomWidth"), 8015element.css("borderLeftWidth") 8016], 8017paddings=[ 8018element.css("paddingTop"), 8019element.css("paddingRight"), 8020element.css("paddingBottom"), 8021element.css("paddingLeft") 8022]; 8023for (; i < 4; i++){ 8024widths[i]=(parseFloat(borders[i])||0); 8025widths[i] +=(parseFloat(paddings[i])||0); 8026} 8027return { 8028height: widths[0] + widths[2], 8029width: widths[1] + widths[3] 8030};}, 8031_proportionallyResize: function (){ 8032if(!this._proportionallyResizeElements.length){ 8033return; 8034} 8035var prel, 8036i=0, 8037element=this.helper||this.element; 8038for (; i < this._proportionallyResizeElements.length; i++){ 8039prel=this._proportionallyResizeElements[i]; 8040if(!this.outerDimensions){ 8041this.outerDimensions=this._getPaddingPlusBorderDimensions(prel); 8042} 8043prel.css({ 8044height: (element.height() - this.outerDimensions.height)||0, 8045width: (element.width() - this.outerDimensions.width)||0 8046}); 8047}}, 8048_renderProxy: function (){ 8049var el=this.element, o=this.options; 8050this.elementOffset=el.offset(); 8051if(this._helper){ 8052this.helper=this.helper||$("<div style='overflow:hidden;'></div>"); 8053this._addClass(this.helper, this._helper); 8054this.helper.css({ 8055width: this.element.outerWidth(), 8056height: this.element.outerHeight(), 8057position: "absolute", 8058left: this.elementOffset.left + "px", 8059top: this.elementOffset.top + "px", 8060zIndex: ++o.zIndex 8061}); 8062this.helper 8063.appendTo("body") 8064.disableSelection(); 8065}else{ 8066this.helper=this.element; 8067}}, 8068_change: { 8069e: function (event, dx){ 8070return { width: this.originalSize.width + dx };}, 8071w: function (event, dx){ 8072var cs=this.originalSize, sp=this.originalPosition; 8073return { left: sp.left + dx, width: cs.width - dx };}, 8074n: function (event, dx, dy){ 8075var cs=this.originalSize, sp=this.originalPosition; 8076return { top: sp.top + dy, height: cs.height - dy };}, 8077s: function (event, dx, dy){ 8078return { height: this.originalSize.height + dy };}, 8079se: function (event, dx, dy){ 8080return $.extend(this._change.s.apply(this, arguments), 8081this._change.e.apply(this, [event, dx, dy])); 8082}, 8083sw: function (event, dx, dy){ 8084return $.extend(this._change.s.apply(this, arguments), 8085this._change.w.apply(this, [event, dx, dy])); 8086}, 8087ne: function (event, dx, dy){ 8088return $.extend(this._change.n.apply(this, arguments), 8089this._change.e.apply(this, [event, dx, dy])); 8090}, 8091nw: function (event, dx, dy){ 8092return $.extend(this._change.n.apply(this, arguments), 8093this._change.w.apply(this, [event, dx, dy])); 8094}}, 8095_propagate: function (n, event){ 8096$.ui.plugin.call(this, n, [event, this.ui()]); 8097(n!=="resize"&&this._trigger(n, event, this.ui())); 8098}, 8099plugins: {}, 8100ui: function (){ 8101return { 8102originalElement: this.originalElement, 8103element: this.element, 8104helper: this.helper, 8105position: this.position, 8106size: this.size, 8107originalSize: this.originalSize, 8108originalPosition: this.originalPosition 8109};}}); 8110$.ui.plugin.add("resizable", "animate", { 8111stop: function (event){ 8112var that=$(this).resizable("instance"), 8113o=that.options, 8114pr=that._proportionallyResizeElements, 8115ista=pr.length&&(/textarea/i).test(pr[0].nodeName), 8116soffseth=ista&&that._hasScroll(pr[0], "left") ? 0:that.sizeDiff.height, 8117soffsetw=ista ? 0:that.sizeDiff.width, 8118style={ width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, 8119left=(parseFloat(that.element.css("left")) + 8120(that.position.left - that.originalPosition.left))||null, 8121top=(parseFloat(that.element.css("top")) + 8122(that.position.top - that.originalPosition.top))||null; 8123that.element.animate($.extend(style, top&&left ? { top: top, left: left }:{}), { 8124duration: o.animateDuration, 8125easing: o.animateEasing, 8126step: function (){ 8127var data={ 8128width: parseFloat(that.element.css("width")), 8129height: parseFloat(that.element.css("height")), 8130top: parseFloat(that.element.css("top")), 8131left: parseFloat(that.element.css("left")) 8132}; 8133if(pr&&pr.length){ 8134$(pr[0]).css({ width: data.width, height: data.height }); 8135} 8136that._updateCache(data); 8137that._propagate("resize", event); 8138}} 8139); 8140}}); 8141$.ui.plugin.add("resizable", "containment", { 8142start: function (){ 8143var element, p, co, ch, cw, width, height, 8144that=$(this).resizable("instance"), 8145o=that.options, 8146el=that.element, 8147oc=o.containment, 8148ce=(oc instanceof $) ? oc.get(0):(/parent/.test(oc)) ? el.parent().get(0):oc; 8149if(!ce){ 8150return; 8151} 8152that.containerElement=$(ce); 8153if(/document/.test(oc)||oc===document){ 8154that.containerOffset={ 8155left: 0, 8156top: 0 8157}; 8158that.containerPosition={ 8159left: 0, 8160top: 0 8161}; 8162that.parentData={ 8163element: $(document), 8164left: 0, 8165top: 0, 8166width: $(document).width(), 8167height: $(document).height()||document.body.parentNode.scrollHeight 8168};}else{ 8169element=$(ce); 8170p=[]; 8171$(["Top", "Right", "Left", "Bottom"]).each(function (i, name){ 8172p[i]=that._num(element.css("padding" + name)); 8173}); 8174that.containerOffset=element.offset(); 8175that.containerPosition=element.position(); 8176that.containerSize={ 8177height: (element.innerHeight() - p[3]), 8178width: (element.innerWidth() - p[1]) 8179}; 8180co=that.containerOffset; 8181ch=that.containerSize.height; 8182cw=that.containerSize.width; 8183width=(that._hasScroll(ce, "left") ? ce.scrollWidth:cw); 8184height=(that._hasScroll(ce) ? ce.scrollHeight:ch); 8185that.parentData={ 8186element: ce, 8187left: co.left, 8188top: co.top, 8189width: width, 8190height: height 8191};}}, 8192resize: function (event){ 8193var woset, hoset, isParent, isOffsetRelative, 8194that=$(this).resizable("instance"), 8195o=that.options, 8196co=that.containerOffset, 8197cp=that.position, 8198pRatio=that._aspectRatio||event.shiftKey, 8199cop={ 8200top: 0, 8201left: 0 8202}, 8203ce=that.containerElement, 8204continueResize=true; 8205if(ce[0]!==document&&(/static/).test(ce.css("position"))){ 8206cop=co; 8207} 8208if(cp.left < (that._helper ? co.left:0)){ 8209that.size.width=that.size.width + 8210(that._helper ? 8211(that.position.left - co.left) : 8212(that.position.left - cop.left)); 8213if(pRatio){ 8214that.size.height=that.size.width / that.aspectRatio; 8215continueResize=false; 8216} 8217that.position.left=o.helper ? co.left:0; 8218} 8219if(cp.top < (that._helper ? co.top:0)){ 8220that.size.height=that.size.height + 8221(that._helper ? 8222(that.position.top - co.top) : 8223that.position.top); 8224if(pRatio){ 8225that.size.width=that.size.height * that.aspectRatio; 8226continueResize=false; 8227} 8228that.position.top=that._helper ? co.top:0; 8229} 8230isParent=that.containerElement.get(0)===that.element.parent().get(0); 8231isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")); 8232if(isParent&&isOffsetRelative){ 8233that.offset.left=that.parentData.left + that.position.left; 8234that.offset.top=that.parentData.top + that.position.top; 8235}else{ 8236that.offset.left=that.element.offset().left; 8237that.offset.top=that.element.offset().top; 8238} 8239woset=Math.abs(that.sizeDiff.width + 8240(that._helper ? 8241that.offset.left - cop.left : 8242(that.offset.left - co.left))); 8243hoset=Math.abs(that.sizeDiff.height + 8244(that._helper ? 8245that.offset.top - cop.top : 8246(that.offset.top - co.top))); 8247if(woset + that.size.width >=that.parentData.width){ 8248that.size.width=that.parentData.width - woset; 8249if(pRatio){ 8250that.size.height=that.size.width / that.aspectRatio; 8251continueResize=false; 8252}} 8253if(hoset + that.size.height >=that.parentData.height){ 8254that.size.height=that.parentData.height - hoset; 8255if(pRatio){ 8256that.size.width=that.size.height * that.aspectRatio; 8257continueResize=false; 8258}} 8259if(!continueResize){ 8260that.position.left=that.prevPosition.left; 8261that.position.top=that.prevPosition.top; 8262that.size.width=that.prevSize.width; 8263that.size.height=that.prevSize.height; 8264}}, 8265stop: function (){ 8266var that=$(this).resizable("instance"), 8267o=that.options, 8268co=that.containerOffset, 8269cop=that.containerPosition, 8270ce=that.containerElement, 8271helper=$(that.helper), 8272ho=helper.offset(), 8273w=helper.outerWidth() - that.sizeDiff.width, 8274h=helper.outerHeight() - that.sizeDiff.height; 8275if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){ 8276$(this).css({ 8277left: ho.left - cop.left - co.left, 8278width: w, 8279height: h 8280}); 8281} 8282if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){ 8283$(this).css({ 8284left: ho.left - cop.left - co.left, 8285width: w, 8286height: h 8287}); 8288}} 8289}); 8290$.ui.plugin.add("resizable", "alsoResize", { 8291start: function (){ 8292var that=$(this).resizable("instance"), 8293o=that.options; 8294$(o.alsoResize).each(function (){ 8295var el=$(this); 8296el.data("ui-resizable-alsoresize", { 8297width: parseFloat(el.width()), height: parseFloat(el.height()), 8298left: parseFloat(el.css("left")), top: parseFloat(el.css("top")) 8299}); 8300}); 8301}, 8302resize: function (event, ui){ 8303var that=$(this).resizable("instance"), 8304o=that.options, 8305os=that.originalSize, 8306op=that.originalPosition, 8307delta={ 8308height: (that.size.height - os.height)||0, 8309width: (that.size.width - os.width)||0, 8310top: (that.position.top - op.top)||0, 8311left: (that.position.left - op.left)||0 8312}; 8313$(o.alsoResize).each(function (){ 8314var el=$(this), start=$(this).data("ui-resizable-alsoresize"), style={}, 8315css=el.parents(ui.originalElement[0]).length ? 8316["width", "height"] : 8317["width", "height", "top", "left"]; 8318$.each(css, function (i, prop){ 8319var sum=(start[prop]||0) + (delta[prop]||0); 8320if(sum&&sum >=0){ 8321style[prop]=sum||null; 8322}}); 8323el.css(style); 8324}); 8325}, 8326stop: function (){ 8327$(this).removeData("ui-resizable-alsoresize"); 8328}}); 8329$.ui.plugin.add("resizable", "ghost", { 8330start: function (){ 8331var that=$(this).resizable("instance"), cs=that.size; 8332that.ghost=that.originalElement.clone(); 8333that.ghost.css({ 8334opacity: 0.25, 8335display: "block", 8336position: "relative", 8337height: cs.height, 8338width: cs.width, 8339margin: 0, 8340left: 0, 8341top: 0 8342}); 8343that._addClass(that.ghost, "ui-resizable-ghost"); 8344if($.uiBackCompat!==false&&typeof that.options.ghost==="string"){ 8345that.ghost.addClass(this.options.ghost); 8346} 8347that.ghost.appendTo(that.helper); 8348}, 8349resize: function (){ 8350var that=$(this).resizable("instance"); 8351if(that.ghost){ 8352that.ghost.css({ 8353position: "relative", 8354height: that.size.height, 8355width: that.size.width 8356}); 8357}}, 8358stop: function (){ 8359var that=$(this).resizable("instance"); 8360if(that.ghost&&that.helper){ 8361that.helper.get(0).removeChild(that.ghost.get(0)); 8362}} 8363}); 8364$.ui.plugin.add("resizable", "grid", { 8365resize: function (){ 8366var outerDimensions, 8367that=$(this).resizable("instance"), 8368o=that.options, 8369cs=that.size, 8370os=that.originalSize, 8371op=that.originalPosition, 8372a=that.axis, 8373grid=typeof o.grid==="number" ? [o.grid, o.grid]:o.grid, 8374gridX=(grid[0]||1), 8375gridY=(grid[1]||1), 8376ox=Math.round((cs.width - os.width) / gridX) * gridX, 8377oy=Math.round((cs.height - os.height) / gridY) * gridY, 8378newWidth=os.width + ox, 8379newHeight=os.height + oy, 8380isMaxWidth=o.maxWidth&&(o.maxWidth < newWidth), 8381isMaxHeight=o.maxHeight&&(o.maxHeight < newHeight), 8382isMinWidth=o.minWidth&&(o.minWidth > newWidth), 8383isMinHeight=o.minHeight&&(o.minHeight > newHeight); 8384o.grid=grid; 8385if(isMinWidth){ 8386newWidth +=gridX; 8387} 8388if(isMinHeight){ 8389newHeight +=gridY; 8390} 8391if(isMaxWidth){ 8392newWidth -=gridX; 8393} 8394if(isMaxHeight){ 8395newHeight -=gridY; 8396} 8397if(/^(se|s|e)$/.test(a)){ 8398that.size.width=newWidth; 8399that.size.height=newHeight; 8400}else if(/^(ne)$/.test(a)){ 8401that.size.width=newWidth; 8402that.size.height=newHeight; 8403that.position.top=op.top - oy; 8404}else if(/^(sw)$/.test(a)){ 8405that.size.width=newWidth; 8406that.size.height=newHeight; 8407that.position.left=op.left - ox; 8408}else{ 8409if(newHeight - gridY <=0||newWidth - gridX <=0){ 8410outerDimensions=that._getPaddingPlusBorderDimensions(this); 8411} 8412if(newHeight - gridY > 0){ 8413that.size.height=newHeight; 8414that.position.top=op.top - oy; 8415}else{ 8416newHeight=gridY - outerDimensions.height; 8417that.size.height=newHeight; 8418that.position.top=op.top + os.height - newHeight; 8419} 8420if(newWidth - gridX > 0){ 8421that.size.width=newWidth; 8422that.position.left=op.left - ox; 8423}else{ 8424newWidth=gridX - outerDimensions.width; 8425that.size.width=newWidth; 8426that.position.left=op.left + os.width - newWidth; 8427}} 8428}}); 8429return $.ui.resizable; 8430})); 8431(function (factory){ 8432if(typeof define==="function"&&define.amd){ 8433define('ui/widgets/dialog.js', [ 8434"jquery", 8435"./button", 8436"./draggable", 8437"./mouse", 8438"./resizable", 8439"../focusable", 8440"../keycode", 8441"../position", 8442"../safe-active-element", 8443"../safe-blur", 8444"../tabbable", 8445"../unique-id", 8446"../version", 8447"../widget" 8448], factory); 8449}else{ 8450factory(jQuery); 8451}}(function ($){ 8452$.widget("ui.dialog", { 8453version: "@VERSION", 8454options: { 8455appendTo: "body", 8456autoOpen: true, 8457buttons: [], 8458classes: { 8459"ui-dialog": "ui-corner-all", 8460"ui-dialog-titlebar": "ui-corner-all" 8461}, 8462closeOnEscape: true, 8463closeText: "Close", 8464draggable: true, 8465hide: null, 8466height: "auto", 8467maxHeight: null, 8468maxWidth: null, 8469minHeight: 150, 8470minWidth: 150, 8471modal: false, 8472position: { 8473my: "center", 8474at: "center", 8475of: window, 8476collision: "fit", 8477using: function (pos){ 8478var topOffset=$(this).css(pos).offset().top; 8479if(topOffset < 0){ 8480$(this).css("top", pos.top - topOffset); 8481}} 8482}, 8483resizable: true, 8484show: null, 8485title: null, 8486width: 300, 8487beforeClose: null, 8488close: null, 8489drag: null, 8490dragStart: null, 8491dragStop: null, 8492focus: null, 8493open: null, 8494resize: null, 8495resizeStart: null, 8496resizeStop: null 8497}, 8498sizeRelatedOptions: { 8499buttons: true, 8500height: true, 8501maxHeight: true, 8502maxWidth: true, 8503minHeight: true, 8504minWidth: true, 8505width: true 8506}, 8507resizableRelatedOptions: { 8508maxHeight: true, 8509maxWidth: true, 8510minHeight: true, 8511minWidth: true 8512}, 8513_create: function (){ 8514this.originalCss={ 8515display: this.element[0].style.display, 8516width: this.element[0].style.width, 8517minHeight: this.element[0].style.minHeight, 8518maxHeight: this.element[0].style.maxHeight, 8519height: this.element[0].style.height 8520}; 8521this.originalPosition={ 8522parent: this.element.parent(), 8523index: this.element.parent().children().index(this.element) 8524}; 8525this.originalTitle=this.element.attr("title"); 8526if(this.options.title==null&&this.originalTitle!=null){ 8527this.options.title=this.originalTitle; 8528} 8529if(this.options.disabled){ 8530this.options.disabled=false; 8531} 8532this._createWrapper(); 8533this.element 8534.show() 8535.removeAttr("title") 8536.appendTo(this.uiDialog); 8537this._addClass("ui-dialog-content", "ui-widget-content"); 8538this._createTitlebar(); 8539this._createButtonPane(); 8540if(this.options.draggable&&$.fn.draggable){ 8541this._makeDraggable(); 8542} 8543if(this.options.resizable&&$.fn.resizable){ 8544this._makeResizable(); 8545} 8546this._isOpen=false; 8547this._trackFocus(); 8548}, 8549_init: function (){ 8550if(this.options.autoOpen){ 8551this.open(); 8552}}, 8553_appendTo: function (){ 8554var element=this.options.appendTo; 8555if(element&&(element.jquery||element.nodeType)){ 8556return $(element); 8557} 8558return this.document.find(element||"body").eq(0); 8559}, 8560_destroy: function (){ 8561var next, 8562originalPosition=this.originalPosition; 8563this._untrackInstance(); 8564this._destroyOverlay(); 8565this.element 8566.removeUniqueId() 8567.css(this.originalCss) 8568.detach(); 8569this.uiDialog.remove(); 8570if(this.originalTitle){ 8571this.element.attr("title", this.originalTitle); 8572} 8573next=originalPosition.parent.children().eq(originalPosition.index); 8574if(next.length&&next[0]!==this.element[0]){ 8575next.before(this.element); 8576}else{ 8577originalPosition.parent.append(this.element); 8578}}, 8579widget: function (){ 8580return this.uiDialog; 8581}, 8582disable: $.noop, 8583enable: $.noop, 8584close: function (event){ 8585var that=this; 8586if(!this._isOpen||this._trigger("beforeClose", event)===false){ 8587return; 8588} 8589this._isOpen=false; 8590this._focusedElement=null; 8591this._destroyOverlay(); 8592this._untrackInstance(); 8593if(!this.opener.filter(":focusable").trigger("focus").length){ 8594$.ui.safeBlur($.ui.safeActiveElement(this.document[0])); 8595} 8596this._hide(this.uiDialog, this.options.hide, function (){ 8597that._trigger("close", event); 8598}); 8599}, 8600isOpen: function (){ 8601return this._isOpen; 8602}, 8603moveToTop: function (){ 8604this._moveToTop(); 8605}, 8606_moveToTop: function (event, silent){ 8607var moved=false, 8608zIndices=this.uiDialog.siblings(".ui-front:visible").map(function (){ 8609return +$(this).css("z-index"); 8610}).get(), 8611zIndexMax=Math.max.apply(null, zIndices); 8612if(zIndexMax >=+this.uiDialog.css("z-index")){ 8613this.uiDialog.css("z-index", zIndexMax + 1); 8614moved=true; 8615} 8616if(moved&&!silent){ 8617this._trigger("focus", event); 8618} 8619return moved; 8620}, 8621open: function (){ 8622var that=this; 8623if(this._isOpen){ 8624if(this._moveToTop()){ 8625this._focusTabbable(); 8626} 8627return; 8628} 8629this._isOpen=true; 8630this.opener=$($.ui.safeActiveElement(this.document[0])); 8631this._size(); 8632this._position(); 8633this._createOverlay(); 8634this._moveToTop(null, true); 8635if(this.overlay){ 8636this.overlay.css("z-index", this.uiDialog.css("z-index") - 1); 8637} 8638this._show(this.uiDialog, this.options.show, function (){ 8639that._focusTabbable(); 8640that._trigger("focus"); 8641}); 8642this._makeFocusTarget(); 8643this._trigger("open"); 8644}, 8645_focusTabbable: function (){ 8646var hasFocus=this._focusedElement; 8647if(!hasFocus){ 8648hasFocus=this.element.find("[autofocus]"); 8649} 8650if(!hasFocus.length){ 8651hasFocus=this.element.find(":tabbable"); 8652} 8653if(!hasFocus.length){ 8654hasFocus=this.uiDialogButtonPane.find(":tabbable"); 8655} 8656if(!hasFocus.length){ 8657hasFocus=this.uiDialogTitlebarClose.filter(":tabbable"); 8658} 8659if(!hasFocus.length){ 8660hasFocus=this.uiDialog; 8661} 8662hasFocus.eq(0).trigger("focus"); 8663}, 8664_keepFocus: function (event){ 8665function checkFocus(){ 8666var activeElement=$.ui.safeActiveElement(this.document[0]), 8667isActive=this.uiDialog[0]===activeElement || 8668$.contains(this.uiDialog[0], activeElement); 8669if(!isActive){ 8670this._focusTabbable(); 8671}} 8672event.preventDefault(); 8673checkFocus.call(this); 8674this._delay(checkFocus); 8675}, 8676_createWrapper: function (){ 8677this.uiDialog=$("<div>") 8678.hide() 8679.attr({ 8680tabIndex: -1, 8681role: "dialog" 8682}) 8683.appendTo(this._appendTo()); 8684this._addClass(this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front"); 8685this._on(this.uiDialog, { 8686keydown: function (event){ 8687if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode && 8688event.keyCode===$.ui.keyCode.ESCAPE){ 8689event.preventDefault(); 8690this.close(event); 8691return; 8692} 8693if(event.keyCode!==$.ui.keyCode.TAB||event.isDefaultPrevented()){ 8694return; 8695} 8696var tabbables=this.uiDialog.find(":tabbable"), 8697first=tabbables.filter(":first"), 8698last=tabbables.filter(":last"); 8699if((event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){ 8700this._delay(function (){ 8701first.trigger("focus"); 8702}); 8703event.preventDefault(); 8704}else if((event.target===first[0]||event.target===this.uiDialog[0])&&event.shiftKey){ 8705this._delay(function (){ 8706last.trigger("focus"); 8707}); 8708event.preventDefault(); 8709}}, 8710mousedown: function (event){ 8711if(this._moveToTop(event)){ 8712this._focusTabbable(); 8713}} 8714}); 8715if(!this.element.find("[aria-describedby]").length){ 8716this.uiDialog.attr({ 8717"aria-describedby": this.element.uniqueId().attr("id") 8718}); 8719}}, 8720_createTitlebar: function (){ 8721var uiDialogTitle; 8722this.uiDialogTitlebar=$("<div>"); 8723this._addClass(this.uiDialogTitlebar, 8724"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix"); 8725this._on(this.uiDialogTitlebar, { 8726mousedown: function (event){ 8727if(!$(event.target).closest(".ui-dialog-titlebar-close")){ 8728this.uiDialog.trigger("focus"); 8729}} 8730}); 8731this.uiDialogTitlebarClose=$("<button type='button'></button>") 8732.button({ 8733label: $("<a>").text(this.options.closeText).html(), 8734icon: "ui-icon-closethick", 8735showLabel: false 8736}) 8737.appendTo(this.uiDialogTitlebar); 8738this._addClass(this.uiDialogTitlebarClose, "ui-dialog-titlebar-close"); 8739this._on(this.uiDialogTitlebarClose, { 8740click: function (event){ 8741event.preventDefault(); 8742this.close(event); 8743}}); 8744uiDialogTitle=$("<span>").uniqueId().prependTo(this.uiDialogTitlebar); 8745this._addClass(uiDialogTitle, "ui-dialog-title"); 8746this._title(uiDialogTitle); 8747this.uiDialogTitlebar.prependTo(this.uiDialog); 8748this.uiDialog.attr({ 8749"aria-labelledby": uiDialogTitle.attr("id") 8750}); 8751}, 8752_title: function (title){ 8753if(this.options.title){ 8754title.text(this.options.title); 8755}else{ 8756title.html(" "); 8757}}, 8758_createButtonPane: function (){ 8759this.uiDialogButtonPane=$("<div>"); 8760this._addClass(this.uiDialogButtonPane, "ui-dialog-buttonpane", 8761"ui-widget-content ui-helper-clearfix"); 8762this.uiButtonSet=$("<div>") 8763.appendTo(this.uiDialogButtonPane); 8764this._addClass(this.uiButtonSet, "ui-dialog-buttonset"); 8765this._createButtons(); 8766}, 8767_createButtons: function (){ 8768var that=this, 8769buttons=this.options.buttons; 8770this.uiDialogButtonPane.remove(); 8771this.uiButtonSet.empty(); 8772if($.isEmptyObject(buttons)||($.isArray(buttons)&&!buttons.length)){ 8773this._removeClass(this.uiDialog, "ui-dialog-buttons"); 8774return; 8775} 8776$.each(buttons, function (name, props){ 8777var click, buttonOptions; 8778props=$.isFunction(props) ? 8779{ click: props, text: name } : 8780props; 8781props=$.extend({ type: "button" }, props); 8782click=props.click; 8783buttonOptions={ 8784icon: props.icon, 8785iconPosition: props.iconPosition, 8786showLabel: props.showLabel 8787}; 8788delete props.click; 8789delete props.icon; 8790delete props.iconPosition; 8791delete props.showLabel; 8792$("<button></button>", props) 8793.button(buttonOptions) 8794.appendTo(that.uiButtonSet) 8795.on("click", function (){ 8796click.apply(that.element[0], arguments); 8797}); 8798}); 8799this._addClass(this.uiDialog, "ui-dialog-buttons"); 8800this.uiDialogButtonPane.appendTo(this.uiDialog); 8801}, 8802_makeDraggable: function (){ 8803var that=this, 8804options=this.options; 8805function filteredUi(ui){ 8806return { 8807position: ui.position, 8808offset: ui.offset 8809};} 8810this.uiDialog.draggable({ 8811cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", 8812handle: ".ui-dialog-titlebar", 8813containment: "document", 8814start: function (event, ui){ 8815that._addClass($(this), "ui-dialog-dragging"); 8816that._blockFrames(); 8817that._trigger("dragStart", event, filteredUi(ui)); 8818}, 8819drag: function (event, ui){ 8820that._trigger("drag", event, filteredUi(ui)); 8821}, 8822stop: function (event, ui){ 8823var left=ui.offset.left - that.document.scrollLeft(), 8824top=ui.offset.top - that.document.scrollTop(); 8825options.position={ 8826my: "left top", 8827at: "left" + (left >=0 ? "+":"") + left + " " + 8828"top" + (top >=0 ? "+":"") + top, 8829of: that.window 8830}; 8831that._removeClass($(this), "ui-dialog-dragging"); 8832that._unblockFrames(); 8833that._trigger("dragStop", event, filteredUi(ui)); 8834}}); 8835}, 8836_makeResizable: function (){ 8837var that=this, 8838options=this.options, 8839handles=options.resizable, 8840position=this.uiDialog.css("position"), 8841resizeHandles=typeof handles==="string" ? 8842handles : 8843"n,e,s,w,se,sw,ne,nw"; 8844function filteredUi(ui){ 8845return { 8846originalPosition: ui.originalPosition, 8847originalSize: ui.originalSize, 8848position: ui.position, 8849size: ui.size 8850};} 8851this.uiDialog.resizable({ 8852cancel: ".ui-dialog-content", 8853containment: "document", 8854alsoResize: this.element, 8855maxWidth: options.maxWidth, 8856maxHeight: options.maxHeight, 8857minWidth: options.minWidth, 8858minHeight: this._minHeight(), 8859handles: resizeHandles, 8860start: function (event, ui){ 8861that._addClass($(this), "ui-dialog-resizing"); 8862that._blockFrames(); 8863that._trigger("resizeStart", event, filteredUi(ui)); 8864}, 8865resize: function (event, ui){ 8866that._trigger("resize", event, filteredUi(ui)); 8867}, 8868stop: function (event, ui){ 8869var offset=that.uiDialog.offset(), 8870left=offset.left - that.document.scrollLeft(), 8871top=offset.top - that.document.scrollTop(); 8872options.height=that.uiDialog.height(); 8873options.width=that.uiDialog.width(); 8874options.position={ 8875my: "left top", 8876at: "left" + (left >=0 ? "+":"") + left + " " + 8877"top" + (top >=0 ? "+":"") + top, 8878of: that.window 8879}; 8880that._removeClass($(this), "ui-dialog-resizing"); 8881that._unblockFrames(); 8882that._trigger("resizeStop", event, filteredUi(ui)); 8883}}) 8884.css("position", position); 8885}, 8886_trackFocus: function (){ 8887this._on(this.widget(), { 8888focusin: function (event){ 8889this._makeFocusTarget(); 8890this._focusedElement=$(event.target); 8891}}); 8892}, 8893_makeFocusTarget: function (){ 8894this._untrackInstance(); 8895this._trackingInstances().unshift(this); 8896}, 8897_untrackInstance: function (){ 8898var instances=this._trackingInstances(), 8899exists=$.inArray(this, instances); 8900if(exists!==-1){ 8901instances.splice(exists, 1); 8902}}, 8903_trackingInstances: function (){ 8904var instances=this.document.data("ui-dialog-instances"); 8905if(!instances){ 8906instances=[]; 8907this.document.data("ui-dialog-instances", instances); 8908} 8909return instances; 8910}, 8911_minHeight: function (){ 8912var options=this.options; 8913return options.height==="auto" ? 8914options.minHeight : 8915Math.min(options.minHeight, options.height); 8916}, 8917_position: function (){ 8918var isVisible=this.uiDialog.is(":visible"); 8919if(!isVisible){ 8920this.uiDialog.show(); 8921} 8922this.uiDialog.position(this.options.position); 8923if(!isVisible){ 8924this.uiDialog.hide(); 8925}}, 8926_setOptions: function (options){ 8927var that=this, 8928resize=false, 8929resizableOptions={}; 8930$.each(options, function (key, value){ 8931that._setOption(key, value); 8932if(key in that.sizeRelatedOptions){ 8933resize=true; 8934} 8935if(key in that.resizableRelatedOptions){ 8936resizableOptions[key]=value; 8937}}); 8938if(resize){ 8939this._size(); 8940this._position(); 8941} 8942if(this.uiDialog.is(":data(ui-resizable)")){ 8943this.uiDialog.resizable("option", resizableOptions); 8944}}, 8945_setOption: function (key, value){ 8946var isDraggable, isResizable, 8947uiDialog=this.uiDialog; 8948if(key==="disabled"){ 8949return; 8950} 8951this._super(key, value); 8952if(key==="appendTo"){ 8953this.uiDialog.appendTo(this._appendTo()); 8954} 8955if(key==="buttons"){ 8956this._createButtons(); 8957} 8958if(key==="closeText"){ 8959this.uiDialogTitlebarClose.button({ 8960label: $("<a>").text("" + this.options.closeText).html() 8961}); 8962} 8963if(key==="draggable"){ 8964isDraggable=uiDialog.is(":data(ui-draggable)"); 8965if(isDraggable&&!value){ 8966uiDialog.draggable("destroy"); 8967} 8968if(!isDraggable&&value){ 8969this._makeDraggable(); 8970}} 8971if(key==="position"){ 8972this._position(); 8973} 8974if(key==="resizable"){ 8975isResizable=uiDialog.is(":data(ui-resizable)"); 8976if(isResizable&&!value){ 8977uiDialog.resizable("destroy"); 8978} 8979if(isResizable&&typeof value==="string"){ 8980uiDialog.resizable("option", "handles", value); 8981} 8982if(!isResizable&&value!==false){ 8983this._makeResizable(); 8984}} 8985if(key==="title"){ 8986this._title(this.uiDialogTitlebar.find(".ui-dialog-title")); 8987}}, 8988_size: function (){ 8989var nonContentHeight, minContentHeight, maxContentHeight, 8990options=this.options; 8991this.element.show().css({ 8992width: "auto", 8993minHeight: 0, 8994maxHeight: "none", 8995height: 0 8996}); 8997if(options.minWidth > options.width){ 8998options.width=options.minWidth; 8999} 9000nonContentHeight=this.uiDialog.css({ 9001height: "auto", 9002width: options.width 9003}) 9004.outerHeight(); 9005minContentHeight=Math.max(0, options.minHeight - nonContentHeight); 9006maxContentHeight=typeof options.maxHeight==="number" ? 9007Math.max(0, options.maxHeight - nonContentHeight) : 9008"none"; 9009if(options.height==="auto"){ 9010this.element.css({ 9011minHeight: minContentHeight, 9012maxHeight: maxContentHeight, 9013height: "auto" 9014}); 9015}else{ 9016this.element.height(Math.max(0, options.height - nonContentHeight)); 9017} 9018if(this.uiDialog.is(":data(ui-resizable)")){ 9019this.uiDialog.resizable("option", "minHeight", this._minHeight()); 9020}}, 9021_blockFrames: function (){ 9022this.iframeBlocks=this.document.find("iframe").map(function (){ 9023var iframe=$(this); 9024return $("<div>") 9025.css({ 9026position: "absolute", 9027width: iframe.outerWidth(), 9028height: iframe.outerHeight() 9029}) 9030.appendTo(iframe.parent()) 9031.offset(iframe.offset())[0]; 9032}); 9033}, 9034_unblockFrames: function (){ 9035if(this.iframeBlocks){ 9036this.iframeBlocks.remove(); 9037delete this.iframeBlocks; 9038}}, 9039_allowInteraction: function (event){ 9040if($(event.target).closest(".ui-dialog").length){ 9041return true; 9042} 9043return !!$(event.target).closest(".ui-datepicker").length; 9044}, 9045_createOverlay: function (){ 9046if(!this.options.modal){ 9047return; 9048} 9049var isOpening=true; 9050this._delay(function (){ 9051isOpening=false; 9052}); 9053if(!this.document.data("ui-dialog-overlays")){ 9054this._on(this.document, { 9055focusin: function (event){ 9056if(isOpening){ 9057return; 9058} 9059if(!this._allowInteraction(event)){ 9060event.preventDefault(); 9061this._trackingInstances()[0]._focusTabbable(); 9062}} 9063}); 9064} 9065this.overlay=$("<div>") 9066.appendTo(this._appendTo()); 9067this._addClass(this.overlay, null, "ui-widget-overlay ui-front"); 9068this._on(this.overlay, { 9069mousedown: "_keepFocus" 9070}); 9071this.document.data("ui-dialog-overlays", 9072(this.document.data("ui-dialog-overlays")||0) + 1); 9073}, 9074_destroyOverlay: function (){ 9075if(!this.options.modal){ 9076return; 9077} 9078if(this.overlay){ 9079var overlays=this.document.data("ui-dialog-overlays") - 1; 9080if(!overlays){ 9081this._off(this.document, "focusin"); 9082this.document.removeData("ui-dialog-overlays"); 9083}else{ 9084this.document.data("ui-dialog-overlays", overlays); 9085} 9086this.overlay.remove(); 9087this.overlay=null; 9088}} 9089}); 9090if($.uiBackCompat!==false){ 9091$.widget("ui.dialog", $.ui.dialog, { 9092options: { 9093dialogClass: "" 9094}, 9095_createWrapper: function (){ 9096this._super(); 9097this.uiDialog.addClass(this.options.dialogClass); 9098}, 9099_setOption: function (key, value){ 9100if(key==="dialogClass"){ 9101this.uiDialog 9102.removeClass(this.options.dialogClass) 9103.addClass(value); 9104} 9105this._superApply(arguments); 9106}}); 9107} 9108return $.ui.dialog; 9109})); 9110(function (factory){ 9111if(typeof define==="function"&&define.amd){ 9112define('ui/widgets/droppable.js', [ 9113"jquery", 9114"./draggable", 9115"./mouse", 9116"../version", 9117"../widget" 9118], factory); 9119}else{ 9120factory(jQuery); 9121}}(function ($){ 9122$.widget("ui.droppable", { 9123version: "@VERSION", 9124widgetEventPrefix: "drop", 9125options: { 9126accept: "*", 9127addClasses: true, 9128greedy: false, 9129scope: "default", 9130tolerance: "intersect", 9131activate: null, 9132deactivate: null, 9133drop: null, 9134out: null, 9135over: null 9136}, 9137_create: function (){ 9138var proportions, 9139o=this.options, 9140accept=o.accept; 9141this.isover=false; 9142this.isout=true; 9143this.accept=$.isFunction(accept) ? accept:function (d){ 9144return d.is(accept); 9145}; 9146this.proportions=function(){ 9147if(arguments.length){ 9148proportions=arguments[0]; 9149}else{ 9150return proportions ? 9151proportions : 9152proportions={ 9153width: this.element[0].offsetWidth, 9154height: this.element[0].offsetHeight 9155};}}; 9156this._addToManager(o.scope); 9157o.addClasses&&this._addClass("ui-droppable"); 9158}, 9159_addToManager: function (scope){ 9160$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[]; 9161$.ui.ddmanager.droppables[scope].push(this); 9162}, 9163_splice: function (drop){ 9164var i=0; 9165for (; i < drop.length; i++){ 9166if(drop[i]===this){ 9167drop.splice(i, 1); 9168}} 9169}, 9170_destroy: function (){ 9171var drop=$.ui.ddmanager.droppables[this.options.scope]; 9172this._splice(drop); 9173}, 9174_setOption: function (key, value){ 9175if(key==="accept"){ 9176this.accept=$.isFunction(value) ? value:function (d){ 9177return d.is(value); 9178};}else if(key==="scope"){ 9179var drop=$.ui.ddmanager.droppables[this.options.scope]; 9180this._splice(drop); 9181this._addToManager(value); 9182} 9183this._super(key, value); 9184}, 9185_activate: function (event){ 9186var draggable=$.ui.ddmanager.current; 9187this._addActiveClass(); 9188if(draggable){ 9189this._trigger("activate", event, this.ui(draggable)); 9190}}, 9191_deactivate: function (event){ 9192var draggable=$.ui.ddmanager.current; 9193this._removeActiveClass(); 9194if(draggable){ 9195this._trigger("deactivate", event, this.ui(draggable)); 9196}}, 9197_over: function (event){ 9198var draggable=$.ui.ddmanager.current; 9199if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){ 9200return; 9201} 9202if(this.accept.call(this.element[0], (draggable.currentItem||draggable.element))){ 9203this._addHoverClass(); 9204this._trigger("over", event, this.ui(draggable)); 9205}}, 9206_out: function (event){ 9207var draggable=$.ui.ddmanager.current; 9208if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){ 9209return; 9210} 9211if(this.accept.call(this.element[0], (draggable.currentItem||draggable.element))){ 9212this._removeHoverClass(); 9213this._trigger("out", event, this.ui(draggable)); 9214}}, 9215_drop: function (event, custom){ 9216var draggable=custom||$.ui.ddmanager.current, 9217childrenIntersection=false; 9218if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){ 9219return false; 9220} 9221this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function (){ 9222var inst=$(this).droppable("instance"); 9223if(inst.options.greedy && 9224!inst.options.disabled && 9225inst.options.scope===draggable.options.scope && 9226inst.accept.call(inst.element[0], (draggable.currentItem||draggable.element)) && 9227intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance, event) 9228){ childrenIntersection=true; return false; }}); 9229if(childrenIntersection){ 9230return false; 9231} 9232if(this.accept.call(this.element[0], (draggable.currentItem||draggable.element))){ 9233this._removeActiveClass(); 9234this._removeHoverClass(); 9235this._trigger("drop", event, this.ui(draggable)); 9236return this.element; 9237} 9238return false; 9239}, 9240ui: function (c){ 9241return { 9242draggable: (c.currentItem||c.element), 9243helper: c.helper, 9244position: c.position, 9245offset: c.positionAbs 9246};}, 9247_addHoverClass: function (){ 9248this._addClass("ui-droppable-hover"); 9249}, 9250_removeHoverClass: function (){ 9251this._removeClass("ui-droppable-hover"); 9252}, 9253_addActiveClass: function (){ 9254this._addClass("ui-droppable-active"); 9255}, 9256_removeActiveClass: function (){ 9257this._removeClass("ui-droppable-active"); 9258}}); 9259var intersect=(function (){ 9260function isOverAxis(x, reference, size){ 9261return (x >=reference)&&(x < (reference + size)); 9262} 9263return function (draggable, droppable, toleranceMode, event){ 9264if(!droppable.offset){ 9265return false; 9266} 9267var x1=(draggable.positionAbs||draggable.position.absolute).left + draggable.margins.left, 9268y1=(draggable.positionAbs||draggable.position.absolute).top + draggable.margins.top, 9269x2=x1 + draggable.helperProportions.width, 9270y2=y1 + draggable.helperProportions.height, 9271l=droppable.offset.left, 9272t=droppable.offset.top, 9273r=l + droppable.proportions().width, 9274b=t + droppable.proportions().height; 9275switch (toleranceMode){ 9276case "fit": 9277return (l <=x1&&x2 <=r&&t <=y1&&y2 <=b); 9278case "intersect": 9279return (l < x1 + (draggable.helperProportions.width / 2) && 9280x2 - (draggable.helperProportions.width / 2) < r && 9281t < y1 + (draggable.helperProportions.height / 2) && 9282y2 - (draggable.helperProportions.height / 2) < b); 9283case "pointer": 9284return isOverAxis(event.pageY, t, droppable.proportions().height)&&isOverAxis(event.pageX, l, droppable.proportions().width); 9285case "touch": 9286return ( 9287(y1 >=t&&y1 <=b) || 9288(y2 >=t&&y2 <=b) || 9289(y1 < t&&y2 > b) 9290)&&( 9291(x1 >=l&&x1 <=r) || 9292(x2 >=l&&x2 <=r) || 9293(x1 < l&&x2 > r) 9294); 9295default: 9296return false; 9297}};})(); 9298$.ui.ddmanager={ 9299current: null, 9300droppables: { "default": [] }, 9301prepareOffsets: function (t, event){ 9302var i, j, 9303m=$.ui.ddmanager.droppables[t.options.scope]||[], 9304type=event ? event.type:null, 9305list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack(); 9306droppablesLoop: for (i=0; i < m.length; i++){ 9307if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0], (t.currentItem||t.element)))){ 9308continue; 9309} 9310for (j=0; j < list.length; j++){ 9311if(list[j]===m[i].element[0]){ 9312m[i].proportions().height=0; 9313continue droppablesLoop; 9314}} 9315m[i].visible=m[i].element.css("display")!=="none"; 9316if(!m[i].visible){ 9317continue; 9318} 9319if(type==="mousedown"){ 9320m[i]._activate.call(m[i], event); 9321} 9322m[i].offset=m[i].element.offset(); 9323m[i].proportions({ width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }); 9324}}, 9325drop: function (draggable, event){ 9326var dropped=false; 9327$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(), function (){ 9328if(!this.options){ 9329return; 9330} 9331if(!this.options.disabled&&this.visible&&intersect(draggable, this, this.options.tolerance, event)){ 9332dropped=this._drop.call(this, event)||dropped; 9333} 9334if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0], (draggable.currentItem||draggable.element))){ 9335this.isout=true; 9336this.isover=false; 9337this._deactivate.call(this, event); 9338}}); 9339return dropped; 9340}, 9341dragStart: function (draggable, event){ 9342draggable.element.parentsUntil("body").on("scroll.droppable", function (){ 9343if(!draggable.options.refreshPositions){ 9344$.ui.ddmanager.prepareOffsets(draggable, event); 9345}}); 9346}, 9347drag: function (draggable, event){ 9348if(draggable.options.refreshPositions){ 9349$.ui.ddmanager.prepareOffsets(draggable, event); 9350} 9351$.each($.ui.ddmanager.droppables[draggable.options.scope]||[], function (){ 9352if(this.options.disabled||this.greedyChild||!this.visible){ 9353return; 9354} 9355var parentInstance, scope, parent, 9356intersects=intersect(draggable, this, this.options.tolerance, event), 9357c = !intersects&&this.isover ? "isout":(intersects&&!this.isover ? "isover":null); 9358if(!c){ 9359return; 9360} 9361if(this.options.greedy){ 9362scope=this.options.scope; 9363parent=this.element.parents(":data(ui-droppable)").filter(function (){ 9364return $(this).droppable("instance").options.scope===scope; 9365}); 9366if(parent.length){ 9367parentInstance=$(parent[0]).droppable("instance"); 9368parentInstance.greedyChild=(c==="isover"); 9369}} 9370if(parentInstance&&c==="isover"){ 9371parentInstance.isover=false; 9372parentInstance.isout=true; 9373parentInstance._out.call(parentInstance, event); 9374} 9375this[c]=true; 9376this[c==="isout" ? "isover":"isout"]=false; 9377this[c==="isover" ? "_over":"_out"].call(this, event); 9378if(parentInstance&&c==="isout"){ 9379parentInstance.isout=false; 9380parentInstance.isover=true; 9381parentInstance._over.call(parentInstance, event); 9382}}); 9383}, 9384dragStop: function (draggable, event){ 9385draggable.element.parentsUntil("body").off("scroll.droppable"); 9386if(!draggable.options.refreshPositions){ 9387$.ui.ddmanager.prepareOffsets(draggable, event); 9388}} 9389}; 9390if($.uiBackCompat!==false){ 9391$.widget("ui.droppable", $.ui.droppable, { 9392options: { 9393hoverClass: false, 9394activeClass: false 9395}, 9396_addActiveClass: function (){ 9397this._super(); 9398if(this.options.activeClass){ 9399this.element.addClass(this.options.activeClass); 9400}}, 9401_removeActiveClass: function (){ 9402this._super(); 9403if(this.options.activeClass){ 9404this.element.removeClass(this.options.activeClass); 9405}}, 9406_addHoverClass: function (){ 9407this._super(); 9408if(this.options.hoverClass){ 9409this.element.addClass(this.options.hoverClass); 9410}}, 9411_removeHoverClass: function (){ 9412this._super(); 9413if(this.options.hoverClass){ 9414this.element.removeClass(this.options.hoverClass); 9415}} 9416}); 9417} 9418return $.ui.droppable; 9419})); 9420(function (factory){ 9421if(typeof define==="function"&&define.amd){ 9422define('ui/widgets/progressbar.js', [ 9423"jquery", 9424"../version", 9425"../widget" 9426], factory); 9427}else{ 9428factory(jQuery); 9429}}(function ($){ 9430return $.widget("ui.progressbar", { 9431version: "@VERSION", 9432options: { 9433classes: { 9434"ui-progressbar": "ui-corner-all", 9435"ui-progressbar-value": "ui-corner-left", 9436"ui-progressbar-complete": "ui-corner-right" 9437}, 9438max: 100, 9439value: 0, 9440change: null, 9441complete: null 9442}, 9443min: 0, 9444_create: function (){ 9445this.oldValue=this.options.value=this._constrainedValue(); 9446this.element.attr({ 9447role: "progressbar", 9448"aria-valuemin": this.min 9449}); 9450this._addClass("ui-progressbar", "ui-widget ui-widget-content"); 9451this.valueDiv=$("<div>").appendTo(this.element); 9452this._addClass(this.valueDiv, "ui-progressbar-value", "ui-widget-header"); 9453this._refreshValue(); 9454}, 9455_destroy: function (){ 9456this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"); 9457this.valueDiv.remove(); 9458}, 9459value: function (newValue){ 9460if(newValue===undefined){ 9461return this.options.value; 9462} 9463this.options.value=this._constrainedValue(newValue); 9464this._refreshValue(); 9465}, 9466_constrainedValue: function (newValue){ 9467if(newValue===undefined){ 9468newValue=this.options.value; 9469} 9470this.indeterminate=newValue===false; 9471if(typeof newValue!=="number"){ 9472newValue=0; 9473} 9474return this.indeterminate ? false : 9475Math.min(this.options.max, Math.max(this.min, newValue)); 9476}, 9477_setOptions: function (options){ 9478var value=options.value; 9479delete options.value; 9480this._super(options); 9481this.options.value=this._constrainedValue(value); 9482this._refreshValue(); 9483}, 9484_setOption: function (key, value){ 9485if(key==="max"){ 9486value=Math.max(this.min, value); 9487} 9488this._super(key, value); 9489}, 9490_setOptionDisabled: function (value){ 9491this._super(value); 9492this.element.attr("aria-disabled", value); 9493this._toggleClass(null, "ui-state-disabled", !!value); 9494}, 9495_percentage: function (){ 9496return this.indeterminate ? 100:100 * (this.options.value - this.min) / (this.options.max - this.min); 9497}, 9498_refreshValue: function (){ 9499var value=this.options.value, 9500percentage=this._percentage(); 9501this.valueDiv 9502.toggle(this.indeterminate||value > this.min) 9503.width(percentage.toFixed(0) + "%"); 9504this 9505._toggleClass(this.valueDiv, "ui-progressbar-complete", null, 9506value===this.options.max) 9507._toggleClass("ui-progressbar-indeterminate", null, this.indeterminate); 9508if(this.indeterminate){ 9509this.element.removeAttr("aria-valuenow"); 9510if(!this.overlayDiv){ 9511this.overlayDiv=$("<div>").appendTo(this.valueDiv); 9512this._addClass(this.overlayDiv, "ui-progressbar-overlay"); 9513}}else{ 9514this.element.attr({ 9515"aria-valuemax": this.options.max, 9516"aria-valuenow": value 9517}); 9518if(this.overlayDiv){ 9519this.overlayDiv.remove(); 9520this.overlayDiv=null; 9521}} 9522if(this.oldValue!==value){ 9523this.oldValue=value; 9524this._trigger("change"); 9525} 9526if(value===this.options.max){ 9527this._trigger("complete"); 9528}} 9529}); 9530})); 9531(function (factory){ 9532if(typeof define==="function"&&define.amd){ 9533define('ui/widgets/selectable.js', [ 9534"jquery", 9535"./mouse", 9536"../version", 9537"../widget" 9538], factory); 9539}else{ 9540factory(jQuery); 9541}}(function ($){ 9542return $.widget("ui.selectable", $.ui.mouse, { 9543version: "@VERSION", 9544options: { 9545appendTo: "body", 9546autoRefresh: true, 9547distance: 0, 9548filter: "*", 9549tolerance: "touch", 9550selected: null, 9551selecting: null, 9552start: null, 9553stop: null, 9554unselected: null, 9555unselecting: null 9556}, 9557_create: function (){ 9558var that=this; 9559this._addClass("ui-selectable"); 9560this.dragged=false; 9561this.refresh=function (){ 9562that.selectees=$(that.options.filter, that.element[0]); 9563that._addClass(that.selectees, "ui-selectee"); 9564that.selectees.each(function (){ 9565var $this=$(this), 9566pos=$this.offset(); 9567$.data(this, "selectable-item", { 9568element: this, 9569$element: $this, 9570left: pos.left, 9571top: pos.top, 9572right: pos.left + $this.outerWidth(), 9573bottom: pos.top + $this.outerHeight(), 9574startselected: false, 9575selected: $this.hasClass("ui-selected"), 9576selecting: $this.hasClass("ui-selecting"), 9577unselecting: $this.hasClass("ui-unselecting") 9578}); 9579}); 9580}; 9581this.refresh(); 9582this._mouseInit(); 9583this.helper=$("<div>"); 9584this._addClass(this.helper, "ui-selectable-helper"); 9585}, 9586_destroy: function (){ 9587this.selectees.removeData("selectable-item"); 9588this._mouseDestroy(); 9589}, 9590_mouseStart: function (event){ 9591var that=this, 9592options=this.options; 9593this.opos=[event.pageX, event.pageY]; 9594if(this.options.disabled){ 9595return; 9596} 9597this.selectees=$(options.filter, this.element[0]); 9598this._trigger("start", event); 9599$(options.appendTo).append(this.helper); 9600this.helper.css({ 9601"left": event.pageX, 9602"top": event.pageY, 9603"width": 0, 9604"height": 0 9605}
vendor: 7,088 bytes, lines 9605-9875
9605); 9606if(options.autoRefresh){ 9607this.refresh(); 9608} 9609this.selectees.filter(".ui-selected").each(function (){ 9610var selectee=$.data(this, "selectable-item"); 9611selectee.startselected=true; 9612if(!event.metaKey&&!event.ctrlKey){ 9613that._removeClass(selectee.$element, "ui-selected"); 9614selectee.selected=false; 9615that._addClass(selectee.$element, "ui-unselecting"); 9616selectee.unselecting=true; 9617that._trigger("unselecting", event, { 9618unselecting: selectee.element 9619}); 9620}}); 9621$(event.target).parents().addBack().each(function (){ 9622var doSelect, 9623selectee=$.data(this, "selectable-item"); 9624if(selectee){ 9625doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected"); 9626that._removeClass(selectee.$element, doSelect ? "ui-unselecting":"ui-selected") 9627._addClass(selectee.$element, doSelect ? "ui-selecting":"ui-unselecting"); 9628selectee.unselecting = !doSelect; 9629selectee.selecting=doSelect; 9630selectee.selected=doSelect; 9631if(doSelect){ 9632that._trigger("selecting", event, { 9633selecting: selectee.element 9634}); 9635}else{ 9636that._trigger("unselecting", event, { 9637unselecting: selectee.element 9638}); 9639} 9640return false; 9641}}); 9642}, 9643_mouseDrag: function (event){ 9644this.dragged=true; 9645if(this.options.disabled){ 9646return; 9647} 9648var tmp, 9649that=this, 9650options=this.options, 9651x1=this.opos[0], 9652y1=this.opos[1], 9653x2=event.pageX, 9654y2=event.pageY; 9655if(x1 > x2){ tmp=x2; x2=x1; x1=tmp; } 9656if(y1 > y2){ tmp=y2; y2=y1; y1=tmp; } 9657this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 }); 9658this.selectees.each(function (){ 9659var selectee=$.data(this, "selectable-item"), 9660hit=false; 9661if(!selectee||selectee.element===that.element[0]){ 9662return; 9663} 9664if(options.tolerance==="touch"){ 9665hit=(!(selectee.left > x2||selectee.right < x1||selectee.top > y2||selectee.bottom < y1)); 9666}else if(options.tolerance==="fit"){ 9667hit=(selectee.left > x1&&selectee.right < x2&&selectee.top > y1&&selectee.bottom < y2); 9668} 9669if(hit){ 9670if(selectee.selected){ 9671that._removeClass(selectee.$element, "ui-selected"); 9672selectee.selected=false; 9673} 9674if(selectee.unselecting){ 9675that._removeClass(selectee.$element, "ui-unselecting"); 9676selectee.unselecting=false; 9677} 9678if(!selectee.selecting){ 9679that._addClass(selectee.$element, "ui-selecting"); 9680selectee.selecting=true; 9681that._trigger("selecting", event, { 9682selecting: selectee.element 9683}); 9684}}else{ 9685if(selectee.selecting){ 9686if((event.metaKey||event.ctrlKey)&&selectee.startselected){ 9687that._removeClass(selectee.$element, "ui-selecting"); 9688selectee.selecting=false; 9689that._addClass(selectee.$element, "ui-selected"); 9690selectee.selected=true; 9691}else{ 9692that._removeClass(selectee.$element, "ui-selecting"); 9693selectee.selecting=false; 9694if(selectee.startselected){ 9695that._addClass(selectee.$element, "ui-unselecting"); 9696selectee.unselecting=true; 9697} 9698that._trigger("unselecting", event, { 9699unselecting: selectee.element 9700}); 9701}} 9702if(selectee.selected){ 9703if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){ 9704that._removeClass(selectee.$element, "ui-selected"); 9705selectee.selected=false; 9706that._addClass(selectee.$element, "ui-unselecting"); 9707selectee.unselecting=true; 9708that._trigger("unselecting", event, { 9709unselecting: selectee.element 9710}); 9711}} 9712}}); 9713return false; 9714}, 9715_mouseStop: function (event){ 9716var that=this; 9717this.dragged=false; 9718$(".ui-unselecting", this.element[0]).each(function (){ 9719var selectee=$.data(this, "selectable-item"); 9720that._removeClass(selectee.$element, "ui-unselecting"); 9721selectee.unselecting=false; 9722selectee.startselected=false; 9723that._trigger("unselected", event, { 9724unselected: selectee.element 9725}); 9726}); 9727$(".ui-selecting", this.element[0]).each(function (){ 9728var selectee=$.data(this, "selectable-item"); 9729that._removeClass(selectee.$element, "ui-selecting") 9730._addClass(selectee.$element, "ui-selected"); 9731selectee.selecting=false; 9732selectee.selected=true; 9733selectee.startselected=true; 9734that._trigger("selected", event, { 9735selected: selectee.element 9736}); 9737}); 9738this._trigger("stop", event); 9739this.helper.remove(); 9740return false; 9741}}); 9742})); 9743(function (factory){ 9744if(typeof define==="function"&&define.amd){ 9745define('ui/widgets/selectmenu.js', [ 9746"jquery", 9747"./menu", 9748"../escape-selector", 9749"../form-reset-mixin", 9750"../keycode", 9751"../labels", 9752"../position", 9753"../unique-id", 9754"../version", 9755"../widget" 9756], factory); 9757}else{ 9758factory(jQuery); 9759}}(function ($){ 9760return $.widget("ui.selectmenu", [$.ui.formResetMixin, { 9761version: "@VERSION", 9762defaultElement: "<select>", 9763options: { 9764appendTo: null, 9765classes: { 9766"ui-selectmenu-button-open": "ui-corner-top", 9767"ui-selectmenu-button-closed": "ui-corner-all" 9768}, 9769disabled: null, 9770icons: { 9771button: "ui-icon-triangle-1-s" 9772}, 9773position: { 9774my: "left top", 9775at: "left bottom", 9776collision: "none" 9777}, 9778width: false, 9779change: null, 9780close: null, 9781focus: null, 9782open: null, 9783select: null 9784}, 9785_create: function (){ 9786var selectmenuId=this.element.uniqueId().attr("id"); 9787this.ids={ 9788element: selectmenuId, 9789button: selectmenuId + "-button", 9790menu: selectmenuId + "-menu" 9791}; 9792this._drawButton(); 9793this._drawMenu(); 9794this._bindFormResetHandler(); 9795this._rendered=false; 9796this.menuItems=$(); 9797}, 9798_drawButton: function (){ 9799var icon, space, 9800that=this, 9801item=this._parseOption(this.element.find("option:selected"), 9802this.element[0].selectedIndex 9803); 9804this.labels=this.element.labels().attr("for", this.ids.button); 9805this._on(this.labels, { 9806click: function (event){ 9807this.button.focus(); 9808event.preventDefault(); 9809}}); 9810this.element.hide(); 9811this.button=$("<span>", { 9812tabindex: this.options.disabled ? -1:0, 9813id: this.ids.button, 9814role: "combobox", 9815"aria-expanded": "false", 9816"aria-autocomplete": "list", 9817"aria-owns": this.ids.menu, 9818"aria-haspopup": "true", 9819title: this.element.attr("title") 9820}) 9821.insertAfter(this.element); 9822this._addClass(this.button, "ui-selectmenu-button ui-selectmenu-button-closed", 9823"ui-button ui-widget"); 9824icon=$("<span>").prependTo(this.button); 9825space=$("<span> </span>"); 9826this._addClass(space, "ui-selectmenu-icon-space"); 9827this._addClass(icon, null, "ui-icon " + this.options.icons.button); 9828icon.after(space); 9829this.buttonItem=this._renderButtonItem(item) 9830.appendTo(this.button); 9831if(this.options.width!==false){ 9832this._resizeButton(); 9833} 9834this._on(this.button, this._buttonEvents); 9835this.button.one("focusin", function (){ 9836if(!that._rendered){ 9837that._refreshMenu(); 9838}}); 9839}, 9840_drawMenu: function (){ 9841var that=this; 9842this.menu=$("<ul>", { 9843"aria-hidden": "true", 9844"aria-labelledby": this.ids.button, 9845id: this.ids.menu 9846}); 9847this.menuWrap=$("<div>").append(this.menu); 9848this._addClass(this.menuWrap, "ui-selectmenu-menu", "ui-front"); 9849this.menuWrap.appendTo(this._appendTo()); 9850this.menuInstance=this.menu 9851.menu({ 9852classes: { 9853"ui-menu": "ui-corner-bottom" 9854}, 9855role: "listbox", 9856select: function (event, ui){ 9857event.preventDefault(); 9858that._setSelection(); 9859that._select(ui.item.data("ui-selectmenu-item"), event); 9860}, 9861focus: function (event, ui){ 9862var item=ui.item.data("ui-selectmenu-item"); 9863if(that.focusIndex!=null&&item.index!==that.focusIndex){ 9864that._trigger("focus", event, { item: item }); 9865if(!that.isOpen){ 9866that._select(item, event); 9867}} 9868that.focusIndex=item.index; 9869that.button.attr("aria-activedescendant", 9870that.menuItems.eq(item.index).attr("id")); 9871}}) 9872.menu("instance"); 9873this.menuInstance._off(this.menu, "mouseleave"); 9874this.menuInstance._closeOnDocumentClick=function (){ 9875return false;
vendor: 10,741 bytes, lines 9876-10327
9876}; 9877this.menuInstance._isDivider=function (){ 9878return false; 9879};}, 9880refresh: function (){ 9881this._refreshMenu(); 9882this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{} 9883) 9884); 9885if(this.options.width===null){ 9886this._resizeButton(); 9887}}, 9888_refreshMenu: function (){ 9889var item, 9890options=this.element.find("option"); 9891this.menu.empty(); 9892this._parseOptions(options); 9893this._renderMenu(this.menu, this.items); 9894this.menuInstance.refresh(); 9895this.menuItems=this.menu.find("li") 9896.not(".ui-selectmenu-optgroup") 9897.find(".ui-menu-item-wrapper"); 9898this._rendered=true; 9899if(!options.length){ 9900return; 9901} 9902item=this._getSelectedItem(); 9903this.menuInstance.focus(null, item); 9904this._setAria(item.data("ui-selectmenu-item")); 9905this._setOption("disabled", this.element.prop("disabled")); 9906}, 9907open: function (event){ 9908if(this.options.disabled){ 9909return; 9910} 9911if(!this._rendered){ 9912this._refreshMenu(); 9913}else{ 9914this._removeClass(this.menu.find(".ui-state-active"), null, "ui-state-active"); 9915this.menuInstance.focus(null, this._getSelectedItem()); 9916} 9917if(!this.menuItems.length){ 9918return; 9919} 9920this.isOpen=true; 9921this._toggleAttr(); 9922this._resizeMenu(); 9923this._position(); 9924this._on(this.document, this._documentClick); 9925this._trigger("open", event); 9926}, 9927_position: function (){ 9928this.menuWrap.position($.extend({ of: this.button }, this.options.position)); 9929}, 9930close: function (event){ 9931if(!this.isOpen){ 9932return; 9933} 9934this.isOpen=false; 9935this._toggleAttr(); 9936this.range=null; 9937this._off(this.document); 9938this._trigger("close", event); 9939}, 9940widget: function (){ 9941return this.button; 9942}, 9943menuWidget: function (){ 9944return this.menu; 9945}, 9946_renderButtonItem: function (item){ 9947var buttonItem=$("<span>"); 9948this._setText(buttonItem, item.label); 9949this._addClass(buttonItem, "ui-selectmenu-text"); 9950return buttonItem; 9951}, 9952_renderMenu: function (ul, items){ 9953var that=this, 9954currentOptgroup=""; 9955$.each(items, function (index, item){ 9956var li; 9957if(item.optgroup!==currentOptgroup){ 9958li=$("<li>", { 9959text: item.optgroup 9960}); 9961that._addClass(li, "ui-selectmenu-optgroup", "ui-menu-divider" + 9962(item.element.parent("optgroup").prop("disabled") ? 9963" ui-state-disabled" : 9964"")); 9965li.appendTo(ul); 9966currentOptgroup=item.optgroup; 9967} 9968that._renderItemData(ul, item); 9969}); 9970}, 9971_renderItemData: function (ul, item){ 9972return this._renderItem(ul, item).data("ui-selectmenu-item", item); 9973}, 9974_renderItem: function (ul, item){ 9975var li=$("<li>"), 9976wrapper=$("<div>", { 9977title: item.element.attr("title") 9978}); 9979if(item.disabled){ 9980this._addClass(li, null, "ui-state-disabled"); 9981} 9982this._setText(wrapper, item.label); 9983return li.append(wrapper).appendTo(ul); 9984}, 9985_setText: function (element, value){ 9986if(value){ 9987element.text(value); 9988}else{ 9989element.html(" "); 9990}}, 9991_move: function (direction, event){ 9992var item, next, 9993filter=".ui-menu-item"; 9994if(this.isOpen){ 9995item=this.menuItems.eq(this.focusIndex).parent("li"); 9996}else{ 9997item=this.menuItems.eq(this.element[0].selectedIndex).parent("li"); 9998filter +=":not(.ui-state-disabled)"; 9999} 10000if(direction==="first"||direction==="last"){ 10001next=item[direction==="first" ? "prevAll":"nextAll"](filter).eq(-1); 10002}else{ 10003next=item[direction + "All"](filter).eq(0); 10004} 10005if(next.length){ 10006this.menuInstance.focus(event, next); 10007}}, 10008_getSelectedItem: function (){ 10009return this.menuItems.eq(this.element[0].selectedIndex).parent("li"); 10010}, 10011_toggle: function (event){ 10012this[this.isOpen ? "close":"open"](event); 10013}, 10014_setSelection: function (){ 10015var selection; 10016if(!this.range){ 10017return; 10018} 10019if(window.getSelection){ 10020selection=window.getSelection(); 10021selection.removeAllRanges(); 10022selection.addRange(this.range); 10023}else{ 10024this.range.select(); 10025} 10026this.button.focus(); 10027}, 10028_documentClick: { 10029mousedown: function (event){ 10030if(!this.isOpen){ 10031return; 10032} 10033if(!$(event.target).closest(".ui-selectmenu-menu, #" + 10034$.ui.escapeSelector(this.ids.button)).length){ 10035this.close(event); 10036}} 10037}, 10038_buttonEvents: { 10039mousedown: function (){ 10040var selection; 10041if(window.getSelection){ 10042selection=window.getSelection(); 10043if(selection.rangeCount){ 10044this.range=selection.getRangeAt(0); 10045}}else{ 10046this.range=document.selection.createRange(); 10047}}, 10048click: function (event){ 10049this._setSelection(); 10050this._toggle(event); 10051}, 10052keydown: function (event){ 10053var preventDefault=true; 10054switch (event.keyCode){ 10055case $.ui.keyCode.TAB: 10056case $.ui.keyCode.ESCAPE: 10057this.close(event); 10058preventDefault=false; 10059break; 10060case $.ui.keyCode.ENTER: 10061if(this.isOpen){ 10062this._selectFocusedItem(event); 10063} 10064break; 10065case $.ui.keyCode.UP: 10066if(event.altKey){ 10067this._toggle(event); 10068}else{ 10069this._move("prev", event); 10070} 10071break; 10072case $.ui.keyCode.DOWN: 10073if(event.altKey){ 10074this._toggle(event); 10075}else{ 10076this._move("next", event); 10077} 10078break; 10079case $.ui.keyCode.SPACE: 10080if(this.isOpen){ 10081this._selectFocusedItem(event); 10082}else{ 10083this._toggle(event); 10084} 10085break; 10086case $.ui.keyCode.LEFT: 10087this._move("prev", event); 10088break; 10089case $.ui.keyCode.RIGHT: 10090this._move("next", event); 10091break; 10092case $.ui.keyCode.HOME: 10093case $.ui.keyCode.PAGE_UP: 10094this._move("first", event); 10095break; 10096case $.ui.keyCode.END: 10097case $.ui.keyCode.PAGE_DOWN: 10098this._move("last", event); 10099break; 10100default: 10101this.menu.trigger(event); 10102preventDefault=false; 10103} 10104if(preventDefault){ 10105event.preventDefault(); 10106}} 10107}, 10108_selectFocusedItem: function (event){ 10109var item=this.menuItems.eq(this.focusIndex).parent("li"); 10110if(!item.hasClass("ui-state-disabled")){ 10111this._select(item.data("ui-selectmenu-item"), event); 10112}}, 10113_select: function (item, event){ 10114var oldIndex=this.element[0].selectedIndex; 10115this.element[0].selectedIndex=item.index; 10116this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(item)); 10117this._setAria(item); 10118this._trigger("select", event, { item: item }); 10119if(item.index!==oldIndex){ 10120this._trigger("change", event, { item: item }); 10121} 10122this.close(event); 10123}, 10124_setAria: function (item){ 10125var id=this.menuItems.eq(item.index).attr("id"); 10126this.button.attr({ 10127"aria-labelledby": id, 10128"aria-activedescendant": id 10129}); 10130this.menu.attr("aria-activedescendant", id); 10131}, 10132_setOption: function (key, value){ 10133if(key==="icons"){ 10134var icon=this.button.find("span.ui-icon"); 10135this._removeClass(icon, null, this.options.icons.button) 10136._addClass(icon, null, value.button); 10137} 10138this._super(key, value); 10139if(key==="appendTo"){ 10140this.menuWrap.appendTo(this._appendTo()); 10141} 10142if(key==="width"){ 10143this._resizeButton(); 10144}}, 10145_setOptionDisabled: function (value){ 10146this._super(value); 10147this.menuInstance.option("disabled", value); 10148this.button.attr("aria-disabled", value); 10149this._toggleClass(this.button, null, "ui-state-disabled", value); 10150this.element.prop("disabled", value); 10151if(value){ 10152this.button.attr("tabindex", -1); 10153this.close(); 10154}else{ 10155this.button.attr("tabindex", 0); 10156}}, 10157_appendTo: function (){ 10158var element=this.options.appendTo; 10159if(element){ 10160element=element.jquery||element.nodeType ? 10161$(element) : 10162this.document.find(element).eq(0); 10163} 10164if(!element||!element[0]){ 10165element=this.element.closest(".ui-front, dialog"); 10166} 10167if(!element.length){ 10168element=this.document[0].body; 10169} 10170return element; 10171}, 10172_toggleAttr: function (){ 10173this.button.attr("aria-expanded", this.isOpen); 10174this._removeClass(this.button, "ui-selectmenu-button-" + 10175(this.isOpen ? "closed":"open")) 10176._addClass(this.button, "ui-selectmenu-button-" + 10177(this.isOpen ? "open":"closed")) 10178._toggleClass(this.menuWrap, "ui-selectmenu-open", null, this.isOpen); 10179this.menu.attr("aria-hidden", !this.isOpen); 10180}, 10181_resizeButton: function (){ 10182var width=this.options.width; 10183if(width===false){ 10184this.button.css("width", ""); 10185return; 10186} 10187if(width===null){ 10188width=this.element.show().outerWidth(); 10189this.element.hide(); 10190} 10191this.button.outerWidth(width); 10192}, 10193_resizeMenu: function (){ 10194this.menu.outerWidth(Math.max(this.button.outerWidth(), 10195this.menu.width("").outerWidth() + 1 10196)); 10197}, 10198_getCreateOptions: function (){ 10199var options=this._super(); 10200options.disabled=this.element.prop("disabled"); 10201return options; 10202}, 10203_parseOptions: function (options){ 10204var that=this, 10205data=[]; 10206options.each(function (index, item){ 10207data.push(that._parseOption($(item), index)); 10208}); 10209this.items=data; 10210}, 10211_parseOption: function (option, index){ 10212var optgroup=option.parent("optgroup"); 10213return { 10214element: option, 10215index: index, 10216value: option.val(), 10217label: option.text(), 10218optgroup: optgroup.attr("label")||"", 10219disabled: optgroup.prop("disabled")||option.prop("disabled") 10220};}, 10221_destroy: function (){ 10222this._unbindFormResetHandler(); 10223this.menuWrap.remove(); 10224this.button.remove(); 10225this.element.show(); 10226this.element.removeUniqueId(); 10227this.labels.attr("for", this.ids.element); 10228}}]); 10229})); 10230(function (factory){ 10231if(typeof define==="function"&&define.amd){ 10232define('ui/widgets/slider.js', [ 10233"jquery", 10234"./mouse", 10235"../keycode", 10236"../version", 10237"../widget" 10238], factory); 10239}else{ 10240factory(jQuery); 10241}}(function ($){ 10242return $.widget("ui.slider", $.ui.mouse, { 10243version: "@VERSION", 10244widgetEventPrefix: "slide", 10245options: { 10246animate: false, 10247classes: { 10248"ui-slider": "ui-corner-all", 10249"ui-slider-handle": "ui-corner-all", 10250"ui-slider-range": "ui-corner-all ui-widget-header" 10251}, 10252distance: 0, 10253max: 100, 10254min: 0, 10255orientation: "horizontal", 10256range: false, 10257step: 1, 10258value: 0, 10259values: null, 10260change: null, 10261slide: null, 10262start: null, 10263stop: null 10264}, 10265numPages: 5, 10266_create: function (){ 10267this._keySliding=false; 10268this._mouseSliding=false; 10269this._animateOff=true; 10270this._handleIndex=null; 10271this._detectOrientation(); 10272this._mouseInit(); 10273this._calculateNewMax(); 10274this._addClass("ui-slider ui-slider-" + this.orientation, 10275"ui-widget ui-widget-content"); 10276this._refresh(); 10277this._animateOff=false; 10278}, 10279_refresh: function (){ 10280this._createRange(); 10281this._createHandles(); 10282this._setupEvents(); 10283this._refreshValue(); 10284}, 10285_createHandles: function (){ 10286var i, handleCount, 10287options=this.options, 10288existingHandles=this.element.find(".ui-slider-handle"), 10289handle="<span tabindex='0'></span>", 10290handles=[]; 10291handleCount=(options.values&&options.values.length)||1; 10292if(existingHandles.length > handleCount){ 10293existingHandles.slice(handleCount).remove(); 10294existingHandles=existingHandles.slice(0, handleCount); 10295} 10296for (i=existingHandles.length; i < handleCount; i++){ 10297handles.push(handle); 10298} 10299this.handles=existingHandles.add($(handles.join("")).appendTo(this.element)); 10300this._addClass(this.handles, "ui-slider-handle", "ui-state-default"); 10301this.handle=this.handles.eq(0); 10302this.handles.each(function (i){ 10303$(this).data("ui-slider-handle-index", i); 10304}); 10305}, 10306_createRange: function (){ 10307var options=this.options; 10308if(options.range){ 10309if(options.range===true){ 10310if(!options.values){ 10311options.values=[this._valueMin(), this._valueMin()]; 10312}else if(options.values.length&&options.values.length!==2){ 10313options.values=[options.values[0], options.values[0]]; 10314}else if($.isArray(options.values)){ 10315options.values=options.values.slice(0); 10316}} 10317if(!this.range||!this.range.length){ 10318this.range=$("<div>") 10319.appendTo(this.element); 10320this._addClass(this.range, "ui-slider-range"); 10321}else{ 10322this._removeClass(this.range, "ui-slider-range-min ui-slider-range-max"); 10323this.range.css({ 10324"left": "", 10325"bottom": "" 10326}); 10327}
vendor: 4,748 bytes, lines 10328-10496
10328if(options.range==="min"||options.range==="max"){ 10329this._addClass(this.range, "ui-slider-range-" + options.range); 10330}}else{ 10331if(this.range){ 10332this.range.remove(); 10333} 10334this.range=null; 10335}}, 10336_setupEvents: function (){ 10337this._off(this.handles); 10338this._on(this.handles, this._handleEvents); 10339this._hoverable(this.handles); 10340this._focusable(this.handles); 10341}, 10342_destroy: function (){ 10343this.handles.remove(); 10344if(this.range){ 10345this.range.remove(); 10346} 10347this._mouseDestroy(); 10348}, 10349_mouseCapture: function (event){ 10350var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, 10351that=this, 10352o=this.options; 10353if(o.disabled){ 10354return false; 10355} 10356this.elementSize={ 10357width: this.element.outerWidth(), 10358height: this.element.outerHeight() 10359}; 10360this.elementOffset=this.element.offset(); 10361position={ x: event.pageX, y: event.pageY }; 10362normValue=this._normValueFromMouse(position); 10363distance=this._valueMax() - this._valueMin() + 1; 10364this.handles.each(function (i){ 10365var thisDistance=Math.abs(normValue - that.values(i)); 10366if((distance > thisDistance) || 10367(distance===thisDistance && 10368(i===that._lastChangedValue||that.values(i)===o.min))){ 10369distance=thisDistance; 10370closestHandle=$(this); 10371index=i; 10372}}); 10373allowed=this._start(event, index); 10374if(allowed===false){ 10375return false; 10376} 10377this._mouseSliding=true; 10378this._handleIndex=index; 10379this._addClass(closestHandle, null, "ui-state-active"); 10380closestHandle.trigger("focus"); 10381offset=closestHandle.offset(); 10382mouseOverHandle = !$(event.target).parents().addBack().is(".ui-slider-handle"); 10383this._clickOffset=mouseOverHandle ? { left: 0, top: 0 }:{ 10384left: event.pageX - offset.left - (closestHandle.width() / 2), 10385top: event.pageY - offset.top - 10386(closestHandle.height() / 2) - 10387(parseInt(closestHandle.css("borderTopWidth"), 10)||0) - 10388(parseInt(closestHandle.css("borderBottomWidth"), 10)||0) + 10389(parseInt(closestHandle.css("marginTop"), 10)||0) 10390}; 10391if(!this.handles.hasClass("ui-state-hover")){ 10392this._slide(event, index, normValue); 10393} 10394this._animateOff=true; 10395return true; 10396}, 10397_mouseStart: function (){ 10398return true; 10399}, 10400_mouseDrag: function (event){ 10401var position={ x: event.pageX, y: event.pageY }, 10402normValue=this._normValueFromMouse(position); 10403this._slide(event, this._handleIndex, normValue); 10404return false; 10405}, 10406_mouseStop: function (event){ 10407this._removeClass(this.handles, null, "ui-state-active"); 10408this._mouseSliding=false; 10409this._stop(event, this._handleIndex); 10410this._change(event, this._handleIndex); 10411this._handleIndex=null; 10412this._clickOffset=null; 10413this._animateOff=false; 10414return false; 10415}, 10416_detectOrientation: function (){ 10417this.orientation=(this.options.orientation==="vertical") ? "vertical":"horizontal"; 10418}, 10419_normValueFromMouse: function (position){ 10420var pixelTotal, 10421pixelMouse, 10422percentMouse, 10423valueTotal, 10424valueMouse; 10425if(this.orientation==="horizontal"){ 10426pixelTotal=this.elementSize.width; 10427pixelMouse=position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left:0); 10428}else{ 10429pixelTotal=this.elementSize.height; 10430pixelMouse=position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top:0); 10431} 10432percentMouse=(pixelMouse / pixelTotal); 10433if(percentMouse > 1){ 10434percentMouse=1; 10435} 10436if(percentMouse < 0){ 10437percentMouse=0; 10438} 10439if(this.orientation==="vertical"){ 10440percentMouse=1 - percentMouse; 10441} 10442valueTotal=this._valueMax() - this._valueMin(); 10443valueMouse=this._valueMin() + percentMouse * valueTotal; 10444return this._trimAlignValue(valueMouse); 10445}, 10446_uiHash: function (index, value, values){ 10447var uiHash={ 10448handle: this.handles[index], 10449handleIndex: index, 10450value: value!==undefined ? value:this.value() 10451}; 10452if(this._hasMultipleValues()){ 10453uiHash.value=value!==undefined ? value:this.values(index); 10454uiHash.values=values||this.values(); 10455} 10456return uiHash; 10457}, 10458_hasMultipleValues: function (){ 10459return this.options.values&&this.options.values.length; 10460}, 10461_start: function (event, index){ 10462return this._trigger("start", event, this._uiHash(index)); 10463}, 10464_slide: function (event, index, newVal){ 10465var allowed, otherVal, 10466currentValue=this.value(), 10467newValues=this.values(); 10468if(this._hasMultipleValues()){ 10469otherVal=this.values(index ? 0:1); 10470currentValue=this.values(index); 10471if(this.options.values.length===2&&this.options.range===true){ 10472newVal=index===0 ? Math.min(otherVal, newVal):Math.max(otherVal, newVal); 10473} 10474newValues[index]=newVal; 10475} 10476if(newVal===currentValue){ 10477return; 10478} 10479allowed=this._trigger("slide", event, this._uiHash(index, newVal, newValues)); 10480if(allowed===false){ 10481return; 10482} 10483if(this._hasMultipleValues()){ 10484this.values(index, newVal); 10485}else{ 10486this.value(newVal); 10487}}, 10488_stop: function (event, index){ 10489this._trigger("stop", event, this._uiHash(index)); 10490}, 10491_change: function (event, index){ 10492if(!this._keySliding&&!this._mouseSliding){ 10493this._lastChangedValue=index; 10494this._trigger("change", event, this._uiHash(index)); 10495}}, 10496value: function (newValue){
vendor: 15,333 bytes, lines 10497-11055
10497if(arguments.length){ 10498this.options.value=this._trimAlignValue(newValue); 10499this._refreshValue(); 10500this._change(null, 0); 10501return; 10502} 10503return this._value(); 10504}, 10505values: function (index, newValue){ 10506var vals, 10507newValues, 10508i; 10509if(arguments.length > 1){ 10510this.options.values[index]=this._trimAlignValue(newValue); 10511this._refreshValue(); 10512this._change(null, index); 10513return; 10514} 10515if(arguments.length){ 10516if($.isArray(arguments[0])){ 10517vals=this.options.values; 10518newValues=arguments[0]; 10519for (i=0; i < vals.length; i +=1){ 10520vals[i]=this._trimAlignValue(newValues[i]); 10521this._change(null, i); 10522} 10523this._refreshValue(); 10524}else{ 10525if(this._hasMultipleValues()){ 10526return this._values(index); 10527}else{ 10528return this.value(); 10529}} 10530}else{ 10531return this._values(); 10532}}, 10533_setOption: function (key, value){ 10534var i, 10535valsLength=0; 10536if(key==="range"&&this.options.range===true){ 10537if(value==="min"){ 10538this.options.value=this._values(0); 10539this.options.values=null; 10540}else if(value==="max"){ 10541this.options.value=this._values(this.options.values.length - 1); 10542this.options.values=null; 10543}} 10544if($.isArray(this.options.values)){ 10545valsLength=this.options.values.length; 10546} 10547this._super(key, value); 10548switch (key){ 10549case "orientation": 10550this._detectOrientation(); 10551this._removeClass("ui-slider-horizontal ui-slider-vertical") 10552._addClass("ui-slider-" + this.orientation); 10553this._refreshValue(); 10554if(this.options.range){ 10555this._refreshRange(value); 10556} 10557this.handles.css(value==="horizontal" ? "bottom":"left", ""); 10558break; 10559case "value": 10560this._animateOff=true; 10561this._refreshValue(); 10562this._change(null, 0); 10563this._animateOff=false; 10564break; 10565case "values": 10566this._animateOff=true; 10567this._refreshValue(); 10568for (i=valsLength - 1; i >=0; i--){ 10569this._change(null, i); 10570} 10571this._animateOff=false; 10572break; 10573case "step": 10574case "min": 10575case "max": 10576this._animateOff=true; 10577this._calculateNewMax(); 10578this._refreshValue(); 10579this._animateOff=false; 10580break; 10581case "range": 10582this._animateOff=true; 10583this._refresh(); 10584this._animateOff=false; 10585break; 10586}}, 10587_setOptionDisabled: function (value){ 10588this._super(value); 10589this._toggleClass(null, "ui-state-disabled", !!value); 10590}, 10591_value: function (){ 10592var val=this.options.value; 10593val=this._trimAlignValue(val); 10594return val; 10595}, 10596_values: function (index){ 10597var val, 10598vals, 10599i; 10600if(arguments.length){ 10601val=this.options.values[index]; 10602val=this._trimAlignValue(val); 10603return val; 10604}else if(this._hasMultipleValues()){ 10605vals=this.options.values.slice(); 10606for (i=0; i < vals.length; i +=1){ 10607vals[i]=this._trimAlignValue(vals[i]); 10608} 10609return vals; 10610}else{ 10611return []; 10612}}, 10613_trimAlignValue: function (val){ 10614if(val <=this._valueMin()){ 10615return this._valueMin(); 10616} 10617if(val >=this._valueMax()){ 10618return this._valueMax(); 10619} 10620var step=(this.options.step > 0) ? this.options.step:1, 10621valModStep=(val - this._valueMin()) % step, 10622alignValue=val - valModStep; 10623if(Math.abs(valModStep) * 2 >=step){ 10624alignValue +=(valModStep > 0) ? step:(-step); 10625} 10626return parseFloat(alignValue.toFixed(5)); 10627}, 10628_calculateNewMax: function (){ 10629var max=this.options.max, 10630min=this._valueMin(), 10631step=this.options.step, 10632aboveMin=Math.floor((+(max - min).toFixed(this._precision())) / step) * step; 10633max=aboveMin + min; 10634this.max=parseFloat(max.toFixed(this._precision())); 10635}, 10636_precision: function (){ 10637var precision=this._precisionOf(this.options.step); 10638if(this.options.min!==null){ 10639precision=Math.max(precision, this._precisionOf(this.options.min)); 10640} 10641return precision; 10642}, 10643_precisionOf: function (num){ 10644var str=num.toString(), 10645decimal=str.indexOf("."); 10646return decimal===-1 ? 0:str.length - decimal - 1; 10647}, 10648_valueMin: function (){ 10649return this.options.min; 10650}, 10651_valueMax: function (){ 10652return this.max; 10653}, 10654_refreshRange: function (orientation){ 10655if(orientation==="vertical"){ 10656this.range.css({ "width": "", "left": "" }); 10657} 10658if(orientation==="horizontal"){ 10659this.range.css({ "height": "", "bottom": "" }); 10660}}, 10661_refreshValue: function (){ 10662var lastValPercent, valPercent, value, valueMin, valueMax, 10663oRange=this.options.range, 10664o=this.options, 10665that=this, 10666animate=(!this._animateOff) ? o.animate:false, 10667_set={}; 10668if(this._hasMultipleValues()){ 10669this.handles.each(function (i){ 10670valPercent=(that.values(i) - that._valueMin()) / (that._valueMax() - that._valueMin()) * 100; 10671_set[that.orientation==="horizontal" ? "left":"bottom"]=valPercent + "%"; 10672$(this).stop(1, 1)[animate ? "animate":"css"](_set, o.animate); 10673if(that.options.range===true){ 10674if(that.orientation==="horizontal"){ 10675if(i===0){ 10676that.range.stop(1, 1)[animate ? "animate":"css"]({ left: valPercent + "%" }, o.animate); 10677} 10678if(i===1){ 10679that.range[animate ? "animate":"css"]({ width: (valPercent - lastValPercent) + "%" }, { queue: false, duration: o.animate }); 10680}}else{ 10681if(i===0){ 10682that.range.stop(1, 1)[animate ? "animate":"css"]({ bottom: (valPercent) + "%" }, o.animate); 10683} 10684if(i===1){ 10685that.range[animate ? "animate":"css"]({ height: (valPercent - lastValPercent) + "%" }, { queue: false, duration: o.animate }); 10686}} 10687} 10688lastValPercent=valPercent; 10689}); 10690}else{ 10691value=this.value(); 10692valueMin=this._valueMin(); 10693valueMax=this._valueMax(); 10694valPercent=(valueMax!==valueMin) ? 10695(value - valueMin) / (valueMax - valueMin) * 100 : 106960; 10697_set[this.orientation==="horizontal" ? "left":"bottom"]=valPercent + "%"; 10698this.handle.stop(1, 1)[animate ? "animate":"css"](_set, o.animate); 10699if(oRange==="min"&&this.orientation==="horizontal"){ 10700this.range.stop(1, 1)[animate ? "animate":"css"]({ width: valPercent + "%" }, o.animate); 10701} 10702if(oRange==="max"&&this.orientation==="horizontal"){ 10703this.range.stop(1, 1)[animate ? "animate":"css"]({ width: (100 - valPercent) + "%" }, o.animate); 10704} 10705if(oRange==="min"&&this.orientation==="vertical"){ 10706this.range.stop(1, 1)[animate ? "animate":"css"]({ height: valPercent + "%" }, o.animate); 10707} 10708if(oRange==="max"&&this.orientation==="vertical"){ 10709this.range.stop(1, 1)[animate ? "animate":"css"]({ height: (100 - valPercent) + "%" }, o.animate); 10710}} 10711}, 10712_handleEvents: { 10713keydown: function (event){ 10714var allowed, curVal, newVal, step, 10715index=$(event.target).data("ui-slider-handle-index"); 10716switch (event.keyCode){ 10717case $.ui.keyCode.HOME: 10718case $.ui.keyCode.END: 10719case $.ui.keyCode.PAGE_UP: 10720case $.ui.keyCode.PAGE_DOWN: 10721case $.ui.keyCode.UP: 10722case $.ui.keyCode.RIGHT: 10723case $.ui.keyCode.DOWN: 10724case $.ui.keyCode.LEFT: 10725event.preventDefault(); 10726if(!this._keySliding){ 10727this._keySliding=true; 10728this._addClass($(event.target), null, "ui-state-active"); 10729allowed=this._start(event, index); 10730if(allowed===false){ 10731return; 10732}} 10733break; 10734} 10735step=this.options.step; 10736if(this._hasMultipleValues()){ 10737curVal=newVal=this.values(index); 10738}else{ 10739curVal=newVal=this.value(); 10740} 10741switch (event.keyCode){ 10742case $.ui.keyCode.HOME: 10743newVal=this._valueMin(); 10744break; 10745case $.ui.keyCode.END: 10746newVal=this._valueMax(); 10747break; 10748case $.ui.keyCode.PAGE_UP: 10749newVal=this._trimAlignValue(curVal + ((this._valueMax() - this._valueMin()) / this.numPages) 10750); 10751break; 10752case $.ui.keyCode.PAGE_DOWN: 10753newVal=this._trimAlignValue(curVal - ((this._valueMax() - this._valueMin()) / this.numPages)); 10754break; 10755case $.ui.keyCode.UP: 10756case $.ui.keyCode.RIGHT: 10757if(curVal===this._valueMax()){ 10758return; 10759} 10760newVal=this._trimAlignValue(curVal + step); 10761break; 10762case $.ui.keyCode.DOWN: 10763case $.ui.keyCode.LEFT: 10764if(curVal===this._valueMin()){ 10765return; 10766} 10767newVal=this._trimAlignValue(curVal - step); 10768break; 10769} 10770this._slide(event, index, newVal); 10771}, 10772keyup: function (event){ 10773var index=$(event.target).data("ui-slider-handle-index"); 10774if(this._keySliding){ 10775this._keySliding=false; 10776this._stop(event, index); 10777this._change(event, index); 10778this._removeClass($(event.target), null, "ui-state-active"); 10779}} 10780}}); 10781})); 10782(function (factory){ 10783if(typeof define==="function"&&define.amd){ 10784define('ui/widgets/sortable.js', [ 10785"jquery", 10786"./mouse", 10787"../data", 10788"../ie", 10789"../scroll-parent", 10790"../version", 10791"../widget" 10792], factory); 10793}else{ 10794factory(jQuery); 10795}}(function ($){ 10796return $.widget("ui.sortable", $.ui.mouse, { 10797version: "@VERSION", 10798widgetEventPrefix: "sort", 10799ready: false, 10800options: { 10801appendTo: "parent", 10802axis: false, 10803connectWith: false, 10804containment: false, 10805cursor: "auto", 10806cursorAt: false, 10807dropOnEmpty: true, 10808forcePlaceholderSize: false, 10809forceHelperSize: false, 10810grid: false, 10811handle: false, 10812helper: "original", 10813items: "> *", 10814opacity: false, 10815placeholder: false, 10816revert: false, 10817scroll: true, 10818scrollSensitivity: 20, 10819scrollSpeed: 20, 10820scope: "default", 10821tolerance: "intersect", 10822zIndex: 1000, 10823activate: null, 10824beforeStop: null, 10825change: null, 10826deactivate: null, 10827out: null, 10828over: null, 10829receive: null, 10830remove: null, 10831sort: null, 10832start: null, 10833stop: null, 10834update: null 10835}, 10836_isOverAxis: function (x, reference, size){ 10837return (x >=reference)&&(x < (reference + size)); 10838}, 10839_isFloating: function (item){ 10840return (/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display")); 10841}, 10842_create: function (){ 10843this.containerCache={}; 10844this._addClass("ui-sortable"); 10845this.refresh(); 10846this.offset=this.element.offset(); 10847this._mouseInit(); 10848this._setHandleClassName(); 10849this.ready=true; 10850}, 10851_setOption: function (key, value){ 10852this._super(key, value); 10853if(key==="handle"){ 10854this._setHandleClassName(); 10855}}, 10856_setHandleClassName: function (){ 10857var that=this; 10858this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle"); 10859$.each(this.items, function (){ 10860that._addClass(this.instance.options.handle ? 10861this.item.find(this.instance.options.handle) : 10862this.item, 10863"ui-sortable-handle" 10864); 10865}); 10866}, 10867_destroy: function (){ 10868this._mouseDestroy(); 10869for (var i=this.items.length - 1; i >=0; i--){ 10870this.items[i].item.removeData(this.widgetName + "-item"); 10871} 10872return this; 10873}, 10874_mouseCapture: function (event, overrideHandle){ 10875var currentItem=null, 10876validHandle=false, 10877that=this; 10878if(this.reverting){ 10879return false; 10880} 10881if(this.options.disabled||this.options.type==="static"){ 10882return false; 10883} 10884this._refreshItems(event); 10885$(event.target).parents().each(function (){ 10886if($.data(this, that.widgetName + "-item")===that){ 10887currentItem=$(this); 10888return false; 10889}}); 10890if($.data(event.target, that.widgetName + "-item")===that){ 10891currentItem=$(event.target); 10892} 10893if(!currentItem){ 10894return false; 10895} 10896if(this.options.handle&&!overrideHandle){ 10897$(this.options.handle, currentItem).find("*").addBack().each(function (){ 10898if(this===event.target){ 10899validHandle=true; 10900}}); 10901if(!validHandle){ 10902return false; 10903}} 10904this.currentItem=currentItem; 10905this._removeCurrentsFromItems(); 10906return true; 10907}, 10908_mouseStart: function (event, overrideHandle, noActivation){ 10909var i, body, 10910o=this.options; 10911this.currentContainer=this; 10912this.refreshPositions(); 10913this.helper=this._createHelper(event); 10914this._cacheHelperProportions(); 10915this._cacheMargins(); 10916this.scrollParent=this.helper.scrollParent(); 10917this.offset=this.currentItem.offset(); 10918this.offset={ 10919top: this.offset.top - this.margins.top, 10920left: this.offset.left - this.margins.left 10921}; 10922$.extend(this.offset, { 10923click: { 10924left: event.pageX - this.offset.left, 10925top: event.pageY - this.offset.top 10926}, 10927parent: this._getParentOffset(), 10928relative: this._getRelativeOffset() 10929}); 10930this.helper.css("position", "absolute"); 10931this.cssPosition=this.helper.css("position"); 10932this.originalPosition=this._generatePosition(event); 10933this.originalPageX=event.pageX; 10934this.originalPageY=event.pageY; 10935(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt)); 10936this.domPosition={ prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; 10937if(this.helper[0]!==this.currentItem[0]){ 10938this.currentItem.hide(); 10939} 10940this._createPlaceholder(); 10941if(o.containment){ 10942this._setContainment(); 10943} 10944if(o.cursor&&o.cursor!=="auto"){ 10945body=this.document.find("body"); 10946this.storedCursor=body.css("cursor"); 10947body.css("cursor", o.cursor); 10948this.storedStylesheet=$("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(body); 10949} 10950if(o.opacity){ 10951if(this.helper.css("opacity")){ 10952this._storedOpacity=this.helper.css("opacity"); 10953} 10954this.helper.css("opacity", o.opacity); 10955} 10956if(o.zIndex){ 10957if(this.helper.css("zIndex")){ 10958this._storedZIndex=this.helper.css("zIndex"); 10959} 10960this.helper.css("zIndex", o.zIndex); 10961} 10962if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){ 10963this.overflowOffset=this.scrollParent.offset(); 10964} 10965this._trigger("start", event, this._uiHash()); 10966if(!this._preserveHelperProportions){ 10967this._cacheHelperProportions(); 10968} 10969if(!noActivation){ 10970for (i=this.containers.length - 1; i >=0; i--){ 10971this.containers[i]._trigger("activate", event, this._uiHash(this)); 10972}} 10973if($.ui.ddmanager){ 10974$.ui.ddmanager.current=this; 10975} 10976if($.ui.ddmanager&&!o.dropBehaviour){ 10977$.ui.ddmanager.prepareOffsets(this, event); 10978} 10979this.dragging=true; 10980this._addClass(this.helper, "ui-sortable-helper"); 10981this._mouseDrag(event); 10982return true; 10983}, 10984_mouseDrag: function (event){ 10985var i, item, itemElement, intersection, 10986o=this.options, 10987scrolled=false; 10988this.position=this._generatePosition(event); 10989this.positionAbs=this._convertPositionTo("absolute"); 10990if(!this.lastPositionAbs){ 10991this.lastPositionAbs=this.positionAbs; 10992} 10993if(this.options.scroll){ 10994if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){ 10995if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity){ 10996this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop + o.scrollSpeed; 10997}else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity){ 10998this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop - o.scrollSpeed; 10999} 11000if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity){ 11001this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft + o.scrollSpeed; 11002}else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity){ 11003this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft - o.scrollSpeed; 11004}}else{ 11005if(event.pageY - this.document.scrollTop() < o.scrollSensitivity){ 11006scrolled=this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed); 11007}else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity){ 11008scrolled=this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed); 11009} 11010if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity){ 11011scrolled=this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed); 11012}else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity){ 11013scrolled=this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed); 11014}} 11015if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){ 11016$.ui.ddmanager.prepareOffsets(this, event); 11017}} 11018this.positionAbs=this._convertPositionTo("absolute"); 11019if(!this.options.axis||this.options.axis!=="y"){ 11020this.helper[0].style.left=this.position.left + "px"; 11021} 11022if(!this.options.axis||this.options.axis!=="x"){ 11023this.helper[0].style.top=this.position.top + "px"; 11024} 11025for (i=this.items.length - 1; i >=0; i--){ 11026item=this.items[i]; 11027itemElement=item.item[0]; 11028intersection=this._intersectsWithPointer(item); 11029if(!intersection){ 11030continue; 11031} 11032if(item.instance!==this.currentContainer){ 11033continue; 11034} 11035if(itemElement!==this.currentItem[0] && 11036this.placeholder[intersection===1 ? "next":"prev"]()[0]!==itemElement && 11037!$.contains(this.placeholder[0], itemElement) && 11038(this.options.type==="semi-dynamic" ? !$.contains(this.element[0], itemElement):true) 11039){ 11040this.direction=intersection===1 ? "down":"up"; 11041if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){ 11042this._rearrange(event, item); 11043}else{ 11044break; 11045} 11046this._trigger("change", event, this._uiHash()); 11047break; 11048}} 11049this._contactContainers(event); 11050if($.ui.ddmanager){ 11051$.ui.ddmanager.drag(this, event); 11052} 11053this._trigger("sort", event, this._uiHash()); 11054this.lastPositionAbs=this.positionAbs; 11055return false;
vendor: 1,624 bytes, lines 11056-11110
11056}, 11057_mouseStop: function (event, noPropagation){ 11058if(!event){ 11059return; 11060} 11061if($.ui.ddmanager&&!this.options.dropBehaviour){ 11062$.ui.ddmanager.drop(this, event); 11063} 11064if(this.options.revert){ 11065var that=this, 11066cur=this.placeholder.offset(), 11067axis=this.options.axis, 11068animation={}; 11069if(!axis||axis==="x"){ 11070animation.left=cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0]===this.document[0].body ? 0:this.offsetParent[0].scrollLeft); 11071} 11072if(!axis||axis==="y"){ 11073animation.top=cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0]===this.document[0].body ? 0:this.offsetParent[0].scrollTop); 11074} 11075this.reverting=true; 11076$(this.helper).animate(animation, parseInt(this.options.revert, 10)||500, function (){ 11077that._clear(event); 11078}); 11079}else{ 11080this._clear(event, noPropagation); 11081} 11082return false; 11083}, 11084cancel: function (){ 11085if(this.dragging){ 11086this._mouseUp({ target: null }); 11087if(this.options.helper==="original"){ 11088this.currentItem.css(this._storedCSS); 11089this._removeClass(this.currentItem, "ui-sortable-helper"); 11090}else{ 11091this.currentItem.show(); 11092} 11093for (var i=this.containers.length - 1; i >=0; i--){ 11094this.containers[i]._trigger("deactivate", null, this._uiHash(this)); 11095if(this.containers[i].containerCache.over){ 11096this.containers[i]._trigger("out", null, this._uiHash(this)); 11097this.containers[i].containerCache.over=0; 11098}} 11099} 11100if(this.placeholder){ 11101if(this.placeholder[0].parentNode){ 11102this.placeholder[0].parentNode.removeChild(this.placeholder[0]); 11103} 11104if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){ 11105this.helper.remove(); 11106} 11107$.extend(this, { 11108helper: null, 11109dragging: false, 11110reverting: false,
vendor: 4,855 bytes, lines 11111-11236
11111_noFinalSort: null 11112}); 11113if(this.domPosition.prev){ 11114$(this.domPosition.prev).after(this.currentItem); 11115}else{ 11116$(this.domPosition.parent).prepend(this.currentItem); 11117}} 11118return this; 11119}, 11120serialize: function (o){ 11121var items=this._getItemsAsjQuery(o&&o.connected), 11122str=[]; 11123o=o||{}; 11124$(items).each(function (){ 11125var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/)); 11126if(res){ 11127str.push((o.key||res[1] + "[]") + "=" + (o.key&&o.expression ? res[1]:res[2])); 11128}}); 11129if(!str.length&&o.key){ 11130str.push(o.key + "="); 11131} 11132return str.join("&"); 11133}, 11134toArray: function (o){ 11135var items=this._getItemsAsjQuery(o&&o.connected), 11136ret=[]; 11137o=o||{}; 11138items.each(function (){ ret.push($(o.item||this).attr(o.attribute||"id")||""); }); 11139return ret; 11140}, 11141_intersectsWith: function (item){ 11142var x1=this.positionAbs.left, 11143x2=x1 + this.helperProportions.width, 11144y1=this.positionAbs.top, 11145y2=y1 + this.helperProportions.height, 11146l=item.left, 11147r=l + item.width, 11148t=item.top, 11149b=t + item.height, 11150dyClick=this.offset.click.top, 11151dxClick=this.offset.click.left, 11152isOverElementHeight=(this.options.axis==="x")||((y1 + dyClick) > t&&(y1 + dyClick) < b), 11153isOverElementWidth=(this.options.axis==="y")||((x1 + dxClick) > l&&(x1 + dxClick) < r), 11154isOverElement=isOverElementHeight&&isOverElementWidth; 11155if(this.options.tolerance==="pointer" || 11156this.options.forcePointerForContainers || 11157(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating ? "width":"height"] > item[this.floating ? "width":"height"]) 11158){ 11159return isOverElement; 11160}else{ 11161return (l < x1 + (this.helperProportions.width / 2) && 11162x2 - (this.helperProportions.width / 2) < r && 11163t < y1 + (this.helperProportions.height / 2) && 11164y2 - (this.helperProportions.height / 2) < b); 11165}}, 11166_intersectsWithPointer: function (item){ 11167var verticalDirection, horizontalDirection, 11168isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), 11169isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), 11170isOverElement=isOverElementHeight&&isOverElementWidth; 11171if(!isOverElement){ 11172return false; 11173} 11174verticalDirection=this._getDragVerticalDirection(); 11175horizontalDirection=this._getDragHorizontalDirection(); 11176return this.floating ? 11177((horizontalDirection==="right"||verticalDirection==="down") ? 2:1) 11178: (verticalDirection&&(verticalDirection==="down" ? 2:1)); 11179}, 11180_intersectsWithSides: function (item){ 11181var isOverBottomHalf=this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height / 2), item.height), 11182isOverRightHalf=this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width / 2), item.width), 11183verticalDirection=this._getDragVerticalDirection(), 11184horizontalDirection=this._getDragHorizontalDirection(); 11185if(this.floating&&horizontalDirection){ 11186return ((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf)); 11187}else{ 11188return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf)); 11189}}, 11190_getDragVerticalDirection: function (){ 11191var delta=this.positionAbs.top - this.lastPositionAbs.top; 11192return delta!==0&&(delta > 0 ? "down":"up"); 11193}, 11194_getDragHorizontalDirection: function (){ 11195var delta=this.positionAbs.left - this.lastPositionAbs.left; 11196return delta!==0&&(delta > 0 ? "right":"left"); 11197}, 11198refresh: function (event){ 11199this._refreshItems(event); 11200this._setHandleClassName(); 11201this.refreshPositions(); 11202return this; 11203}, 11204_connectWith: function (){ 11205var options=this.options; 11206return options.connectWith.constructor===String ? [options.connectWith]:options.connectWith; 11207}, 11208_getItemsAsjQuery: function (connected){ 11209var i, j, cur, inst, 11210items=[], 11211queries=[], 11212connectWith=this._connectWith(); 11213if(connectWith&&connected){ 11214for (i=connectWith.length - 1; i >=0; i--){ 11215cur=$(connectWith[i], this.document[0]); 11216for (j=cur.length - 1; j >=0; j--){ 11217inst=$.data(cur[j], this.widgetFullName); 11218if(inst&&inst!==this&&!inst.options.disabled){ 11219queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element):$(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]); 11220}} 11221}} 11222queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }):$(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); 11223function addItems(){ 11224items.push(this); 11225} 11226for (i=queries.length - 1; i >=0; i--){ 11227queries[i][0].each(addItems); 11228} 11229return $(items); 11230}, 11231_removeCurrentsFromItems: function (){ 11232var list=this.currentItem.find(":data(" + this.widgetName + "-item)"); 11233this.items=$.grep(this.items, function (item){ 11234for (var j=0; j < list.length; j++){ 11235if(list[j]===item.item[0]){ 11236return false;
vendor: 1,766 bytes, lines 11237-11293
11237}} 11238return true; 11239}); 11240}, 11241_refreshItems: function (event){ 11242this.items=[]; 11243this.containers=[this]; 11244var i, j, cur, inst, targetData, _queries, item, queriesLength, 11245items=this.items, 11246queries=[[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }):$(this.options.items, this.element), this]], 11247connectWith=this._connectWith(); 11248if(connectWith&&this.ready){ 11249for (i=connectWith.length - 1; i >=0; i--){ 11250cur=$(connectWith[i], this.document[0]); 11251for (j=cur.length - 1; j >=0; j--){ 11252inst=$.data(cur[j], this.widgetFullName); 11253if(inst&&inst!==this&&!inst.options.disabled){ 11254queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }):$(inst.options.items, inst.element), inst]); 11255this.containers.push(inst); 11256}} 11257}} 11258for (i=queries.length - 1; i >=0; i--){ 11259targetData=queries[i][1]; 11260_queries=queries[i][0]; 11261for (j=0, queriesLength=_queries.length; j < queriesLength; j++){ 11262item=$(_queries[j]); 11263item.data(this.widgetName + "-item", targetData); 11264items.push({ 11265item: item, 11266instance: targetData, 11267width: 0, height: 0, 11268left: 0, top: 0 11269}); 11270}} 11271}, 11272refreshPositions: function (fast){ 11273this.floating=this.items.length ? 11274this.options.axis==="x"||this._isFloating(this.items[0].item) : 11275false; 11276if(this.offsetParent&&this.helper){ 11277this.offset.parent=this._getParentOffset(); 11278} 11279var i, item, t, p; 11280for (i=this.items.length - 1; i >=0; i--){ 11281item=this.items[i]; 11282if(item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]){ 11283continue; 11284} 11285t=this.options.toleranceElement ? $(this.options.toleranceElement, item.item):item.item; 11286if(!fast){ 11287item.width=t.outerWidth(); 11288item.height=t.outerHeight(); 11289} 11290p=t.offset(); 11291item.left=p.left; 11292item.top=p.top; 11293}
vendor: 1,387 bytes, lines 11294-11336
11294if(this.options.custom&&this.options.custom.refreshContainers){ 11295this.options.custom.refreshContainers.call(this); 11296}else{ 11297for (i=this.containers.length - 1; i >=0; i--){ 11298p=this.containers[i].element.offset(); 11299this.containers[i].containerCache.left=p.left; 11300this.containers[i].containerCache.top=p.top; 11301this.containers[i].containerCache.width=this.containers[i].element.outerWidth(); 11302this.containers[i].containerCache.height=this.containers[i].element.outerHeight(); 11303}} 11304return this; 11305}, 11306_createPlaceholder: function (that){ 11307that=that||this; 11308var className, 11309o=that.options; 11310if(!o.placeholder||o.placeholder.constructor===String){ 11311className=o.placeholder; 11312o.placeholder={ 11313element: function (){ 11314var nodeName=that.currentItem[0].nodeName.toLowerCase(), 11315element=$("<" + nodeName + ">", that.document[0]); 11316that._addClass(element, "ui-sortable-placeholder", 11317className||that.currentItem[0].className) 11318._removeClass(element, "ui-sortable-helper"); 11319if(nodeName==="tbody"){ 11320that._createTrPlaceholder(that.currentItem.find("tr").eq(0), 11321$("<tr>", that.document[0]).appendTo(element) 11322); 11323}else if(nodeName==="tr"){ 11324that._createTrPlaceholder(that.currentItem, element); 11325}else if(nodeName==="img"){ 11326element.attr("src", that.currentItem.attr("src")); 11327} 11328if(!className){ 11329element.css("visibility", "hidden"); 11330} 11331return element; 11332}, 11333update: function (container, p){ 11334if(className&&!o.forcePlaceholderSize){ 11335return; 11336}
vendor: 9,163 bytes, lines 11337-11554
11337if(!p.height()){ p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); } 11338if(!p.width()){ p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }} 11339};} 11340that.placeholder=$(o.placeholder.element.call(that.element, that.currentItem)); 11341that.currentItem.after(that.placeholder); 11342o.placeholder.update(that, that.placeholder); 11343}, 11344_createTrPlaceholder: function (sourceTr, targetTr){ 11345var that=this; 11346sourceTr.children().each(function (){ 11347$("<td> </td>", that.document[0]) 11348.attr("colspan", $(this).attr("colspan")||1) 11349.appendTo(targetTr); 11350}); 11351}, 11352_contactContainers: function (event){ 11353var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis, 11354innermostContainer=null, 11355innermostIndex=null; 11356for (i=this.containers.length - 1; i >=0; i--){ 11357if($.contains(this.currentItem[0], this.containers[i].element[0])){ 11358continue; 11359} 11360if(this._intersectsWith(this.containers[i].containerCache)){ 11361if(innermostContainer&&$.contains(this.containers[i].element[0], innermostContainer.element[0])){ 11362continue; 11363} 11364innermostContainer=this.containers[i]; 11365innermostIndex=i; 11366}else{ 11367if(this.containers[i].containerCache.over){ 11368this.containers[i]._trigger("out", event, this._uiHash(this)); 11369this.containers[i].containerCache.over=0; 11370}} 11371} 11372if(!innermostContainer){ 11373return; 11374} 11375if(this.containers.length===1){ 11376if(!this.containers[innermostIndex].containerCache.over){ 11377this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); 11378this.containers[innermostIndex].containerCache.over=1; 11379}}else{ 11380dist=10000; 11381itemWithLeastDistance=null; 11382floating=innermostContainer.floating||this._isFloating(this.currentItem); 11383posProperty=floating ? "left":"top"; 11384sizeProperty=floating ? "width":"height"; 11385axis=floating ? "clientX":"clientY"; 11386for (j=this.items.length - 1; j >=0; j--){ 11387if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])){ 11388continue; 11389} 11390if(this.items[j].item[0]===this.currentItem[0]){ 11391continue; 11392} 11393cur=this.items[j].item.offset()[posProperty]; 11394nearBottom=false; 11395if(event[axis] - cur > this.items[j][sizeProperty] / 2){ 11396nearBottom=true; 11397} 11398if(Math.abs(event[axis] - cur) < dist){ 11399dist=Math.abs(event[axis] - cur); 11400itemWithLeastDistance=this.items[j]; 11401this.direction=nearBottom ? "up":"down"; 11402}} 11403if(!itemWithLeastDistance&&!this.options.dropOnEmpty){ 11404return; 11405} 11406if(this.currentContainer===this.containers[innermostIndex]){ 11407if(!this.currentContainer.containerCache.over){ 11408this.containers[innermostIndex]._trigger("over", event, this._uiHash()); 11409this.currentContainer.containerCache.over=1; 11410} 11411return; 11412} 11413itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true):this._rearrange(event, null, this.containers[innermostIndex].element, true); 11414this._trigger("change", event, this._uiHash()); 11415this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); 11416this.currentContainer=this.containers[innermostIndex]; 11417this.options.placeholder.update(this.currentContainer, this.placeholder); 11418this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); 11419this.containers[innermostIndex].containerCache.over=1; 11420}}, 11421_createHelper: function (event){ 11422var o=this.options, 11423helper=$.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])):(o.helper==="clone" ? this.currentItem.clone():this.currentItem); 11424if(!helper.parents("body").length){ 11425$(o.appendTo!=="parent" ? o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]); 11426} 11427if(helper[0]===this.currentItem[0]){ 11428this._storedCSS={ width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };} 11429if(!helper[0].style.width||o.forceHelperSize){ 11430helper.width(this.currentItem.width()); 11431} 11432if(!helper[0].style.height||o.forceHelperSize){ 11433helper.height(this.currentItem.height()); 11434} 11435return helper; 11436}, 11437_adjustOffsetFromHelper: function (obj){ 11438if(typeof obj==="string"){ 11439obj=obj.split(" "); 11440} 11441if($.isArray(obj)){ 11442obj={ left: +obj[0], top: +obj[1]||0 };} 11443if("left" in obj){ 11444this.offset.click.left=obj.left + this.margins.left; 11445} 11446if("right" in obj){ 11447this.offset.click.left=this.helperProportions.width - obj.right + this.margins.left; 11448} 11449if("top" in obj){ 11450this.offset.click.top=obj.top + this.margins.top; 11451} 11452if("bottom" in obj){ 11453this.offset.click.top=this.helperProportions.height - obj.bottom + this.margins.top; 11454}}, 11455_getParentOffset: function (){ 11456this.offsetParent=this.helper.offsetParent(); 11457var po=this.offsetParent.offset(); 11458if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0], this.offsetParent[0])){ 11459po.left +=this.scrollParent.scrollLeft(); 11460po.top +=this.scrollParent.scrollTop(); 11461} 11462if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){ 11463po={ top: 0, left: 0 };} 11464return { 11465top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10)||0), 11466left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0) 11467};}, 11468_getRelativeOffset: function (){ 11469if(this.cssPosition==="relative"){ 11470var p=this.currentItem.position(); 11471return { 11472top: p.top - (parseInt(this.helper.css("top"), 10)||0) + this.scrollParent.scrollTop(), 11473left: p.left - (parseInt(this.helper.css("left"), 10)||0) + this.scrollParent.scrollLeft() 11474};}else{ 11475return { top: 0, left: 0 };}}, 11476_cacheMargins: function (){ 11477this.margins={ 11478left: (parseInt(this.currentItem.css("marginLeft"), 10)||0), 11479top: (parseInt(this.currentItem.css("marginTop"), 10)||0) 11480};}, 11481_cacheHelperProportions: function (){ 11482this.helperProportions={ 11483width: this.helper.outerWidth(), 11484height: this.helper.outerHeight() 11485};}, 11486_setContainment: function (){ 11487var ce, co, over, 11488o=this.options; 11489if(o.containment==="parent"){ 11490o.containment=this.helper[0].parentNode; 11491} 11492if(o.containment==="document"||o.containment==="window"){ 11493this.containment=[ 114940 - this.offset.relative.left - this.offset.parent.left, 114950 - this.offset.relative.top - this.offset.parent.top, 11496o.containment==="document" ? this.document.width():this.window.width() - this.helperProportions.width - this.margins.left, 11497(o.containment==="document" ? this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top 11498]; 11499} 11500if(!(/^(document|window|parent)$/).test(o.containment)){ 11501ce=$(o.containment)[0]; 11502co=$(o.containment).offset(); 11503over=($(ce).css("overflow")!=="hidden"); 11504this.containment=[ 11505co.left + (parseInt($(ce).css("borderLeftWidth"), 10)||0) + (parseInt($(ce).css("paddingLeft"), 10)||0) - this.margins.left, 11506co.top + (parseInt($(ce).css("borderTopWidth"), 10)||0) + (parseInt($(ce).css("paddingTop"), 10)||0) - this.margins.top, 11507co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth):ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"), 10)||0) - (parseInt($(ce).css("paddingRight"), 10)||0) - this.helperProportions.width - this.margins.left, 11508co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight):ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"), 10)||0) - (parseInt($(ce).css("paddingBottom"), 10)||0) - this.helperProportions.height - this.margins.top 11509]; 11510}}, 11511_convertPositionTo: function (d, pos){ 11512if(!pos){ 11513pos=this.position; 11514} 11515var mod=d==="absolute" ? 1:-1, 11516scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent:this.scrollParent, 11517scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName); 11518return { 11519top: ( 11520pos.top + 11521this.offset.relative.top * mod + 11522this.offset.parent.top * mod - 11523((this.cssPosition==="fixed" ? -this.scrollParent.scrollTop():(scrollIsRootNode ? 0:scroll.scrollTop())) * mod) 11524), 11525left: ( 11526pos.left + 11527this.offset.relative.left * mod + 11528this.offset.parent.left * mod - 11529((this.cssPosition==="fixed" ? -this.scrollParent.scrollLeft():scrollIsRootNode ? 0:scroll.scrollLeft()) * mod) 11530) 11531};}, 11532_generatePosition: function (event){ 11533var top, left, 11534o=this.options, 11535pageX=event.pageX, 11536pageY=event.pageY, 11537scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent:this.scrollParent, scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName); 11538if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){ 11539this.offset.relative=this._getRelativeOffset(); 11540} 11541if(this.originalPosition){ 11542if(this.containment){ 11543if(event.pageX - this.offset.click.left < this.containment[0]){ 11544pageX=this.containment[0] + this.offset.click.left; 11545} 11546if(event.pageY - this.offset.click.top < this.containment[1]){ 11547pageY=this.containment[1] + this.offset.click.top; 11548} 11549if(event.pageX - this.offset.click.left > this.containment[2]){ 11550pageX=this.containment[2] + this.offset.click.left; 11551} 11552if(event.pageY - this.offset.click.top > this.containment[3]){ 11553pageY=this.containment[3] + this.offset.click.top; 11554}}
vendor: 5,978 bytes, lines 11555-11747
11555if(o.grid){ 11556top=this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; 11557pageY=this.containment ? ((top - this.offset.click.top >=this.containment[1]&&top - this.offset.click.top <=this.containment[3]) ? top:((top - this.offset.click.top >=this.containment[1]) ? top - o.grid[1]:top + o.grid[1])):top; 11558left=this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; 11559pageX=this.containment ? ((left - this.offset.click.left >=this.containment[0]&&left - this.offset.click.left <=this.containment[2]) ? left:((left - this.offset.click.left >=this.containment[0]) ? left - o.grid[0]:left + o.grid[0])):left; 11560}} 11561return { 11562top: ( 11563pageY - 11564this.offset.click.top - 11565this.offset.relative.top - 11566this.offset.parent.top + 11567((this.cssPosition==="fixed" ? -this.scrollParent.scrollTop():(scrollIsRootNode ? 0:scroll.scrollTop()))) 11568), 11569left: ( 11570pageX - 11571this.offset.click.left - 11572this.offset.relative.left - 11573this.offset.parent.left + 11574((this.cssPosition==="fixed" ? -this.scrollParent.scrollLeft():scrollIsRootNode ? 0:scroll.scrollLeft())) 11575) 11576};}, 11577_rearrange: function (event, i, a, hardRefresh){ 11578a ? a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction==="down" ? i.item[0]:i.item[0].nextSibling)); 11579this.counter=this.counter ? ++this.counter:1; 11580var counter=this.counter; 11581this._delay(function (){ 11582if(counter===this.counter){ 11583this.refreshPositions(!hardRefresh); 11584}}); 11585}, 11586_clear: function (event, noPropagation){ 11587this.reverting=false; 11588var i, 11589delayedTriggers=[]; 11590if(!this._noFinalSort&&this.currentItem.parent().length){ 11591this.placeholder.before(this.currentItem); 11592} 11593this._noFinalSort=null; 11594if(this.helper[0]===this.currentItem[0]){ 11595for (i in this._storedCSS){ 11596if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){ 11597this._storedCSS[i]=""; 11598}} 11599this.currentItem.css(this._storedCSS); 11600this._removeClass(this.currentItem, "ui-sortable-helper"); 11601}else{ 11602this.currentItem.show(); 11603} 11604if(this.fromOutside&&!noPropagation){ 11605delayedTriggers.push(function (event){ this._trigger("receive", event, this._uiHash(this.fromOutside)); }); 11606} 11607if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){ 11608delayedTriggers.push(function (event){ this._trigger("update", event, this._uiHash()); }); 11609} 11610if(this!==this.currentContainer){ 11611if(!noPropagation){ 11612delayedTriggers.push(function (event){ this._trigger("remove", event, this._uiHash()); }); 11613delayedTriggers.push((function (c){ return function (event){ c._trigger("receive", event, this._uiHash(this)); };}).call(this, this.currentContainer)); 11614delayedTriggers.push((function (c){ return function (event){ c._trigger("update", event, this._uiHash(this)); };}).call(this, this.currentContainer)); 11615}} 11616function delayEvent(type, instance, container){ 11617return function (event){ 11618container._trigger(type, event, instance._uiHash(instance)); 11619};} 11620for (i=this.containers.length - 1; i >=0; i--){ 11621if(!noPropagation){ 11622delayedTriggers.push(delayEvent("deactivate", this, this.containers[i])); 11623} 11624if(this.containers[i].containerCache.over){ 11625delayedTriggers.push(delayEvent("out", this, this.containers[i])); 11626this.containers[i].containerCache.over=0; 11627}} 11628if(this.storedCursor){ 11629this.document.find("body").css("cursor", this.storedCursor); 11630this.storedStylesheet.remove(); 11631} 11632if(this._storedOpacity){ 11633this.helper.css("opacity", this._storedOpacity); 11634} 11635if(this._storedZIndex){ 11636this.helper.css("zIndex", this._storedZIndex==="auto" ? "":this._storedZIndex); 11637} 11638this.dragging=false; 11639if(!noPropagation){ 11640this._trigger("beforeStop", event, this._uiHash()); 11641} 11642this.placeholder[0].parentNode.removeChild(this.placeholder[0]); 11643if(!this.cancelHelperRemoval){ 11644if(this.helper[0]!==this.currentItem[0]){ 11645this.helper.remove(); 11646} 11647this.helper=null; 11648} 11649if(!noPropagation){ 11650for (i=0; i < delayedTriggers.length; i++){ 11651delayedTriggers[i].call(this, event); 11652} 11653this._trigger("stop", event, this._uiHash()); 11654} 11655this.fromOutside=false; 11656return !this.cancelHelperRemoval; 11657}, 11658_trigger: function (){ 11659if($.Widget.prototype._trigger.apply(this, arguments)===false){ 11660this.cancel(); 11661}}, 11662_uiHash: function (_inst){ 11663var inst=_inst||this; 11664return { 11665helper: inst.helper, 11666placeholder: inst.placeholder||$([]), 11667position: inst.position, 11668originalPosition: inst.originalPosition, 11669offset: inst.positionAbs, 11670item: inst.currentItem, 11671sender: _inst ? _inst.element:null 11672};}}); 11673})); 11674(function (factory){ 11675if(typeof define==="function"&&define.amd){ 11676define('ui/widgets/spinner.js', [ 11677"jquery", 11678"./button", 11679"../version", 11680"../keycode", 11681"../safe-active-element", 11682"../widget" 11683], factory); 11684}else{ 11685factory(jQuery); 11686}}(function ($){ 11687function spinnerModifer(fn){ 11688return function (){ 11689var previous=this.element.val(); 11690fn.apply(this, arguments); 11691this._refresh(); 11692if(previous!==this.element.val()){ 11693this._trigger("change"); 11694}};} 11695$.widget("ui.spinner", { 11696version: "@VERSION", 11697defaultElement: "<input>", 11698widgetEventPrefix: "spin", 11699options: { 11700classes: { 11701"ui-spinner": "ui-corner-all", 11702"ui-spinner-down": "ui-corner-br", 11703"ui-spinner-up": "ui-corner-tr" 11704}, 11705culture: null, 11706icons: { 11707down: "ui-icon-triangle-1-s", 11708up: "ui-icon-triangle-1-n" 11709}, 11710incremental: true, 11711max: null, 11712min: null, 11713numberFormat: null, 11714page: 10, 11715step: 1, 11716change: null, 11717spin: null, 11718start: null, 11719stop: null 11720}, 11721_create: function (){ 11722this._setOption("max", this.options.max); 11723this._setOption("min", this.options.min); 11724this._setOption("step", this.options.step); 11725if(this.value()!==""){ 11726this._value(this.element.val(), true); 11727} 11728this._draw(); 11729this._on(this._events); 11730this._refresh(); 11731this._on(this.window, { 11732beforeunload: function (){ 11733this.element.removeAttr("autocomplete"); 11734}}); 11735}, 11736_getCreateOptions: function (){ 11737var options=this._super(); 11738var element=this.element; 11739$.each(["min", "max", "step"], function (i, option){ 11740var value=element.attr(option); 11741if(value!=null&&value.length){ 11742options[option]=value; 11743}}); 11744return options; 11745}, 11746_events: { 11747keydown: function (event){
vendor: 1,079 bytes, lines 11748-11793
11748if(this._start(event)&&this._keydown(event)){ 11749event.preventDefault(); 11750}}, 11751keyup: "_stop", 11752focus: function (){ 11753this.previous=this.element.val(); 11754}, 11755blur: function (event){ 11756if(this.cancelBlur){ 11757delete this.cancelBlur; 11758return; 11759} 11760this._stop(); 11761this._refresh(); 11762if(this.previous!==this.element.val()){ 11763this._trigger("change", event); 11764}}, 11765mousewheel: function (event, delta){ 11766if(!delta){ 11767return; 11768} 11769if(!this.spinning&&!this._start(event)){ 11770return false; 11771} 11772this._spin((delta > 0 ? 1:-1) * this.options.step, event); 11773clearTimeout(this.mousewheelTimer); 11774this.mousewheelTimer=this._delay(function (){ 11775if(this.spinning){ 11776this._stop(event); 11777}}, 100); 11778event.preventDefault(); 11779}, 11780"mousedown .ui-spinner-button": function (event){ 11781var previous; 11782previous=this.element[0]===$.ui.safeActiveElement(this.document[0]) ? 11783this.previous:this.element.val(); 11784function checkFocus(){ 11785var isActive=this.element[0]===$.ui.safeActiveElement(this.document[0]); 11786if(!isActive){ 11787this.element.trigger("focus"); 11788this.previous=previous; 11789this._delay(function (){ 11790this.previous=previous; 11791}); 11792}} 11793event.preventDefault();
vendor: 7,910 bytes, lines 11794-12121
11794checkFocus.call(this); 11795this.cancelBlur=true; 11796this._delay(function (){ 11797delete this.cancelBlur; 11798checkFocus.call(this); 11799}); 11800if(this._start(event)===false){ 11801return; 11802} 11803this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1:-1, event); 11804}, 11805"mouseup .ui-spinner-button": "_stop", 11806"mouseenter .ui-spinner-button": function (event){ 11807if(!$(event.currentTarget).hasClass("ui-state-active")){ 11808return; 11809} 11810if(this._start(event)===false){ 11811return false; 11812} 11813this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1:-1, event); 11814}, 11815"mouseleave .ui-spinner-button": "_stop" 11816}, 11817_enhance: function (){ 11818this.uiSpinner=this.element 11819.attr("autocomplete", "off") 11820.wrap("<span>") 11821.parent() 11822.append("<a></a><a></a>" 11823); 11824}, 11825_draw: function (){ 11826this._enhance(); 11827this._addClass(this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content"); 11828this._addClass("ui-spinner-input"); 11829this.element.attr("role", "spinbutton"); 11830this.buttons=this.uiSpinner.children("a") 11831.attr("tabIndex", -1) 11832.attr("aria-hidden", true) 11833.button({ 11834classes: { 11835"ui-button": "" 11836}}); 11837this._removeClass(this.buttons, "ui-corner-all"); 11838this._addClass(this.buttons.first(), "ui-spinner-button ui-spinner-up"); 11839this._addClass(this.buttons.last(), "ui-spinner-button ui-spinner-down"); 11840this.buttons.first().button({ 11841"icon": this.options.icons.up, 11842"showLabel": false 11843}); 11844this.buttons.last().button({ 11845"icon": this.options.icons.down, 11846"showLabel": false 11847}); 11848if(this.buttons.height() > Math.ceil(this.uiSpinner.height() * 0.5) && 11849this.uiSpinner.height() > 0){ 11850this.uiSpinner.height(this.uiSpinner.height()); 11851}}, 11852_keydown: function (event){ 11853var options=this.options, 11854keyCode=$.ui.keyCode; 11855switch (event.keyCode){ 11856case keyCode.UP: 11857this._repeat(null, 1, event); 11858return true; 11859case keyCode.DOWN: 11860this._repeat(null, -1, event); 11861return true; 11862case keyCode.PAGE_UP: 11863this._repeat(null, options.page, event); 11864return true; 11865case keyCode.PAGE_DOWN: 11866this._repeat(null, -options.page, event); 11867return true; 11868} 11869return false; 11870}, 11871_start: function (event){ 11872if(!this.spinning&&this._trigger("start", event)===false){ 11873return false; 11874} 11875if(!this.counter){ 11876this.counter=1; 11877} 11878this.spinning=true; 11879return true; 11880}, 11881_repeat: function (i, steps, event){ 11882i=i||500; 11883clearTimeout(this.timer); 11884this.timer=this._delay(function (){ 11885this._repeat(40, steps, event); 11886}, i); 11887this._spin(steps * this.options.step, event); 11888}, 11889_spin: function (step, event){ 11890var value=this.value()||0; 11891if(!this.counter){ 11892this.counter=1; 11893} 11894value=this._adjustValue(value + step * this._increment(this.counter)); 11895if(!this.spinning||this._trigger("spin", event, { value: value })!==false){ 11896this._value(value); 11897this.counter++; 11898}}, 11899_increment: function (i){ 11900var incremental=this.options.incremental; 11901if(incremental){ 11902return $.isFunction(incremental) ? 11903incremental(i) : 11904Math.floor(i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1); 11905} 11906return 1; 11907}, 11908_precision: function (){ 11909var precision=this._precisionOf(this.options.step); 11910if(this.options.min!==null){ 11911precision=Math.max(precision, this._precisionOf(this.options.min)); 11912} 11913return precision; 11914}, 11915_precisionOf: function (num){ 11916var str=num.toString(), 11917decimal=str.indexOf("."); 11918return decimal===-1 ? 0:str.length - decimal - 1; 11919}, 11920_adjustValue: function (value){ 11921var base, aboveMin, 11922options=this.options; 11923base=options.min!==null ? options.min:0; 11924aboveMin=value - base; 11925aboveMin=Math.round(aboveMin / options.step) * options.step; 11926value=base + aboveMin; 11927value=parseFloat(value.toFixed(this._precision())); 11928if(options.max!==null&&value > options.max){ 11929return options.max; 11930} 11931if(options.min!==null&&value < options.min){ 11932return options.min; 11933} 11934return value; 11935}, 11936_stop: function (event){ 11937if(!this.spinning){ 11938return; 11939} 11940clearTimeout(this.timer); 11941clearTimeout(this.mousewheelTimer); 11942this.counter=0; 11943this.spinning=false; 11944this._trigger("stop", event); 11945}, 11946_setOption: function (key, value){ 11947var prevValue, first, last; 11948if(key==="culture"||key==="numberFormat"){ 11949prevValue=this._parse(this.element.val()); 11950this.options[key]=value; 11951this.element.val(this._format(prevValue)); 11952return; 11953} 11954if(key==="max"||key==="min"||key==="step"){ 11955if(typeof value==="string"){ 11956value=this._parse(value); 11957}} 11958if(key==="icons"){ 11959first=this.buttons.first().find(".ui-icon"); 11960this._removeClass(first, null, this.options.icons.up); 11961this._addClass(first, null, value.up); 11962last=this.buttons.last().find(".ui-icon"); 11963this._removeClass(last, null, this.options.icons.down); 11964this._addClass(last, null, value.down); 11965} 11966this._super(key, value); 11967}, 11968_setOptionDisabled: function (value){ 11969this._super(value); 11970this._toggleClass(this.uiSpinner, null, "ui-state-disabled", !!value); 11971this.element.prop("disabled", !!value); 11972this.buttons.button(value ? "disable":"enable"); 11973}, 11974_setOptions: spinnerModifer(function (options){ 11975this._super(options); 11976}), 11977_parse: function (val){ 11978if(typeof val==="string"&&val!==""){ 11979val=window.Globalize&&this.options.numberFormat ? 11980Globalize.parseFloat(val, 10, this.options.culture):+val; 11981} 11982return val===""||isNaN(val) ? null:val; 11983}, 11984_format: function (value){ 11985if(value===""){ 11986return ""; 11987} 11988return window.Globalize&&this.options.numberFormat ? 11989Globalize.format(value, this.options.numberFormat, this.options.culture) : 11990value; 11991}, 11992_refresh: function (){ 11993this.element.attr({ 11994"aria-valuemin": this.options.min, 11995"aria-valuemax": this.options.max, 11996"aria-valuenow": this._parse(this.element.val()) 11997}); 11998}, 11999isValid: function (){ 12000var value=this.value(); 12001if(value===null){ 12002return false; 12003} 12004return value===this._adjustValue(value); 12005}, 12006_value: function (value, allowAny){ 12007var parsed; 12008if(value!==""){ 12009parsed=this._parse(value); 12010if(parsed!==null){ 12011if(!allowAny){ 12012parsed=this._adjustValue(parsed); 12013} 12014value=this._format(parsed); 12015}} 12016this.element.val(value); 12017this._refresh(); 12018}, 12019_destroy: function (){ 12020this.element 12021.prop("disabled", false) 12022.removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"); 12023this.uiSpinner.replaceWith(this.element); 12024}, 12025stepUp: spinnerModifer(function (steps){ 12026this._stepUp(steps); 12027}), 12028_stepUp: function (steps){ 12029if(this._start()){ 12030this._spin((steps||1) * this.options.step); 12031this._stop(); 12032}}, 12033stepDown: spinnerModifer(function (steps){ 12034this._stepDown(steps); 12035}), 12036_stepDown: function (steps){ 12037if(this._start()){ 12038this._spin((steps||1) * -this.options.step); 12039this._stop(); 12040}}, 12041pageUp: spinnerModifer(function (pages){ 12042this._stepUp((pages||1) * this.options.page); 12043}), 12044pageDown: spinnerModifer(function (pages){ 12045this._stepDown((pages||1) * this.options.page); 12046}), 12047value: function (newVal){ 12048if(!arguments.length){ 12049return this._parse(this.element.val()); 12050} 12051spinnerModifer(this._value).call(this, newVal); 12052}, 12053widget: function (){ 12054return this.uiSpinner; 12055}}); 12056if($.uiBackCompat!==false){ 12057$.widget("ui.spinner", $.ui.spinner, { 12058_enhance: function (){ 12059this.uiSpinner=this.element 12060.attr("autocomplete", "off") 12061.wrap(this._uiSpinnerHtml()) 12062.parent() 12063.append(this._buttonHtml()); 12064}, 12065_uiSpinnerHtml: function (){ 12066return "<span>"; 12067}, 12068_buttonHtml: function (){ 12069return "<a></a><a></a>"; 12070}}); 12071} 12072return $.ui.spinner; 12073})); 12074(function (factory){ 12075if(typeof define==="function"&&define.amd){ 12076define('ui/widgets/tabs.js', [ 12077"jquery", 12078"../escape-selector", 12079"../keycode", 12080"../safe-active-element", 12081"../unique-id", 12082"../version", 12083"../widget" 12084], factory); 12085}else{ 12086factory(jQuery); 12087}}(function ($){ 12088$.widget("ui.tabs", { 12089version: "@VERSION", 12090delay: 300, 12091options: { 12092active: null, 12093classes: { 12094"ui-tabs": "ui-corner-all", 12095"ui-tabs-nav": "ui-corner-all", 12096"ui-tab": "ui-corner-top", 12097"ui-tabs-panel": "ui-corner-bottom" 12098}, 12099collapsible: false, 12100event: "click", 12101heightStyle: "content", 12102hide: null, 12103show: null, 12104activate: null, 12105beforeActivate: null, 12106beforeLoad: null, 12107load: null 12108}, 12109_isLocal: (function (){ 12110var rhash=/#.*$/; 12111return function (anchor){ 12112var anchorUrl, locationUrl; 12113anchorUrl=anchor.href.replace(rhash, ""); 12114locationUrl=location.href.replace(rhash, ""); 12115try { 12116anchorUrl=decodeURIComponent(anchorUrl); 12117} catch (error){ } 12118try { 12119locationUrl=decodeURIComponent(locationUrl); 12120} catch (error){ } 12121return anchor.hash.length >
vendor: 4,455 bytes, lines 12121-12293
12121 1&&anchorUrl===locationUrl; 12122};})(), 12123_create: function (){ 12124var that=this, 12125options=this.options; 12126this.running=false; 12127this._addClass("ui-tabs", "ui-widget ui-widget-content"); 12128this._toggleClass("ui-tabs-collapsible", null, options.collapsible); 12129this._processTabs(); 12130options.active=this._initialActive(); 12131if($.isArray(options.disabled)){ 12132options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"), function (li){ 12133return that.tabs.index(li); 12134}) 12135)).sort(); 12136} 12137if(this.options.active!==false&&this.anchors.length){ 12138this.active=this._findActive(options.active); 12139}else{ 12140this.active=$(); 12141} 12142this._refresh(); 12143if(this.active.length){ 12144this.load(options.active); 12145}}, 12146_initialActive: function (){ 12147var active=this.options.active, 12148collapsible=this.options.collapsible, 12149locationHash=location.hash.substring(1); 12150if(active===null){ 12151if(locationHash){ 12152this.tabs.each(function (i, tab){ 12153if($(tab).attr("aria-controls")===locationHash){ 12154active=i; 12155return false; 12156}}); 12157} 12158if(active===null){ 12159active=this.tabs.index(this.tabs.filter(".ui-tabs-active")); 12160} 12161if(active===null||active===-1){ 12162active=this.tabs.length ? 0:false; 12163}} 12164if(active!==false){ 12165active=this.tabs.index(this.tabs.eq(active)); 12166if(active===-1){ 12167active=collapsible ? false:0; 12168}} 12169if(!collapsible&&active===false&&this.anchors.length){ 12170active=0; 12171} 12172return active; 12173}, 12174_getCreateEventData: function (){ 12175return { 12176tab: this.active, 12177panel: !this.active.length ? $():this._getPanelForTab(this.active) 12178};}, 12179_tabKeydown: function (event){ 12180var focusedTab=$($.ui.safeActiveElement(this.document[0])).closest("li"), 12181selectedIndex=this.tabs.index(focusedTab), 12182goingForward=true; 12183if(this._handlePageNav(event)){ 12184return; 12185} 12186switch (event.keyCode){ 12187case $.ui.keyCode.RIGHT: 12188case $.ui.keyCode.DOWN: 12189selectedIndex++; 12190break; 12191case $.ui.keyCode.UP: 12192case $.ui.keyCode.LEFT: 12193goingForward=false; 12194selectedIndex--; 12195break; 12196case $.ui.keyCode.END: 12197selectedIndex=this.anchors.length - 1; 12198break; 12199case $.ui.keyCode.HOME: 12200selectedIndex=0; 12201break; 12202case $.ui.keyCode.SPACE: 12203event.preventDefault(); 12204clearTimeout(this.activating); 12205this._activate(selectedIndex); 12206return; 12207case $.ui.keyCode.ENTER: 12208event.preventDefault(); 12209clearTimeout(this.activating); 12210this._activate(selectedIndex===this.options.active ? false:selectedIndex); 12211return; 12212default: 12213return; 12214} 12215event.preventDefault(); 12216clearTimeout(this.activating); 12217selectedIndex=this._focusNextTab(selectedIndex, goingForward); 12218if(!event.ctrlKey&&!event.metaKey){ 12219focusedTab.attr("aria-selected", "false"); 12220this.tabs.eq(selectedIndex).attr("aria-selected", "true"); 12221this.activating=this._delay(function (){ 12222this.option("active", selectedIndex); 12223}, this.delay); 12224}}, 12225_panelKeydown: function (event){ 12226if(this._handlePageNav(event)){ 12227return; 12228} 12229if(event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){ 12230event.preventDefault(); 12231this.active.trigger("focus"); 12232}}, 12233_handlePageNav: function (event){ 12234if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){ 12235this._activate(this._focusNextTab(this.options.active - 1, false)); 12236return true; 12237} 12238if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){ 12239this._activate(this._focusNextTab(this.options.active + 1, true)); 12240return true; 12241}}, 12242_findNextTab: function (index, goingForward){ 12243var lastTabIndex=this.tabs.length - 1; 12244function constrain(){ 12245if(index > lastTabIndex){ 12246index=0; 12247} 12248if(index < 0){ 12249index=lastTabIndex; 12250} 12251return index; 12252} 12253while ($.inArray(constrain(), this.options.disabled)!==-1){ 12254index=goingForward ? index + 1:index - 1; 12255} 12256return index; 12257}, 12258_focusNextTab: function (index, goingForward){ 12259index=this._findNextTab(index, goingForward); 12260this.tabs.eq(index).trigger("focus"); 12261return index; 12262}, 12263_setOption: function (key, value){ 12264if(key==="active"){ 12265this._activate(value); 12266return; 12267} 12268this._super(key, value); 12269if(key==="collapsible"){ 12270this._toggleClass("ui-tabs-collapsible", null, value); 12271if(!value&&this.options.active===false){ 12272this._activate(0); 12273}} 12274if(key==="event"){ 12275this._setupEvents(value); 12276} 12277if(key==="heightStyle"){ 12278this._setupHeightStyle(value); 12279}}, 12280_sanitizeSelector: function (hash){ 12281return hash ? hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&"):""; 12282}, 12283refresh: function (){ 12284var options=this.options, 12285lis=this.tablist.children(":has(a[href])"); 12286options.disabled=$.map(lis.filter(".ui-state-disabled"), function (tab){ 12287return lis.index(tab); 12288}); 12289this._processTabs(); 12290if(options.active===false||!this.anchors.length){ 12291options.active=false; 12292this.active=$(); 12293}else if(this.active.length&&!$.contains(this.tablist[0], this.active[0])
vendor: 19,705 bytes, lines 12293-13065
12293){ 12294if(this.tabs.length===options.disabled.length){ 12295options.active=false; 12296this.active=$(); 12297}else{ 12298this._activate(this._findNextTab(Math.max(0, options.active - 1), false)); 12299}}else{ 12300options.active=this.tabs.index(this.active); 12301} 12302this._refresh(); 12303}, 12304_refresh: function (){ 12305this._setOptionDisabled(this.options.disabled); 12306this._setupEvents(this.options.event); 12307this._setupHeightStyle(this.options.heightStyle); 12308this.tabs.not(this.active).attr({ 12309"aria-selected": "false", 12310"aria-expanded": "false", 12311tabIndex: -1 12312}); 12313this.panels.not(this._getPanelForTab(this.active)) 12314.hide() 12315.attr({ 12316"aria-hidden": "true" 12317}); 12318if(!this.active.length){ 12319this.tabs.eq(0).attr("tabIndex", 0); 12320}else{ 12321this.active 12322.attr({ 12323"aria-selected": "true", 12324"aria-expanded": "true", 12325tabIndex: 0 12326}); 12327this._addClass(this.active, "ui-tabs-active", "ui-state-active"); 12328this._getPanelForTab(this.active) 12329.show() 12330.attr({ 12331"aria-hidden": "false" 12332}); 12333}}, 12334_processTabs: function (){ 12335var that=this, 12336prevTabs=this.tabs, 12337prevAnchors=this.anchors, 12338prevPanels=this.panels; 12339this.tablist=this._getList().attr("role", "tablist"); 12340this._addClass(this.tablist, "ui-tabs-nav", 12341"ui-helper-reset ui-helper-clearfix ui-widget-header"); 12342this.tablist 12343.on("mousedown" + this.eventNamespace, "> li", function (event){ 12344if($(this).is(".ui-state-disabled")){ 12345event.preventDefault(); 12346}}) 12347.on("focus" + this.eventNamespace, ".ui-tabs-anchor", function (){ 12348if($(this).closest("li").is(".ui-state-disabled")){ 12349this.blur(); 12350}}); 12351this.tabs=this.tablist.find("> li:has(a[href])") 12352.attr({ 12353role: "tab", 12354tabIndex: -1 12355}); 12356this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default"); 12357this.anchors=this.tabs.map(function (){ 12358return $("a", this)[0]; 12359}) 12360.attr({ 12361role: "presentation", 12362tabIndex: -1 12363}); 12364this._addClass(this.anchors, "ui-tabs-anchor"); 12365this.panels=$(); 12366this.anchors.each(function (i, anchor){ 12367var selector, panel, panelId, 12368anchorId=$(anchor).uniqueId().attr("id"), 12369tab=$(anchor).closest("li"), 12370originalAriaControls=tab.attr("aria-controls"); 12371if(that._isLocal(anchor)){ 12372selector=anchor.hash; 12373panelId=selector.substring(1); 12374panel=that.element.find(that._sanitizeSelector(selector)); 12375}else{ 12376panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id; 12377selector="#" + panelId; 12378panel=that.element.find(selector); 12379if(!panel.length){ 12380panel=that._createPanel(panelId); 12381panel.insertAfter(that.panels[i - 1]||that.tablist); 12382} 12383panel.attr("aria-live", "polite"); 12384} 12385if(panel.length){ 12386that.panels=that.panels.add(panel); 12387} 12388if(originalAriaControls){ 12389tab.data("ui-tabs-aria-controls", originalAriaControls); 12390} 12391tab.attr({ 12392"aria-controls": panelId, 12393"aria-labelledby": anchorId 12394}); 12395panel.attr("aria-labelledby", anchorId); 12396}); 12397this.panels.attr("role", "tabpanel"); 12398this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content"); 12399if(prevTabs){ 12400this._off(prevTabs.not(this.tabs)); 12401this._off(prevAnchors.not(this.anchors)); 12402this._off(prevPanels.not(this.panels)); 12403}}, 12404_getList: function (){ 12405return this.tablist||this.element.find("ol, ul").eq(0); 12406}, 12407_createPanel: function (id){ 12408return $("<div>") 12409.attr("id", id) 12410.data("ui-tabs-destroy", true); 12411}, 12412_setOptionDisabled: function (disabled){ 12413var currentItem, li, i; 12414if($.isArray(disabled)){ 12415if(!disabled.length){ 12416disabled=false; 12417}else if(disabled.length===this.anchors.length){ 12418disabled=true; 12419}} 12420for (i=0; (li=this.tabs[i]) ; i++){ 12421currentItem=$(li); 12422if(disabled===true||$.inArray(i, disabled)!==-1){ 12423currentItem.attr("aria-disabled", "true"); 12424this._addClass(currentItem, null, "ui-state-disabled"); 12425}else{ 12426currentItem.removeAttr("aria-disabled"); 12427this._removeClass(currentItem, null, "ui-state-disabled"); 12428}} 12429this.options.disabled=disabled; 12430this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, 12431disabled===true); 12432}, 12433_setupEvents: function (event){ 12434var events={}; 12435if(event){ 12436$.each(event.split(" "), function (index, eventName){ 12437events[eventName]="_eventHandler"; 12438}); 12439} 12440this._off(this.anchors.add(this.tabs).add(this.panels)); 12441this._on(true, this.anchors, { 12442click: function (event){ 12443event.preventDefault(); 12444}}); 12445this._on(this.anchors, events); 12446this._on(this.tabs, { keydown: "_tabKeydown" }); 12447this._on(this.panels, { keydown: "_panelKeydown" }); 12448this._focusable(this.tabs); 12449this._hoverable(this.tabs); 12450}, 12451_setupHeightStyle: function (heightStyle){ 12452var maxHeight, 12453parent=this.element.parent(); 12454if(heightStyle==="fill"){ 12455maxHeight=parent.height(); 12456maxHeight -=this.element.outerHeight() - this.element.height(); 12457this.element.siblings(":visible").each(function (){ 12458var elem=$(this), 12459position=elem.css("position"); 12460if(position==="absolute"||position==="fixed"){ 12461return; 12462} 12463maxHeight -=elem.outerHeight(true); 12464}); 12465this.element.children().not(this.panels).each(function (){ 12466maxHeight -=$(this).outerHeight(true); 12467}); 12468this.panels.each(function (){ 12469$(this).height(Math.max(0, maxHeight - 12470$(this).innerHeight() + $(this).height())); 12471}) 12472.css("overflow", "auto"); 12473}else if(heightStyle==="auto"){ 12474maxHeight=0; 12475this.panels.each(function (){ 12476maxHeight=Math.max(maxHeight, $(this).height("").height()); 12477}).height(maxHeight); 12478}}, 12479_eventHandler: function (event){ 12480var options=this.options, 12481active=this.active, 12482anchor=$(event.currentTarget), 12483tab=anchor.closest("li"), 12484clickedIsActive=tab[0]===active[0], 12485collapsing=clickedIsActive&&options.collapsible, 12486toShow=collapsing ? $():this._getPanelForTab(tab), 12487toHide = !active.length ? $():this._getPanelForTab(active), 12488eventData={ 12489oldTab: active, 12490oldPanel: toHide, 12491newTab: collapsing ? $():tab, 12492newPanel: toShow 12493}; 12494event.preventDefault(); 12495if(tab.hasClass("ui-state-disabled") || 12496tab.hasClass("ui-tabs-loading") || 12497this.running || 12498(clickedIsActive&&!options.collapsible) || 12499(this._trigger("beforeActivate", event, eventData)===false)){ 12500return; 12501} 12502options.active=collapsing ? false:this.tabs.index(tab); 12503this.active=clickedIsActive ? $():tab; 12504if(this.xhr){ 12505this.xhr.abort(); 12506} 12507if(!toHide.length&&!toShow.length){ 12508$.error("jQuery UI Tabs: Mismatching fragment identifier."); 12509} 12510if(toShow.length){ 12511this.load(this.tabs.index(tab), event); 12512} 12513this._toggle(event, eventData); 12514}, 12515_toggle: function (event, eventData){ 12516var that=this, 12517toShow=eventData.newPanel, 12518toHide=eventData.oldPanel; 12519this.running=true; 12520function complete(){ 12521that.running=false; 12522that._trigger("activate", event, eventData); 12523} 12524function show(){ 12525that._addClass(eventData.newTab.closest("li"), "ui-tabs-active", "ui-state-active"); 12526if(toShow.length&&that.options.show){ 12527that._show(toShow, that.options.show, complete); 12528}else{ 12529toShow.show(); 12530complete(); 12531}} 12532if(toHide.length&&this.options.hide){ 12533this._hide(toHide, this.options.hide, function (){ 12534that._removeClass(eventData.oldTab.closest("li"), 12535"ui-tabs-active", "ui-state-active"); 12536show(); 12537}); 12538}else{ 12539this._removeClass(eventData.oldTab.closest("li"), 12540"ui-tabs-active", "ui-state-active"); 12541toHide.hide(); 12542show(); 12543} 12544toHide.attr("aria-hidden", "true"); 12545eventData.oldTab.attr({ 12546"aria-selected": "false", 12547"aria-expanded": "false" 12548}); 12549if(toShow.length&&toHide.length){ 12550eventData.oldTab.attr("tabIndex", -1); 12551}else if(toShow.length){ 12552this.tabs.filter(function (){ 12553return $(this).attr("tabIndex")===0; 12554}) 12555.attr("tabIndex", -1); 12556} 12557toShow.attr("aria-hidden", "false"); 12558eventData.newTab.attr({ 12559"aria-selected": "true", 12560"aria-expanded": "true", 12561tabIndex: 0 12562}); 12563}, 12564_activate: function (index){ 12565var anchor, 12566active=this._findActive(index); 12567if(active[0]===this.active[0]){ 12568return; 12569} 12570if(!active.length){ 12571active=this.active; 12572} 12573anchor=active.find(".ui-tabs-anchor")[0]; 12574this._eventHandler({ 12575target: anchor, 12576currentTarget: anchor, 12577preventDefault: $.noop 12578}); 12579}, 12580_findActive: function (index){ 12581return index===false ? $():this.tabs.eq(index); 12582}, 12583_getIndex: function (index){ 12584if(typeof index==="string"){ 12585index=this.anchors.index(this.anchors.filter("[href$='" + $.ui.escapeSelector(index) + "']")); 12586} 12587return index; 12588}, 12589_destroy: function (){ 12590if(this.xhr){ 12591this.xhr.abort(); 12592} 12593this.tablist 12594.removeAttr("role") 12595.off(this.eventNamespace); 12596this.anchors 12597.removeAttr("role tabIndex") 12598.removeUniqueId(); 12599this.tabs.add(this.panels).each(function (){ 12600if($.data(this, "ui-tabs-destroy")){ 12601$(this).remove(); 12602}else{ 12603$(this).removeAttr("role tabIndex " + 12604"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded"); 12605}}); 12606this.tabs.each(function (){ 12607var li=$(this), 12608prev=li.data("ui-tabs-aria-controls"); 12609if(prev){ 12610li 12611.attr("aria-controls", prev) 12612.removeData("ui-tabs-aria-controls"); 12613}else{ 12614li.removeAttr("aria-controls"); 12615}}); 12616this.panels.show(); 12617if(this.options.heightStyle!=="content"){ 12618this.panels.css("height", ""); 12619}}, 12620enable: function (index){ 12621var disabled=this.options.disabled; 12622if(disabled===false){ 12623return; 12624} 12625if(index===undefined){ 12626disabled=false; 12627}else{ 12628index=this._getIndex(index); 12629if($.isArray(disabled)){ 12630disabled=$.map(disabled, function (num){ 12631return num!==index ? num:null; 12632}); 12633}else{ 12634disabled=$.map(this.tabs, function (li, num){ 12635return num!==index ? num:null; 12636}); 12637}} 12638this._setOptionDisabled(disabled); 12639}, 12640disable: function (index){ 12641var disabled=this.options.disabled; 12642if(disabled===true){ 12643return; 12644} 12645if(index===undefined){ 12646disabled=true; 12647}else{ 12648index=this._getIndex(index); 12649if($.inArray(index, disabled)!==-1){ 12650return; 12651} 12652if($.isArray(disabled)){ 12653disabled=$.merge([index], disabled).sort(); 12654}else{ 12655disabled=[index]; 12656}} 12657this._setOptionDisabled(disabled); 12658}, 12659load: function (index, event){ 12660index=this._getIndex(index); 12661var that=this, 12662tab=this.tabs.eq(index), 12663anchor=tab.find(".ui-tabs-anchor"), 12664panel=this._getPanelForTab(tab), 12665eventData={ 12666tab: tab, 12667panel: panel 12668}, 12669complete=function (jqXHR, status){ 12670if(status==="abort"){ 12671that.panels.stop(false, true); 12672} 12673that._removeClass(tab, "ui-tabs-loading"); 12674panel.removeAttr("aria-busy"); 12675if(jqXHR===that.xhr){ 12676delete that.xhr; 12677}}; 12678if(this._isLocal(anchor[0])){ 12679return; 12680} 12681this.xhr=$.ajax(this._ajaxSettings(anchor, event, eventData)); 12682if(this.xhr&&this.xhr.statusText!=="canceled"){ 12683this._addClass(tab, "ui-tabs-loading"); 12684panel.attr("aria-busy", "true"); 12685this.xhr 12686.done(function (response, status, jqXHR){ 12687setTimeout(function (){ 12688panel.html(response); 12689that._trigger("load", event, eventData); 12690complete(jqXHR, status); 12691}, 1); 12692}) 12693.fail(function (jqXHR, status){ 12694setTimeout(function (){ 12695complete(jqXHR, status); 12696}, 1); 12697}); 12698}}, 12699_ajaxSettings: function (anchor, event, eventData){ 12700var that=this; 12701return { 12702url: anchor.attr("href"), 12703beforeSend: function (jqXHR, settings){ 12704return that._trigger("beforeLoad", event, 12705$.extend({ jqXHR: jqXHR, ajaxSettings: settings }, eventData)); 12706}};}, 12707_getPanelForTab: function (tab){ 12708var id=$(tab).attr("aria-controls"); 12709return this.element.find(this._sanitizeSelector("#" + id)); 12710}}); 12711if($.uiBackCompat!==false){ 12712$.widget("ui.tabs", $.ui.tabs, { 12713_processTabs: function (){ 12714this._superApply(arguments); 12715this._addClass(this.tabs, "ui-tab"); 12716}}); 12717} 12718return $.ui.tabs; 12719})); 12720(function (factory){ 12721if(typeof define==="function"&&define.amd){ 12722define('ui/widgets/tooltip.js', [ 12723"jquery", 12724"../keycode", 12725"../position", 12726"../unique-id", 12727"../version", 12728"../widget" 12729], factory); 12730}else{ 12731factory(jQuery); 12732}}(function ($){ 12733$.widget("ui.tooltip", { 12734version: "@VERSION", 12735options: { 12736classes: { 12737"ui-tooltip": "ui-corner-all ui-widget-shadow" 12738}, 12739content: function (){ 12740var title=$(this).attr("title")||""; 12741return $("<a>").text(title).html(); 12742}, 12743hide: true, 12744items: "[title]:not([disabled])", 12745position: { 12746my: "left top+15", 12747at: "left bottom", 12748collision: "flipfit flip" 12749}, 12750show: true, 12751track: false, 12752close: null, 12753open: null 12754}, 12755_addDescribedBy: function (elem, id){ 12756var describedby=(elem.attr("aria-describedby")||"").split(/\s+/); 12757describedby.push(id); 12758elem 12759.data("ui-tooltip-id", id) 12760.attr("aria-describedby", $.trim(describedby.join(" "))); 12761}, 12762_removeDescribedBy: function (elem){ 12763var id=elem.data("ui-tooltip-id"), 12764describedby=(elem.attr("aria-describedby")||"").split(/\s+/), 12765index=$.inArray(id, describedby); 12766if(index!==-1){ 12767describedby.splice(index, 1); 12768} 12769elem.removeData("ui-tooltip-id"); 12770describedby=$.trim(describedby.join(" ")); 12771if(describedby){ 12772elem.attr("aria-describedby", describedby); 12773}else{ 12774elem.removeAttr("aria-describedby"); 12775}}, 12776_create: function (){ 12777this._on({ 12778mouseover: "open", 12779focusin: "open" 12780}); 12781this.tooltips={}; 12782this.parents={}; 12783this.liveRegion=$("<div>") 12784.attr({ 12785role: "log", 12786"aria-live": "assertive", 12787"aria-relevant": "additions" 12788}) 12789.appendTo(this.document[0].body); 12790this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"); 12791}, 12792_setOption: function (key, value){ 12793var that=this; 12794this._super(key, value); 12795if(key==="content"){ 12796$.each(this.tooltips, function (id, tooltipData){ 12797that._updateContent(tooltipData.element); 12798}); 12799}}, 12800_setOptionDisabled: function (value){ 12801this[value ? "_disable":"_enable"](); 12802}, 12803_disable: function (){ 12804var that=this; 12805$.each(this.tooltips, function (id, tooltipData){ 12806var event=$.Event("blur"); 12807event.target=event.currentTarget=tooltipData.element[0]; 12808that.close(event, true); 12809}); 12810this.element.find(this.options.items).addBack().each(function (){ 12811var element=$(this); 12812if(element.is("[title]")){ 12813element 12814.data("ui-tooltip-title", element.attr("title")) 12815.removeAttr("title"); 12816}}); 12817}, 12818_enable: function (){ 12819this.element.find(this.options.items).addBack().each(function (){ 12820var element=$(this); 12821if(element.data("ui-tooltip-title")){ 12822element.attr("title", element.data("ui-tooltip-title")); 12823}}); 12824}, 12825open: function (event){ 12826var that=this, 12827target=$(event ? event.target:this.element) 12828.closest(this.options.items); 12829if(!target.length||target.data("ui-tooltip-id")){ 12830return; 12831} 12832if(target.attr("title")){ 12833target.data("ui-tooltip-title", target.attr("title")); 12834} 12835target.data("ui-tooltip-open", true); 12836if(event&&event.type==="mouseover"){ 12837target.parents().each(function (){ 12838var parent=$(this), 12839blurEvent; 12840if(parent.data("ui-tooltip-open")){ 12841blurEvent=$.Event("blur"); 12842blurEvent.target=blurEvent.currentTarget=this; 12843that.close(blurEvent, true); 12844} 12845if(parent.attr("title")){ 12846parent.uniqueId(); 12847that.parents[this.id]={ 12848element: this, 12849title: parent.attr("title") 12850}; 12851parent.attr("title", ""); 12852}}); 12853} 12854this._registerCloseHandlers(event, target); 12855this._updateContent(target, event); 12856}, 12857_updateContent: function (target, event){ 12858var content, 12859contentOption=this.options.content, 12860that=this, 12861eventType=event ? event.type:null; 12862if(typeof contentOption==="string"||contentOption.nodeType || 12863contentOption.jquery){ 12864return this._open(event, target, contentOption); 12865} 12866content=contentOption.call(target[0], function (response){ 12867that._delay(function (){ 12868if(!target.data("ui-tooltip-open")){ 12869return; 12870} 12871if(event){ 12872event.type=eventType; 12873} 12874this._open(event, target, response); 12875}); 12876}); 12877if(content){ 12878this._open(event, target, content); 12879}}, 12880_open: function (event, target, content){ 12881var tooltipData, tooltip, delayedShow, a11yContent, 12882positionOption=$.extend({}, this.options.position); 12883if(!content){ 12884return; 12885} 12886tooltipData=this._find(target); 12887if(tooltipData){ 12888tooltipData.tooltip.find(".ui-tooltip-content").html(content); 12889return; 12890} 12891if(target.is("[title]")){ 12892if(event&&event.type==="mouseover"){ 12893target.attr("title", ""); 12894}else{ 12895target.removeAttr("title"); 12896}} 12897tooltipData=this._tooltip(target); 12898tooltip=tooltipData.tooltip; 12899this._addDescribedBy(target, tooltip.attr("id")); 12900tooltip.find(".ui-tooltip-content").html(content); 12901this.liveRegion.children().hide(); 12902a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html()); 12903a11yContent.removeAttr("name").find("[name]").removeAttr("name"); 12904a11yContent.removeAttr("id").find("[id]").removeAttr("id"); 12905a11yContent.appendTo(this.liveRegion); 12906function position(event){ 12907positionOption.of=event; 12908if(tooltip.is(":hidden")){ 12909return; 12910} 12911tooltip.position(positionOption); 12912} 12913if(this.options.track&&event&&/^mouse/.test(event.type)){ 12914this._on(this.document, { 12915mousemove: position 12916}); 12917position(event); 12918}else{ 12919tooltip.position($.extend({ 12920of: target 12921}, this.options.position)); 12922} 12923tooltip.hide(); 12924this._show(tooltip, this.options.show); 12925if(this.options.track&&this.options.show&&this.options.show.delay){ 12926delayedShow=this.delayedShow=setInterval(function (){ 12927if(tooltip.is(":visible")){ 12928position(positionOption.of); 12929clearInterval(delayedShow); 12930}}, $.fx.interval); 12931} 12932this._trigger("open", event, { tooltip: tooltip }); 12933}, 12934_registerCloseHandlers: function (event, target){ 12935var events={ 12936keyup: function (event){ 12937if(event.keyCode===$.ui.keyCode.ESCAPE){ 12938var fakeEvent=$.Event(event); 12939fakeEvent.currentTarget=target[0]; 12940this.close(fakeEvent, true); 12941}} 12942}; 12943if(target[0]!==this.element[0]){ 12944events.remove=function (){ 12945this._removeTooltip(this._find(target).tooltip); 12946};} 12947if(!event||event.type==="mouseover"){ 12948events.mouseleave="close"; 12949} 12950if(!event||event.type==="focusin"){ 12951events.focusout="close"; 12952} 12953this._on(true, target, events); 12954}, 12955close: function (event){ 12956var tooltip, 12957that=this, 12958target=$(event ? event.currentTarget:this.element), 12959tooltipData=this._find(target); 12960if(!tooltipData){ 12961target.removeData("ui-tooltip-open"); 12962return; 12963} 12964tooltip=tooltipData.tooltip; 12965if(tooltipData.closing){ 12966return; 12967} 12968clearInterval(this.delayedShow); 12969if(target.data("ui-tooltip-title")&&!target.attr("title")){ 12970target.attr("title", target.data("ui-tooltip-title")); 12971} 12972this._removeDescribedBy(target); 12973tooltipData.hiding=true; 12974tooltip.stop(true); 12975this._hide(tooltip, this.options.hide, function (){ 12976that._removeTooltip($(this)); 12977}); 12978target.removeData("ui-tooltip-open"); 12979this._off(target, "mouseleave focusout keyup"); 12980if(target[0]!==this.element[0]){ 12981this._off(target, "remove"); 12982} 12983this._off(this.document, "mousemove"); 12984if(event&&event.type==="mouseleave"){ 12985$.each(this.parents, function (id, parent){ 12986$(parent.element).attr("title", parent.title); 12987delete that.parents[id]; 12988}); 12989} 12990tooltipData.closing=true; 12991this._trigger("close", event, { tooltip: tooltip }); 12992if(!tooltipData.hiding){ 12993tooltipData.closing=false; 12994}}, 12995_tooltip: function (element){ 12996var tooltip=$("<div>").attr("role", "tooltip"), 12997content=$("<div>").appendTo(tooltip), 12998id=tooltip.uniqueId().attr("id"); 12999this._addClass(content, "ui-tooltip-content"); 13000this._addClass(tooltip, "ui-tooltip", "ui-widget ui-widget-content"); 13001tooltip.appendTo(this._appendTo(element)); 13002return this.tooltips[id]={ 13003element: element, 13004tooltip: tooltip 13005};}, 13006_find: function (target){ 13007var id=target.data("ui-tooltip-id"); 13008return id ? this.tooltips[id]:null; 13009}, 13010_removeTooltip: function (tooltip){ 13011tooltip.remove(); 13012delete this.tooltips[tooltip.attr("id")]; 13013}, 13014_appendTo: function (target){ 13015var element=target.closest(".ui-front, dialog"); 13016if(!element.length){ 13017element=this.document[0].body; 13018} 13019return element; 13020}, 13021_destroy: function (){ 13022var that=this; 13023$.each(this.tooltips, function (id, tooltipData){ 13024var event=$.Event("blur"), 13025element=tooltipData.element; 13026event.target=event.currentTarget=element[0]; 13027that.close(event, true); 13028$("#" + id).remove(); 13029if(element.data("ui-tooltip-title")){ 13030if(!element.attr("title")){ 13031element.attr("title", element.data("ui-tooltip-title")); 13032} 13033element.removeData("ui-tooltip-title"); 13034}}); 13035this.liveRegion.remove(); 13036}}); 13037if($.uiBackCompat!==false){ 13038$.widget("ui.tooltip", $.ui.tooltip, { 13039options: { 13040tooltipClass: null 13041}, 13042_tooltip: function (){ 13043var tooltipData=this._superApply(arguments); 13044if(this.options.tooltipClass){ 13045tooltipData.tooltip.addClass(this.options.tooltipClass); 13046} 13047return tooltipData; 13048}}); 13049} 13050return $.ui.tooltip; 13051})); 13052jQuery(document).ready(function ($){ 13053if(!$.cookie("promobarcookie")){ $(".promo-bar").show(); }}); 13054function removeThis(field){ $(field).parent().hide(); jQuery.cookie("promobarcookie", "closed", { expires: 1, path: '/' });} 13055var hideSliderTimeConstant=3000; 13056var mainSliderHideTime=setTimeout(function (){ }, hideSliderTimeConstant); 13057var newSongSliderHideTime=setTimeout(function (){ }, hideSliderTimeConstant); 13058var cartPlayerHideTime=setTimeout(function (){ }, hideSliderTimeConstant); 13059var singleSongPlayerHideTime=setTimeout(function (){ }, hideSliderTimeConstant); 13060var checkoutPlayerHideTime=setTimeout(function (){ }, hideSliderTimeConstant); 13061jQuery(document).ready(function ($){ 13062var bpm_from='', 13063bpm_to='', 13064len_from='', 13065len_to='';
13066$(".search_filter").not("#genre_tag").select2({ minimumResultsForSearch: Infinity, width: null }); 13067$("#genre_tag").select2({ minimumResultsForSearch: Infinity, width: "47%" }); 13068var bpms=ajax_obj_search.bpm.split('-'); 13069var lengths=ajax_obj_search.length.split('-'); 13070var $length=''; 13071var $bpm=''; 13072$bpm=jQuery("#bpm_range").ionRangeSlider({ 13073type: "double", 13074grid: true, 13075min: 50, 13076max: 180, 13077from: bpms[0], 13078to: bpms[1], 13079max_postfix: "+", 13080onFinish: function (data){ 13081bpm_from=data.input.data("from"), 13082bpm_to=data.input.data("to"), 13083len_from=$length.data("from"), 13084len_to=$length.data("to"); 13085filterByRangeSlider(data.input, $length); 13086}, 13087}); 13088$length=jQuery("#length_range").ionRangeSlider({ 13089type: "double", 13090grid: true, 13091min: 0.30, 13092max: 10, 13093from: lengths[0], 13094to: lengths[1], 13095step: 0.1, 13096postfix: "min", 13097max_postfix: "+", 13098onFinish: function (data){ 13099bpm_from=$bpm.data("from"), 13100bpm_to=$bpm.data("to"), 13101len_from=data.input.data("from"), 13102len_to=data.input.data("to"); 13103filterByRangeSlider($bpm, data.input); 13104}, 13105}); 13106InitializeSingleSongPagePlayer(); 13107InitializeMediaElements(); 13108NewMusicSongsInitialize(); 13109InitializeCartPlayer(); 13110InitializeCheckoutPagePlayer(); 13111$('#mediawrapper .plbutton.buybutton').click(function (e){ 13112e.stopPropagation(); 13113var href=$(this).attr('href'); 13114window.location=href; 13115}); 13116/* $('#cart_player .edd-remove-from-cart').click(function(e){ 13117e.stopPropagation(); 13118var href=$(this).attr('href'); 13119window.location=href; 13120});*/ 13121$('body').on('click', '#cart_player .edd-remove-from-cart', function (e){ 13122e.stopPropagation(); 13123setTimeout(function (){ 13124}, 10); 13125}); 13126$('#edd_checkout_cart_wrap .edd-remove-from-cart').click(function (e){ 13127e.stopPropagation(); 13128var href=$(this).attr('href'); 13129window.location=href; 13130}); 13131$('#mediawrapper .mejs-mediaelement .player-error').html('Leider ergab die Suche keine Treffer - bitte erweitern Sie die Filtereinstellungen'); 13132$('#Fader').easyFader({ slideDur: 6000, fadeDur: 800 }); 13133$("area[rel^='prettyPhoto']").prettyPhoto(); $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'normal', slideshow: 6000 }); 13134$(".toggle_container").hide(); $("h4.trigger").click(function (){ $(this).toggleClass("active").next().slideToggle("normal"); return false; }); 13135$("#main").fitVids(); 13136$.scrollUp({ 13137scrollName: 'scrollUp', 13138topDistance: '300', 13139topSpeed: 300, 13140animation: 'fade', 13141animationInSpeed: 200, 13142animationOutSpeed: 200, 13143scrollText: 'Top', 13144activeOverlay: false, 13145scrollImg: true, 13146}); 13147$(document).on('opening', '.remodal', function (){ console.log('opening'); }); 13148$(document).on('opened', '.remodal', function (){ console.log('opened'); }); 13149$(document).on('closing', '.remodal', function (e){ console.log('closing' + (e.reason ? ', reason: ' + e.reason:'')); }); 13150$(document).on('closed', '.remodal', function (e){ 13151try { 13152var mid=$(this).attr('data-remodal-id'); 13153$('.hide_' + mid).hide(); 13154$('.show_' + mid).show(); 13155console.log('closed' + (e.reason ? ', reason: ' + e.reason:'')); 13156} catch (ex){ 13157}}); 13158$(document).on('confirmation', '.remodal', function (){ console.log('confirmation'); }); 13159$(document).on('cancellation', '.remodal', function (){ console.log('cancellation'); }); 13160$(".search").keyup(function (){ 13161var searchid=$(this).val(); 13162var dataString='action=get_search_keyword&search=' + searchid; 13163if(searchid!=''){ 13164$(".search-content input.beat_search_input").addClass('icon-spinner').isLoading({ 13165class: "icon-spin", 13166tpl: '<span class="isloading-wrapper %wrapper%">%text%<i class="%class% icon-spin"></i></span>', 13167disableSource: false, 13168}); 13169$.ajax({ 13170type: "POST", 13171url: ajax_obj_search.ajax_url, 13172data: dataString, 13173cache: false, 13174success: function (html){ 13175$("#result").html(html).show(); 13176$(".search-content input.beat_search_input").removeClass('icon-spinner').isLoading("hide"); 13177}}); 13178} return false; 13179}); 13180$("#result .list_show").live("click", function (e){ 13181var $clicked=$(this); 13182var $name=$clicked.find('.search_keyword').html(); 13183var tag_name=$clicked.find('.search_keyword').data('keyword'); 13184var decoded=$("<div/>").html($name).text(); 13185$('#searchid').val(decoded); 13186$("#mediawrapper .mejs-playlist").LoadingOverlay("show", { 13187image: "", 13188fontawesome: "fa fa-spinner fa-spin" 13189}); 13190if(decoded){ 13191var searchid=$(this).val(); 13192var dataString='action=get_search_result&' + tag_name + '=' + decoded; 13193var dataString1='action=pagination_filter&' + tag_name + '=' + decoded; 13194$.ajax({ 13195type: "POST", 13196url: ajax_obj_search.ajax_url, 13197data: dataString, 13198cache: false, 13199success: function (html){ 13200$('#mediawrapper div').remove(); 13201var audio=document.createElement("AUDIO"); 13202audio.setAttribute("id", "mejs"); 13203audio.setAttribute("preload", "none") 13204audio.setAttribute("controls", "controls"); 13205audio.setAttribute("style", "width: 100%;"); 13206audio.innerHTML=html; 13207document.getElementById("mediawrapper").appendChild(audio); 13208InitializeMediaElements(); 13209}}); 13210$.ajax({ 13211type: "POST", 13212url: ajax_obj_search.ajax_url, 13213data: dataString1, 13214cache: false, 13215success: function (html){ 13216$('.navigation').html(html); 13217}}); 13218}}); 13219$(document).live("click", function (e){ 13220var $clicked=$(e.target); 13221if(!$clicked.hasClass("search")){ 13222$("#result").fadeOut(); 13223}}); 13224$('#searchid').click(function (){ 13225$("#result").fadeIn(); 13226}); 13227$('.search_filter').change(function (){
13228var genre_tag=$('#genre_tag option:selected').val(); 13229var download_category_tag=$('#download_category_tag option:selected').val(); 13230var artist_tag=$('#artist_tag option:selected').val(); 13231var download_tag=$('#download_tag option:selected').val(); 13232var data_filter=''; 13233if(genre_tag!=''){ 13234data_filter +='&genre_tag=' + genre_tag; 13235} 13236if(download_category_tag!=''){ 13237data_filter +='&download_category_tag=' + download_category_tag; 13238} 13239if(artist_tag!=''){ 13240data_filter +='&artist_tag=' + artist_tag; 13241} 13242if(download_tag!=''){ 13243data_filter +='&download_tag=' + download_tag; 13244} 13245if(bpm_from!=''&&bpm_to!=''){ 13246data_filter +='&bpm=' + bpm_from + '-' + bpm_to; 13247} 13248if(len_from!=''&&len_to!=''){ 13249data_filter +='&length=' + len_from + '-' + len_to; 13250} 13251var dataString='action=get_download'; 13252var dataString1='action=pagination_filter'; 13253if(data_filter!=''){ 13254dataString=dataString + data_filter; 13255dataString1=dataString1 + data_filter; 13256} 13257$("#mediawrapper .mejs-playlist").LoadingOverlay("show", { 13258image: "", 13259fontawesome: "fa fa-spinner fa-spin" 13260}); 13261filters={ 13262cat: download_category_tag, gen: genre_tag, art: artist_tag, stimmung: download_tag, 13263}; 13264if(bpm_from!=''&&bpm_to!=''&&len_from!=''&&len_to!=''){ 13265filters={ 13266cat: download_category_tag, gen: genre_tag, art: artist_tag, stimmung: download_tag, bpm: bpm_from + '-' + bpm_to, length: +len_from + '-' + len_to, 13267};} 13268SETUrl(ajax_obj_search.home_url); 13269$.ajax({ 13270type: "POST", 13271url: ajax_obj_search.ajax_url, 13272data: dataString, 13273cache: false, 13274success: function (html){ 13275$('#mediawrapper div').remove(); 13276var audio=document.createElement("AUDIO"); 13277audio.setAttribute("id", "mejs"); 13278audio.setAttribute("preload", "none") 13279audio.setAttribute("controls", "controls"); 13280audio.setAttribute("style", "width: 100%;"); 13281audio.innerHTML=html; 13282document.getElementById("mediawrapper").appendChild(audio); 13283InitializeMediaElements(); 13284}}); 13285$.ajax({ 13286type: "POST", 13287url: ajax_obj_search.ajax_url, 13288data: dataString1, 13289cache: false, 13290success: function (html){ 13291$('.navigation').html(html); 13292}}); 13293}); 13294}); 13295function pagination(e, cats, gens, arts, stimmungs, pagenos, bpmRange, lengthRange){ 13296e.preventDefault(); 13297var data_filter=''; 13298if(gens!=''){ 13299data_filter +='&genre_tag=' + gens; 13300} 13301if(cats!=''){ 13302data_filter +='&download_category_tag=' + cats; 13303} 13304if(arts!=''){ 13305data_filter +='&artist_tag=' + arts; 13306} 13307if(stimmungs!=''){ 13308data_filter +='&download_tag=' + stimmungs; 13309} 13310if(pagenos!=''){ 13311data_filter +='&pageno=' + pagenos; 13312} 13313if(bpmRange!=''){ 13314data_filter +='&bpm=' + bpmRange; 13315} 13316if(lengthRange!=''){ 13317data_filter +='&length=' + lengthRange; 13318} 13319var dataString='action=get_download'; 13320var dataString1='action=pagination_filter'; 13321if(data_filter!=''){ 13322dataString=dataString + data_filter; 13323dataString1=dataString1 + data_filter; 13324} 13325jQuery("#mediawrapper .mejs-playlist").LoadingOverlay("show", { 13326image: "", 13327fontawesome: "fa fa-spinner fa-spin" 13328}); 13329filters={ 13330cat: cats, gen: gens, art: arts, stimmung: stimmungs, pageno: pagenos, bpm: bpmRange, length: lengthRange 13331}; 13332SETUrl(ajax_obj_search.home_url); 13333jQuery.ajax({ 13334type: "POST", 13335url: ajax_obj_search.ajax_url, 13336data: dataString, 13337cache: false, 13338success: function (html){ 13339jQuery('#mediawrapper div').remove(); 13340var audio=document.createElement("AUDIO"); 13341audio.setAttribute("id", "mejs"); 13342audio.setAttribute("preload", "none") 13343audio.setAttribute("controls", "controls"); 13344audio.setAttribute("style", "width: 100%;"); 13345audio.innerHTML=html; 13346document.getElementById("mediawrapper").appendChild(audio); 13347InitializeMediaElements(); 13348}}); 13349jQuery.ajax({ 13350type: "POST", 13351url: ajax_obj_search.ajax_url, 13352data: dataString1, 13353cache: false, 13354success: function (html){ 13355jQuery('.navigation').html(html); 13356}}); 13357} 13358function filterByRangeSlider($bpm, $length){ 13359var bpm_from=$bpm.data("from"), 13360bpm_to=$bpm.data("to"), 13361len_from=$length.data("from"), 13362len_to=$length.data("to"); 13363var genre_tag=jQuery('#genre_tag option:selected').val(); 13364var download_category_tag=jQuery('#download_category_tag option:selected').val(); 13365var artist_tag=jQuery('#artist_tag option:selected').val(); 13366var download_tag=jQuery('#download_tag option:selected').val(); 13367var data_filter=''; 13368if(genre_tag!=''){ 13369data_filter +='&genre_tag=' + genre_tag; 13370} 13371if(download_category_tag!=''){ 13372data_filter +='&download_category_tag=' + download_category_tag; 13373} 13374if(artist_tag!=''){ 13375data_filter +='&artist_tag=' + artist_tag; 13376} 13377if(download_tag!=''){ 13378data_filter +='&download_tag=' + download_tag; 13379} 13380if(bpm_from!=''&&bpm_to!=''){ 13381data_filter +='&bpm=' + bpm_from + '-' + bpm_to; 13382} 13383if(len_from!=''&&len_to!=''){ 13384data_filter +='&length=' + len_from + '-' + len_to; 13385} 13386var dataString='action=get_download'; 13387var dataString1='action=pagination_filter'; 13388if(data_filter!=''){ 13389dataString=dataString + data_filter; 13390dataString1=dataString1 + data_filter; 13391} 13392jQuery("#mediawrapper .mejs-playlist").LoadingOverlay("show", { 13393image: "", 13394fontawesome: "fa fa-spinner fa-spin" 13395}); 13396filters={ 13397cat: download_category_tag, gen: genre_tag, art: artist_tag, stimmung: download_tag, bpm: bpm_from + '-' + bpm_to, length: +len_from + '-' + len_to, 13398}; 13399SETUrl(ajax_obj_search.home_url); 13400jQuery.ajax({ 13401type: "POST", 13402url: ajax_obj_search.ajax_url, 13403data: dataString, 13404cache: false, 13405success: function (html){ 13406jQuery('#mediawrapper div').remove(); 13407var audio=document.createElement("AUDIO"); 13408audio.setAttribute("id", "mejs"); 13409audio.setAttribute("preload", "none") 13410audio.setAttribute("controls", "controls"); 13411audio.setAttribute("style", "width: 100%;"); 13412audio.innerHTML=html; 13413document.getElementById("mediawrapper").appendChild(audio); 13414InitializeMediaElements(); 13415}}); 13416jQuery.ajax({ 13417type: "POST", 13418url: ajax_obj_search.ajax_url, 13419data: dataString1, 13420cache: false, 13421success: function (html){ 13422jQuery('.navigation').html(html); 13423}}); 13424} 13425jQuery(function (){ 13426jQuery('#edd_checkout_cart li').on('mouseover', function (){ 13427jQuery(this).attr('title', ''); 13428}); 13429edd_scripts.select_option="Bitte wählen Sie eine Lizenz aus"; 13430jQuery('.header-text-container').find('p').each(function(){ 13431if(jQuery.trim(jQuery(this).text())==''||jQuery.trim(jQuery(this).text())==null){ 13432jQuery(this).remove(); 13433}}) 13434jQuery('.homepage-searchbox-control').next().remove(); 13435jQuery('.beatstore').prepend(jQuery('.homepage-searchbox-control')) 13436jQuery('#searchboxcontainer,.filterclick-container').fadeIn(); 13437jQuery('#mediawrapper').css('visibility','visible'); 13438jQuery('.range').next().remove(); 13439jQuery('#advancefilters').toggle(function (){ 13440jQuery('.filter_tag_box').last().slideUp() 13441jQuery('.range').slideUp() 13442jQuery('.arrow b').removeClass('active') 13443}, function (){ 13444jQuery('.arrow b').addClass('active') 13445jQuery('.filter_tag_box').last().slideDown() 13446jQuery('.range').slideDown() 13447}); 13448jQuery('#advancefilters').click(); 13449$('.edd-cart').find('li.edd_checkout').click(function (){ $('.edd-cart').find('li.edd_checkout a').click() }) 13450if(window.location.search.length > 2){ 13451jQuery('#advancefilters').click(); 13452goToByScroll('searchboxcontainer'); 13453setTimeout(function (){ 13454goToByScroll('searchboxcontainer'); 13455}, 500) 13456setTimeout(function (){ 13457goToByScroll('searchboxcontainer'); 13458}, 1000) 13459setTimeout(function (){ 13460goToByScroll('searchboxcontainer'); 13461}, 2000) 13462if($('#mediawrapper').find('li').length > 0){ 13463if($('#mediawrapper').find('.mejs-container').find('#favouritesongs').length==0){ 13464$('#mediawrapper').find('.mejs-container').prepend('<span id="favouritesongs">Suchergebnisse</span>') 13465}} 13466} 13467jQuery('.edd-remove-from-cart').on('click', function (e){ 13468e.stopPropagation(); 13469}); 13470jsfix(); 13471SetYouTubeVideosToHttps(); 13472}) 13473function goToByScroll(id){ 13474id=id.replace("link", ""); 13475try { 13476jQuery('html,body').animate({ 13477scrollTop: jQuery("#" + id).offset().top - 125 13478}, 'slow'); 13479} 13480catch(e){ 13481}} 13482function InitializeSingleSongPagePlayer(){ 13483jQuery('#singledownloadnn audio').mediaelementplayer({ 13484playlist: true, 13485audioHeight: 1, 13486startVolume: 0.8, 13487loop: 'true', 13488playlistposition: 'bottom', 13489success: function (mediaElement, domObject){ 13490$(".samir .fa-play").on("click", function (){ 13491$('.samir .fa-pause').show(); 13492$('.samir .fa-play').hide(); 13493$('.samir').css('background-color', '#36ACE3'); 13494mediaElement.play(); 13495}); 13496$(".samir .fa-pause").on("click", function (){ 13497$('.samir .fa-pause').hide(); 13498$('.samir .fa-play').show(); 13499$('.samir').css('background-color', 'black'); 13500mediaElement.pause(); 13501}); 13502$('#singledownloadnn .mejs-playlist').hide(); 13503mediaElement.addEventListener('play', function (){ 13504var $singledownloadnn=jQuery('#singledownloadnn'); 13505var $singledownloadnn_control=jQuery($singledownloadnn).find('.mejs-inner .mejs-controls'); 13506var name=$('#singledownloadnn .mejs-playlist .current').find('span.name').html(); 13507setCurrentPlaying('#singledownloadnn'); 13508jQuery('.mejs-controls').not(jQuery('#singledownloadnn .mejs-inner .mejs-controls')).css('bottom', "-65px"); 13509jQuery('.track_title').not(jQuery('#singledownloadnn .mejs-inner .track_title')).css('bottom', "-65px"); 13510jQuery('#singledownloadnn .mejs-inner .mejs-controls').css('bottom', '0px'); 13511jQuery('#singledownloadnn .mejs-inner .track_title').removeAttr('style'); 13512clearTimeout(singleSongPlayerHideTime); 13513$('.samir .fa-pause').show(); 13514$('.samir .fa-play').hide(); 13515$('.samir').css('background-color', '#36ACE3'); 13516try { 13517var name=$singledownloadnn.find('.mejs-playlist .current').find('span.name').html(); 13518var byname=$singledownloadnn.find('.mejs-playlist .current span.genre').find('by').html(); 13519var n=byname.lastIndexOf("|"); 13520var byname=byname.substring(n + 2); 13521var html_name='<div class="track_title">' + name + ' | ' + byname + '</div>'; 13522if($singledownloadnn.find(".track_title").length > 0){ 13523$singledownloadnn.find('.track_title').html(name + ' | ' + byname); 13524}else{ 13525$singledownloadnn_control.css("height", "45px"); 13526$singledownloadnn_control.after(html_name); 13527}} 13528catch (e){ 13529var html_name='<div class="track_title"></div>'; 13530if($singledownloadnn.find(".track_title").length > 0){ 13531$singledownloadnn.find('.track_title').html(''); 13532}else{ 13533$singledownloadnn_control.css("height", "45px"); 13534$singledownloadnn_control.after(html_name); 13535}} 13536}, false); 13537mediaElement.addEventListener('pause', function (){ 13538$('.samir .fa-pause').hide(); 13539$('.samir .fa-play').show(); 13540$('.samir').css('background-color', 'black'); 13541clearTimeout(singleSongPlayerHideTime); 13542singleSongPlayerHideTime=setTimeout(function (){ 13543jQuery('#singledownloadnn .mejs-inner .mejs-controls').css('bottom', "-65px"); 13544jQuery('#singledownloadnn .mejs-inner .track_title').css('bottom', "-65px"); 13545}, hideSliderTimeConstant); 13546}, false); 13547}, 13548features: ['playlistfeature', 'prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume'], 13549keyActions: [] 13550}); 13551} 13552function InitializeCheckoutPagePlayer(){ 13553jQuery('#edd_checkout_cart_wrap audio').mediaelementplayer({ 13554playlist: true, 13555audioHeight: 1, 13556startVolume: 0.8, 13557loop: 'true', 13558playlistposition: 'bottom', 13559success: function (mediaElement, domObject){ 13560var $edd_checkout_cart_wrap=jQuery('#edd_checkout_cart_wrap'); 13561var $$edd_checkout_cart_wrap_control=jQuery($edd_checkout_cart_wrap).find('.mejs-inner .mejs-controls'); 13562mediaElement.addEventListener('play', function (object){ 13563jQuery('.mejs-controls').not(jQuery('#edd_checkout_cart_wrap .mejs-inner .mejs-controls')).css('bottom', "-65px"); 13564jQuery('.track_title').not(jQuery('#edd_checkout_cart_wrap .mejs-inner .track_title')).css('bottom', "-65px"); 13565jQuery('#edd_checkout_cart_wrap .mejs-inner .mejs-controls').css('bottom', '0px'); 13566jQuery('#edd_checkout_cart_wrap .mejs-inner .track_title').removeAttr('style'); 13567setCurrentPlaying('#edd_checkout_cart_wrap'); 13568clearTimeout(newSongSliderHideTime); 13569try { 13570var name=jQuery.trim(jQuery('#edd_checkout_cart_wrap .mejs-inner .current span.name').text().replace(jQuery('#edd_checkout_cart_wrap .mejs-inner .current span.name span').text(), '')); 13571var html_name='<div class="track_title">' + name + '</div>'; 13572if($edd_checkout_cart_wrap.find(".track_title").length > 0){ 13573$edd_checkout_cart_wrap.find('.track_title').html(name); 13574}else{ 13575$$edd_checkout_cart_wrap_control.css("height", "45px"); 13576$$edd_checkout_cart_wrap_control.after(html_name); 13577}} 13578catch (e){ 13579var html_name='<div class="track_title"></div>'; 13580if($edd_checkout_cart_wrap.find$(".track_title").length > 0){ 13581$edd_checkout_cart_wrap.find('.track_title').html(''); 13582}else{ 13583$$edd_checkout_cart_wrap_control.css("height", "45px"); 13584$$edd_checkout_cart_wrap_control.after(html_name); 13585}} 13586}, false); 13587mediaElement.addEventListener('pause', function (object){ 13588$('#widget_new_beats_new .playing').removeClass('playing'); 13589console.log('pause'); 13590clearTimeout(newSongSliderHideTime); 13591newSongSliderHideTime=setTimeout(function (){ 13592jQuery('#edd_checkout_cart_wrap').find('.mejs-inner .mejs-controls').css('bottom', "-65px"); 13593jQuery('#edd_checkout_cart_wrap').find('.mejs-inner .track_title').css('bottom', "-65px"); 13594}, hideSliderTimeConstant); 13595}, false); 13596mejs_playlist_cart_checkout(); 13597}, 13598features: ['playlistfeature', 'prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume'], 13599keyActions: [] 13600}); 13601} 13602function InitializeMediaElements(){ 13603console.log('InitializeMediaElements'); 13604jQuery('#mediawrapper').css('visibility', 'hidden').css('opacity', '0'); 13605jQuery('#mediawrapper audio').mediaelementplayer({ 13606playlist: true, 13607audioHeight: 30, 13608startVolume: 0.8, 13609loop: 'true', 13610playlistposition: 'bottom', 13611success: function (mediaElement, domObject){ 13612setTimeout(function (){ 13613jQuery('#mediawrapper').css('transition', 'all 1s ease').css('visibility', 'visible').css('opacity', '1'); 13614},100) 13615mediaElement.addEventListener('play', function (object){ 13616var $mediawrapper=jQuery('#mediawrapper'); 13617var $mediawrapper_control=jQuery($mediawrapper).find('.mejs-inner .mejs-controls'); 13618clearTimeout(mainSliderHideTime); 13619console.log('play'); 13620setCurrentPlaying('#mediawrapper'); 13621try { 13622var name=$mediawrapper.find('.mejs-playlist .current').find('span.name').html(); 13623var byname=$mediawrapper.find('.mejs-playlist .current span.genre').find('by').html(); 13624var n=byname.lastIndexOf("|"); 13625var byname=byname.substring(n + 2); 13626var html_name='<div class="track_title">' + name + ' | ' + byname + '</div>'; 13627if($mediawrapper.find(".track_title").length > 0){ 13628$mediawrapper.find('.track_title').html(name + ' | ' + byname); 13629}else{ 13630$mediawrapper_control.css("height", "45px"); 13631$mediawrapper_control.after(html_name); 13632}} 13633catch (e){ 13634var html_name='<div class="track_title"></div>'; 13635if($mediawrapper.find(".track_title").length > 0){ 13636$mediawrapper.find('.track_title').html(''); 13637}else{ 13638$mediawrapper_control.css("height", "45px"); 13639$mediawrapper_control.after(html_name); 13640}} 13641}, false); 13642mediaElement.addEventListener('pause', function (object){ 13643clearTimeout(mainSliderHideTime); 13644mainSliderHideTime=setTimeout(function (){ 13645$('#mediawrapper .mejs-inner').find('.mejs-controls').css('bottom', "-65px"); 13646$('#mediawrapper .mejs-inner').find('.track_title').css('bottom', "-65px"); 13647}, hideSliderTimeConstant); 13648}, false); 13649}, 13650features: ['playlistfeature', 'prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume'], 13651keyActions: [] 13652}); 13653jQuery('#mediawrapper .mejs-mediaelement .player-error').html('Leider ergab die Suche keine Treffer - bitte erweitern Sie die Filtereinstellungen'); 13654jQuery(document).on('opening', '.remodal', function (){ console.log('opening'); }); 13655jQuery(document).on('opened', '.remodal', function (){ console.log('opened'); }); 13656jQuery(document).on('closing', '.remodal', function (e){ console.log('closing' + (e.reason ? ', reason: ' + e.reason:'')); }); 13657jQuery(document).on('closed', '.remodal', function (e){ console.log('closed' + (e.reason ? ', reason: ' + e.reason:'')); }); 13658jQuery(document).on('confirmation', '.remodal', function (){ console.log('confirmation'); }); 13659jQuery(document).on('cancellation', '.remodal', function (){ console.log('cancellation'); }); 13660jQuery('.remodal').remodal(); 13661mejs_playlist(); 13662} 13663function mejs_playlist(){ 13664setRemodals(); 13665jQuery(".remodal .edd_download_purchase_form label input[type=checkbox]").change(function (){ 13666jQuery(this).closest("label").toggleClass("checked"); 13667}); 13668jQuery(".remodal span.edd_price_option_price").each(function (){
13669var myNumber=parseInt(jQuery(this).text()); 13670if(myNumber==29){ 13671jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>BASIC</strong> <span style="color: #00ccff;">29â¬</span> Privater Einsatz:</h3><ul><li>WebVideo (Youtube, Vimeo etc.)</li><li>Film</li><li>Podcast</li><li>Webseite (Hintergrundmusik)</li><li>Powerpoint Präsentation o. Ã.</li></ul></div>'); 13672} 13673else if(myNumber==59){ 13674jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>STANDARD <span style="color: #000000;">A</span></strong><span style="color: #00ccff;"> 59â¬</span> kommerzieller Einsatz:</h3><ul><li>WebVideo (Youtube, Vimeo etc.)</li><li>Film / Imagefilm</li><li>Messe Einsatz</li><li>Hörbuch</li><li>Podcast</li><li>Apps / Videospiele bis 25.000 Downloads</li><li>Powerpoint Präsentation o. Ã.</li><li>Telefon Warteschleife für 1 Standort bis 60 Nebenstellen</li><li>mechanische Vervielfältigung CD/DVD/USB STICK etc. bis 1.000 Stück</li></ul></div>'); 13675} 13676else if(myNumber==150){ 13677jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>STANDARD B</strong> <span style="color: #00ccff;">150â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung regional pro Jahr</li><li>PoS Werbung national pro Jahr</li><li>App / Video Spiel bis 100.000 Downloads</li><li>Telefon Warteschleife für bis zu 4 Standorte (weitere a. A.) und ab 61 Nebestellen</li><li>mechanische Vervielfältigung CD/DVD/USB STICK etc. bis 5.000 Stück (höhere Stückzahlen a. A.)</li></ul></div>'); 13678} 13679else if(myNumber==500){ 13680jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>WERBUNG A</strong> <span style="color: #00ccff;">national 500â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung national pro Jahr</li><li>In-Stream Video Werbung national pro Jahr</li><li>Kino Projekt / pro Jahr</li><li>App / Video Spiel ab 100.000 Downloads</li></ul></div>'); 13681} 13682else if(myNumber==1){ 13683jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>WERBUNG B</strong><span style="color: #00ccff;"> international 1500â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung international pro Jahr</li><li>In-Stream Video Werbung international pro Jahr</li></ul></div>'); 13684}else{ 13685console.log(myNumber); 13686}}); 13687jQuery(".remodal .edd_purchase_tax_rate").text("7% Mwst. inbegriffen"); 13688jQuery(".edd-cart-added-alert").html('<i class="edd-icon-ok" aria-hidden="true"></i> Zum Warenkorb hinzugefügt'); 13689jQuery(".mejs-playlist .pltext").each(function (){ 13690if(jQuery(this).html()=="â¬29.00 - â¬1500.00"){ 13691jQuery(this).html("ab 29â¬"); 13692}else{ 13693jQuery(this).html(); 13694}}); 13695jQuery("#mediawrapper .mejs-container ul.mejs > li,.mejs-playlist > ul li .sound-loop-file").click(function (){ 13696jQuery("#mediawrapper .mejs-button.mejs-playpause-button.mejs-pause").click(); 13697}); 13698jQuery("body .mejs-playlist li .buybutton").click(function (e){ 13699e.stopPropagation(); 13700setTimeout(function (){ 13701jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13702}, 200); 13703}); 13704jQuery("#mediawrapper .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13705if(jQuery(this).hasClass("mejs-play")){ 13706jQuery("#mediawrapper .played.current").addClass("playing"); 13707}else{ 13708jQuery(".played").removeClass("playing"); 13709}}); 13710jQuery(".mejs-button.mejs-nexttrack-button.mejs-nexttrack, .mejs-button.mejs-prevtrack-button.mejs-prevtrack").click(function (){ 13711jQuery("li.played.current").addClass("playing") 13712}); 13713/*jQuery('body').on('click', '.remodal a.edd-add-to-cart', function (){ 13714alert('adsa'); 13715setTimeout(function(){ 13716alert('cc'); 13717jQuery(".remodal-close").click(); 13718}, 4500); 13719});*/ 13720if(window.location.search.length > 2){ 13721if($('#mediawrapper').find('li').length > 0){ 13722if($('#mediawrapper').find('.mejs-container').find('#favouritesongs').length==0){ 13723$('#mediawrapper').find('.mejs-container').prepend('<span id="favouritesongs">Suchergebnisse</span>') 13724}} 13725goToByScroll('searchboxcontainer'); 13726} 13727jQuery(document).on('hover', '#mediawrapper ul li', function (){ 13728$(this).attr('title', ''); 13729}); 13730jQuery(document).on('hover', '.mejs-playlist ul li', function (){ 13731$(this).attr('title', ''); 13732}) 13733} 13734function NewMusicSongsInitialize(){ 13735jQuery('#widget_new_beats_new').find('audio').mediaelementplayer({ 13736playlist: true, 13737audioHeight: 0, 13738defaultAudioWidth:'100%', 13739startVolume: 0.8, 13740loop: 'true', 13741playlistposition: 'bottom', 13742success: function (mediaElement, domObject){ 13743var $widget_new_beats_new=jQuery('#widget_new_beats_new'); 13744var $widget_new_beats_new_control=jQuery($widget_new_beats_new).find('.mejs-inner .mejs-controls'); 13745mediaElement.addEventListener('play', function (object){ 13746clearTimeout(newSongSliderHideTime); 13747setCurrentPlaying('#widget_new_beats_new'); 13748try { 13749var name=jQuery.trim($widget_new_beats_new.find('.mejs-playlist .current').find('.song-name-container a').text()); 13750var html_name='<div class="track_title">' + name + '</div>'; 13751if($widget_new_beats_new.find(".track_title").length > 0){ 13752$widget_new_beats_new.find('.track_title').html(name); 13753}else{ 13754$widget_new_beats_new_control.css("height", "45px"); 13755$widget_new_beats_new_control.after(html_name); 13756}} 13757catch (e){ 13758var html_name='<div class="track_title"></div>'; 13759if($widget_new_beats_new.find$(".track_title").length > 0){ 13760$widget_new_beats_new.find('.track_title').html(''); 13761}else{ 13762$widget_new_beats_new.find("#mediawrapper .mejs-controls").css("height", "45px"); 13763$widget_new_beats_new.find("#mediawrapper .mejs-controls").after(html_name); 13764}} 13765}, false); 13766mediaElement.addEventListener('pause', function (object){ 13767$('#widget_new_beats_new .playing').removeClass('playing'); 13768console.log('pause'); 13769clearTimeout(newSongSliderHideTime); 13770newSongSliderHideTime=setTimeout(function (){ 13771jQuery('#widget_new_beats_new').find('.mejs-inner .mejs-controls').css('bottom', "-65px"); 13772jQuery('#widget_new_beats_new').find('.mejs-inner .track_title').css('bottom', "-65px"); 13773}, hideSliderTimeConstant); 13774}, false); 13775}, 13776features: ['playlistfeature', 'prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume'], 13777keyActions: [] 13778}); 13779$('#widget_new_beats_new').find('.mejs-audio').removeAttr('style'); 13780$('#widget_new_beats_new').find('.mejs-playlist').css('width', '100%'); 13781$(document).on("click", "#widget_new_beats_new .mejs-container ul.mejs > li", function (){
13782$("#widget_new_beats_new .mejs-button.mejs-playpause-button.mejs-pause").click(); 13783}); 13784$(document).on("click", "#widget_new_beats_new .mejs-controls .mejs-button.mejs-playpause-button", function (){ 13785console.log('mejs-button.mejs-playpause-button'); 13786console.log(jQuery(this).hasClass("mejs-play")); 13787if($(this).hasClass("mejs-play")){ 13788$(".custom-new-song-player .played.current").addClass("playing"); 13789}else{ 13790$(".played").removeClass("playing"); 13791}}); 13792} 13793function setCurrentPlaying(container){ 13794jQuery(".played").removeClass("playing"); 13795$(container).find(".played.current").addClass("playing"); 13796} 13797function setRemodals(){ 13798var ids=[]; 13799var duplicates=[]; 13800jQuery('.remodal').each(function (){ 13801if(ids.indexOf(jQuery(this).attr('data-remodal-id'))==-1){ 13802ids.push(jQuery(this).attr('data-remodal-id')); 13803}else{ 13804duplicates.push(jQuery(this).attr('data-remodal-id')); 13805}}); 13806jQuery(duplicates).each(function (e, al){ 13807jQuery(jQuery('div[data-remodal-id="' + al + '"]')[0]).parent()[0].remove() 13808}) 13809} 13810function jsfix(){ 13811jQuery(".remodal span.edd_price_option_price").each(function (){ 13812var myNumber=parseInt(jQuery(this).text()); 13813if(myNumber==29){ 13814jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>BASIC</strong> <span style="color: #00ccff;">29â¬</span> Privater Einsatz:</h3><ul><li>WebVideo (Youtube, Vimeo etc.)</li><li>Film</li><li>Podcast</li><li>Webseite (Hintergrundmusik)</li><li>Powerpoint Präsentation o. Ã.</li></ul></div>'); 13815} 13816else if(myNumber==59){ 13817jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>STANDARD <span style="color: #000000;">A</span></strong><span style="color: #00ccff;"> 59â¬</span> kommerzieller Einsatz:</h3><ul><li>WebVideo (Youtube, Vimeo etc.)</li><li>Film / Imagefilm</li><li>Messe Einsatz</li><li>Hörbuch</li><li>Podcast</li><li>Apps / Videospiele bis 25.000 Downloads</li><li>Powerpoint Präsentation o. Ã.</li><li>Telefon Warteschleife für 1 Standort bis 60 Nebenstellen</li><li>mechanische Vervielfältigung CD/DVD/USB STICK etc. bis 1.000 Stück</li></ul></div>'); 13818} 13819else if(myNumber==150){ 13820jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>STANDARD B</strong> <span style="color: #00ccff;">150â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung regional pro Jahr</li><li>PoS Werbung national pro Jahr</li><li>App / Video Spiel bis 100.000 Downloads</li><li>Telefon Warteschleife für bis zu 4 Standorte (weitere a. A.) und ab 61 Nebestellen</li><li>mechanische Vervielfältigung CD/DVD/USB STICK etc. bis 5.000 Stück (höhere Stückzahlen a. A.)</li></ul></div>'); 13821} 13822else if(myNumber==500){ 13823jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>WERBUNG A</strong> <span style="color: #00ccff;">national 500â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung national pro Jahr</li><li>In-Stream Video Werbung national pro Jahr</li><li>Kino Projekt / pro Jahr</li><li>App / Video Spiel ab 100.000 Downloads</li></ul></div>'); 13824} 13825else if(myNumber==1){ 13826jQuery(this).closest("li").find(".fa-info-circle").append('<div class="infobox"><h3><strong>WERBUNG B</strong><span style="color: #00ccff;"> international 1500â¬<span style="color: #000000;">:</span></span></h3><ul><li>TV / Radio / Kino Werbung international pro Jahr</li><li>In-Stream Video Werbung international pro Jahr</li></ul></div>'); 13827}else{ 13828console.log(myNumber); 13829}}); 13830jQuery(".remodal .edd_purchase_tax_rate").text("7% Mwst. inbegriffen"); 13831/ Added to cart" must be named "Zum Warenkorb hinzugefügt" / 13832jQuery(".edd-cart-added-alert").html('<i class="edd-icon-ok" aria-hidden="true"></i> Zum Warenkorb hinzugefügt'); 13833ShowHideCartIfThereisNoElement(); 13834} 13835function ShowHideCartIfThereisNoElement(){ 13836if(jQuery('.widget_edd_cart_widget').find('.edd-cart').find('.mejs li').length > 0){ 13837jQuery('.widget_edd_cart_widget').slideDown() 13838}else{ 13839jQuery('.widget_edd_cart_widget').slideUp() 13840}} 13841function InitializeCartPlayer(){ 13842jQuery('.edd-cart audio').mediaelementplayer({ 13843playlist: true, 13844audioHeight: 1, 13845startVolume: 0.8, 13846loop: 'true', 13847playlistposition: 'bottom', 13848success: function (mediaElement, domObject){ 13849mediaElement.addEventListener('play', function (){ 13850var $cartwrapper=jQuery('#cart_player'); 13851var $cartwrapper_control=jQuery($cartwrapper).find('.mejs-inner .mejs-controls'); 13852clearTimeout(cartPlayerHideTime); 13853console.log('play'); 13854setCurrentPlaying('#cart_player'); 13855try { 13856var name=$cartwrapper.find('.mejs-playlist .current').find('span.name').html(); 13857var byname=$cartwrapper.find('.mejs-playlist .current span.genre').find('by').html(); 13858var n=byname.lastIndexOf("|"); 13859var byname=byname.substring(n + 2); 13860var html_name='<div class="track_title">' + name + ' | ' + byname + '</div>'; 13861if($cartwrapper.find(".track_title").length > 0){ 13862$cartwrapper.find('.track_title').html(name + ' | ' + byname); 13863}else{ 13864$cartwrapper_control.css("height", "45px"); 13865$cartwrapper_control.after(html_name); 13866}} 13867catch (e){ 13868var html_name='<div class="track_title"></div>'; 13869if($cartwrapper.find(".track_title").length > 0){ 13870$cartwrapper.find('.track_title').html(''); 13871}else{ 13872$cartwrapper_control.css("height", "45px"); 13873$cartwrapper_control.after(html_name); 13874}} 13875}, false); 13876mediaElement.addEventListener('pause', function (object){ 13877clearTimeout(cartPlayerHideTime); 13878cartPlayerHideTime=setTimeout(function (){ 13879$('#cart_player .mejs-inner').find('.mejs-controls').css('bottom', "-65px"); 13880$('#cart_player .mejs-inner').find('.track_title').css('bottom', "-65px"); 13881}, hideSliderTimeConstant); 13882}, false); 13883mejs_playlist_cart(); 13884}, 13885features: ['playlistfeature', 'prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume'], 13886keyActions: [] 13887}); 13888} 13889function mejs_playlist_cart(){ 13890setTimeout(function (){ 13891jQuery(".edd-cart .mejs li").each(function (index){ 13892var chtml=jQuery(this).html(); 13893jQuery(this).html(chtml); 13894}); 13895jQuery(".edd-cart .mejs li .cname").prepend('<div class="btn-list-play"><i class="fa fa-play" aria-hidden="true"></i><i class="fa fa-pause" aria-hidden="true"></i></div>'); 13896}, 500); 13897/* jQuery(".mejs-playlist .pltext").each(function(){ 13898if(jQuery(this).html()=="â¬29.00 - â¬1500.00"){ 13899jQuery(this).html("ab 29â¬"); 13900}else{ 13901jQuery(this).html(); 13902}});*/ 13903var _tax=$('.edd-cart .edd_cart_tax').html().replace('Geschätzte Steuern:', '7% MwSt. :'); 13904jQuery('.edd-cart .edd_cart_tax').html(_tax); 13905jQuery(".edd-cart .mejs-container ul.mejs > li").click(function (e){ 13906if(jQuery(e.target).hasClass('edd-remove-from-cart')){ 13907console.log('edd-remove-from-cart clicks'); 13908}else{ 13909if(jQuery(this).hasClass("playing")){ 13910jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13911}else{ 13912jQuery(this).toggleClass("playing"); 13913}} 13914}); 13915/* jQuery("body .mejs-playlist li .buybutton").click(function(e){ 13916setTimeout(function(){ 13917jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13918}, 200); 13919});*/ 13920jQuery(".edd-cart .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13921if(jQuery(this).hasClass("mejs-play")){ 13922jQuery(".played.current").addClass("playing"); 13923}else{ 13924jQuery(".played").removeClass("playing"); 13925}}); 13926jQuery("div#music_maker_recent_beats_widget-2 .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13927if(jQuery(this).hasClass("mejs-play")){ 13928jQuery(".played.current").removeClass("playing"); 13929jQuery(this).closest(".played.current").addClass("playing"); 13930}else{ 13931}}); 13932jQuery(".mejs-button.mejs-nexttrack-button.mejs-nexttrack, .mejs-button.mejs-prevtrack-button.mejs-prevtrack").click(function (){ 13933jQuery("li.played.current").addClass("playing") 13934}); 13935} 13936function mejs_playlist_singledownloadnn(){ 13937setTimeout(function (){ 13938jQuery("#singledownloadnn .mejs li").each(function (index){ 13939var chtml=jQuery(this).attr('title'); 13940jQuery(this).html(chtml); 13941jQuery(this).attr('title', ''); 13942}); 13943jQuery("#singledownloadnn .mejs li .cname").prepend('<div class="btn-list-play"><i class="fa fa-play" aria-hidden="true"></i><i class="fa fa-pause" aria-hidden="true"></i></div>'); 13944}, 500); 13945/* jQuery(".mejs-playlist .pltext").each(function(){ 13946if(jQuery(this).html()=="â¬29.00 - â¬1500.00"){ 13947jQuery(this).html("ab 29â¬"); 13948}else{ 13949jQuery(this).html(); 13950}});*/ 13951jQuery("#singledownloadnn .mejs-container ul.mejs > li").click(function (){ 13952if(jQuery(this).hasClass("playing")){ 13953jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13954}else{ 13955jQuery(this).toggleClass("playing"); 13956}}); 13957/* jQuery("body .mejs-playlist li .buybutton").click(function(e){ 13958setTimeout(function(){ 13959jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13960}, 200); 13961});*/ 13962jQuery("#singledownloadnn .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13963if(jQuery(this).hasClass("mejs-play")){ 13964jQuery(".played.current").addClass("playing"); 13965}else{ 13966jQuery(".played").removeClass("playing"); 13967}}); 13968jQuery("div#music_maker_recent_beats_widget-2 .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13969if(jQuery(this).hasClass("mejs-play")){ 13970jQuery(".played.current").removeClass("playing"); 13971jQuery(this).closest(".played.current").addClass("playing"); 13972}else{ 13973}}); 13974jQuery(".mejs-button.mejs-nexttrack-button.mejs-nexttrack, .mejs-button.mejs-prevtrack-button.mejs-prevtrack").click(function (){ 13975jQuery("li.played.current").addClass("playing") 13976}); 13977} 13978function mejs_playlist_cart_checkout(){ 13979jQuery("#edd_checkout_cart_wrap .mejs li .cname").prepend('<div class="btn-list-play"><i class="fa fa-play" aria-hidden="true"></i><i class="fa fa-pause" aria-hidden="true"></i></div>'); 13980/* jQuery(".mejs-playlist .pltext").each(function(){ 13981if(jQuery(this).html()=="â¬29.00 - â¬1500.00"){ 13982jQuery(this).html("ab 29â¬"); 13983}else{ 13984jQuery(this).html(); 13985}});*/ 13986jQuery("#edd_checkout_cart_wrap .mejs-container ul.mejs > li").click(function (){ 13987if(jQuery(this).hasClass("playing")){ 13988jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13989}else{ 13990jQuery(this).toggleClass("playing"); 13991}}); 13992/* jQuery("body .mejs-playlist li .buybutton").click(function(e){ 13993setTimeout(function(){ 13994jQuery(".mejs-button.mejs-playpause-button.mejs-pause").click(); 13995}, 200); 13996});*/ 13997jQuery("#edd_checkout_cart_wrap .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 13998if(jQuery(this).hasClass("mejs-play")){ 13999jQuery(".played.current").addClass("playing"); 14000}else{ 14001jQuery(".played").removeClass("playing"); 14002}}); 14003jQuery("div#music_maker_recent_beats_widget-2 .mejs-controls .mejs-button.mejs-playpause-button").on("click", function (){ 14004if(jQuery(this).hasClass("mejs-play")){ 14005jQuery(".played.current").removeClass("playing"); 14006jQuery(this).closest(".played.current").addClass("playing"); 14007}else{ 14008}}); 14009jQuery(".mejs-button.mejs-nexttrack-button.mejs-nexttrack, .mejs-button.mejs-prevtrack-button.mejs-prevtrack").click(function (){ 14010jQuery("li.played.current").addClass("playing") 14011}); 14012} 14013function myFunction(){ document.getElementsByClassName("topnav")[0].classList.toggle("responsive"); } 14014!function (a, b, c){ a.fn.scrollUp=function (b){ a.data(c.body, "scrollUp")||(a.data(c.body, "scrollUp", !0), a.fn.scrollUp.init(b)) }, a.fn.scrollUp.init=function (d){ var e=a.fn.scrollUp.settings=a.extend({}
14014, a.fn.scrollUp.defaults, d), f=a("<a/>", { id: e.scrollName, href: "#top", title: e.scrollText }).appendTo("body"); e.scrollImg||f.html(e.scrollText), f.css({ display: "none", position: "fixed", zIndex: e.zIndex }), e.activeOverlay&&a("<div/>", { id: e.scrollName + "-active" }).css({ position: "absolute", top: e.scrollDistance + "px", width: "100%", borderTop: "1px dotted" + e.activeOverlay, zIndex: e.zIndex }).appendTo("body"), scrollEvent=a(b).scroll(function (){ switch (scrollDis="top"===e.scrollFrom ? e.scrollDistance:a(c).height() - a(b).height() - e.scrollDistance, e.animation){ case "fade": a(a(b).scrollTop() > scrollDis ? f.fadeIn(e.animationInSpeed):f.fadeOut(e.animationOutSpeed)); break; case "slide": a(a(b).scrollTop() > scrollDis ? f.slideDown(e.animationInSpeed):f.slideUp(e.animationOutSpeed)); break; default: a(a(b).scrollTop() > scrollDis ? f.show(0):f.hide(0)) }}), f.click(function (b){ b.preventDefault(), a("html, body").animate({ scrollTop: 0 }, e.topSpeed, e.easingType) }) }, a.fn.scrollUp.defaults={ scrollName: "scrollUp", scrollDistance: 300, scrollFrom: "top", scrollSpeed: 300, easingType: "linear", animation: "fade", animationInSpeed: 200, animationOutSpeed: 200, scrollText: "Scroll to top", scrollImg: !1, activeOverlay: !1, zIndex: 2147483647 }, a.fn.scrollUp.destroy=function (d){ a.removeData(c.body, "scrollUp"), a("#" + a.fn.scrollUp.settings.scrollName).remove(), a("#" + a.fn.scrollUp.settings.scrollName + "-active").remove(), a.fn.jquery.split(".")[1] >=7 ? a(b).off("scroll", d):a(b).unbind("scroll", d) }, a.scrollUp=a.fn.scrollUp }(jQuery, window, document); 14015function social_popup(url){ newwindow=window.open(url, 'name', 'height=600,width=750'); if(window.focus){ newwindow.focus() } return false; } 14016var popupLinkConfig=new Array; 14017popupLinkConfig["popup"]=new Array("", "width=700,height=600,scrollbar=yes,menubar=yes"); 14018window.onload=initPage; 14019function initPage(){ initPopupLinks(); } 14020function initPopupLinks(){ 14021if(!document.getElementsByTagName) return true; 14022var pageLinks=document.getElementsByTagName("a"); 14023for (var i=0; i < pageLinks.length; i++){ 14024if(((pageLinks[i].className!=null) && 14025(pageLinks[i].className!="")) || 14026((pageLinks[i].parentNode.className!=null) && 14027(pageLinks[i].parentNode.className!=""))){ 14028var linkClass=" " + pageLinks[i].className + " "; 14029if((linkClass==" ")&&(pageLinks[i].parentNode.className!="")){ 14030linkClass=" " + pageLinks[i].parentNode.className + " "; 14031} 14032for (var theKey in popupLinkConfig){ 14033if(linkClass.indexOf(" " + theKey + " ") > -1){ 14034if((pageLinks[i].target=="")||(pageLinks[i].target==null)){ 14035pageLinks[i].target=(popupLinkConfig[theKey][0]!="") ? popupLinkConfig[theKey][0]:theKey; 14036} 14037pageLinks[i].settings=popupLinkConfig[theKey][1]; 14038pageLinks[i].onclick=popUp; 14039}} 14040}} 14041return true; 14042} 14043function popUp(){ newWin=window.open(this.href, this.target, this.settings); newWin.focus(); return false; } 14044function SetYouTubeVideosToHttps(){ 14045jQuery('iframe').each(function (){ 14046var _source=jQuery(this).attr('src'); 14047if(_source.indexOf('youtube') > -1&&_source.indexOf('http://') > -1){ 14048jQuery(this).attr('src', _source.replace('http://', 'https://')); 14049}}) 14050}; 14051window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);
14051d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window); 14052function vc_js(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_googleplus(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_google_fonts(),vc_gridBehaviour(),vc_rowBehaviour(),vc_prepareHoverBox(),vc_googleMapsPointer(),vc_ttaActivation(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}function getSizeName(){var screen_w=jQuery(window).width();return 1170<screen_w?"desktop_wide":960<screen_w&&1169>screen_w?"desktop":768<screen_w&&959>screen_w?"tablet":300<screen_w&&767>screen_w?"mobile":300>screen_w?"mobile_portrait":""}function loadScript(url,$obj,callback){var script=document.createElement("script");script.type="text/javascript",script.readyState&&(script.onreadystatechange=function(){"loaded"!==script.readyState&&"complete"!==script.readyState||(script.onreadystatechange=null,callback())}),script.src=url,$obj.get(0).appendChild(script)}function vc_ttaActivation(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var $=window.jQuery,ui={};ui.newPanel=$(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,ui)})}function vc_accordionActivate(event,ui){if(ui.newPanel.length&&ui.newHeader.length){var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=ui.newPanel.find(".vc_round-chart"),$line_charts=ui.newPanel.find(".vc_line-chart"),$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');void 0!==jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),vc_carouselBehaviour(ui.newPanel),vc_plugin_flexslider(ui.newPanel),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}}
14052function initVideoBackgrounds(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}function vc_initVideoBackgrounds(){jQuery("[data-vc-video-bg]").each(function(){var youtubeUrl,youtubeId,$element=jQuery(this);$element.data("vcVideoBg")?(youtubeUrl=$element.data("vcVideoBg"),youtubeId=vcExtractYoutubeId(youtubeUrl),youtubeId&&($element.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground($element,youtubeId)),jQuery(window).on("grid:items:added",function(event,$grid){$element.has($grid).length&&vcResizeVideoBackground($element)})):$element.find(".vc_video-bg").remove()})}function insertYoutubeVideoAsBackground($element,youtubeId,counter){if("undefined"==typeof YT||void 0===YT.Player)return 100<(counter=void 0===counter?0:counter)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground($element,youtubeId,counter++)},100);var $container=$element.prepend('<div class="vc_video-bg vc_hidden-xs"><div class="inner"></div></div>').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}function vcResizeVideoBackground($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px",iframeW+="px",iframeH+="px"):(iframeW=containerW,iframeH=containerW*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px",iframeW+="px",iframeH+="px"),$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}function vcExtractYoutubeId(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}function vc_googleMapsPointer(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.click(function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.mouseleave(function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}function vc_setHoverBoxPerspective(hoverBox){hoverBox.each(function(){var $this=jQuery(this),width=$this.width(),perspective=4*width+"px";$this.css("perspective",perspective)})}function vc_setHoverBoxHeight(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner");hoverBoxInner.css("min-height",0);var frontHeight=$this.find(".vc-hoverbox-front-inner").outerHeight(),backHeight=$this.find(".vc-hoverbox-back-inner").outerHeight(),hoverBoxHeight=frontHeight>backHeight?frontHeight:backHeight;hoverBoxHeight<250&&(hoverBoxHeight=250),hoverBoxInner.css("min-height",hoverBoxHeight+"px")})}function vc_prepareHoverBox(){var hoverBox=jQuery(".vc-hoverbox");vc_setHoverBoxHeight(hoverBox),vc_setHoverBoxPerspective(hoverBox)}document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;i<prefix.length;i++)prefix[i]+"transform"in document.documentElement.style&&(document.documentElement.className+=" vc_transform ")}(),"function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function($parent){($parent?$parent.find(".wpb_flexslider"):jQuery(".wpb_flexslider")).each(function(){var this_element=jQuery(this),sliderTimeout=1e3*parseInt(this_element.attr("data-interval")),sliderFx=this_element.attr("data-flex_fx"),slideshow=!0;0===sliderTimeout&&(slideshow=!1),this_element.is(":visible")&&this_element.flexslider({animation:sliderFx,slideshow:slideshow,slideshowSpeed:sliderTimeout,sliderSpeed:800,smoothHeight:!0})})}),"function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){0<jQuery(".wpb_googleplus").length&&function(){var po=document.createElement("script");po.type="text/javascript",po.async=!0,po.src="//apis.google.com/js/plusone.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s)}()}),"function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){0<jQuery(".wpb_pinterest").length&&function(){var po=document.createElement("script");po.type="text/javascript",po.async=!0,po.src="//assets.pinterest.com/js/pinit.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s)}()}),"function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){void 0!==jQuery.fn.waypoint&&jQuery(".vc_progress_bar").waypoint(function(){jQuery(this).find(".vc_single_bar").each(function(index){var $this=jQuery(this),bar=$this.find(".vc_bar"),val=bar.data("percentage-value");setTimeout(function(){bar.css({width:val+"%"})},200*index)})},{offset:"85%"})}),"function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){void 0!==jQuery.fn.waypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function(){jQuery(this).addClass("wpb_start_animation animated")},{offset:"85%"})}),"function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function($el){function event(e){e&&e.preventDefault&&e.preventDefault();var title=jQuery(this),element=title.closest(".vc_toggle"),content=element.find(".vc_toggle_content");element.hasClass("vc_toggle_active")?content.slideUp({duration:300,complete:function(){element.removeClass("vc_toggle_active")}}):content.slideDown({duration:300,complete:function(){element.addClass("vc_toggle_active")}})}$el?$el.hasClass("vc_toggle_title")?$el.unbind("click").click(event):$el.find(".vc_toggle_title").unbind("click").click(event):jQuery(".vc_toggle_title").unbind("click").on("click",event)}),"function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function($tab){if(jQuery.ui){var $call=$tab||jQuery(".wpb_tabs, .wpb_tour"),ver=jQuery.ui&&jQuery.ui.version?jQuery.ui.version.split("."):"1.10",old_version=1===parseInt(ver[0])&&9>parseInt(ver[1]);$call.each(function(index){var $tabs,interval=jQuery(this).attr("data-interval"),tabs_array=[];if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},beforeActivate:function(event,ui){1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}}),interval&&0<interval)try{$tabs.tabs("rotate",1e3*interval)}catch(e){window.console&&window.console.log&&console.log(e)}jQuery(this).find(".wpb_tab").each(function(){tabs_array.push(this.id)}),jQuery(this).find(".wpb_tabs_nav li").click(function(e){return e.preventDefault(),old_version?$tabs.tabs("select",jQuery("a",this).attr("href")):$tabs.tabs("option","active",jQuery(this).index()),!1}),jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").click(function(e){if(e.preventDefault(),old_version){var index=$tabs.tabs("option","selected");jQuery(this).parent().hasClass("wpb_next_slide")?index++:index--,0>index?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)}else{var index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length;index=jQuery(this).parent().hasClass("wpb_next_slide")?index+1>=length?0:index+1:0>index-1?length-1:index-1,$tabs.tabs("option","active",index)}})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,$this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0<parseInt($this.data("active-tab"))&&parseInt($this.data("active-tab"))-1),collapsible=!1===active_tab||"yes"===$this.data("c
14052ollapsible");$tabs=$this.find(".wpb_accordion_wrapper").accordion({header:"> div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).click(function(e){e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1");var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousele_li.css({"margin-right":carousele_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).resize(function(){var before_resize=screen_size;screen_size=getSizeName(),before_resize!=screen_size&&window.setTimeout("location.reload()",20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){location.href.indexOf("#!prettyPhoto")>-1&&(location.hash="")},social_tools:""})}catch(err){window.console&&window.console.log&&console.log(err)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){function fullWidthRow(){var $elements=$('[data-vc-full-width="true"]');$.each($elements,function(key,item){var $el=$(this);$el.addClass("vc_hidden");var $el_full=$el.next(".vc_row-full-width");if($el_full.length||($el_full=$el.parent().next(".vc_row-full-width")),$el_full.length){var el_margin_left=parseInt($el.css("margin-left"),10),el_margin_right=parseInt($el.css("margin-right"),10),offset=0-$el_full.offset().left-el_margin_left,width=$(window).width();if($el.css({position:"relative",left:offset,"box-sizing":"border-box",width:$(window).width()}),!$el.data("vcStretchContent")){var padding=-1*offset;0>padding&&(padding=0);var paddingRight=width-padding-$el_full.width()+el_margin_left+el_margin_right;0>paddingRight&&(paddingRight=0),$el.css({"padding-left":padding+"px","padding-right":paddingRight+"px"})}$el.attr("data-vc-full-width-init","true"),$el.removeClass("vc_hidden"),$(document).trigger("vc-full-width-row-single",{el:$el,offset:offset,marginLeft:el_margin_left,marginRight:el_margin_right,elFull:$el_full,width:width})}}),$(document).trigger("vc-full-width-row",$elements)}function fullHeightRow(){var $element=$(".vc_row-o-full-height:first");
14052if($element.length){var $window,windowHeight,offsetTop,fullHeight;$window=$(window),windowHeight=$window.height(),offsetTop=$element.offset().top,offsetTop<windowHeight&&(fullHeight=100-offsetTop/(windowHeight/100),$element.css("min-height",fullHeight+"vh"))}$(document).trigger("vc-full-height-row",$element)}var $=window.jQuery;$(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour",fullWidthRow).on("resize.vcRowBehaviour",fullHeightRow),fullWidthRow(),fullHeightRow(),function(){(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){"flex"===$(this).css("display")&&$(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')})}(),vc_initVideoBackgrounds(),function(){var vcSkrollrOptions,callSkrollInit=!1;window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSpeed,skrollrSize,skrollrStart,skrollrEnd,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),$parallaxElement=$("<div />").addClass("vc_parallax-inner").appendTo($(this)),$parallaxElement.height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),youtubeId=vcExtractYoutubeId(parallaxImage),youtubeId?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrSpeed=skrollrSize-100,skrollrStart=-skrollrSpeed,skrollrEnd=0,$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: "+skrollrEnd+"%;")}),!(!callSkrollInit||!window.skrollr)&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}()}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event,ui){var $ui_panel,$google_maps,panel=ui.panel||ui.newPanel,$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=panel.find(".vc_round-chart"),$line_charts=panel.find(".vc_line-chart"),$carousel=panel.find('[data-ride="vc_carousel"]');if(vc_carouselBehaviour(),vc_plugin_flexslider(panel),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),$ui_panel=panel.find(".isotope, .wpb_image_grid_ul"),$google_maps=panel.find(".wpb_gmaps_widget"),0<$ui_panel.length&&$ui_panel.isotope("layout"),$google_maps.length&&!$google_maps.is(".map_ready")){var $frame=$google_maps.find("iframe");$frame.attr("src",$frame.attr("src")),$google_maps.addClass("map_ready")}panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),window.vc_googleMapsPointer,jQuery(document).ready(vc_prepareHoverBo
14052x),jQuery(window).resize(vc_prepareHoverBox),jQuery(document).ready(function($){window.vc_js()});
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.