Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: jquery-ui/js/jquery-ui-1.12.1.custom.min.js

Issue 29527615: Issue 5574 - Update to current jQuery and jQuery UI versions (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome
Patch Set: Fixed tab selection and recompressed images Created Aug. 25, 2017, 11:33 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « jquery-ui/js/jquery-3.2.1.min.js ('k') | jquery-ui/js/jquery-ui-1.8.16.custom.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*! jQuery UI - v1.12.1 - 2017-08-25
2 * http://jqueryui.com
3 * Includes: widget.js, form-reset-mixin.js, keycode.js, labels.js, unique-id.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/t abs.js
4 * Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6 (function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery )})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.sl ice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]); o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a ){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0] ;e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.e xtend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){retur n!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._cre ateWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.exten d(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a .options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunctio n(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}f unction n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this. _super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this ,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.p rototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{con structor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstru ctors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i. _proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bri dge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r= o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[ s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget. extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widget FullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l =this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(t his,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i= s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+ "'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.ea ch(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data (this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors= [],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:" <div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){ s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventN amespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this .focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullN ame,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destro y()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this .document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget. extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.d isabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",n ull,this._getCreateEventData()),this._init()},_getCreateOptions:function(){retur n{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){v ar e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._remo veClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullN ame),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bin dings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.el ement},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widge t.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift (),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++ )n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0== =n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options [e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:fun ction(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:functi on(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabl ed"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s, n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n .length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element: s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass( this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(th is.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-st ate-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable: function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.a dd?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.clas sesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]] )}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.c lasses||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e .keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_ untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,funct ion(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target ).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_a ddClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:functio n(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra :n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(t his._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&( s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.elemen t,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disab led!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).app ly(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid ++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h, c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespa ce+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e) .get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hove rable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t ?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:fun ction(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e) {this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e ){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:fun ction(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){th is._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){thi s._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e ,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetE ventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o= i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s), !(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPreve nted())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype ["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"nu mber"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=! t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effect s.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){ t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,t.fn.form=function(){return"strin g"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixi n={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data ("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormRes etHandler:function(){if(this.form=this.element.form(),this.form.length){var t=th is.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-for m-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-inst ances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.f orm.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this. form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-insta nces").off("reset.ui-form-reset")}}},t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE: 46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PER IOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([! "#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")} }(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.l ength?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr( "id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.sibli ngs()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i)) ),this.pushStack(n))},t.fn.extend({uniqueId:function(){var t=0;return function() {return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUnique Id:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).r emoveAttr("id")})}});var s=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup", {version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disable d:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], inp ut[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxra dio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:". ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this .element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callCh ildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.e lement.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.fin d(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents"). contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options .items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.fi nd(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-content s").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'>< /span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i= i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("mi ddle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("inst ance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length) {o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o) ),n[s](r);var l=n[s]("widget");t.data(l[0],"ui-controlgroup-data",o?o:n[s]("inst ance")),i.push(l[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this. _addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e ){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data ");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-c orner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOp tions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null ,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction ,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left "),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOp tions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classe s["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function (t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:functi on(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOp tions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto ":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-close d":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-select menu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-o pen":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom": "right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-butto n-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var n={};re turn t.each(e,function(o){var a=i.options.classes[o]||"";a=t.trim(a.replace(s,"" )),n[o]=(a+" "+e[o]).replace(/\s+/g," ")}),n},_setOption:function(t,e){return"di rection"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this. _super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0): (this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-cont rolgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.d irection&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.c hildWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each (["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&& i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length? "only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName] (o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t .widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disab led:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","u i-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=t his,n=this._super()||{};return this._readType(),i=this.element.labels(),this.lab el=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each( function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),th is.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!= e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bind FormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.elem ent[0].disabled),this._setOption("disabled",this.options.disabled),this._addClas s("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"u i-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClas s(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.la bel!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.l abel=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-check boxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"u i-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addCla ss(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._remo veClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function (){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type," input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradi o on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){t his._updateIcon(this.element[0].checked)},widget:function(){return this.label},_ getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.esca peSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter( s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element) ):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleCla ss(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon& &"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-stat e-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.typ e&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance") ;e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_des troy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),th is.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._sup er(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e) ,this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon :function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||( this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.ico nSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-che ck ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon -blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkb oxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-che cked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon &&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:fu nction(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(th is.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label. append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=t his.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-che ckboxradio-checked","ui-state-active",t),null!==this.options.label&&this._update Label(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.check boxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",option s:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"b eginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._su per()||{};return this.isInput=this.element.is("input"),t=this.element[0].disable d,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():thi s.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:fun ction(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),n ull==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1) ,this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.lab el!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this .element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this. _setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a" )&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault (),this.element[0].click?this.element[0].click():this.element.trigger("click"))} })},_enhance:function(){this.element.is("button")||this.element.attr("role","but ton"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updat eTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),thi s.options.showLabel||this.title||this.element.attr("title",this.options.label)}, _updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition :i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this. options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon"," ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this ._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,nul l,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpa ce||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button -icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._att achIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon& &this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this. element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bot tom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.el ement[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:func tion(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0== =t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOpti on:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remo ve(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateI con(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this ._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element. html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIcon Space(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._togg leClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.b lur())},refresh:function(){var t=this.element.is("input, button")?this.element[0 ].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled &&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&( t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary :null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.opt ions.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(t his.options.text=this.options.showLabel),this.options.icon||!this.options.icons. primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.pr imary=this.options.icon):this.options.icons.primary?this.options.icon=this.optio ns.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.ic onPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this ._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"=== t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e. primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("ico n",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments), void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.le ngth&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkb ox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t. ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?t his.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.bu tton),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?t his.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option" ===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[ 0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(argumen ts[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments) )}),t.ui.button,t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}c atch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.tab s",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corne r-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs -tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:n ull,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLo cal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s= location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeUR IComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-wi dget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this. _processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled =t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),functio n(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&th is.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.len gth&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i= this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this. tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}), null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1 ===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1 ===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData: function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab( this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.d ocument[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)) {switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=t his.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SP ACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),vo id 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activat ing),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preven tDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e. metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected"," true"),this.activating=this._delay(function(){this.option("active",s)},this.dela y))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t .ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNa v:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate( this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.key Code.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0) :void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e} for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1: e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.t abs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this. _activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui -tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"even t"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0 )},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\ ^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.child ren(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t) {return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this .active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e .disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab( Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,t his.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(thi s.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle (this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"fal se","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(t his.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active .attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass (this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.activ e).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_pr ocessTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.ta blist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tab s-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("m ousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled" )&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",functio n(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this .tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass (this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function (){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClas s(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s) {var n,o,a,r=t(s).uniqueId().attr("id"),l=t(s).closest("li"),h=l.attr("aria-cont rols");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSele ctor(n))):(a=l.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element .find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)) ,o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("u i-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":r}),o.attr( "aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.p anels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this. _off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){re turn this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){r eturn t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:fun ction(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&( e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("a ria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr( "aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.dis abled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e== =!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e ]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this ._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anch ors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown :"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setup HeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i -=this.element.outerHeight()-this.element.height(),this.element.siblings(":visib le").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!= =s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(funct ion(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Ma th.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"a uto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").heigh t())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n= t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,l=r?t():th is._getPanelForTab(o),h=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPane l:h,newTab:r?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled" )||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger ("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t() :o,this.xhr&&this.xhr.abort(),h.length||l.length||t.error("jQuery UI Tabs: Misma tching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._to ggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate ",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-stat e-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())
7 }var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hid e?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li" ),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest( "li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","tr ue"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&& r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){retu rn 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","fals e"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_ activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.lengt h||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,c urrentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t ():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anch ors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_dest roy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(th is.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),thi s.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).r emove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria -labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this ),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-t abs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content" !==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){va r i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isAr ray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){r eturn i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=thi s.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1! ==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOption Disabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e ),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},l=func tion(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"), a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xh r=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&& (this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(fu nction(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),l(n,e)},1)} ).fail(function(t,e){setTimeout(function(){l(t,e)},1)})))},_ajaxSettings:functio n(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:func tion(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s)) }}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.ele ment.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.ta bs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClas s(this.tabs,"ui-tab")}}),t.ui.tabs});
OLDNEW
« no previous file with comments | « jquery-ui/js/jquery-3.2.1.min.js ('k') | jquery-ui/js/jquery-ui-1.8.16.custom.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld