From 92ae28e17df355b1c96f4196289a5e2d4fe9ed3c Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 9 Jun 2008 19:37:55 +0000 Subject: [PATCH] jQuery UI 1.5 git-svn-id: https://develop.svn.wordpress.org/trunk@8064 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/jquery/ui.core.js | 277 +---------- wp-includes/js/jquery/ui.sortable.js | 672 +-------------------------- wp-includes/js/jquery/ui.tabs.js | 595 +----------------------- wp-includes/script-loader.php | 6 +- 4 files changed, 6 insertions(+), 1544 deletions(-) diff --git a/wp-includes/js/jquery/ui.core.js b/wp-includes/js/jquery/ui.core.js index 5fabd9ae85..7a07cef84c 100644 --- a/wp-includes/js/jquery/ui.core.js +++ b/wp-includes/js/jquery/ui.core.js @@ -1,277 +1,2 @@ -/* - * jQuery UI @VERSION - * - * Copyright (c) 2008 Paul Bakaus (ui.jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - * - * $Id: ui.core.js 5587 2008-05-13 19:56:42Z scott.gonzalez $ - */ -;(function($) { +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3(C){C.8={2t:{1o:3(E,F,H){6 G=C.8[E].m;1v(6 D 2s H){G.u[D]=G.u[D]||[];G.u[D].2r([F,H[D]])}},1n:3(D,F,E){6 H=D.u[F];5(!H){4}1v(6 G=0;G\').1i(D).f({2l:"2k",11:"-1u",2j:"-1u",2i:"2h"}).2g("1t");C.8.n[D]=!!((!(/2f|2e/).h(E.f("2d"))||(/^[1-9]/).h(E.f("2c"))||(/^[1-9]/).h(E.f("2b"))||!(/1r/).h(E.f("2a"))||!(/29|28\\(0, 0, 0, 0\\)/).h(E.f("27"))));26{C("1t").1s(0).25(E.1s(0))}24(F){}4 C.8.n[D]},23:3(D){D.j="1g";D.1q=3(){4 7};5(D.t){D.t.1p="1r"}},22:3(D){D.j="21";D.1q=3(){4 d};5(D.t){D.t.1p=""}},20:3(G,E){6 D=/11/.h(E||"11")?"1Z":"1Y",F=7;5(G[D]>0){4 d}G[D]=1;F=G[D]>0?d:7;G[D]=0;4 F}};6 B=C.Z.q;C.Z.q=3(){C("*",2).1o(2).1X("q");4 B.r(2,1m)};3 A(E,F,G){6 D=C[E][F].1W||[];D=(U D=="T"?D.10(/,?\\s+/):D);4(C.1V(G,D)!=-1)}C.X=3(E,D){6 F=E.10(".")[0];E=E.10(".")[1];C.Z[E]=3(J){6 H=(U J=="T"),I=1U.m.1T.1n(1m,1);5(H&&A(F,E,J)){6 G=C.Y(2[0],E);4(G?G[J].r(G,I):1S)}4 2.1R(3(){6 K=C.Y(2,E);5(H&&K&&C.1Q(K[J])){K[J].r(K,I)}1P{5(!H){C.Y(2,E,1O C[F][E](2,J))}}})};C[F][E]=3(I,H){6 G=2;2.e=E;2.1h=F+"-"+E;2.a=C.1l({k:7},C[F][E].13,H);2.c=C(I).g("l."+E,3(L,J,K){4 G.l(J,K)}).g("W."+E,3(K,J){4 G.W(J)}).g("q",3(){4 G.1j()});2.1k()};C[F][E].m=C.1l({},C.X.m,D)};C.X.m={1k:3(){},1j:3(){2.c.1N(2.e)},W:3(D){4 2.a[D]},l:3(D,E){2.a[D]=E;5(D=="k"){2.c[E?"1i":"1M"](2.1h+"-k")}},1L:3(){2.l("k",7)},1K:3(){2.l("k",d)}};C.8.14={1J:3(){6 D=2;2.c.g("1I."+2.e,3(E){4 D.1e(E)});5(C.S.R){2.1f=2.c.V("j");2.c.V("j","1g")}2.1H=7},1G:3(){2.c.P("."+2.e);(C.S.R&&2.c.V("j",2.1f))},1e:3(F){(2.b&&2.i(F));2.p=F;6 E=2,G=(F.1F==1),D=(U 2.a.w=="T"?C(F.1E).1D(2.a.w):7);5(!G||D||!2.15(F)){4 d}2.o=!2.a.v;5(!2.o){2.1C=1B(3(){E.o=d},2.a.v)}5(2.N(F)&&2.z(F)){2.b=(2.y(F)!==7);5(!2.b){F.1A();4 d}}2.Q=3(H){4 E.1d(H)};2.O=3(H){4 E.i(H)};C(1c).g("1b."+2.e,2.Q).g("1a."+2.e,2.O);4 7},1d:3(D){5(C.S.R&&!D.1z){4 2.i(D)}5(2.b){2.x(D);4 7}5(2.N(D)&&2.z(D)){2.b=(2.y(2.p,D)!==7);(2.b?2.x(D):2.i(D))}4!2.b},i:3(D){C(1c).P("1b."+2.e,2.Q).P("1a."+2.e,2.O);5(2.b){2.b=7;2.16(D)}4 7},N:3(D){4(M.1y(M.18(2.p.19-D.19),M.18(2.p.17-D.17))>=2.a.12)},z:3(D){4 2.o},y:3(D){},x:3(D){},16:3(D){},15:3(D){4 d}};C.8.14.13={w:1x,12:1,v:0}})(1w)',62,154,'||this|function|return|if|var|false|ui||options|_mouseStarted|element|true|widgetName|css|bind|test|mouseUp|unselectable|disabled|setData|prototype|cssCache|_mouseDelayMet|_mouseDownEvent|remove|apply||style|plugins|delay|cancel|mouseDrag|mouseStart|mouseDelayMet|||||||||||||Math|mouseDistanceMet|_mouseUpDelegate|unbind|_mouseMoveDelegate|msie|browser|string|typeof|attr|getData|widget|data|fn|split|top|distance|defaults|mouse|mouseCapture|mouseStop|pageY|abs|pageX|mouseup|mousemove|document|mouseMove|mouseDown|_mouseUnselectable|on|widgetBaseClass|addClass|destroy|init|extend|arguments|call|add|MozUserSelect|onselectstart|none|get|body|5000px|for|jQuery|null|max|button|preventDefault|setTimeout|_mouseDelayTimer|is|target|which|mouseDestroy|started|mousedown|mouseInit|disable|enable|removeClass|removeData|new|else|isFunction|each|undefined|slice|Array|inArray|getter|trigger|scrollLeft|scrollTop|hasScroll|off|enableSelection|disableSelection|catch|removeChild|try|backgroundColor|rgba|transparent|backgroundImage|width|height|cursor|default|auto|appendTo|block|display|left|absolute|position|gen|resizable|class|div|length|push|in|plugin'.split('|'),0,{})) -$.ui = { - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - cssCache: {}, - css: function(name) { - if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; } - var tmp = $('
').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body'); - - //if (!$.browser.safari) - //tmp.appendTo('body'); - - //Opera and Safari set width and height to 0px instead of auto - //Safari returns rgba(0,0,0,0) when bgcolor is not set - $.ui.cssCache[name] = !!( - (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || - !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) - ); - try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} - return $.ui.cssCache[name]; - }, - disableSelection: function(e) { - e.unselectable = "on"; - e.onselectstart = function() { return false; }; - if (e.style) { e.style.MozUserSelect = "none"; } - }, - enableSelection: function(e) { - e.unselectable = "off"; - e.onselectstart = function() { return true; }; - if (e.style) { e.style.MozUserSelect = ""; } - }, - hasScroll: function(e, a) { - var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false; - if (e[scroll] > 0) return true; e[scroll] = 1; - has = e[scroll] > 0 ? true : false; e[scroll] = 0; - return has; - } -}; - - -/** jQuery core modifications and additions **/ - -var _remove = $.fn.remove; -$.fn.remove = function() { - $("*", this).add(this).trigger("remove"); - return _remove.apply(this, arguments ); -}; - -// $.widget is a factory to create jQuery plugins -// taking some boilerplate code out of the plugin code -// created by Scott González and Jörn Zaefferer -function getter(namespace, plugin, method) { - var methods = $[namespace][plugin].getter || []; - methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods); - return ($.inArray(method, methods) != -1); -} - -var widgetPrototype = { - init: function() {}, - destroy: function() { - this.element.removeData(this.widgetName); - }, - - getData: function(key) { - return this.options[key]; - }, - setData: function(key, value) { - this.options[key] = value; - }, - - enable: function() { - this.setData('disabled', false); - }, - disable: function() { - this.setData('disabled', true); - } -}; - -$.widget = function(name, prototype) { - var namespace = name.split(".")[0]; - name = name.split(".")[1]; - // create plugin method - $.fn[name] = function(options) { - var isMethodCall = (typeof options == 'string'), - args = Array.prototype.slice.call(arguments, 1); - - if (isMethodCall && getter(namespace, name, options)) { - var instance = $.data(this[0], name); - return (instance ? instance[options].apply(instance, args) - : undefined); - } - - return this.each(function() { - var instance = $.data(this, name); - if (!instance) { - $.data(this, name, new $[namespace][name](this, options)); - } else if (isMethodCall) { - instance[options].apply(instance, args); - } - }); - }; - - // create widget constructor - $[namespace][name] = function(element, options) { - var self = this; - - this.widgetName = name; - - this.options = $.extend({}, $[namespace][name].defaults, options); - this.element = $(element) - .bind('setData.' + name, function(e, key, value) { - return self.setData(key, value); - }) - .bind('getData.' + name, function(e, key) { - return self.getData(key); - }) - .bind('remove', function() { - return self.destroy(); - }); - this.init(); - }; - - // add widget prototype - $[namespace][name].prototype = $.extend({}, widgetPrototype, prototype); -}; - - -/** Mouse Interaction Plugin **/ - -$.ui.mouse = { - mouseInit: function() { - var self = this; - - this.element.bind('mousedown.'+this.widgetName, function(e) { - return self.mouseDown(e); - }); - - // Prevent text selection in IE - if ($.browser.msie) { - this._mouseUnselectable = this.element.attr('unselectable'); - this.element.attr('unselectable', 'on'); - } - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - mouseDestroy: function() { - this.element.unbind('.'+this.widgetName); - - // Restore text selection in IE - ($.browser.msie - && this.element.attr('unselectable', this._mouseUnselectable)); - }, - - mouseDown: function(e) { - // we may have missed mouseup (out of window) - (this._mouseStarted && this.mouseUp(e)); - - this._mouseDownEvent = e; - - var self = this, - btnIsLeft = (e.which == 1), - elIsCancel = ($(e.target).is(this.options.cancel)); - if (!btnIsLeft || elIsCancel) { - return true; - } - - this._mouseDelayMet = !this.options.delay; - if (!this._mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - self._mouseDelayMet = true; - }, this.options.delay); - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(e) { - return self.mouseMove(e); - }; - this._mouseUpDelegate = function(e) { - return self.mouseUp(e); - }; - $(document) - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - return false; - }, - - mouseMove: function(e) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !e.button) { - return this.mouseUp(e); - } - - if (this._mouseStarted) { - this.mouseDrag(e); - return false; - } - - if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) { - this._mouseStarted = - (this.mouseStart(this._mouseDownEvent, e) !== false); - (this._mouseStarted || this.mouseUp(e)); - } - - return !this._mouseStarted; - }, - - mouseUp: function(e) { - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - if (this._mouseStarted) { - this._mouseStarted = false; - this.mouseStop(e); - } - - return false; - }, - - mouseDistanceMet: function(e) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - e.pageX), - Math.abs(this._mouseDownEvent.pageY - e.pageY) - ) >= this.options.distance - ); - }, - - mouseDelayMet: function(e) { - return this._mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - mouseStart: function(e) {}, - mouseDrag: function(e) {}, - mouseStop: function(e) {} -}; - -$.ui.mouse.defaults = { - cancel: null, - distance: 0, - delay: 0 -}; - -})(jQuery); \ No newline at end of file diff --git a/wp-includes/js/jquery/ui.sortable.js b/wp-includes/js/jquery/ui.sortable.js index f5867aec53..4d4d308530 100644 --- a/wp-includes/js/jquery/ui.sortable.js +++ b/wp-includes/js/jquery/ui.sortable.js @@ -1,672 +1,2 @@ -/* - * jQuery UI Sortable - * - * Copyright (c) 2008 Paul Bakaus - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * ui.core.js - * - * Revision: $Id: ui.sortable.js 5433 2008-05-04 20:07:17Z joern.zaefferer $ - */ -;(function($) { +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b(B){b A(E,D){9 C=B.2Q.3T&&B.2Q.3S<3R;5(E.2P&&!C){c E.2P(D)}5(E.2O){c!!(E.2O(D)&16)}1O(D=D.1g){5(D==E){c W}}c w}B.3Q("k.o",B.2f(B.k.3P,{3O:b(){9 C=4.6;4.O={};4.g.24("k-o");4.25();4.13=4.f.z?(/7|23/).17(4.f[0].v.e("3N")):w;5(!(/(2N|1s|3M)/).17(4.g.e("Y"))){4.g.e("Y","2N")}4.a=4.g.a();4.3L()},3K:{},k:b(C){c{l:(C||4)["l"],q:(C||4)["q"]||B([]),Y:(C||4)["Y"],3J:(C||4)["1b"],6:4.6,g:4.g,v:(C||4)["j"],3I:C?C.g:X}},t:b(F,E,C,D){B.k.1o.14(4,F,[E,4.k(C)]);5(!D){4.g.3H(F=="1z"?F:"1z"+F,[E,4.k(C)],4.6[F])}},2e:b(E){9 C=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 D=[];E=E||{};C.1v(b(){9 F=(B(4).2L(E.3G||"2K")||"").3F(E.3E||(/(.+)[-=3D](.+)/));5(F){D.1w((E.2M||F[1])+"[]="+(E.2M?F[1]:F[2]))}});c D.3C("&")},2d:b(C){9 D=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 E=[];D.1v(b(){E.1w(B(4).2L(C||"2K"))});c E},2F:b(J){9 E=4.1b.7,D=E+4.r.m,I=4.1b.8,H=I+4.r.n;9 F=J.7,C=F+J.m,K=J.8,G=K+J.n;5(4.6.1r=="2J"||(4.6.1r=="1S"&&4.r[4.13?"m":"n"]>J[4.13?"m":"n"])){c(I+4.a.p.8>K&&I+4.a.p.8F&&E+4.a.p.7J[4.13?"m":"n"])){5(!(I+4.a.p.8>K&&I+4.a.p.8F&&E+4.a.p.7F&&E+4.a.p.7F+J.m/2&&E+4.a.p.7K&&I+4.a.p.8K+J.n/2&&I+4.a.p.8F&&EC){c 1}}Z{5(H>K&&IG){c 2}}}c w},25:b(){4.2I();4.1T()},2I:b(){4.f=[];4.d=[4];9 C=4.f;9 E=[B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)];5(4.6.28){P(9 F=4.6.28.z-1;F>=0;F--){9 H=B(4.6.28[F]);P(9 D=H.z-1;D>=0;D--){9 G=B.1f(H[D],"o");5(G&&!G.6.27){E.1w(B.1L(G.6.f)?G.6.f.14(G.g):B(G.6.f,G.g));4.d.1w(G)}}}}P(9 F=E.z-1;F>=0;F--){E[F].1v(b(){B.1f(4,"o-v",W);C.1w({v:B(4),m:0,n:0,7:0,8:0})})}},1T:b(C){P(9 E=4.f.z-1;E>=0;E--){9 D=4.f[E].v;5(!C){4.f[E].m=(4.6.1l?B(4.6.1l,D):D).1u()}5(!C){4.f[E].n=(4.6.1l?B(4.6.1l,D):D).1t()}9 F=(4.6.1l?B(4.6.1l,D):D).a();4.f[E].7=F.7;4.f[E].8=F.8}P(9 E=4.d.z-1;E>=0;E--){9 F=4.d[E].g.a();4.d[E].O.7=F.7;4.d[E].O.8=F.8;4.d[E].O.m=4.d[E].g.1u();4.d[E].O.n=4.d[E].g.1t()}},3B:b(){4.g.3A("k-o k-o-27").2H("o").3z(".o");4.3y();P(9 C=4.f.z-1;C>=0;C--){4.f[C].v.2H("o-v")}},1Z:b(E){9 C=E||4,F=C.6;5(F.q.3x==3w){9 D=F.q;F.q={g:b(){c B("<2G>").24(D)[0]},1i:b(G,H){H.e(G.a()).e({m:G.1u(),n:G.1t()})}}}C.q=B(F.q.g.14(C.g,C.j)).1q("S").e({Y:"1s"});F.q.1i.14(C.g,C.j,C.q)},2q:b(F){P(9 D=4.d.z-1;D>=0;D--){5(4.2F(4.d[D].O)){5(!4.d[D].O.1a){5(4.26!=4.d[D]){9 I=3v;9 H=X;9 E=4.1b[4.d[D].13?"7":"8"];P(9 C=4.f.z-1;C>=0;C--){5(!A(4.d[D].g[0],4.f[C].v[0])){1X}9 G=4.f[C][4.d[D].13?"7":"8"];5(1k.2E(G-E)=0;E--){4.d[E].t("3i",H,4)}}5(B.k.15){B.k.15.3h=4}5(B.k.15&&!J.2n){B.k.15.3g(4,H)}4.2j=W;4.2u(H);c W},2t:b(D,E){5(!E){E=4.Y}9 C=D=="1s"?1:-1;c{8:(E.8+4.a.s.8*C-(4.u[0]==h.S?0:4.u[0].N)*C+4.T.8*C),7:(E.7+4.a.s.7*C-(4.u[0]==h.S?0:4.u[0].M)*C+4.T.7*C)}},1Y:b(F){9 G=4.6;9 C={8:(F.1e-4.a.p.8-4.a.s.8+(4.u[0]==h.S?0:4.u[0].N)),7:(F.1c-4.a.p.7-4.a.s.7+(4.u[0]==h.S?0:4.u[0].M))};5(!4.1j){c C}5(4.i){5(C.7<4.i[0]){C.7=4.i[0]}5(C.8<4.i[1]){C.8=4.i[1]}5(C.7>4.i[2]){C.7=4.i[2]}5(C.8>4.i[3]){C.8=4.i[3]}}5(G.11){9 E=4.1j.8+1k.2v((C.8-4.1j.8)/G.11[1])*G.11[1];C.8=4.i?(!(E<4.i[1]||E>4.i[3])?E:(!(E<4.i[1])?E-G.11[1]:E+G.11[1])):E;9 D=4.1j.7+1k.2v((C.7-4.1j.7)/G.11[0])*G.11[0];C.7=4.i?(!(D<4.i[0]||D>4.i[2])?D:(!(D<4.i[0])?D-G.11[0]:D+G.11[0])):D}c C},2u:b(D){4.Y=4.1Y(D);4.1b=4.2t("1s");P(9 C=4.f.z-1;C>=0;C--){9 E=4.2s(4.f[C]);5(!E){1X}5(4.f[C].v[0]!=4.j[0]&&4.j[E==1?"3f":"1G"]()[0]!=4.f[C].v[0]&&!A(4.j[0],4.f[C].v[0])&&(4.6.2r=="3e-3d"?!A(4.g[0],4.f[C].v[0]):W)){4.2h=E==1?"2g":"3c";4.1D(D,4.f[C]);4.t("1W",D);3b}}4.2q(D);4.t("1z",D);5(!4.6.1I||4.6.1I=="x"){4.l[0].2p.7=4.Y.7+"2o"}5(!4.6.1I||4.6.1I=="y"){4.l[0].2p.8=4.Y.8+"2o"}5(B.k.15){B.k.15.3a(4,D)}c w},39:b(E,D){5(B.k.15&&!4.6.2n){B.k.15.38(4,E)}5(4.6.1V){9 C=4;9 F=C.j.a();5(C.q){C.q.2m({18:"37"},(L(4.6.1V,10)||2l)-36)}B(4.l).2m({7:F.7-4.a.s.7-C.T.7+(4.u[0]==h.S?0:4.u[0].M),8:F.8-4.a.s.8-C.T.8+(4.u[0]==h.S?0:4.u[0].N)},L(4.6.1V,10)||2l,b(){C.t("1p",E,X,D);C.1H(E)})}Z{4.t("1p",E,X,D);4.1H(E,D)}c w},1H:b(E,D){5(4.1U!=4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}5(!A(4.g[0],4.j[0])){5(4.1U==4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}4.t("1E",E,X,D);P(9 C=4.d.z-1;C>=0;C--){5(A(4.d[C].g[0],4.j[0])){4.d[C].t("1i",E,4,D);4.d[C].t("35",E,4,D)}}}P(9 C=4.d.z-1;C>=0;C--){4.d[C].t("34",E,4,D);5(4.d[C].O.1a){4.d[C].t("2k",E,4);4.d[C].O.1a=0}}4.2j=w;5(4.33){c w}B(4.j).e("2i","");5(4.q){4.q.1E()}4.l.1E();c W},1D:b(E,D,C){C?C.32(4.j):D.v[4.2h=="2g"?"31":"30"](4.j);4.1T(W);5(4.6.q){4.6.q.1i.14(4.g,4.j,4.q)}}}));B.2f(B.k.o,{2Z:"2e 2d",2Y:{1r:"1S",2X:0,2W:0,2V:":2U,2T",f:"> *",19:2S,2c:W,1q:"s"}});B.k.1o.1C("o","1h",{1n:b(E,D){9 C=B("S");5(C.e("1h")){D.6.1R=C.e("1h")}C.e("1h",D.6.1h)},1p:b(D,C){5(C.6.1R){B("S").e("1h",C.6.1R)}}});B.k.1o.1C("o","19",{1n:b(E,D){9 C=D.l;5(C.e("19")){D.6.1Q=C.e("19")}C.e("19",D.6.19)},1p:b(D,C){5(C.6.1Q){B(C.l).e("19",C.6.1Q)}}});B.k.1o.1C("o","18",{1n:b(E,D){9 C=D.l;5(C.e("18")){D.6.1P=C.e("18")}C.e("18",D.6.18)},1p:b(D,C){5(C.6.1P){B(C.l).e("18",C.6.1P)}}});B.k.1o.1C("o","1m",{1n:b(E,D){9 F=D.6;9 C=B(4).1f("o");F.V=F.V||20;F.U=F.U||20;C.R=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-y"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);C.Q=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-x"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);5(C.R[0]!=h&&C.R[0].1y!="1x"){C.1N=C.R.a()}5(C.Q[0]!=h&&C.Q[0].1y!="1x"){C.1M=C.Q.a()}},1z:b(E,D){9 F=D.6;9 C=B(4).1f("o");5(C.R[0]!=h&&C.R[0].1y!="1x"){5((C.1N.8+C.R[0].2a)-E.1e t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r); - } else { - - return (l < x1 + (this.helperProportions.width / 2) // Right Half - && x2 - (this.helperProportions.width / 2) < r // Left Half - && t < y1 + (this.helperProportions.height / 2) // Bottom Half - && y2 - (this.helperProportions.height / 2) < b ); // Top Half - - } - - }, - intersectsWithEdge: function(item) { - var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width, - y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height; - var l = item.left, r = l + item.width, - t = item.top, b = t + item.height; - - if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.currentItem[0]['offset'+(this.floating ? 'Width' : 'Height')] > item.item[0]['offset'+(this.floating ? 'Width' : 'Height')])) { - - if(!(y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r)) return false; - - if(this.floating) { - if(x1 + this.offset.click.left > l && x1 + this.offset.click.left < l + item.width/2) return 2; - if(x1 + this.offset.click.left > l+item.width/2 && x1 + this.offset.click.left < r) return 1; - } else { - if(y1 + this.offset.click.top > t && y1 + this.offset.click.top < t + item.height/2) return 2; - if(y1 + this.offset.click.top > t+item.height/2 && y1 + this.offset.click.top < b) return 1; - } - - } else { - - if (!(l < x1 + (this.helperProportions.width / 2) // Right Half - && x2 - (this.helperProportions.width / 2) < r // Left Half - && t < y1 + (this.helperProportions.height / 2) // Bottom Half - && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half - - if(this.floating) { - if(x2 > l && x1 < l) return 2; //Crosses left edge - if(x1 < r && x2 > r) return 1; //Crosses right edge - } else { - if(y2 > t && y1 < t) return 1; //Crosses top edge - if(y1 < b && y2 > b) return 2; //Crosses bottom edge - } - - } - - return false; - - }, - refresh: function() { - this.refreshItems(); - this.refreshPositions(); - }, - refreshItems: function() { - - this.items = []; - this.containers = [this]; - var items = this.items; - var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)]; - - if(this.options.connectWith) { - for (var i = this.options.connectWith.length - 1; i >= 0; i--){ - var cur = $(this.options.connectWith[i]); - for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], 'sortable'); - if(inst && !inst.options.disabled) { - queries.push($.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element)); - this.containers.push(inst); - } - }; - }; - } - - for (var i = queries.length - 1; i >= 0; i--){ - queries[i].each(function() { - $.data(this, 'sortable-item', true); // Data for target checking (mouse manager) - items.push({ - item: $(this), - width: 0, height: 0, - left: 0, top: 0 - }); - }); - }; - - }, - refreshPositions: function(fast) { - for (var i = this.items.length - 1; i >= 0; i--){ - var t = this.items[i].item; - if(!fast) this.items[i].width = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerWidth(); - if(!fast) this.items[i].height = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerHeight(); - var p = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).offset(); - this.items[i].left = p.left; - this.items[i].top = p.top; - }; - for (var i = this.containers.length - 1; i >= 0; i--){ - var p =this.containers[i].element.offset(); - this.containers[i].containerCache.left = p.left; - this.containers[i].containerCache.top = p.top; - this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); - this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); - }; - }, - destroy: function() { - this.element - .removeClass("ui-sortable ui-sortable-disabled") - .removeData("sortable") - .unbind(".sortable"); - this.mouseDestroy(); - - for ( var i = this.items.length - 1; i >= 0; i-- ) - this.items[i].item.removeData("sortable-item"); - }, - createPlaceholder: function(that) { - - var self = that || this, o = self.options; - - if(o.placeholder.constructor == String) { - var className = o.placeholder; - o.placeholder = { - element: function() { - return $('
').addClass(className)[0]; - }, - update: function(i, p) { - p.css(i.offset()).css({ width: i.outerWidth(), height: i.outerHeight() }); - } - }; - } - - self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)).appendTo('body').css({ position: 'absolute' }); - o.placeholder.update.call(self.element, self.currentItem, self.placeholder); - }, - contactContainers: function(e) { - for (var i = this.containers.length - 1; i >= 0; i--){ - - if(this.intersectsWith(this.containers[i].containerCache)) { - if(!this.containers[i].containerCache.over) { - - - if(this.currentContainer != this.containers[i]) { - - //When entering a new container, we will find the item with the least distance and append our item near it - var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top']; - for (var j = this.items.length - 1; j >= 0; j--) { - if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue; - var cur = this.items[j][this.containers[i].floating ? 'left' : 'top']; - if(Math.abs(cur - base) < dist) { - dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; - } - } - - if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled - continue; - - //We also need to exchange the placeholder - if(this.placeholder) this.placeholder.remove(); - if(this.containers[i].options.placeholder) { - this.containers[i].createPlaceholder(this); - } else { - this.placeholder = null;; - } - - - itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element); - this.propagate("change", e); //Call plugins and callbacks - this.containers[i].propagate("change", e, this); //Call plugins and callbacks - this.currentContainer = this.containers[i]; - - } - - this.containers[i].propagate("over", e, this); - this.containers[i].containerCache.over = 1; - } - } else { - if(this.containers[i].containerCache.over) { - this.containers[i].propagate("out", e, this); - this.containers[i].containerCache.over = 0; - } - } - - }; - }, - mouseStart: function(e, overrideHandle, noActivation) { - - var o = this.options; - this.currentContainer = this; - - if(this.options.disabled || this.options.type == 'static') return false; - - //Find out if the clicked node (or one of its parents) is a actual item in this.items - var currentItem = null, nodes = $(e.target).parents().each(function() { - if($.data(this, 'sortable-item')) { - currentItem = $(this); - return false; - } - }); - if($.data(e.target, 'sortable-item')) currentItem = $(e.target); - - if(!currentItem) return false; - if(this.options.handle && !overrideHandle) { - var validHandle = false; - $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; }); - if(!validHandle) return false; - } - - this.currentItem = currentItem; - - this.refresh(); - - //Create and append the visible helper - this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); - if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already - this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - this.margins = { //Cache the margins - left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), - top: (parseInt(this.currentItem.css("marginTop"),10) || 0) - }; - - this.offset = this.currentItem.offset(); //The element's absolute position on the page - this.offset = { //Substract the margins from the element's absolute offset - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - this.offset.click = { //Where the click happened, relative to the element - left: e.pageX - this.offset.left, - top: e.pageY - this.offset.top - }; - - this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position - - this.offset.parent = { //Store its position plus border - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - this.originalPosition = this.generatePosition(e); //Generate the original position - this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size - - if(o.cursorAt) { - if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left; - if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right; - if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top; - if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom; - } - - this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position - - /* - * - Position constraining - - * Here we prepare position constraining like grid and containment. - */ - - if(o.containment) { - if(o.containment == 'parent') o.containment = this.helper[0].parentNode; - if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)]; - if(!(/^(document|window|parent)$/).test(o.containment)) { - var ce = $(o.containment)[0]; - var co = $(o.containment).offset(); - - this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top, - co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0), - co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0) - ]; - } - } - - //If o.placeholder is used, create a new element at the given position with the class - if(o.placeholder) this.createPlaceholder(); - - //Call plugins and callbacks - this.propagate("start", e); - this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size - - if(this.options.placeholder != 'clone') this.currentItem.css('visibility', 'hidden'); //Set the original element visibility to hidden to still fill out the white space - - if(!noActivation) { - for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); } //Post 'activate' events to possible containers - } - - //Prepare possible droppables - if($.ui.ddmanager) $.ui.ddmanager.current = this; - if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); - - this.dragging = true; - - this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position - return true; - - - }, - convertPositionTo: function(d, pos) { - if(!pos) pos = this.position; - var mod = d == "absolute" ? 1 : -1; - return { - top: ( - pos.top // the calculated relative position - + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position - + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) - ), - left: ( - pos.left // the calculated relative position - + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position - + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) - ) - }; - }, - generatePosition: function(e) { - - var o = this.options; - var position = { - top: ( - e.pageY // The absolute mouse position - - this.offset.click.top // Click offset (relative to the element) - - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed - ), - left: ( - e.pageX // The absolute mouse position - - this.offset.click.left // Click offset (relative to the element) - - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed - ) - }; - - if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - if(this.containment) { - if(position.left < this.containment[0]) position.left = this.containment[0]; - if(position.top < this.containment[1]) position.top = this.containment[1]; - if(position.left > this.containment[2]) position.left = this.containment[2]; - if(position.top > this.containment[3]) position.top = this.containment[3]; - } - - if(o.grid) { - var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1]; - position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; - - var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0]; - position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; - } - - return position; - }, - mouseDrag: function(e) { - - - //Compute the helpers position - this.position = this.generatePosition(e); - this.positionAbs = this.convertPositionTo("absolute"); - - //Rearrange - for (var i = this.items.length - 1; i >= 0; i--) { - var intersection = this.intersectsWithEdge(this.items[i]); - if(!intersection) continue; - - if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself - && this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before - && !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked - && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true) - ) { - - this.direction = intersection == 1 ? "down" : "up"; - this.rearrange(e, this.items[i]); - this.propagate("change", e); //Call plugins and callbacks - break; - } - } - - //Post events to containers - this.contactContainers(e); - - //Call plugins and callbacks - this.propagate("sort", e); - - if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px'; - - //Interconnect with droppables - if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); - - return false; - - }, - mouseStop: function(e, noPropagation) { - - //If we are using droppables, inform the manager about the drop - if ($.ui.ddmanager && !this.options.dropBehaviour) - $.ui.ddmanager.drop(this, e); - - if(this.options.revert) { - var self = this; - var cur = self.currentItem.offset(); - - //Also animate the placeholder if we have one - if(self.placeholder) self.placeholder.animate({ opacity: 'hide' }, (parseInt(this.options.revert, 10) || 500)-50); - - $(this.helper).animate({ - left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), - top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) - }, parseInt(this.options.revert, 10) || 500, function() { - self.propagate("stop", e, null, noPropagation); - self.clear(e); - }); - } else { - this.propagate("stop", e, null, noPropagation); - this.clear(e, noPropagation); - } - - return false; - - }, - clear: function(e, noPropagation) { - - if(this.domPosition != this.currentItem.prev()[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed - if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element - this.propagate("remove", e, null, noPropagation); - for (var i = this.containers.length - 1; i >= 0; i--){ - if(contains(this.containers[i].element[0], this.currentItem[0])) { - this.containers[i].propagate("update", e, this, noPropagation); - this.containers[i].propagate("receive", e, this, noPropagation); - } - }; - }; - - //Post events to containers - for (var i = this.containers.length - 1; i >= 0; i--){ - this.containers[i].propagate("deactivate", e, this, noPropagation); - if(this.containers[i].containerCache.over) { - this.containers[i].propagate("out", e, this); - this.containers[i].containerCache.over = 0; - } - } - - this.dragging = false; - if(this.cancelHelperRemoval) return false; - $(this.currentItem).css('visibility', ''); - if(this.placeholder) this.placeholder.remove(); - this.helper.remove(); - - return true; - - }, - rearrange: function(e, i, a) { - a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem); - this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove - if(this.options.placeholder) this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder); - } -})); - -$.extend($.ui.sortable, { - getter: "serialize toArray", - defaults: { - tolerance: "guess", - distance: 0, - delay: 0, - cancel: ":input,button", - items: '> *', - zIndex: 1000, - dropOnEmpty: true, - appendTo: "parent" - } -}); - -/* - * Sortable Extensions - */ - -$.ui.plugin.add("sortable", "cursor", { - start: function(e, ui) { - var t = $('body'); - if (t.css("cursor")) ui.options._cursor = t.css("cursor"); - t.css("cursor", ui.options.cursor); - }, - stop: function(e, ui) { - if (ui.options._cursor) $('body').css("cursor", ui.options._cursor); - } -}); - -$.ui.plugin.add("sortable", "zIndex", { - start: function(e, ui) { - var t = ui.helper; - if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex"); - t.css('zIndex', ui.options.zIndex); - }, - stop: function(e, ui) { - if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex); - } -}); - -$.ui.plugin.add("sortable", "opacity", { - start: function(e, ui) { - var t = ui.helper; - if(t.css("opacity")) ui.options._opacity = t.css("opacity"); - t.css('opacity', ui.options.opacity); - }, - stop: function(e, ui) { - if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity); - } -}); - -$.ui.plugin.add("sortable", "scroll", { - start: function(e, ui) { - var o = ui.options; - var i = $(this).data("sortable"); - o.scrollSensitivity = o.scrollSensitivity || 20; - o.scrollSpeed = o.scrollSpeed || 20; - - i.overflowY = function(el) { - do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); - return $(document); - }(i.currentItem); - i.overflowX = function(el) { - do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode); - return $(document); - }(i.currentItem); - - if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset(); - if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset(); - - }, - sort: function(e, ui) { - - var o = ui.options; - var i = $(this).data("sortable"); - - if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') { - if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity) - i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed; - if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity) - i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed; - } else { - if(e.pageY - $(document).scrollTop() < o.scrollSensitivity) - $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity) - $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - } - - if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') { - if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity) - i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed; - if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity) - i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed; - } else { - if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity) - $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - } - - } -}); - -})(jQuery); diff --git a/wp-includes/js/jquery/ui.tabs.js b/wp-includes/js/jquery/ui.tabs.js index a675b4de78..339de6be5c 100644 --- a/wp-includes/js/jquery/ui.tabs.js +++ b/wp-includes/js/jquery/ui.tabs.js @@ -1,595 +1,2 @@ -/* - * jQuery UI Tabs - * - * Copyright (c) 2007, 2008 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * ui.core.js - * - * Revision: $Id: ui.tabs.js 5641 2008-05-20 02:53:23Z scott.gonzalez $ - */ -;(function($) { +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4(A){A.39("8.3",{38:4(){2.c.u+=".3";2.1e(1c)},37:4(B,C){5((/^7/).1Z(B)){2.16(C)}m{2.c[B]=C;2.1e()}},i:4(){f 2.$3.i},1E:4(B){f B.24&&B.24.13(/\\s/g,"23").13(/[^A-36-35-9\\-23:\\.]/g,"")||2.c.1Q+A.e(B)},8:4(C,B){f{c:2.c,34:C,1M:B}},1e:4(O){2.$h=A("1i:33(a[n])",2.k);2.$3=2.$h.1s(4(){f A("a",2)[0]});2.$b=A([]);6 P=2,D=2.c;2.$3.V(4(R,Q){5(Q.t&&Q.t.13("#","")){P.$b=P.$b.1b(Q.t)}m{5(A(Q).12("n")!="#"){A.e(Q,"n.3",Q.n);A.e(Q,"p.3",Q.n);6 T=P.1E(Q);Q.n="#"+T;6 S=A("#"+T);5(!S.i){S=A(D.1x).12("1f",T).l(D.18).32(P.$b[R-1]||P.k);S.e("1a.3",1c)}P.$b=P.$b.1b(S)}m{D.d.1U(R+1)}}});5(O){2.k.l(D.1w);2.$b.V(4(){6 Q=A(2);Q.l(D.18)});5(D.7===1p){5(1J.t){2.$3.V(4(S,Q){5(Q.t==1J.t){D.7=S;5(A.W.1g||A.W.31){6 R=A(1J.t),T=R.12("1f");R.12("1f","");1z(4(){R.12("1f",T)},30)}2Z(0,0);f o}})}m{5(D.Y){6 J=2Y(A.Y("8-3"+A.e(P.k)),10);5(J&&P.$3[J]){D.7=J}}m{5(P.$h.z("."+D.j).i){D.7=P.$h.Z(P.$h.z("."+D.j)[0])}}}}D.7=D.7===v||D.7!==1p?D.7:0;D.d=A.2X(D.d.2W(A.1s(2.$h.z("."+D.U),4(R,Q){f P.$h.Z(R)}))).1T();5(A.1r(D.7,D.d)!=-1){D.d.2V(A.1r(D.7,D.d),1)}2.$b.l(D.w);2.$h.q(D.j);5(D.7!==v){2.$b.r(D.7).1G().q(D.w);2.$h.r(D.7).l(D.j);6 K=4(){A(P.k).y("20",[P.8(P.$3[D.7],P.$b[D.7])],D.1G)};5(A.e(2.$3[D.7],"p.3")){2.p(D.7,K)}m{K()}}A(2U).15("2T",4(){P.$3.14(".3");P.$h=P.$3=P.$b=v})}2S(6 G=0,N;N=2.$h[G];G++){A(N)[A.1r(G,D.d)!=-1&&!A(N).11(D.j)?"l":"q"](D.U)}5(D.x===o){2.$3.1m("x.3")}6 C,I,B={"2R-2Q":0,1I:1},E="2P";5(D.X&&D.X.2O==2N){C=D.X[0]||B,I=D.X[1]||B}m{C=I=D.X||B}6 H={1q:"",2M:"",2L:""};5(!A.W.1g){H.1H=""}4 M(R,Q,S){Q.22(C,C.1I||E,4(){Q.l(D.w).1d(H);5(A.W.1g&&C.1H){Q[0].21.z=""}5(S){L(R,S,Q)}})}4 L(R,S,Q){5(I===B){S.1d("1q","1D")}S.22(I,I.1I||E,4(){S.q(D.w).1d(H);5(A.W.1g&&I.1H){S[0].21.z=""}A(P.k).y("20",[P.8(R,S[0])],D.1G)})}4 F(R,T,Q,S){T.l(D.j).2K().q(D.j);M(R,Q,S)}2.$3.14(".3").15(D.u,4(){6 T=A(2).2J("1i:r(0)"),Q=P.$b.z(":2I"),S=A(2.t);5((T.11(D.j)&&!D.1h)||T.11(D.U)||A(2).11(D.17)||A(P.k).y("2H",[P.8(2,S[0])],D.16)===o){2.1t();f o}P.c.7=P.$3.Z(2);5(D.1h){5(T.11(D.j)){P.c.7=v;T.q(D.j);P.$b.1F();M(2,Q);2.1t();f o}m{5(!Q.i){P.$b.1F();6 R=2;P.p(P.$3.Z(2),4(){T.l(D.j).l(D.1v);L(R,S)});2.1t();f o}}}5(D.Y){A.Y("8-3"+A.e(P.k),P.c.7,D.Y)}P.$b.1F();5(S.i){6 R=2;P.p(P.$3.Z(2),Q.i?4(){F(R,T,Q,S)}:4(){T.l(D.j);L(R,S)})}m{2G"1K 2F 2E: 2D 2C 2B."}5(A.W.1g){2.1t()}f o});5(!(/^1y/).1Z(D.u)){2.$3.15("1y.3",4(){f o})}},1b:4(E,D,C){5(C==1p){C=2.$3.i}6 G=2.c;6 I=A(G.1P.13(/#\\{n\\}/g,E).13(/#\\{1j\\}/g,D));I.e("1a.3",1c);6 H=E.2A("#")==0?E.13("#",""):2.1E(A("a:2z-2y",I)[0]);6 F=A("#"+H);5(!F.i){F=A(G.1x).12("1f",H).l(G.w).e("1a.3",1c)}F.l(G.18);5(C>=2.$h.i){I.1Y(2.k);F.1Y(2.k[0].2x)}m{I.1X(2.$h[C]);F.1X(2.$b[C])}G.d=A.1s(G.d,4(K,J){f K>=C?++K:K});2.1e();5(2.$3.i==1){I.l(G.j);F.q(G.w);6 B=A.e(2.$3[0],"p.3");5(B){2.p(C,B)}}2.k.y("2w",[2.8(2.$3[C],2.$b[C])],G.1b)},19:4(B){6 D=2.c,E=2.$h.r(B).19(),C=2.$b.r(B).19();5(E.11(D.j)&&2.$3.i>1){2.16(B+(B+1<2.$3.i?1:-1))}D.d=A.1s(A.1W(D.d,4(G,F){f G!=B}),4(G,F){f G>=B?--G:G});2.1e();2.k.y("2v",[2.8(E.1C("a")[0],C[0])],D.19)},1V:4(B){6 C=2.c;5(A.1r(B,C.d)==-1){f}6 D=2.$h.r(B).q(C.U);5(A.W.2u){D.1d("1q","2t-1D");1z(4(){D.1d("1q","1D")},0)}C.d=A.1W(C.d,4(F,E){f F!=B});2.k.y("2s",[2.8(2.$3[B],2.$b[B])],C.1V)},1S:4(C){6 B=2,D=2.c;5(C!=D.7){2.$h.r(C).l(D.U);D.d.1U(C);D.d.1T();2.k.y("2r",[2.8(2.$3[C],2.$b[C])],D.1S)}},16:4(B){5(2q B=="2p"){B=2.$3.Z(2.$3.z("[n$="+B+"]")[0])}2.$3.r(B).2o(2.c.u)},p:4(G,K){6 L=2,D=2.c,E=2.$3.r(G),J=E[0],H=K==1p||K===o,B=E.e("p.3");K=K||4(){};5(!B||!H&&A.e(J,"x.3")){K();f}6 M=4(N){6 O=A(N),P=O.1C("*:2n");f P.i&&P||O};6 C=4(){L.$3.z("."+D.17).q(D.17).V(4(){5(D.1l){M(2).2m().1o(M(2).e("1j.3"))}});L.1n=v};5(D.1l){6 I=M(J).1o();M(J).2l("<1B>").1C("1B").e("1j.3",I).1o(D.1l)}6 F=A.1L({},D.1k,{1R:B,1A:4(O,N){A(J.t).1o(O);C();5(D.x){A.e(J,"x.3",1c)}A(L.k).y("2k",[L.8(L.$3[G],L.$b[G])],D.p);D.1k.1A&&D.1k.1A(O,N);K()}});5(2.1n){2.1n.2j();C()}E.l(D.17);1z(4(){L.1n=A.2i(F)},0)},1R:4(C,B){2.$3.r(C).1m("x.3").e("p.3",B)},1a:4(){6 B=2.c;2.k.14(".3").q(B.1w).1m("3");2.$3.V(4(){6 C=A.e(2,"n.3");5(C){2.n=C}6 D=A(2).14(".3");A.V(["n","p","x"],4(E,F){D.1m(F+".3")})});2.$h.1b(2.$b).V(4(){5(A.e(2,"1a.3")){A(2).19()}m{A(2).q([B.j,B.1v,B.U,B.18,B.w].2h(" "))}})}});A.8.3.2g={1h:o,u:"1y",d:[],Y:v,1l:"2fe;",x:o,1Q:"8-3-",1k:{},X:v,1P:\'<1i><1O>#{1j}\',1x:"<1N>",1w:"8-3-2d",j:"8-3-7",1v:"8-3-1h",U:"8-3-d",18:"8-3-1M",w:"8-3-2c",17:"8-3-2b"};A.8.3.2a="i";A.1L(A.8.3.29,{1u:v,28:4(C,F){F=F||o;6 B=2,E=2.c.7;4 G(){B.1u=27(4(){E=++E - if (o.selected === undefined) { - if (location.hash) { - this.$tabs.each(function(i, a) { - if (a.hash == location.hash) { - o.selected = i; - // prevent page scroll to fragment - if ($.browser.msie || $.browser.opera) { // && !o.remote - var $toShow = $(location.hash), toShowId = $toShow.attr('id'); - $toShow.attr('id', ''); - setTimeout(function() { - $toShow.attr('id', toShowId); // restore id - }, 500); - } - scrollTo(0, 0); - return false; // break - } - }); - } - else if (o.cookie) { - var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10); - if (index && self.$tabs[index]) - o.selected = index; - } - else if (self.$lis.filter('.' + o.selectedClass).length) - o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] ); - } - o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default - - // Take disabling tabs via class attribute from HTML - // into account and update option properly. - // A selected tab cannot become disabled. - o.disabled = $.unique(o.disabled.concat( - $.map(this.$lis.filter('.' + o.disabledClass), - function(n, i) { return self.$lis.index(n); } ) - )).sort(); - if ($.inArray(o.selected, o.disabled) != -1) - o.disabled.splice($.inArray(o.selected, o.disabled), 1); - - // highlight selected tab - this.$panels.addClass(o.hideClass); - this.$lis.removeClass(o.selectedClass); - if (o.selected !== null) { - this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before - this.$lis.eq(o.selected).addClass(o.selectedClass); - - // seems to be expected behavior that the show callback is fired - var onShow = function() { - $(self.element).triggerHandler('tabsshow', - [self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show); - }; - - // load if remote tab - if ($.data(this.$tabs[o.selected], 'load.tabs')) - this.load(o.selected, onShow); - // just trigger show event - else - onShow(); - - } - - // clean up to avoid memory leaks in certain versions of IE 6 - $(window).bind('unload', function() { - self.$tabs.unbind('.tabs'); - self.$lis = self.$tabs = self.$panels = null; - }); - - } - - // disable tabs - for (var i = 0, li; li = this.$lis[i]; i++) - $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass); - - // reset cache if switching from cached to not cached - if (o.cache === false) - this.$tabs.removeData('cache.tabs'); - - // set up animations - var hideFx, showFx, baseFx = { 'min-width': 0, duration: 1 }, baseDuration = 'normal'; - if (o.fx && o.fx.constructor == Array) - hideFx = o.fx[0] || baseFx, showFx = o.fx[1] || baseFx; - else - hideFx = showFx = o.fx || baseFx; - - // reset some styles to maintain print style sheets etc. - var resetCSS = { display: '', overflow: '', height: '' }; - if (!$.browser.msie) // not in IE to prevent ClearType font issue - resetCSS.opacity = ''; - - // Hide a tab, animation prevents browser scrolling to fragment, - // $show is optional. - function hideTab(clicked, $hide, $show) { - $hide.animate(hideFx, hideFx.duration || baseDuration, function() { // - $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc. - if ($.browser.msie && hideFx.opacity) - $hide[0].style.filter = ''; - if ($show) - showTab(clicked, $show, $hide); - }); - } - - // Show a tab, animation prevents browser scrolling to fragment, - // $hide is optional. - function showTab(clicked, $show, $hide) { - if (showFx === baseFx) - $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels - $show.animate(showFx, showFx.duration || baseDuration, function() { - $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc. - if ($.browser.msie && showFx.opacity) - $show[0].style.filter = ''; - - // callback - $(self.element).triggerHandler('tabsshow', - [self.ui(clicked, $show[0])], o.show); - - }); - } - - // switch a tab - function switchTab(clicked, $li, $hide, $show) { - /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click - $.ajaxHistory.update(clicked.hash); - }*/ - $li.addClass(o.selectedClass) - .siblings().removeClass(o.selectedClass); - hideTab(clicked, $hide, $show); - } - - // attach tab event handler, unbind to avoid duplicates from former tabifying... - this.$tabs.unbind('.tabs').bind(o.event, function() { - - //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click - var $li = $(this).parents('li:eq(0)'), - $hide = self.$panels.filter(':visible'), - $show = $(this.hash); - - // If tab is already selected and not unselectable or tab disabled or - // or is already loading or click callback returns false stop here. - // Check if click handler returns false last so that it is not executed - // for a disabled or loading tab! - if (($li.hasClass(o.selectedClass) && !o.unselect) - || $li.hasClass(o.disabledClass) - || $(this).hasClass(o.loadingClass) - || $(self.element).triggerHandler('tabsselect', [self.ui(this, $show[0])], o.select) === false - ) { - this.blur(); - return false; - } - - self.options.selected = self.$tabs.index(this); - - // if tab may be closed - if (o.unselect) { - if ($li.hasClass(o.selectedClass)) { - self.options.selected = null; - $li.removeClass(o.selectedClass); - self.$panels.stop(); - hideTab(this, $hide); - this.blur(); - return false; - } else if (!$hide.length) { - self.$panels.stop(); - var a = this; - self.load(self.$tabs.index(this), function() { - $li.addClass(o.selectedClass).addClass(o.unselectClass); - showTab(a, $show); - }); - this.blur(); - return false; - } - } - - if (o.cookie) - $.cookie('ui-tabs' + $.data(self.element), self.options.selected, o.cookie); - - // stop possibly running animations - self.$panels.stop(); - - // show new tab - if ($show.length) { - - // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled - /*if ($.browser.msie && o.bookmarkable) { - var showId = this.hash.replace('#', ''); - $show.attr('id', ''); - setTimeout(function() { - $show.attr('id', showId); // restore id - }, 0); - }*/ - - var a = this; - self.load(self.$tabs.index(this), $hide.length ? - function() { - switchTab(a, $li, $hide, $show); - } : - function() { - $li.addClass(o.selectedClass); - showTab(a, $show); - } - ); - - // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash - /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0; - var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0; - setTimeout(function() { - scrollTo(scrollX, scrollY); - }, 0);*/ - - } else - throw 'jQuery UI Tabs: Mismatching fragment identifier.'; - - // Prevent IE from keeping other link focussed when using the back button - // and remove dotted border from clicked link. This is controlled in modern - // browsers via CSS, also blur removes focus from address bar in Firefox - // which can become a usability and annoying problem with tabsRotate. - if ($.browser.msie) - this.blur(); - - //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE - return false; - - }); - - // disable click if event is configured to something else - if (!(/^click/).test(o.event)) - this.$tabs.bind('click.tabs', function() { return false; }); - - }, - add: function(url, label, index) { - if (index == undefined) - index = this.$tabs.length; // append by default - - var o = this.options; - var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)); - $li.data('destroy.tabs', true); - - var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] ); - - // try to find an existing element before creating a new one - var $panel = $('#' + id); - if (!$panel.length) { - $panel = $(o.panelTemplate).attr('id', id) - .addClass(o.hideClass) - .data('destroy.tabs', true); - } - $panel.addClass(o.panelClass); - if (index >= this.$lis.length) { - $li.appendTo(this.element); - $panel.appendTo(this.element[0].parentNode); - } else { - $li.insertBefore(this.$lis[index]); - $panel.insertBefore(this.$panels[index]); - } - - o.disabled = $.map(o.disabled, - function(n, i) { return n >= index ? ++n : n }); - - this.tabify(); - - if (this.$tabs.length == 1) { - $li.addClass(o.selectedClass); - $panel.removeClass(o.hideClass); - var href = $.data(this.$tabs[0], 'load.tabs'); - if (href) - this.load(index, href); - } - - // callback - this.element.triggerHandler('tabsadd', - [this.ui(this.$tabs[index], this.$panels[index])], o.add - ); - }, - remove: function(index) { - var o = this.options, $li = this.$lis.eq(index).remove(), - $panel = this.$panels.eq(index).remove(); - - // If selected tab was removed focus tab to the right or - // in case the last tab was removed the tab to the left. - if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1) - this.select(index + (index + 1 < this.$tabs.length ? 1 : -1)); - - o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }), - function(n, i) { return n >= index ? --n : n }); - - this.tabify(); - - // callback - this.element.triggerHandler('tabsremove', - [this.ui($li.find('a')[0], $panel[0])], o.remove - ); - }, - enable: function(index) { - var o = this.options; - if ($.inArray(index, o.disabled) == -1) - return; - - var $li = this.$lis.eq(index).removeClass(o.disabledClass); - if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2... - $li.css('display', 'inline-block'); - setTimeout(function() { - $li.css('display', 'block'); - }, 0); - } - - o.disabled = $.grep(o.disabled, function(n, i) { return n != index; }); - - // callback - this.element.triggerHandler('tabsenable', - [this.ui(this.$tabs[index], this.$panels[index])], o.enable - ); - - }, - disable: function(index) { - var self = this, o = this.options; - if (index != o.selected) { // cannot disable already selected tab - this.$lis.eq(index).addClass(o.disabledClass); - - o.disabled.push(index); - o.disabled.sort(); - - // callback - this.element.triggerHandler('tabsdisable', - [this.ui(this.$tabs[index], this.$panels[index])], o.disable - ); - } - }, - select: function(index) { - if (typeof index == 'string') - index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] ); - this.$tabs.eq(index).trigger(this.options.event); - }, - load: function(index, callback) { // callback is for internal usage only - - var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0], - bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs'); - - callback = callback || function() {}; - - // no remote or from cache - just finish with callback - if (!url || !bypassCache && $.data(a, 'cache.tabs')) { - callback(); - return; - } - - // load remote from here on - - var inner = function(parent) { - var $parent = $(parent), $inner = $parent.find('*:last'); - return $inner.length && $inner || $parent; - }; - var cleanup = function() { - self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass) - .each(function() { - if (o.spinner) - inner(this).parent().html(inner(this).data('label.tabs')); - }); - self.xhr = null; - }; - - if (o.spinner) { - var label = inner(a).html(); - inner(a).wrapInner('') - .find('em').data('label.tabs', label).html(o.spinner); - } - - var ajaxOptions = $.extend({}, o.ajaxOptions, { - url: url, - success: function(r, s) { - $(a.hash).html(r); - cleanup(); - - if (o.cache) - $.data(a, 'cache.tabs', true); // if loaded once do not load them again - - // callbacks - $(self.element).triggerHandler('tabsload', - [self.ui(self.$tabs[index], self.$panels[index])], o.load - ); - o.ajaxOptions.success && o.ajaxOptions.success(r, s); - - // This callback is required because the switch has to take - // place after loading has completed. Call last in order to - // fire load before show callback... - callback(); - } - }); - if (this.xhr) { - // terminate pending requests from other tabs and restore tab label - this.xhr.abort(); - cleanup(); - } - $a.addClass(o.loadingClass); - setTimeout(function() { // timeout is again required in IE, "wait" for id being restored - self.xhr = $.ajax(ajaxOptions); - }, 0); - - }, - url: function(index, url) { - this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url); - }, - destroy: function() { - var o = this.options; - this.element.unbind('.tabs') - .removeClass(o.navClass).removeData('tabs'); - this.$tabs.each(function() { - var href = $.data(this, 'href.tabs'); - if (href) - this.href = href; - var $this = $(this).unbind('.tabs'); - $.each(['href', 'load', 'cache'], function(i, prefix) { - $this.removeData(prefix + '.tabs'); - }); - }); - this.$lis.add(this.$panels).each(function() { - if ($.data(this, 'destroy.tabs')) - $(this).remove(); - else - $(this).removeClass([o.selectedClass, o.unselectClass, - o.disabledClass, o.panelClass, o.hideClass].join(' ')); - }); - } -}); - -$.ui.tabs.defaults = { - // basic setup - unselect: false, - event: 'click', - disabled: [], - cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } - // TODO history: false, - - // Ajax - spinner: 'Loading…', - cache: false, - idPrefix: 'ui-tabs-', - ajaxOptions: {}, - - // animations - fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } - - // templates - tabTemplate: '
  • #{label}
  • ', - panelTemplate: '
    ', - - // CSS classes - navClass: 'ui-tabs-nav', - selectedClass: 'ui-tabs-selected', - unselectClass: 'ui-tabs-unselect', - disabledClass: 'ui-tabs-disabled', - panelClass: 'ui-tabs-panel', - hideClass: 'ui-tabs-hide', - loadingClass: 'ui-tabs-loading' -}; - -$.ui.tabs.getter = "length"; - -/* - * Tabs Extensions - */ - -/* - * Rotate - */ -$.extend($.ui.tabs.prototype, { - rotation: null, - rotate: function(ms, continuing) { - - continuing = continuing || false; - - var self = this, t = this.options.selected; - - function start() { - self.rotation = setInterval(function() { - t = ++t < self.$tabs.length ? t : 0; - self.select(t); - }, ms); - } - - function stop(e) { - if (!e || e.clientX) { // only in case of a true click - clearInterval(self.rotation); - } - } - - // start interval - if (ms) { - start(); - if (!continuing) - this.$tabs.bind(this.options.event, stop); - else - this.$tabs.bind(this.options.event, function() { - stop(); - t = self.options.selected; - start(); - }); - } - // stop interval - else { - stop(); - this.$tabs.unbind(this.options.event, stop); - } - } -}); - -})(jQuery); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 02e686fc87..9258a2dadf 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -98,9 +98,9 @@ function wp_default_scripts( &$scripts ) { 'deleted' => __('Deleted'), ) ); - $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.5b4' ); - $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.5b4' ); - $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.5b4' ); + $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.5' ); + $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.5' ); + $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.5' ); if ( is_admin() ) { $scripts->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' );