');
// Enable or leave the keys
jq(selector_nav_wrap).each(function(){
if(jq('li:last',this).width()+jq('li:last',this).offset().left-jq('li:first',this).offset().left>jq('.item-list-tabs').width()){
// enable the buttons
jq('button',this).css('display','inline');
jq('button.prev',this).css('display','none');
}
});
});
jq(selector_nav_wrap).on('click', '.next', function(){
//Remove the exist selector
//Set the width to the widest of either
var $div =jq('div',this.parentNode)
,maxoffset = jq('li:last',$div).width()+jq('li:last',$div).offset().left - jq('li:first',$div).offset().left - $div.width()
,offset = Math.abs(parseInt( jq('ul',$div).css('marginLeft') ))
,diff = $div.width();
if( offset >= maxoffset )
return;
else if ( offset + diff >= maxoffset ){
diff = maxoffset - offset + 20;
// Hide this
jq(this).css('display','none');
}
// enable the other
jq('.prev', this.parentNode).css('display','block');
jq("ul", jq(this).parent() ).animate({
marginLeft: "-=" + diff
},400, 'swing');
});
jq(selector_nav_wrap).on('click', '.prev', function(){
var offset = Math.abs(parseInt( jq('ul',this.parentNode).css('marginLeft') ));
var diff = jq('div',this.parentNode).width();
if( offset <= 0 )
return;
else if ( offset - diff <= 0 ){
jq(this).css('display','none');
diff = offset;
}
jq('.next', this.parentNode).css('display','block');
jq("ul",jq(this).parent()).animate({
marginLeft: '+='+diff
},400, 'swing');
});
}
/* Scroll a lot of menu items in BuddyPress sub nav menu ------end*/
jq('body').on('click', '.allow-dirrect-links', function(){
window.location = jq(this).attr('data-url');
});
function openWindow( url ){
window.open(url, '_blank');
window.focus();
}
//add class to plugins pages
jq('#content').not('.span8').addClass('span8 added-by-plugins');
jq('#container #container').removeAttr('id');
});
/* Setup activity scope and filter based on the current cookie settings. */
function bp_init_activity() {
/* Reset the page */
jq.cookie( 'bp-activity-oldestpage', 1, {
path: '/'
} );
if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length )
jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
/* Activity Tab Set */
if ( null != jq.cookie('bp-activity-scope') && jq('div.activity-type-tabs').length ) {
jq('div.activity-type-tabs li').each( function() {
jq(this).removeClass('selected');
});
jq('li#activity-' + jq.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected');
}
}
/* Setup object scope and filter based on the current cookie settings for the object. */
function bp_init_objects(objects) {
jq(objects).each( function(i) {
if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('li#' + objects[i] + '-order-select select').length ){
jq('li#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
}
//setup displaymode select position
if ( null != jq.cookie('bp-' + objects[i] + '-displaymode') && jq('li#' + objects[i] + '-displaymode-select select').length ){
jq('li#' + objects[i] + '-displaymode-select select option[value="' + jq.cookie('bp-' + objects[i] + '-displaymode') + '"]').prop( 'selected', true );
}
if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
jq('div.item-list-tabs li').removeClass('selected');
var set_seleted_class_object = jq('div.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current')
if(set_seleted_class_object.size() > 0){
set_seleted_class_object.addClass('selected');
} else {
jq('div.item-list-tabs li#' + objects[i] + '-all, div.item-list-tabs#object-nav li.current').addClass('selected');
}
}
});
}
/* Filter the current content list (groups/members/blogs/topics) */
function bp_filter_request( object, filter, scope, target, search_terms, page, extras ) {
if ( 'activity' == object )
return false;
if ( jq.query.get('s') && !search_terms )
search_terms = jq.query.get('s');
if ( null == scope )
scope = 'all';
/* Save the settings we want to remain persistent to a cookie */
jq.cookie( 'bp-' + object + '-scope', scope, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-filter', filter, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-extras', extras, {
path: '/'
} );
// console.log(object, filter, scope, target, search_terms, page, extras)
/* Set the correct selected nav and filter */
jq('div.item-list-tabs li').removeClass('selected');
var current_tab = jq('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current');
if(current_tab.size() > 0){
current_tab.addClass('selected');
} else {
jq('div.item-list-tabs li#' + object + '-all').addClass('selected');
}
jq('div.item-list-tabs li.selected').addClass('loading');
jq('div.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
if ( 'friends' == object )
object = 'members';
if ( bp_ajax_request )
bp_ajax_request.abort();
bp_ajax_request = jq.post( ajaxurl, {
action: object + '_filter',
'cookie': encodeURIComponent(document.cookie),
'object': object,
'filter': filter,
'search_terms': search_terms,
'scope': scope,
'page': page,
'extras': extras
},
function(response)
{
jq(target).fadeOut( 100, function() {
jq(this).html(response);
jq(this).fadeIn(100);
});
jq('div.item-list-tabs li.loading').removeClass('loading').addClass('selected');
});
}
/* Displaymode the current content list or grid (groups/members/group members/member frends) */
function bp_displaymode_request( object, displaymode, scope, target, search_terms, page, extras ) {
if ( 'activity' == object )
return false;
if ( jq.query.get('s') && !search_terms )
search_terms = jq.query.get('s');
if ( null == scope )
scope = 'all';
/* Save the settings we want to remain persistent to a cookie */
jq.cookie( 'bp-' + object + '-scope', scope, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-displaymode', displaymode, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-extras', extras, {
path: '/'
} );
/* Set the correct selected nav and displymode */
jq('div.item-list-tabs li').removeClass('selected');
jq('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
jq('div.item-list-tabs li.selected').addClass('loading');
jq('div.item-list-tabs select option[value="' + displaymode + '"]').prop( 'selected', true );
if ( 'friends' == object )
object = 'members';
if ( bp_ajax_request )
bp_ajax_request.abort();
bp_ajax_request = jq.post( ajaxurl, {
action: object + '_displaymode',
'cookie': encodeURIComponent(document.cookie),
'object': object,
'displaymode': displaymode,
'search_terms': search_terms,
'scope': scope,
'page': page,
'extras': extras
},
function(response, textStatus, jqXHR)
{
jq(target).fadeOut( 100, function() {
jq(this).html(response);
jq(this).fadeIn(100);
});
jq('div.item-list-tabs li.selected').removeClass('loading').addClass('selected');
});
}
/* Activity Loop Requesting */
function bp_activity_request(scope, filter) {
/* Save the type and filter to a session cookie */
jq.cookie( 'bp-activity-scope', scope, {
path: '/'
} );
jq.cookie( 'bp-activity-filter', filter, {
path: '/'
} );
jq.cookie( 'bp-activity-oldestpage', 1, {
path: '/'
} );
/* Remove selected and loading classes from tabs */
jq('div.item-list-tabs li').each( function() {
jq(this).removeClass('selected loading');
});
/* Set the correct selected nav and filter */
jq('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
jq('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
/* Reload the activity stream based on the selection */
jq('.widget_bp_activity_widget h2 span.ajax-loader').show();
if ( bp_ajax_request )
bp_ajax_request.abort();
bp_ajax_request = jq.post( ajaxurl, {
action: 'activity_widget_filter',
'cookie': encodeURIComponent(document.cookie),
'_wpnonce_activity_filter': jq("input#_wpnonce_activity_filter").val(),
'scope': scope,
'filter': filter
},
function(response)
{
jq('.widget_bp_activity_widget h2 span.ajax-loader').hide();
jq('div.activity').fadeOut( 100, function() {
jq(this).html(response.contents);
jq(this).fadeIn(100);
/* Selectively hide comments */
bp_dtheme_hide_comments();
});
/* Update the feed link */
if ( null != response.feed_url )
jq('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url);
jq('div.item-list-tabs li.selected').removeClass('loading');
}, 'json' );
}
/* Hide long lists of activity comments, only show the latest five root comments. */
function bp_dtheme_hide_comments() {
var comments_divs = jq('div.activity-comments');
if ( !comments_divs.length )
return false;
comments_divs.each( function() {
if ( jq(this).children('ul').children('li').length < 5 ) return;
var comments_div = jq(this);
var parent_li = comments_div.parents('ul#activity-stream > li');
var comment_lis = jq(this).children('ul').children('li');
var comment_count = ' ';
if ( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )
var comment_count = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();
comment_lis.each( function(i) {
/* Show the latest 5 root comments */
if ( i < comment_lis.length - 5 ) {
jq(this).addClass('hidden');
jq(this).toggle();
if ( !i )
jq(this).before( '
' + BP_DTheme.show_all + ' ' + comment_count + ' ' + BP_DTheme.comments + '' );
}
});
});
}
/* Helper Functions */
function checkAll() {
var checkboxes = document.getElementsByTagName("input");
for(var i=0; i
=1.3?0:1
};
k.window=function(a){
return d(window)._scrollable()
};
d.fn._scrollable=function(){
return this.map(function(){
var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;
if(!i)return a;
var e=(a.contentWindow||a).document||a.ownerDocument||a;
return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement
})
};
d.fn.scrollTo=function(n,j,b){
if(typeof j=='object'){
b=j;
j=0
}
if(typeof b=='function')b={
onAfter:b
};
if(n=='max')n=9e9;
b=d.extend({},k.defaults,b);
j=j||b.speed||b.duration;
b.queue=b.queue&&b.axis.length>1;
if(b.queue)j/=2;
b.offset=p(b.offset);
b.over=p(b.over);
return this._scrollable().each(function(){
var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');
switch(typeof f){
case'number':case'string':
if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){
f=p(f);
break
}
f=d(f,this);
case'object':
if(f.is||f.style)s=(f=d(f)).offset()
}
d.each(b.axis.split(''),function(a,i){
var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);
if(s){
g[c]=s[h]+(u?0:l-r.offset()[h]);
if(b.margin){
g[c]-=parseInt(f.css('margin'+e))||0;
g[c]-=parseInt(f.css('border'+e+'Width'))||0
}
g[c]+=b.offset[h]||0;
if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]
}else{
var o=f[h];
g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o
}
if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);
if(!a&&b.queue){
if(l!=g[c])t(b.onAfterFirst);
delete g[c]
}
});
t(b.onAfter);
function t(a){
r.animate(g,j,b.easing,a&&function(){
a.call(this,n,b)
})
}
}).end()
};
k.max=function(a,i){
var e=i=='x'?'Width':'Height',h='scroll'+e;
if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();
var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;
return Math.max(l[h],m[h])-Math.min(l[c],m[c])
};
function p(a){
return typeof a=='object'?a:{
top:a,
left:a
}
}
})(jQuery);
/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */
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(g35?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
}('M 6(A){4 $11=A.11||\'&\';4 $V=A.V===r?r:j;4 $1p=A.1p===r?\'\':\'[]\';4 $13=A.13===r?r:j;4 $D=$13?A.D===j?"#":"?":"";4 $15=A.15===r?r:j;v.1o=M 6(){4 f=6(o,t){8 o!=1v&&o!==x&&(!!t?o.1t==t:j)};4 14=6(1m){4 m,1l=/\\[([^[]*)\\]/g,T=/^([^[]+)(\\[.*\\])?$/.1r(1m),k=T[1],e=[];19(m=1l.1r(T[2]))e.u(m[1]);8[k,e]};4 w=6(3,e,7){4 o,y=e.1b();b(I 3!=\'X\')3=x;b(y===""){b(!3)3=[];b(f(3,L)){3.u(e.h==0?7:w(x,e.z(0),7))}n b(f(3,1a)){4 i=0;19(3[i++]!=x);3[--i]=e.h==0?7:w(3[i],e.z(0),7)}n{3=[];3.u(e.h==0?7:w(x,e.z(0),7))}}n b(y&&y.T(/^\\s*[0-9]+\\s*$/)){4 H=1c(y,10);b(!3)3=[];3[H]=e.h==0?7:w(3[H],e.z(0),7)}n b(y){4 H=y.B(/^\\s*|\\s*$/g,"");b(!3)3={};b(f(3,L)){4 18={};1w(4 i=0;i<3.h;++i){18[i]=3[i]}3=18}3[H]=e.h==0?7:w(3[H],e.z(0),7)}n{8 7}8 3};4 C=6(a){4 p=d;p.l={};b(a.C){v.J(a.Z(),6(5,c){p.O(5,c)})}n{v.J(1u,6(){4 q=""+d;q=q.B(/^[?#]/,\'\');q=q.B(/[;&]$/,\'\');b($V)q=q.B(/[+]/g,\' \');v.J(q.Y(/[&;]/),6(){4 5=1e(d.Y(\'=\')[0]||"");4 c=1e(d.Y(\'=\')[1]||"");b(!5)8;b($15){b(/^[+-]?[0-9]+\\.[0-9]*$/.1d(c))c=1A(c);n b(/^[+-]?[0-9]+$/.1d(c))c=1c(c,10)}c=(!c&&c!==0)?j:c;b(c!==r&&c!==j&&I c!=\'1g\')c=c;p.O(5,c)})})}8 p};C.1H={C:j,1G:6(5,1f){4 7=d.Z(5);8 f(7,1f)},1h:6(5){b(!f(5))8 d.l;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];19(3!=x&&e.h!=0){3=3[e.1b()]}8 I 3==\'1g\'?3:3||""},Z:6(5){4 3=d.1h(5);b(f(3,1a))8 v.1E(j,{},3);n b(f(3,L))8 3.z(0);8 3},O:6(5,c){4 7=!f(c)?x:c;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];d.l[k]=w(3,e.z(0),7);8 d},w:6(5,c){8 d.N().O(5,c)},1s:6(5){8 d.O(5,x).17()},1z:6(5){8 d.N().1s(5)},1j:6(){4 p=d;v.J(p.l,6(5,7){1y p.l[5]});8 p},1F:6(Q){4 D=Q.B(/^.*?[#](.+?)(?:\\?.+)?$/,"$1");4 S=Q.B(/^.*?[?](.+?)(?:#.+)?$/,"$1");8 M C(Q.h==S.h?\'\':S,Q.h==D.h?\'\':D)},1x:6(){8 d.N().1j()},N:6(){8 M C(d)},17:6(){6 F(G){4 R=I G=="X"?f(G,L)?[]:{}:G;b(I G==\'X\'){6 1k(o,5,7){b(f(o,L))o.u(7);n o[5]=7}v.J(G,6(5,7){b(!f(7))8 j;1k(R,5,F(7))})}8 R}d.l=F(d.l);8 d},1B:6(){8 d.N().17()},1D:6(){4 i=0,U=[],W=[],p=d;4 16=6(E){E=E+"";b($V)E=E.B(/ /g,"+");8 1C(E)};4 1n=6(1i,5,7){b(!f(7)||7===r)8;4 o=[16(5)];b(7!==j){o.u("=");o.u(16(7))}1i.u(o.P(""))};4 F=6(R,k){4 12=6(5){8!k||k==""?[5].P(""):[k,"[",5,"]"].P("")};v.J(R,6(5,7){b(I 7==\'X\')F(7,12(5));n 1n(W,12(5),7)})};F(d.l);b(W.h>0)U.u($D);U.u(W.P($11));8 U.P("")}};8 M C(1q.S,1q.D)}}(v.1o||{});',62,106,'|||target|var|key|function|value|return|||if|val|this|tokens|is||length||true|base|keys||else||self||false|||push|jQuery|set|null|token|slice|settings|replace|queryObject|hash|str|build|orig|index|typeof|each|parsed|Array|new|copy|SET|join|url|obj|search|match|queryString|spaces|chunks|object|split|get||separator|newKey|prefix|parse|numbers|encode|COMPACT|temp|while|Object|shift|parseInt|test|decodeURIComponent|type|number|GET|arr|EMPTY|add|rx|path|addFields|query|suffix|location|exec|REMOVE|constructor|arguments|undefined|for|empty|delete|remove|parseFloat|compact|encodeURIComponent|toString|extend|load|has|prototype'.split('|'),0,{}))
var $ = jQuery;//fix for some plugins