diff --git a/app/actions/webplayer.js b/app/actions/webplayer.js index 4c60a9a..5389a56 100644 --- a/app/actions/webplayer.js +++ b/app/actions/webplayer.js @@ -127,11 +127,12 @@ export const PUSH_SONG = "PUSH_SONG"; * * @param songID The id of the song to push. * @param index [Optional] The position to insert at in the playlist. - * If negative, counts from the end. Defaults to last. + * If negative, counts from the end. Undefined (default) + * is last position. * * @return Dispatch a PUSH_SONG action. */ -export function pushSong(songID, index=-1) { +export function pushSong(songID, index) { return (dispatch) => { // Handle reference counting dispatch(incrementRefCount({ @@ -197,31 +198,31 @@ export function jumpToSong(songID) { } -export const PLAY_PREVIOUS = "PLAY_PREVIOUS"; +export const PLAY_PREVIOUS_SONG = "PLAY_PREVIOUS_SONG"; /** * Move one song backwards in the playlist. * - * @return Dispatch a PLAY_PREVIOUS action. + * @return Dispatch a PLAY_PREVIOUS_SONG action. */ -export function playPrevious() { +export function playPreviousSong() { return (dispatch) => { dispatch({ - type: PLAY_PREVIOUS, + type: PLAY_PREVIOUS_SONG, }); }; } -export const PLAY_NEXT = "PLAY_NEXT"; +export const PLAY_NEXT_SONG = "PLAY_NEXT_SONG"; /** * Move one song forward in the playlist. * - * @return Dispatch a PLAY_NEXT action. + * @return Dispatch a PLAY_NEXT_SONG action. */ -export function playNext() { +export function playNextSong() { return (dispatch) => { dispatch({ - type: PLAY_NEXT, + type: PLAY_NEXT_SONG, }); }; } diff --git a/app/components/Album.jsx b/app/components/Album.jsx index 50ae69a..65df7f1 100644 --- a/app/components/Album.jsx +++ b/app/components/Album.jsx @@ -22,17 +22,47 @@ const albumMessages = defineMessages(messagesMap(Array.concat([], commonMessages * Track row in an album tracks table. */ class AlbumTrackRowCSSIntl extends Component { + constructor(props) { + super(props); + + // Bind this + this.onPlayClick = this.onPlayClick.bind(this); + this.onPlayNextClick = this.onPlayNextClick.bind(this); + } + + /** + * Handle click on play button. + */ + onPlayClick() { + $(this.refs.play).blur(); + this.props.playAction(this.props.song.get("id")); + } + + /** + * Handle click on play next button. + */ + onPlayNextClick() { + $(this.refs.playNext).blur(); + this.props.playNextAction(this.props.song.get("id")); + } + render() { const { formatMessage } = this.props.intl; const length = formatLength(this.props.track.get("time")); return ( -   + {this.props.track.get("track")} @@ -44,6 +74,7 @@ class AlbumTrackRowCSSIntl extends Component { } AlbumTrackRowCSSIntl.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, track: PropTypes.instanceOf(Immutable.Map).isRequired, intl: intlShape.isRequired, }; @@ -57,9 +88,9 @@ class AlbumTracksTableCSS extends Component { render() { let rows = []; // Build rows for each track - const playAction = this.props.playAction; + const { playAction, playNextAction } = this.props; this.props.tracks.forEach(function (item) { - rows.push(); + rows.push(); }); return ( @@ -72,6 +103,7 @@ class AlbumTracksTableCSS extends Component { } AlbumTracksTableCSS.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, tracks: PropTypes.instanceOf(Immutable.List).isRequired, }; export let AlbumTracksTable = CSSModules(AlbumTracksTableCSS, css); @@ -93,7 +125,7 @@ class AlbumRowCSS extends Component {
{ this.props.songs.size > 0 ? - : + : null }
@@ -103,6 +135,7 @@ class AlbumRowCSS extends Component { } AlbumRowCSS.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, album: PropTypes.instanceOf(Immutable.Map).isRequired, songs: PropTypes.instanceOf(Immutable.List).isRequired, }; diff --git a/app/components/Artist.jsx b/app/components/Artist.jsx index fb259a4..cc99b3c 100644 --- a/app/components/Artist.jsx +++ b/app/components/Artist.jsx @@ -48,13 +48,13 @@ class ArtistCSS extends Component { // Build album rows let albumsRows = []; - const { albums, songs, playAction } = this.props; + const { albums, songs, playAction, playNextAction } = this.props; if (albums && songs) { albums.forEach(function (album) { const albumSongs = album.get("tracks").map( id => songs.get(id) ); - albumsRows.push(); + albumsRows.push(); }); } @@ -85,6 +85,7 @@ ArtistCSS.propTypes = { error: PropTypes.string, isFetching: PropTypes.bool.isRequired, playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, artist: PropTypes.instanceOf(Immutable.Map), albums: PropTypes.instanceOf(Immutable.List), songs: PropTypes.instanceOf(Immutable.Map), diff --git a/app/components/Songs.jsx b/app/components/Songs.jsx index 8c49ac4..65fa8a2 100644 --- a/app/components/Songs.jsx +++ b/app/components/Songs.jsx @@ -30,6 +30,30 @@ const songsMessages = defineMessages(messagesMap(Array.concat([], commonMessages * A single row for a single song in the songs table. */ class SongsTableRowCSSIntl extends Component { + constructor(props) { + super(props); + + // Bind this + this.onPlayClick = this.onPlayClick.bind(this); + this.onPlayNextClick = this.onPlayNextClick.bind(this); + } + + /** + * Handle click on play button. + */ + onPlayClick() { + $(this.refs.play).blur(); + this.props.playAction(this.props.song.get("id")); + } + + /** + * Handle click on play next button. + */ + onPlayNextClick() { + $(this.refs.playNext).blur(); + this.props.playNextAction(this.props.song.get("id")); + } + render() { const { formatMessage } = this.props.intl; @@ -40,11 +64,17 @@ class SongsTableRowCSSIntl extends Component { return ( @@ -58,6 +88,7 @@ class SongsTableRowCSSIntl extends Component { } SongsTableRowCSSIntl.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, song: PropTypes.instanceOf(Immutable.Map).isRequired, intl: intlShape.isRequired, }; @@ -86,9 +117,9 @@ class SongsTableCSS extends Component { // Build song rows let rows = []; - const { playAction } = this.props; + const { playAction, playNextAction } = this.props; displayedSongs.forEach(function (song) { - rows.push(); + rows.push(); }); // Handle login icon @@ -134,6 +165,7 @@ class SongsTableCSS extends Component { } SongsTableCSS.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, songs: PropTypes.instanceOf(Immutable.List).isRequired, filterText: PropTypes.string, }; @@ -180,6 +212,7 @@ export default class FilterablePaginatedSongsTable extends Component { }; const songsTableProps = { playAction: this.props.playAction, + playNextAction: this.props.playNextAction, isFetching: this.props.isFetching, songs: this.props.songs, filterText: this.state.filterText, @@ -197,6 +230,7 @@ export default class FilterablePaginatedSongsTable extends Component { } FilterablePaginatedSongsTable.propTypes = { playAction: PropTypes.func.isRequired, + playNextAction: PropTypes.func.isRequired, isFetching: PropTypes.bool.isRequired, error: PropTypes.string, songs: PropTypes.instanceOf(Immutable.List).isRequired, diff --git a/app/components/elements/WebPlayer.jsx b/app/components/elements/WebPlayer.jsx index 3cf4f2c..1dfeca4 100644 --- a/app/components/elements/WebPlayer.jsx +++ b/app/components/elements/WebPlayer.jsx @@ -82,6 +82,32 @@ class WebPlayerCSSIntl extends Component { } } + // Click handlers + const onPrev = (function () { + $(this.refs.prevBtn).blur(); + this.props.onPrev(); + }).bind(this); + const onPlayPause = (function () { + $(this.refs.playPauseBtn).blur(); + this.props.onPlayPause(); + }).bind(this); + const onSkip = (function () { + $(this.refs.nextBtn).blur(); + this.props.onSkip(); + }).bind(this); + const onMute = (function () { + $(this.refs.volumeBtn).blur(); + this.props.onMute(); + }).bind(this); + const onRepeat = (function () { + $(this.refs.repeatBtn).blur(); + this.props.onRepeat(); + }).bind(this); + const onRandom = (function () { + $(this.refs.randomBtn).blur(); + this.props.onRandom(); + }).bind(this); + return (
@@ -109,24 +135,24 @@ class WebPlayerCSSIntl extends Component {
- - -
- - -
-   + {this.props.song.get("name")}
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Qe=/<|&#?\w+;/;!function(){var e=re.createDocumentFragment(),t=e.appendChild(re.createElement("div")),n=re.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),he.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",he.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Je=re.documentElement,Ze=/^key/,et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,tt=/^([^.]*)(?:\.(.+)|)/;ve.event={global:{},add:function(e,t,n,r,o){var i,a,s,u,c,l,f,p,d,h,m,v=Le.get(e);if(v)for(n.handler&&(i=n,n=i.handler,o=i.selector),o&&ve.find.matchesSelector(Je,o),n.guid||(n.guid=ve.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(t){return"undefined"!=typeof ve&&ve.event.triggered!==t.type?ve.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Fe)||[""],c=t.length;c--;)s=tt.exec(t[c])||[],d=m=s[1],h=(s[2]||"").split(".").sort(),d&&(f=ve.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=ve.event.special[d]||{},l=ve.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&ve.expr.match.needsContext.test(o),namespace:h.join(".")},i),(p=u[d])||(p=u[d]=[],p.delegateCount=0,f.setup&&f.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,l):p.push(l),ve.event.global[d]=!0)},remove:function(e,t,n,r,o){var i,a,s,u,c,l,f,p,d,h,m,v=Le.hasData(e)&&Le.get(e);if(v&&(u=v.events)){for(t=(t||"").match(Fe)||[""],c=t.length;c--;)if(s=tt.exec(t[c])||[],d=m=s[1],h=(s[2]||"").split(".").sort(),d){for(f=ve.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)l=p[i],!o&&m!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(i,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(e,l));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,v.handle)!==!1||ve.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ve.event.remove(e,d+t[c],n,r,!0);ve.isEmptyObject(u)&&Le.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,s=ve.event.fix(e),u=new Array(arguments.length),c=(Le.get(this,"events")||{})[s.type]||[],l=ve.event.special[s.type]||{};for(u[0]=s,t=1;t-1:ve.find(o,this,null,[u]).length),r[o]&&r.push(i);r.length&&a.push({elem:u,handlers:r})}return s\x20\t\r\n\f]*)[^>]*)\/>/gi,rt=/\s*$/g;ve.extend({htmlPrefilter:function(e){return e.replace(nt,"<$1>")},clone:function(e,t,n){var r,o,i,a,s=e.cloneNode(!0),u=ve.contains(e.ownerDocument,e);if(!(he.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ve.isXMLDoc(e)))for(a=_(s),i=_(e),r=0,o=i.length;r0&&w(a,!u&&_(e,"script")),s},cleanData:function(e){for(var t,n,r,o=ve.event.special,i=0;void 0!==(n=e[i]);i++)if(je(n)){if(t=n[Le.expando]){if(t.events)for(r in t.events)o[r]?ve.event.remove(n,r):ve.removeEvent(n,r,t.handle);n[Le.expando]=void 0}n[De.expando]&&(n[De.expando]=void 0)}}}),ve.fn.extend({detach:function(e){return I(this,e,!0)},remove:function(e){return I(this,e)},text:function(e){return Ne(this,function(e){return void 0===e?ve.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return F(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=O(this,e);t.appendChild(e)}})},prepend:function(){return F(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=O(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return F(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return F(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ve.cleanData(_(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ve.clone(this,e,t)})},html:function(e){return Ne(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!Xe[(Ke.exec(e)||["",""])[1].toLowerCase()]){e=ve.htmlPrefilter(e);try{for(;n1)}}),ve.Tween=B,B.prototype={constructor:B,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||ve.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(ve.cssNumber[n]?"":"px")},cur:function(){var e=B.propHooks[this.prop];return e&&e.get?e.get(this):B.propHooks._default.get(this)},run:function(e){var t,n=B.propHooks[this.prop];return this.options.duration?this.pos=t=ve.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):B.propHooks._default.set(this),this}},B.prototype.init.prototype=B.prototype,B.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ve.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){ve.fx.step[e.prop]?ve.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ve.cssProps[e.prop]]&&!ve.cssHooks[e.prop]?e.elem[e.prop]=e.now:ve.style(e.elem,e.prop,e.now+e.unit)}}},B.propHooks.scrollTop=B.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ve.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ve.fx=B.prototype.init,ve.fx.step={};var mt,vt,yt=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;ve.Animation=ve.extend(G,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return y(n.elem,e,He.exec(t),n),n}]},tweener:function(e,t){ve.isFunction(e)?(t=e,e=["*"]):e=e.match(Fe);for(var n,r=0,o=e.length;r1)},removeAttr:function(e){return this.each(function(){ve.removeAttr(this,e)})}}),ve.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return"undefined"==typeof e.getAttribute?ve.prop(e,t,n):(1===i&&ve.isXMLDoc(e)||(o=ve.attrHooks[t.toLowerCase()]||(ve.expr.match.bool.test(t)?bt:void 0)),void 0!==n?null===n?void ve.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:(r=ve.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!he.radioValue&&"radio"===t&&ve.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(Fe);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),bt={set:function(e,t,n){return t===!1?ve.removeAttr(e,n):e.setAttribute(n,n),n}},ve.each(ve.expr.match.bool.source.match(/\w+/g),function(e,t){var n=_t[t]||ve.find.attr;_t[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=_t[a],_t[a]=o,o=null!=n(e,t,r)?a:null,_t[a]=i),o}});var wt=/^(?:input|select|textarea|button)$/i,Et=/^(?:a|area)$/i;ve.fn.extend({prop:function(e,t){return Ne(this,ve.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ve.propFix[e]||e]})}}),ve.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&ve.isXMLDoc(e)||(t=ve.propFix[t]||t,o=ve.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ve.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),he.optSelected||(ve.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ve.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ve.propFix[this.toLowerCase()]=this});var xt=/[\t\r\n\f]/g;ve.fn.extend({addClass:function(e){var t,n,r,o,i,a,s,u=0;if(ve.isFunction(e))return this.each(function(t){ve(this).addClass(e.call(this,t,K(this)))});if("string"==typeof e&&e)for(t=e.match(Fe)||[];n=this[u++];)if(o=K(n),r=1===n.nodeType&&(" "+o+" ").replace(xt," ")){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");s=ve.trim(r),o!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,o,i,a,s,u=0;if(ve.isFunction(e))return this.each(function(t){ve(this).removeClass(e.call(this,t,K(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Fe)||[];n=this[u++];)if(o=K(n),r=1===n.nodeType&&(" "+o+" ").replace(xt," ")){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");s=ve.trim(r),o!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ve.isFunction(e)?this.each(function(n){ve(this).toggleClass(e.call(this,n,K(this),t),t)}):this.each(function(){var t,r,o,i;if("string"===n)for(r=0,o=ve(this),i=e.match(Fe)||[];t=i[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||(t=K(this),t&&Le.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Le.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+K(n)+" ").replace(xt," ").indexOf(t)>-1)return!0;return!1}});var Tt=/\r/g,St=/[\x20\t\r\n\f]+/g;ve.fn.extend({val:function(e){var t,n,r,o=this[0];{if(arguments.length)return r=ve.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=r?e.call(this,n,ve(this).val()):e,null==o?o="":"number"==typeof o?o+="":ve.isArray(o)&&(o=ve.map(o,function(e){return null==e?"":e+""})),t=ve.valHooks[this.type]||ve.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=ve.valHooks[o.type]||ve.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(Tt,""):null==n?"":n)}}}),ve.extend({valHooks:{option:{get:function(e){var t=ve.find.attr(e,"value");return null!=t?t:ve.trim(ve.text(e)).replace(St," ")}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type,a=i?null:[],s=i?o+1:r.length,u=o<0?s:i?o:0;u-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),ve.each(["radio","checkbox"],function(){ve.valHooks[this]={set:function(e,t){if(ve.isArray(t))return e.checked=ve.inArray(ve(e).val(),t)>-1}},he.checkOn||(ve.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Pt=/^(?:focusinfocus|focusoutblur)$/;ve.extend(ve.event,{trigger:function(e,t,r,o){var i,a,s,u,c,l,f,p=[r||re],d=fe.call(e,"type")?e.type:e,h=fe.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||re,3!==r.nodeType&&8!==r.nodeType&&!Pt.test(d+ve.event.triggered)&&(d.indexOf(".")>-1&&(h=d.split("."),d=h.shift(),h.sort()),c=d.indexOf(":")<0&&"on"+d,e=e[ve.expando]?e:new ve.Event(d,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:ve.makeArray(t,[e]),f=ve.event.special[d]||{},o||!f.trigger||f.trigger.apply(r,t)!==!1)){if(!o&&!f.noBubble&&!ve.isWindow(r)){for(u=f.delegateType||d,Pt.test(u+d)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||re)&&p.push(s.defaultView||s.parentWindow||n)}for(i=0;(a=p[i++])&&!e.isPropagationStopped();)e.type=i>1?u:f.bindType||d,l=(Le.get(a,"events")||{})[e.type]&&Le.get(a,"handle"),l&&l.apply(a,t),l=c&&a[c],l&&l.apply&&je(a)&&(e.result=l.apply(a,t),e.result===!1&&e.preventDefault());return e.type=d,o||e.isDefaultPrevented()||f._default&&f._default.apply(p.pop(),t)!==!1||!je(r)||c&&ve.isFunction(r[d])&&!ve.isWindow(r)&&(s=r[c],s&&(r[c]=null),ve.event.triggered=d,r[d](),ve.event.triggered=void 0,s&&(r[c]=s)),e.result}},simulate:function(e,t,n){var r=ve.extend(new ve.Event,n,{type:e,isSimulated:!0});ve.event.trigger(r,null,t)}}),ve.fn.extend({trigger:function(e,t){return this.each(function(){ve.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ve.event.trigger(e,t,n,!0)}}),ve.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){ve.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ve.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),he.focusin="onfocusin"in n,he.focusin||ve.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ve.event.simulate(t,e.target,ve.event.fix(e))};ve.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=Le.access(r,t);o||r.addEventListener(e,n,!0),Le.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=Le.access(r,t)-1;o?Le.access(r,t,o):(r.removeEventListener(e,n,!0),Le.remove(r,t))}}});var Ot=n.location,Ct=ve.now(),At=/\?/;ve.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(r){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||ve.error("Invalid XML: "+e),t};var kt=/\[\]$/,Mt=/\r?\n/g,Ft=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;ve.param=function(e,t){var n,r=[],o=function(e,t){var n=ve.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(ve.isArray(e)||e.jquery&&!ve.isPlainObject(e))ve.each(e,function(){o(this.name,this.value)});else for(n in e)Y(n,e[n],t,o);return r.join("&")},ve.fn.extend({serialize:function(){return ve.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ve.prop(this,"elements");return e?ve.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ve(this).is(":disabled")&&It.test(this.nodeName)&&!Ft.test(e)&&(this.checked||!Ge.test(e))}).map(function(e,t){var n=ve(this).val();return null==n?null:ve.isArray(n)?ve.map(n,function(e){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}});var Rt=/%20/g,Nt=/#.*$/,jt=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Dt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ut=/^(?:GET|HEAD)$/,Bt=/^\/\//,qt={},Ht={},Wt="*/".concat("*"),zt=re.createElement("a");zt.href=Ot.href,ve.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ot.href,type:"GET",isLocal:Dt.test(Ot.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ve.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?J(J(e,ve.ajaxSettings),t):J(ve.ajaxSettings,e)},ajaxPrefilter:X(qt),ajaxTransport:X(Ht),ajax:function(e,t){function r(e,t,r,s){var c,p,d,_,w,E=t;l||(l=!0,u&&n.clearTimeout(u),o=void 0,a=s||"",x.readyState=e>0?4:0,c=e>=200&&e<300||304===e,r&&(_=Z(h,x,r)),_=ee(h,_,x,c),c?(h.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(ve.lastModified[i]=w),w=x.getResponseHeader("etag"),w&&(ve.etag[i]=w)),204===e||"HEAD"===h.type?E="nocontent":304===e?E="notmodified":(E=_.state,p=_.data,d=_.error,c=!d)):(d=E,!e&&E||(E="error",e<0&&(e=0))),x.status=e,x.statusText=(t||E)+"",c?y.resolveWith(m,[p,E,x]):y.rejectWith(m,[x,E,d]),x.statusCode(b),b=void 0,f&&v.trigger(c?"ajaxSuccess":"ajaxError",[x,h,c?p:d]),g.fireWith(m,[x,E]),f&&(v.trigger("ajaxComplete",[x,h]),--ve.active||ve.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var o,i,a,s,u,c,l,f,p,d,h=ve.ajaxSetup({},t),m=h.context||h,v=h.context&&(m.nodeType||m.jquery)?ve(m):ve.event,y=ve.Deferred(),g=ve.Callbacks("once memory"),b=h.statusCode||{},_={},w={},E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Lt.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,_[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)x.always(e[x.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||E;return o&&o.abort(t),r(0,t),this}};if(y.promise(x),h.url=((e||h.url||Ot.href)+"").replace(Bt,Ot.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Fe)||[""],null==h.crossDomain){c=re.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=zt.protocol+"//"+zt.host!=c.protocol+"//"+c.host}catch(T){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ve.param(h.data,h.traditional)),Q(qt,h,t,x),l)return x;f=ve.event&&h.global,f&&0===ve.active++&&ve.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ut.test(h.type),i=h.url.replace(Nt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Rt,"+")):(d=h.url.slice(i.length),h.data&&(i+=(At.test(i)?"&":"?")+h.data,delete h.data),h.cache===!1&&(i=i.replace(jt,""),d=(At.test(i)?"&":"?")+"_="+Ct++ +d),h.url=i+d),h.ifModified&&(ve.lastModified[i]&&x.setRequestHeader("If-Modified-Since",ve.lastModified[i]),ve.etag[i]&&x.setRequestHeader("If-None-Match",ve.etag[i])),(h.data&&h.hasContent&&h.contentType!==!1||t.contentType)&&x.setRequestHeader("Content-Type",h.contentType),x.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Wt+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)x.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(h.beforeSend.call(m,x,h)===!1||l))return x.abort();if(E="abort",g.add(h.complete),x.done(h.success),x.fail(h.error),o=Q(Ht,h,t,x)){if(x.readyState=1,f&&v.trigger("ajaxSend",[x,h]),l)return x;h.async&&h.timeout>0&&(u=n.setTimeout(function(){x.abort("timeout")},h.timeout));try{l=!1,o.send(_,r)}catch(T){if(l)throw T;r(-1,T)}}else r(-1,"No Transport");return x},getJSON:function(e,t,n){return ve.get(e,t,n,"json")},getScript:function(e,t){return ve.get(e,void 0,t,"script")}}),ve.each(["get","post"],function(e,t){ve[t]=function(e,n,r,o){return ve.isFunction(n)&&(o=o||r,r=n,n=void 0),ve.ajax(ve.extend({url:e,type:t,dataType:o,data:n,success:r},ve.isPlainObject(e)&&e))}}),ve._evalUrl=function(e){return ve.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},ve.fn.extend({wrapAll:function(e){var t;return this[0]&&(ve.isFunction(e)&&(e=e.call(this[0])),t=ve(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ve.isFunction(e)?this.each(function(t){ve(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ve(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ve.isFunction(e);return this.each(function(n){ve(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ve(this).replaceWith(this.childNodes)}),this}}),ve.expr.pseudos.hidden=function(e){return!ve.expr.pseudos.visible(e)},ve.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ve.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var $t={0:200,1223:204},Vt=ve.ajaxSettings.xhr();he.cors=!!Vt&&"withCredentials"in Vt,he.ajax=Vt=!!Vt,ve.ajaxTransport(function(e){var t,r;if(he.cors||Vt&&!e.crossDomain)return{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i($t[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(u){if(t)throw u}},abort:function(){t&&t()}}}),ve.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ve.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ve.globalEval(e),e}}}),ve.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ve.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,o){t=ve("