Skip to:
Content
Pages
Categories
Search
Top
Bottom

Issue with /buddypress/bp-themes/bp-default/_inc/global.js


  • kwerri
    Participant

    @kwerri

    I’m not sure if this has been reported already, but I couldn’t find anything on this when I searched the forums.

    In the file above, there’s this code:

    jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});

    Unfortunately, it looks like this code is not consistent with what is available on http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js. This has been causing me problems on various pages, e.g. I cannot navigate to pages on my forums, I cannot see the ‘new post’ form for topics, my navigation menus on the front page only drop down once.

    I had to download the js code from the gsgd.co.uk link and minify it before these problems were fixed.

    So – no problems really, but just something that the Buddypress team might want to be aware of.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Paul Wong-Gibbs
    Keymaster

    @djpaul

    What, exactly, isn’t consistent or doesn’t work? Were you able to pinpoint? I updated it from that source for BP 1.5 (I think), and minimised it without edits.


    kwerri
    Participant

    @kwerri

    Hi Paul,

    Here is the code that I got after minifying from the gsgd.co.uk site:

    jQuery.easing=jQuery.easing;jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){returnjQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){returnc*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)returnc/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){returnc*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){returnc*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)returnc/2*t*t*t+b;returnc/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){returnc*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)returnc/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){returnc*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){returnc*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)returnc/2*t*t*t*t*t+b;returnc/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){returnc*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)returnb;if(t==d)returnb+c;if((t/=d/2)<1)returnc/2*Math.pow(2,10*(t-1))+b;returnc/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){returnc*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;returnc/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){vars=1.70158;varp=0;vara=c;if(t==0)returnb;if((t/=d)==1)returnb+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;vars=p/4;}elsevars=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){vars=1.70158;varp=0;vara=c;if(t==0)returnb;if((t/=d)==1)returnb+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;vars=p/4;}elsevars=p/(2*Math.PI)*Math.asin(c/a);returna*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){vars=1.70158;varp=0;vara=c;if(t==0)returnb;if((t/=d/2)==2)returnb+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;vars=p/4;}elsevars=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;returna*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;returnc*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;returnc*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)returnc/2*(t*t*(((s*=(1.525))+1)*t-s))+b;returnc/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){returnc-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){returnc*(7.5625*t*t)+b;}elseif(t<(2/2.75)){returnc*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}elseif(t<(2.5/2.75)){returnc*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{returnc*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)returnjQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;returnjQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});

    Before I replaced the code in global.js with this minified code above, I was getting a script error on this specific line:

    return jQuery.easing[jQuery.easing.def](e,f,a,h,g)

    The script error is:

    Object doesn't support property or method 'undefined'
    global.js, line 1263 character 115

    kwerri
    Participant

    @kwerri

    Looking at this further, it looks like the problem is not with the global.js file after all.

    It seems that the jQuery.easing object needs to be set up so that it has various ‘easing’ functions (like easeInQuad, easeOutQuad) as member functions. Unfortunately, at the time I click the ‘New Topic’ button, these functions are not assigned to the jQuery easing object and it looks like this causes the click to fail.

    I wish I knew why the jQuery object was not properly set up; I may have to ask elsewhere to find out, but I’ll post back with what I find out (so others can benefit).


    kwerri
    Participant

    @kwerri

    I’ve moved the ‘easing’ plugin code to the document.ready statement block, and that seems to have solved the problem for now. I’m pretty sure that there must be a better fix for this – the jQuery.easing object is properly set up when the page is loaded, but the moment I click on the new topic button or pagination links, it looks like the work to set it up is undone.

    Anyhow, this works for me for now, so unless someone else comes up with something better, I’ll stick with it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with /buddypress/bp-themes/bp-default/_inc/global.js’ is closed to new replies.
Skip to toolbar