Owen Leonard
ca6113decc
This patch updates jQueryUI in the OPAC and staff interface. Old assets are removed and new assets added. jQueryUI has been re-compiled in each interface to include only the required features. In the OPAC: tabs and tooltip. In the staff interface: accordion, autocomplete, sortable, and tabs. The next patch will make the required updates to templates. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 lines
20 KiB
JavaScript
6 lines
20 KiB
JavaScript
/*! jQuery UI - v1.13.1 - 2022-02-03
|
|
* http://jqueryui.com
|
|
* Includes: widget.js, keycode.js, unique-id.js, widgets/tabs.js
|
|
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
|
|
|
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(l){"use strict";l.ui=l.ui||{};l.ui.version="1.13.1";var a,i=0,o=Array.prototype.hasOwnProperty,r=Array.prototype.slice;l.cleanData=(a=l.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=l._data(i,"events"))&&e.remove&&l(i).triggerHandler("remove");a(t)}),l.widget=function(t,i,e){var s,a,n,o={},r=t.split(".")[0],h=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=l.Widget),Array.isArray(e)&&(e=l.extend.apply(null,[{}].concat(e))),l.expr.pseudos[h.toLowerCase()]=function(t){return!!l.data(t,h)},l[r]=l[r]||{},s=l[r][t],a=l[r][t]=function(t,e){if(!this||!this._createWidget)return new a(t,e);arguments.length&&this._createWidget(t,e)},l.extend(a,s,{version:e.version,_proto:l.extend({},e),_childConstructors:[]}),(n=new i).options=l.widget.extend({},n.options),l.each(e,function(e,s){function a(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}o[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=a,this._superApply=n,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),a.prototype=l.widget.extend(n,{widgetEventPrefix:s&&n.widgetEventPrefix||t},o,{constructor:a,namespace:r,widgetName:t,widgetFullName:h}),s?(l.each(s._childConstructors,function(t,e){var i=e.prototype;l.widget(i.namespace+"."+i.widgetName,a,e._proto)}),delete s._childConstructors):i._childConstructors.push(a),l.widget.bridge(t,a),a},l.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),a=0,n=s.length;a<n;a++)for(e in s[a])i=s[a][e],o.call(s[a],e)&&void 0!==i&&(l.isPlainObject(i)?t[e]=l.isPlainObject(t[e])?l.widget.extend({},t[e],i):l.widget.extend({},i):t[e]=i);return t},l.widget.bridge=function(n,e){var o=e.prototype.widgetFullName||n;l.fn[n]=function(i){var t="string"==typeof i,s=r.call(arguments,1),a=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=l.data(this,o);return"instance"===i?(a=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?l.error("no such method '"+i+"' for "+n+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(a=t&&t.jquery?a.pushStack(t.get()):t,!1):void 0:l.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+i+"'")}):a=void 0:(s.length&&(i=l.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=l.data(this,o);t?(t.option(i||{}),t._init&&t._init()):l.data(this,o,new e(i,this))})),a}},l.Widget=function(){},l.Widget._childConstructors=[],l.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=l(e||this.defaultElement||this)[0],this.element=l(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=l(),this.hoverable=l(),this.focusable=l(),this.classesElementLookup={},e!==this&&(l.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=l(e.style?e.ownerDocument:e.document||e),this.window=l(this.document[0].defaultView||this.document[0].parentWindow)),this.options=l.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:l.noop,_create:l.noop,_init:l.noop,destroy:function(){var i=this;this._destroy(),l.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:l.noop,widget:function(){return this.element},option:function(t,e){var i,s,a,n=t;if(0===arguments.length)return l.widget.extend({},this.options);if("string"==typeof t)if(n={},t=(i=t.split(".")).shift(),i.length){for(s=n[t]=l.widget.extend({},this.options[t]),a=0;a<i.length-1;a++)s[i[a]]=s[i[a]]||{},s=s[i[a]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];n[t]=e}return this._setOptions(n),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=l(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(a){var n=[],o=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=o.classesElementLookup[t[s]]||l(),i=a.add?(function(){var i=[];a.element.each(function(t,e){l.map(o.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),o._on(l(i),{remove:"_untrackClassesElement"})}(),l(l.uniqueSort(i.get().concat(a.element.get())))):l(i.not(a.element).get()),o.classesElementLookup[t[s]]=i,n.push(t[s]),e&&a.classes[t[s]]&&n.push(a.classes[t[s]])}return(a=l.extend({element:this.element,classes:this.options.classes||{}},a)).keys&&t(a.keys.match(/\S+/g)||[],!0),a.extra&&t(a.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(i){var s=this;l.each(s.classesElementLookup,function(t,e){-1!==l.inArray(i.target,e)&&(s.classesElementLookup[t]=l(e.not(i.target).get()))}),this._off(l(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var a="string"==typeof t||null===t,i={extra:a?e:i,keys:a?t:e,element:a?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(a,n,t){var o,r=this;"boolean"!=typeof a&&(t=n,n=a,a=!1),t?(n=o=l(n),this.bindings=this.bindings.add(n)):(t=n,n=this.element,o=this.widget()),l.each(t,function(t,e){function i(){if(a||!0!==r.options.disabled&&!l(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||l.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?o.on(t,s,i):n.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=l(this.bindings.not(t).get()),this.focusable=l(this.focusable.not(t).get()),this.hoverable=l(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(l(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(l(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(l(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(l(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,a,n=this.options[t];if(i=i||{},(e=l.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],a=e.originalEvent)for(s in a)s in e||(e[s]=a[s]);return this.element.trigger(e,i),!("function"==typeof n&&!1===n.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},l.each({show:"fadeIn",hide:"fadeOut"},function(n,o){l.Widget.prototype["_"+n]=function(e,t,i){var s,a=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||o:n;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!l.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&l.effects&&l.effects.effect[a]?e[n](t):a!==n&&e[a]?e[a](t.duration,t.easing,i):e.queue(function(t){l(this)[n](),i&&i.call(e[0]),t()})}});var t,s;l.widget,l.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,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},l.fn.extend({uniqueId:(t=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&l(this).removeAttr("id")})}}),l.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i};l.widget("ui.tabs",{version:"1.13.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-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:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(s=/#.*$/,function(t){var e=t.href.replace(s,""),i=location.href.replace(s,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=l.uniqueSort(t.disabled.concat(l.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=l(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(l(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):l()}},_tabKeydown:function(t){var e=l(l.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case l.ui.keyCode.RIGHT:case l.ui.keyCode.DOWN:i++;break;case l.ui.keyCode.UP:case l.ui.keyCode.LEFT:s=!1,i--;break;case l.ui.keyCode.END:i=this.anchors.length-1;break;case l.ui.keyCode.HOME:i=0;break;case l.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case l.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===l.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===l.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===l.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==l.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=l.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!l.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=l()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=l()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.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.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var h=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){l(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){l(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 l("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=l(),this.anchors.each(function(t,e){var i,s,a,n=l(e).uniqueId().attr("id"),o=l(e).closest("li"),r=o.attr("aria-controls");h._isLocal(e)?(a=(i=e.hash).substring(1),s=h.element.find(h._sanitizeSelector(i))):(a=o.attr("aria-controls")||l({}).uniqueId()[0].id,(s=h.element.find(i="#"+a)).length||(s=h._createPanel(a)).insertAfter(h.panels[t-1]||h.tablist),s.attr("aria-live","polite")),s.length&&(h.panels=h.panels.add(s)),r&&o.data("ui-tabs-aria-controls",r),o.attr({"aria-controls":a,"aria-labelledby":n}),s.attr("aria-labelledby",n)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return l("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=l(e),!0===t||-1!==l.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&l.each(t.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.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=l(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=l(this).outerHeight(!0)}),this.panels.each(function(){l(this).height(Math.max(0,i-l(this).innerHeight()+l(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,l(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=l(t.currentTarget).closest("li"),a=s[0]===i[0],n=a&&e.collapsible,o=n?l():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):l(),i={oldTab:i,oldPanel:r,newTab:n?l():s,newPanel:o};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||a&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!n&&this.tabs.index(s),this.active=a?l():s,this.xhr&&this.xhr.abort(),r.length||o.length||l.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,a=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function o(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,n):(s.show(),n())}this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),o()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a.hide(),o()),a.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&a.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===l(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:l.noop}))},_findActive:function(t){return!1===t?l():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+l.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){l.data(this,"ui-tabs-destroy")?l(this).remove():l(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=l(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?l.map(t,function(t){return t!==i?t:null}):l.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==l.inArray(t,e))return;e=Array.isArray(e)?l.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function a(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(i,"ui-tabs-loading"),o.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),r={tab:i,panel:o};this._isLocal(t[0])||(this.xhr=l.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){o.html(t),n._trigger("load",s,r),a(i,e)},1)}).fail(function(t,e){setTimeout(function(){a(t,e)},1)})))},_ajaxSettings:function(t,i,s){var a=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return a._trigger("beforeLoad",i,l.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=l(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==l.uiBackCompat&&l.widget("ui.tabs",l.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});l.ui.tabs});
|