").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
jQuery.noConflict();
;
/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("
",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);;
var wpFollowButton;
(function($) {
var cookies = document.cookie.split( /;\s*/ ), cookie = false;
for ( i = 0; i < cookies.length; i++ ) {
if ( cookies[i].match( /^wp_api=/ ) ) {
cookies = cookies[i].split( '=' );
cookie = cookies[1];
break;
}
}
wpFollowButton = {
enable: function() {
$( 'a.wpcom-follow, a.wpcom-following' ).click( function( e ) {
e.preventDefault();
var link = $( this );
var blog_id = link.data('id');
var blog_url = link.data('url');
var is_following = link.hasClass( 'wpcom-following' );
if ( blog_id ) {
var f_id = blog_id;
} else {
var ln_classes = link.attr( 'class' ).split( ' ' );
for ( i=0; i < ln_classes.length; i++ ) {
if ( 0 == ln_classes[i].indexOf('f-') ) {
var f_id = ln_classes[i].slice( 2, ln_classes[i].length );
}
}
}
if ( is_following ) {
var action = 'ab_unsubscribe_from_blog';
} else {
var action = 'ab_subscribe_to_blog';
}
var elem = $( 'a.f-' + f_id );
if ( is_following ) {
elem.fadeOut( 'fast', function() {
elem.removeClass( 'wpcom-following' ).addClass( 'wpcom-follow' ).text( 'Follow' );
elem.fadeIn( 'fast' );
})
} else {
elem.fadeOut( 'fast', function() {
elem.addClass( 'wpcom-following' ).removeClass( 'wpcom-follow' ).text( 'Following' );
elem.fadeIn( 'fast' );
})
}
var href = link.attr( 'href' );
var params = href.split( '\?' );
var domain = params[0];
var flds = 'undefined' != typeof params[1] ? params[1].split( '&' ) : [];
for ( var i = 0; i < flds.length; i++ ) {
var pos = flds[i].indexOf( '=' );
if ( -1 == pos ) continue;
var argname = flds[i].substring( 0, pos );
var value = flds[i].substring( pos+1 );
if ( argname == '_wpnonce') {
var nonce = value;
} else if ( argname == 'src' ) {
var source = value;
}
}
$.post( domain + 'wp-admin/admin-ajax.php', {
'action': action,
'_wpnonce': nonce,
'blog_id': blog_id,
'blog_url': blog_url,
'source': source
}, function( response ) {
if ( 'object' == typeof response.errors ) {
if ( is_following )
elem.removeClass( 'wpcom-follow' ).addClass( 'wpcom-following' ).text( 'Following' );
else
elem.removeClass( 'wpcom-following' ).addClass( 'wpcom-follow' ).text( 'Follow' );
}
},
'json' );
});
},
enable_rest: function( el, source ) {
var t = this;
el.unbind( 'click' ).bind( 'click', function( e ) {
e.preventDefault();
var link = $( this );
var blog_id = link.attr( 'data-blog-id' );
var is_following = link.hasClass( 'wpcom-following-rest' );
var rest_path = '/sites/' + blog_id + '/follows/new';
if ( is_following ) {
rest_path = '/sites/' + blog_id + '/follows/mine/delete';
}
//select and update ALL follow buttons on the page (could be more than one)
var attr_selector = 'data-blog-id="' + blog_id + '"';
var elem = $( 'a.wpcom-follow-rest[' + attr_selector + '], a.wpcom-following-rest[' + attr_selector + ']' );
if ( is_following ) {
elem.fadeOut( 'fast', function() {
elem.removeClass( 'wpcom-following-rest' ).addClass( 'wpcom-follow-rest' ).text( link.attr( 'data-follow-text' ) );
elem.fadeIn( 'fast' );
})
} else {
elem.fadeOut( 'fast', function() {
elem.addClass( 'wpcom-following-rest' ).removeClass( 'wpcom-follow-rest' ).text( link.attr( 'data-following-text' ) );
elem.fadeIn( 'fast' );
})
}
t.ajax( {
type: 'POST',
path : rest_path,
success : function( res ) {
if ( ! res.success ){
if ( is_following )
elem.removeClass( 'wpcom-follow-rest' ).addClass( 'wpcom-following-rest' ).text( link.attr( 'data-following-text' ) );
else
elem.removeClass( 'wpcom-following-rest' ).addClass( 'wpcom-follow-rest' ).text( link.attr( 'data-follow-text' ) );
}
},
error : function( res ) {
if ( is_following )
elem.removeClass( 'wpcom-follow-rest' ).addClass( 'wpcom-following-rest' ).text( link.attr( 'data-following-text' ) );
else
elem.removeClass( 'wpcom-following-rest' ).addClass( 'wpcom-follow-rest' ).text( link.attr( 'data-follow-text' ) );
}
});
//show post-Follow bubble
if ( ! is_following ) {
t.showBubble( link );
t.bumpStat( link.attr( 'data-stat-src' ) );
}
});
//show unfollow text on hover
el.hover( function() {
var link = $( this );
var is_following = link.hasClass( 'wpcom-following-rest' );
if ( is_following )
link.text( link.attr( 'data-following-hover-text' ) );
}, function() {
var link = $( this );
var is_following = link.hasClass( 'wpcom-following-rest' );
if ( is_following )
link.text( link.attr( 'data-following-text' ) );
});
},
showBubble: function( link ) {
var pos = link.position();
var hideBubble = this.hideBubble;
$( 'div.bubble-txt', 'div.action-bubble' ).html( "New posts from this blog will now appear in
your reader." );
var bubble = $( 'div.action-bubble' );
link.parent().append( bubble );
var left = pos.left + ( link.width() / 2 ) - ( $( 'div.wpcom-bubble' ).width() / 2 );
var top = pos.top + bubble.height();
bubble.css( { left: left + 'px', top: top + 'px' } );
bubble.addClass( 'fadein' );
setTimeout( function() {
$('body').on( 'click.bubble touchstart.bubble', function(e) {
if ( !$(e.target).hasClass('action-bubble') && !$(e.target).parents( 'div.action-bubble' ).length )
hideBubble();
});
$(document).on( 'scroll.bubble', hideBubble );
setTimeout( hideBubble, 10000 );
}, 500 );
},
hideBubble: function() {
$( 'div.wpcom-bubble.action-bubble' ).remove();
},
//common method for rendering a follow button from the object data
create : function ( data, source ) {
var is_following = data['params']['is_following'];
var follow_link = $('
', {
'class' : ( is_following ? 'wpcom-following-rest' : 'wpcom-follow-rest' ),
href : 'http://public-api.wordpress.com/sites/' + data['params']['site_id'] + '/follows',
title : data['params']['blog_title'] +
' (' + data['params']['blog_domain'] + ')',
text : is_following ? data['params']['following-text'] : data['params']['follow-text']
} ).attr( {
'data-blog-id' : data['params']['site_id'],
'data-stat-src' : data['params']['stat-source'],
'data-follow-text' : data['params']['follow-text'],
'data-following-text' : data['params']['following-text'],
'data-following-hover-text' : data['params']['following-hover-text']
} );
var follow_button = $( '
', {
'class': 'wpcom-follow-container wpcom-follow-attached',
style: 'display: inline-block;'
} ).append( follow_link );
this.enable_rest( follow_link, source );
return follow_button;
},
createAll: function() {
$( '.wpcom-follow-container' ).not( '.wpcom-follow-attached' ).each( function( index ) {
var el = $( this );
el.replaceWith( wpFollowButton.create( el.data( 'json' ), el.data( 'follow-source' ) ) );
});
},
ajax: function( options ) {
if ( document.location.host == 'public-api.wordpress.com' ) {
//console.log( 'regular ajax call ' + options.type + ' ' + options.path);
$.ajaxSetup({ beforeSend : function(xhr){
if ( cookie ) {
xhr.setRequestHeader( 'Authorization', 'X-WPCOOKIE ' + cookie + ':1:' + document.location.host );
}
}});
var request = {
type : options.type,
url : 'https://public-api.wordpress.com/rest/v1' + options.path,
success : options.success,
error : options.error,
data : options.data,
dataType : 'json'
};
$.ajax(request);
$.ajaxSetup({ beforeSend : null });
} else {
//console.log( 'proxied ajax call ' + options.type + ' ' + options.path );
var request = {
path: options.path,
method: options.type
};
if ( request.method === "POST" )
request.body = options.data;
else
request.query = options.data;
$.wpcom_proxy_request(request).done( function ( response, statusCode ) {
if ( 200 == statusCode )
options.success( response );
else
options.error( statusCode );
} );
}
},
bumpStat: function( source ) {
new Image().src = document.location.protocol +
'//pixel.wp.com/g.gif?v=wpcom-no-pv&x_follow_source=' + encodeURIComponent( source ) + '&baba=' + Math.random();
}
};
$(function(){
wpFollowButton.enable()
wpFollowButton.createAll()
});
})(jQuery);
;
/**
The MIT License
Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
**/
var NO_JQUERY = {};
(function(window, $, undefined) {
if (!("console" in window)) {
var c = window.console = {};
c.log = c.warn = c.error = c.debug = function(){};
}
if ($ === NO_JQUERY) {
// jQuery is optional
$ = {
fn: {},
extend: function() {
var a = arguments[0];
for (var i=1,len=arguments.length; i
; [;])
*/
isWindowsPhone8 : function () {
var t = this;
if ( false === t.userAgent )
return false;
return ( t.userAgent.indexOf('windows phone 8') != -1 );
},
/**
*
* Detects if the device platform is J2ME.
*
*/
isJ2MEPlatform : function () {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('j2me/midp') != -1 )
return true;
if ( t.userAgent.indexOf('midp') != -1 && t.userAgent.indexOf('cldc') != -1 )
return true;
return false;
},
/**
*
* Detects if the device platform is the Symbian Series 40.
* Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser.
* This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
*
*/
isSymbianS40Platform : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('series40') != -1 ) {
if ( t.userAgent.indexOf('nokia') != -1 || t.userAgent.indexOf('ovibrowser') != -1 || t.userAgent.indexOf('nokiabrowser') != -1)
return true;
}
return false;
},
/**
*
* Detects if the device platform is the Symbian Series 60.
*
*/
isSymbianPlatform : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('webkit') != -1 ) {
//First, test for WebKit, then make sure it's either Symbian or S60.
if ( t.userAgent.indexOf('symbian') != -1 || t.userAgent.indexOf('series60') != -1 )
return true;
else
return false;
} else if ( t.userAgent.indexOf('symbianos') != -1 && t.userAgent.indexOf('series60') != -1 ) {
return true;
} else if ( t.userAgent.indexOf('nokia') != -1 && t.userAgent.indexOf('series60') != -1 ) {
return true;
} else if ( t.userAgent.indexOf('opera mini') != -1) {
if( t.userAgent.indexOf('symbianos') != -1 || t.userAgent.indexOf('symbos') != -1 || t.userAgent.indexOf('series 60') != -1 )
return true;
}
return false;
},
/**
* Detects if the current browser is the Kindle Fire Native browser.
*
* Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true
* Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false
*
* @return boolean true if the browser is Kindle Fire Native browser otherwise false
*/
isKindleFire : function() {
var t = this;
if ( false === t.userAgent )
return false;
return( t.userAgent.indexOf('silk/') != -1 && t.userAgent.indexOf('silk-accelerated=') != -1);
},
/**
* Detects if the current browser is Firefox Mobile (Fennec)
*
* http://www.userAgentstring.com/pages/Fennec/
* Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1
* Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1
*/
isFirefoxMobile : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('fennec') != -1 )
return true;
return false;
},
/**
* Detects if the current browser is the native FirefoxOS browser
*
* Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0
*
*/
isFirefoxOS : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('mozilla') != -1 && t.userAgent.indexOf('mobile') != -1 && t.userAgent.indexOf('gecko') != -1 && t.userAgent.indexOf('firefox') != -1 )
return true;
return false;
},
/**
* Detects if the current UA is Facebook for iPad
* - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US)
* - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]
* - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US]
*/
isFacebookForIpad : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('ipad') == -1 )
return false;
if ( t.userAgent.indexOf('facebook') != -1 || t.userAgent.indexOf('fbforiphone') != -1 || t.userAgent.indexOf('fban/fbios;') != -1 )
return true;
return false;
},
/**
* Detects if the current UA is Facebook for iPhone
* - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR)
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0]
* - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US]
*/
isFacebookForIphone : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('iphone') == -1 )
return false;
if ( t.userAgent.indexOf('facebook') != -1 && t.userAgent.indexOf('ipad') == -1 )
return true;
else if ( t.userAgent.indexOf('fbforiphone') != -1 && t.userAgent.indexOf('tablet') == -1 )
return true;
else if ( t.userAgent.indexOf('fban/fbios;') != -1 && t.userAgent.indexOf('tablet') == -1 ) //FB app v5.0 or higher
return true;
return false;
},
/**
* Detects if the current UA is Twitter for iPhone
*
* Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone
* Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
*/
isTwitterForIphone : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('ipad') != -1 )
return false;
if ( t.userAgent.indexOf('twitter for iphone') != -1 )
return true;
return false;
},
/**
* Detects if the current UA is Twitter for iPad
*
* Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad
* Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
*/
isTwitterForIpad : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('twitter for ipad') != -1 )
return true;
if ( t.userAgent.indexOf('ipad') != -1 && t.userAgent.indexOf('twitter for iphone') != -1 )
return true;
return false;
},
/**
* Detects if the current UA is WordPress for iOS
*/
isWordPressForIos : function() {
var t = this;
if ( false === t.userAgent )
return false;
if ( t.userAgent.indexOf('wp-iphone') != -1 )
return true;
return false;
}
};;
/**
* author Christopher Blum
* - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/
* - forked from http://github.com/zuk/jquery.inview/
*/
(function ($) {
var inviewObjects = {}, viewportSize, viewportOffset,
d = document, w = window, documentElement = d.documentElement, expando = $.expando;
$.event.special.inview = {
add: function(data) {
inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) };
},
remove: function(data) {
try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {}
}
};
function getViewportSize() {
var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth };
// if this is correct then return it. iPad has compat Mode, so will
// go into check clientHeight/clientWidth (which has the wrong value).
if (!size.height) {
mode = d.compatMode;
if (mode || !$.support.boxModel) { // IE, Gecko
domObject = mode === 'CSS1Compat' ?
documentElement : // Standards
d.body; // Quirks
size = {
height: domObject.clientHeight,
width: domObject.clientWidth
};
}
}
return size;
}
function getViewportOffset() {
return {
top: w.pageYOffset || documentElement.scrollTop || d.body.scrollTop,
left: w.pageXOffset || documentElement.scrollLeft || d.body.scrollLeft
};
}
function checkInView() {
var $elements = $(), elementsLength, i = 0;
$.each(inviewObjects, function(i, inviewObject) {
var selector = inviewObject.data.selector,
$element = inviewObject.$element;
$elements = $elements.add(selector ? $element.find(selector) : $element);
});
elementsLength = $elements.length;
if (elementsLength) {
viewportSize = viewportSize || getViewportSize();
viewportOffset = viewportOffset || getViewportOffset();
for (; i= 0 && element.offsetHeight >= 0 && element.style.display != "none" &&
elementOffset.top + elementSize.height > viewportOffset.top &&
elementOffset.top < viewportOffset.top + viewportSize.height &&
elementOffset.left + elementSize.width > viewportOffset.left &&
elementOffset.left < viewportOffset.left + viewportSize.width) {
visiblePartX = (viewportOffset.left > elementOffset.left ?
'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ?
'left' : 'both');
visiblePartY = (viewportOffset.top > elementOffset.top ?
'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ?
'top' : 'both');
visiblePartsMerged = visiblePartX + "-" + visiblePartY;
if (!inView || inView !== visiblePartsMerged) {
$element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]);
}
} else if (inView) {
$element.data('inview', false).trigger('inview', [false]);
}
}
}
}
$(w).bind("scroll resize", function() {
viewportSize = viewportOffset = null;
});
// IE < 9 scrolls to focused elements without firing the "scroll" event
if (!documentElement.addEventListener && documentElement.attachEvent) {
documentElement.attachEvent("onfocusin", function() {
viewportOffset = null;
});
}
// Use setInterval in order to also make sure this captures elements within
// "overflow:scroll" elements or elements that appeared in the dom tree due to
// dom manipulation and reflow
// old: $(window).scroll(checkInView);
//
// By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays
// intervals while the user scrolls. Therefore the inview event might fire a bit late there
setInterval(checkInView, 250);
})(jQuery);;
/* global Jetpack */
/**
* Resizeable Iframes.
*
* Start listening to resize postMessage events for selected iframes:
* $( selector ).Jetpack( 'resizeable' );
* - OR -
* Jetpack.resizeable( 'on', context );
*
* Resize selected iframes:
* $( selector ).Jetpack( 'resizeable', 'resize', { width: 100, height: 200 } );
* - OR -
* Jetpack.resizeable( 'resize', { width: 100, height: 200 }, context );
*
* Stop listening to resize postMessage events for selected iframes:
* $( selector ).Jetpack( 'resizeable', 'off' );
* - OR -
* Jetpack.resizeable( 'off', context );
*
* Stop listening to all resize postMessage events:
* Jetpack.resizeable( 'off' );
*/
(function($) {
var listening = false, // Are we listening for resize postMessage events
sourceOrigins = [], // What origins are allowed to send resize postMessage events
$sources = false, // What iframe elements are we tracking resize postMessage events from
URLtoOrigin, // Utility to convert URLs into origins
setupListener, // Binds global resize postMessage event handler
destroyListener, // Unbinds global resize postMessage event handler
methods; // Jetpack.resizeable methods
// Setup the Jetpack global
if ( 'undefined' === typeof window.Jetpack ) {
window.Jetpack = {
/**
* Handles the two different calling methods:
* $( selector ).Jetpack( 'namespace', 'method', context ) // here, context is optional and is used to filter the collection
* - vs. -
* Jetpack.namespace( 'method', context ) // here context defines the collection
*
* @internal
*
* Call as: Jetpack.getTarget.call( this, context )
*
* @param string context: jQuery selector
* @return jQuery|undefined object on which to perform operations or undefined when context cannot be determined
*/
getTarget: function( context ) {
if ( this instanceof jQuery ) {
return context ? this.filter( context ) : this;
}
return context ? $( context ) : context;
}
};
}
// Setup the Jetpack jQuery method
if ( 'undefined' === typeof $.fn.Jetpack ) {
/**
* Dispatches calls to the correct namespace
*
* @param string namespace
* @param ...
* @return mixed|jQuery (chainable)
*/
$.fn.Jetpack = function( namespace ) {
if ( 'function' === typeof Jetpack[namespace] ) {
// Send the call to the correct Jetpack.namespace
return Jetpack[namespace].apply( this, Array.prototype.slice.call( arguments, 1 ) );
} else {
$.error( 'Namespace "' + namespace + '" does not exist on jQuery.Jetpack' );
}
};
}
// Define Jetpack.resizeable() namespace to just always bail if no postMessage
if ( 'function' !== typeof window.postMessage ) {
$.extend( window.Jetpack, {
/**
* Defines the Jetpack.resizeable() namespace.
* See below for non-trivial definition for browsers with postMessage.
*/
resizeable: function() {
$.error( 'Browser does not support window.postMessage' );
}
} );
return;
}
/**
* Utility to convert URLs into origins
*
* http://example.com:port/path?query#fragment -> http://example.com:port
*
* @param string URL
* @return string origin
*/
URLtoOrigin = function( URL ) {
if ( ! URL.match( /^https?:\/\// ) ) {
URL = document.location.href;
}
return URL.split( '/' ).slice( 0, 3 ).join( '/' );
};
/**
* Binds global resize postMessage event handler
*/
setupListener = function() {
listening = true;
$( window ).on( 'message.JetpackResizeableIframe', function( e ) {
var event = e.originalEvent,
data;
// Ensure origin is allowed
if ( -1 === $.inArray( event.origin, sourceOrigins ) ) {
return;
}
// Some browsers send structured data, some send JSON strings
if ( 'object' === typeof event.data ) {
data = event.data.data;
} else {
try {
data = JSON.parse( event.data );
} catch ( err ) {
data = false;
}
}
if ( !data.data ) {
return;
}
// Un-nest
data = data.data;
// Is it a resize event?
if ( 'undefined' === typeof data.action || 'resize' !== data.action ) {
return;
}
// Find the correct iframe and resize it
$sources.filter( function() {
if ( 'undefined' !== typeof data.name ) {
return this.name === data.name;
} else {
return event.source === this.contentWindow;
}
} ).first().Jetpack( 'resizeable', 'resize', data );
} );
};
/**
* Unbinds global resize postMessage event handler
*/
destroyListener = function() {
listening = false;
$( window ).off( 'message.JetpackResizeableIframe' );
sourceOrigins = [];
$( '.jetpack-resizeable' ).removeClass( 'jetpack-resizeable' );
$sources = false;
};
// Methods for Jetpack.resizeable() namespace
methods = {
/**
* Start listening for resize postMessage events on the given iframes
*
* Call statically as: Jetpack.resizeable( 'on', context )
* Call as: $( selector ).Jetpack( 'resizeable', 'on', context ) // context optional: used to filter the collectino
*
* @param string context jQuery selector.
* @return jQuery (chainable)
*/
on: function( context ) {
var target = Jetpack.getTarget.call( this, context );
if ( ! listening ) {
setupListener();
}
target.each( function() {
sourceOrigins.push( URLtoOrigin( $( this ).attr( 'src' ) ) );
} ).addClass( 'jetpack-resizeable' );
$sources = $( '.jetpack-resizeable' );
return target;
},
/**
* Stop listening for resize postMessage events on the given iframes
*
* Call statically as: Jetpack.resizeable( 'off', context )
* Call as: $( selector ).Jetpack( 'resizeable', 'off', context ) // context optional: used to filter the collectino
*
* @param string context jQuery selector
* @return jQuery (chainable)
*/
off: function( context ) {
var target = Jetpack.getTarget.call( this, context );
if ( 'undefined' === typeof target ) {
destroyListener();
return target;
}
target.each( function() {
var origin = URLtoOrigin( $( this ).attr( 'src' ) ),
pos = $.inArray( origin, sourceOrigins );
if ( -1 !== pos ) {
sourceOrigins.splice( pos, 1 );
}
} ).removeClass( 'jetpack-resizeable' );
$sources = $( '.jetpack-resizeable' );
return target;
},
/**
* Resize the given iframes
*
* Call statically as: Jetpack.resizeable( 'resize', dimensions, context )
* Call as: $( selector ).Jetpack( 'resizeable', 'resize', dimensions, context ) // context optional: used to filter the collectino
*
* @param object dimensions in pixels: { width: (int), height: (int) }
* @param string context jQuery selector
* @return jQuery (chainable)
*/
resize: function( dimensions, context ) {
var target = Jetpack.getTarget.call( this, context );
$.each( [ 'width', 'height' ], function( i, variable ) {
var value = 0,
container;
if ( 'undefined' !== typeof dimensions[variable] ) {
value = parseInt( dimensions[variable], 10 );
}
if ( 0 !== value ) {
target[variable]( value );
container = target.parent();
if ( container.hasClass( 'slim-likes-widget' ) ) {
container[variable]( value );
}
}
} );
return target;
}
};
// Define Jetpack.resizeable() namespace
$.extend( window.Jetpack, {
/**
* Defines the Jetpack.resizeable() namespace.
* See above for trivial definition for browsers with no postMessage.
*
* @param string method
* @param ...
* @return mixed|jQuery (chainable)
*/
resizeable: function( method ) {
if ( methods[method] ) {
// Send the call to the correct Jetpack.resizeable() method
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) );
} else if ( ! method ) {
// By default, send to Jetpack.resizeable( 'on' ), which isn't useful in that form but is when called as
// jQuery( selector ).Jetpack( 'resizeable' )
return methods.on.apply( this );
} else {
$.error( 'Method ' + method + ' does not exist on Jetpack.resizeable' );
}
}
} );
})(jQuery);
;
//fgnass.github.com/spin.js#v1.3
/**
* Copyright (c) 2011-2013 Felix Gnass
* Licensed under the MIT license
*/
(function(root, factory) {
/* CommonJS */
if (typeof exports == 'object') module.exports = factory()
/* AMD module */
else if (typeof define == 'function' && define.amd) define(factory)
/* Browser global */
else root.Spinner = factory()
}
(this, function() {
"use strict";
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
, animations = {} /* Animation rules keyed by their name */
, useCssAnimations /* Whether to use CSS animations or setTimeout */
/**
* Utility function to create elements. If no tag name is given,
* a DIV is created. Optionally properties can be passed.
*/
function createEl(tag, prop) {
var el = document.createElement(tag || 'div')
, n
for(n in prop) el[n] = prop[n]
return el
}
/**
* Appends children and returns the parent.
*/
function ins(parent /* child1, child2, ...*/) {
for (var i=1, n=arguments.length; i> 1) : parseInt(o.left, 10) + mid) + 'px',
top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px'
})
}
el.setAttribute('role', 'progressbar')
self.lines(el, self.opts)
if (!useCssAnimations) {
// No CSS animation support, use setTimeout() instead
var i = 0
, start = (o.lines - 1) * (1 - o.direction) / 2
, alpha
, fps = o.fps
, f = fps/o.speed
, ostep = (1-o.opacity) / (f*o.trail / 100)
, astep = f/o.lines
;(function anim() {
i++;
for (var j = 0; j < o.lines; j++) {
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
self.opacity(el, j * o.direction + start, alpha, o)
}
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
})()
}
return self
},
/**
* Stops and removes the Spinner.
*/
stop: function() {
var el = this.el
if (el) {
clearTimeout(this.timeout)
if (el.parentNode) el.parentNode.removeChild(el)
this.el = undefined
}
return this
},
/**
* Internal method that draws the individual lines. Will be overwritten
* in VML fallback mode below.
*/
lines: function(el, o) {
var i = 0
, start = (o.lines - 1) * (1 - o.direction) / 2
, seg
function fill(color, shadow) {
return css(createEl(), {
position: 'absolute',
width: (o.length+o.width) + 'px',
height: o.width + 'px',
background: color,
boxShadow: shadow,
transformOrigin: 'left',
transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
borderRadius: (o.corners * o.width>>1) + 'px'
})
}
for (; i < o.lines; i++) {
seg = css(createEl(), {
position: 'absolute',
top: 1+~(o.width/2) + 'px',
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
opacity: o.opacity,
animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite'
})
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)')))
}
return el
},
/**
* Internal method that adjusts the opacity of a single line.
* Will be overwritten in VML fallback mode below.
*/
opacity: function(el, i, val) {
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
}
})
function initVML() {
/* Utility function to create a VML tag */
function vml(tag, attr) {
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
}
// No CSS transforms but VML support, add a CSS rule for VML elements:
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
Spinner.prototype.lines = function(el, o) {
var r = o.length+o.width
, s = 2*r
function grp() {
return css(
vml('group', {
coordsize: s + ' ' + s,
coordorigin: -r + ' ' + -r
}),
{ width: s, height: s }
)
}
var margin = -(o.width+o.length)*2 + 'px'
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
, i
function seg(i, dx, filter) {
ins(g,
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
ins(css(vml('roundrect', {arcsize: o.corners}), {
width: r,
height: o.width,
left: o.radius,
top: -o.width>>1,
filter: filter
}),
vml('fill', {color: o.color, opacity: o.opacity}),
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
)
)
)
}
if (o.shadow)
for (i = 1; i <= o.lines; i++)
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
for (i = 1; i <= o.lines; i++) seg(i)
return ins(el, g)
}
Spinner.prototype.opacity = function(el, i, val, o) {
var c = el.firstChild
o = o.shadow && o.lines || 0
if (c && i+o < c.childNodes.length) {
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
if (c) c.opacity = val
}
}
}
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
if (!vendor(probe, 'transform') && probe.adj) initVML()
else useCssAnimations = vendor(probe, 'animation')
return Spinner
}));
;
/**
* Copyright (c) 2011-2013 Felix Gnass
* Licensed under the MIT license
*/
/*
Basic Usage:
============
$('#el').spin(); // Creates a default Spinner using the text color of #el.
$('#el').spin({ ... }); // Creates a Spinner using the provided options.
$('#el').spin(false); // Stops and removes the spinner.
Using Presets:
==============
$('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el.
$('#el').spin('large', '#fff'); // Creates a 'large' white Spinner.
Adding a custom preset:
=======================
$.fn.spin.presets.flower = {
lines: 9
length: 10
width: 20
radius: 0
}
$('#el').spin('flower', 'red');
*/
(function(factory) {
if (typeof exports == 'object') {
// CommonJS
factory(require('jquery'), require('spin'))
}
else if (typeof define == 'function' && define.amd) {
// AMD, register as anonymous module
define(['jquery', 'spin'], factory)
}
else {
// Browser globals
if (!window.Spinner) throw new Error('Spin.js not present')
factory(window.jQuery, window.Spinner)
}
}(function($, Spinner) {
$.fn.spin = function(opts, color) {
return this.each(function() {
var $this = $(this),
data = $this.data();
if (data.spinner) {
data.spinner.stop();
delete data.spinner;
}
if (opts !== false) {
opts = $.extend(
{ color: color || $this.css('color') },
$.fn.spin.presets[opts] || opts
)
// Begin WordPress Additions
// To use opts.right, you need to have specified a length, width, and radius.
if ( typeof opts.right !== 'undefined' && typeof opts.length !== 'undefined'
&& typeof opts.width !== 'undefined' && typeof opts.radius !== 'undefined' ) {
var pad = $this.css( 'padding-left' );
pad = ( typeof pad === 'undefined' ) ? 0 : parseInt( pad, 10 );
opts.left = $this.outerWidth() - ( 2 * ( opts.length + opts.width + opts.radius ) ) - pad - opts.right;
delete opts.right;
}
// End WordPress Additions
data.spinner = new Spinner(opts).spin(this)
}
})
}
$.fn.spin.presets = {
tiny: { lines: 8, length: 2, width: 2, radius: 3 },
small: { lines: 8, length: 4, width: 3, radius: 5 },
large: { lines: 10, length: 8, width: 4, radius: 8 }
}
}));
// Jetpack Presets Overrides:
(function($){
$.fn.spin.presets.wp = { trail: 60, speed: 1.3 };
$.fn.spin.presets.small = $.extend( { lines: 8, length: 2, width: 2, radius: 3 }, $.fn.spin.presets.wp );
$.fn.spin.presets.medium = $.extend( { lines: 8, length: 4, width: 3, radius: 5 }, $.fn.spin.presets.wp );
$.fn.spin.presets.large = $.extend( { lines: 10, length: 6, width: 4, radius: 7 }, $.fn.spin.presets.wp );
$.fn.spin.presets['small-left'] = $.extend( { left: 5 }, $.fn.spin.presets.small );
$.fn.spin.presets['small-right'] = $.extend( { right: 5 }, $.fn.spin.presets.small );
$.fn.spin.presets['medium-left'] = $.extend( { left: 5 }, $.fn.spin.presets.medium );
$.fn.spin.presets['medium-right'] = $.extend( { right: 5 }, $.fn.spin.presets.medium );
$.fn.spin.presets['large-left'] = $.extend( { left: 5 }, $.fn.spin.presets.large );
$.fn.spin.presets['large-right'] = $.extend( { right: 5 }, $.fn.spin.presets.large );
})(jQuery);
;
jQuery(document).ready(function($) {
$('.bump-view').click( function( event ) {
var $this = $(this), statarg = "wref=", statval = $this.data( 'bumpView' ), href = $this.attr( 'href' );
$this.attr( 'href', href + ( href.indexOf( '?' ) != -1 ? "&" : "?" ) + statarg + statval );
});
});;