vendor: 4,550 bytes, lines 1-2
1/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ 2!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*ne
vendor: 18,010 bytes, line 2
2w Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")}
vendor: 16,844 bytes, lines 2-4
2)||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; 3 4return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{}
vendor: 1,726 bytes, line 4
4,e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>
vendor: 54,827 bytes, lines 4-5
4=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){ 5return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").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 cc=a.document.documentElement;function dc(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=dc(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||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),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=dc(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]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.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 ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
6//# 7var dfv_helper = (function() { 8 var o = {}; 9 10 o.flexslider_init = function(carousel_options, slider_options, pixelname, adoptions) { 11 12 $(document).ready(function() { 13 var create_car = Object.getOwnPropertyNames(slider_options).length > 1; 14 var cs = 1, opos = {'ad': -1, 'at': -1}; 15 adoptions = adoptions || {"adid": -1, "numpics": -1}; 16 function ad_p (c) { return c > 0 && (++cs % c) === 0;} 17 function save_state(slider) {opos['ad'] = slider.animatingTo; opos['at'] = slider.animatingTo;} 18 function ad (slider, adid) { 19 if (adid === -1) return; 20 if (typeof ADTECH === "undefined") return; 21 22 save_state(slider); 23 var n = $(slider.slides[slider.animatingTo]); 24 n.children().hide(); 25 n.append("<div class='gad' id='" + adid + "'></div>"); 26 $(".slider-subtitle").css("opacity","0"); 27 if (slider.currentSlide < slider.animatingTo) { 28 slider.currentSlide--; 29 slider.animatingTo--; 30 } else { 31 slider.currentSlide++; 32 slider.animatingTo++; 33 } 34 ADTECH.enqueueAd(adid); 35 36 } 37 function rm (slider) { 38 var n = $(slider.slides[opos['ad']]); 39 n.children(".gad").remove(); 40 $(".slider-subtitle").css("opacity","1"); 41 n.children().show(); 42 opos['ad'] = -1; 43 } 44 function ad_ad(slider) { 45 opos['ad'] > -1 && rm(slider); 46 ad_p(adoptions.numpics + 1) && ad(slider, adoptions.adid); 47 } 48 49 function getbefore (pixelname, fn) { 50 51 if (pixelname && fn) { 52 return function(slider) { 53 fn(slider); 54 }; 55 } else if (pixelname) { 56 return function(slider) { 57 }; 58 } else if (fn) { 59 return function(slider) { 60 fn(slider); 61 }; 62 } else { 63 return function(slider) { 64 ; //nothing 65 }; 66 } 67 } 68 69 function reloadAds(){ 70 if (typeof ADTECH !== "undefined") { 71 $.each( $(".banner"), function( key, value ) { 72 ADTECH.enqueueAd(parseInt($(value).attr("id"))); 73 }); 74 ADTECH.executeQueue(); 75 } 76 } 77 78 79 if (create_car) 80 { 81 var before_fn; 82 if (adoptions.adid !== -1 && slider_options.before) { 83 before_fn = function(slider) { ad_ad(slider); slider_options.before(slider); reloadAds(); }; 84 } else if (adoptions.adid !== -1) { 85 before_fn = function(slider) { ad_ad(slider); reloadAds(); }; 86 } else if (slider_options.before) { 87 before_fn = slider_options.before; 88 } 89 $(carousel_options.asNavFor).flexslider({ 90 animation: "slide", 91 animationLoop: false, 92 controlNav: false, 93 prevText:' <i class="icon icon-chevron-left"></i>', 94 nextText:'<i class="icon icon-chevron-right"></i>', 95 multipleKeyboard: true, 96 slideshow: false, 97 itemWidth: slider_options.hasOwnProperty('itemWidth') ? slider_options.itemWidth : 0, 98 itemMargin: slider_options.hasOwnProperty('itemMargin') ? slider_options.itemMargin : 0, 99 move: slider_options.hasOwnProperty('move') ? slider_options.move : 0, 100 sync: slider_options.hasOwnProperty('sync') ? slider_options.sync : '', 101 start: slider_options.hasOwnProperty('start') ? slider_options.start : function(){}, 102 after: slider_options.hasOwnProperty('after') ? slider_options.after : function(slider) { }, 103 before: getbefore(pixelname, before_fn) 104 }); 105 } 106 107 $(slider_options.sync).flexslider({ 108 animation: 'slide', 109 animationLoop: carousel_options.hasOwnProperty('animationLoop') ? carousel_options.animationLoop : false, 110 controlNav: false, 111 prevText:' <i class="icon icon-chevron-left"></i>', 112 nextText:'<i class="icon icon-chevron-right"></i>', 113 slideshow: carousel_options.hasOwnProperty('slideshow') ? carousel_options.slideshow : false, 114 slideshowSpeed: carousel_options.hasOwnProperty('slideshowSpeed') ? carousel_options.slideshowSpeed : 7000, 115 directionNav: carousel_options.hasOwnProperty('directionNav') ? carousel_options.directionNav : true, 116 itemWidth: carousel_options.hasOwnProperty('itemWidth') ? carousel_options.itemWidth : 0, 117 itemMargin: carousel_options.hasOwnProperty('itemMargin') ? carousel_options.itemMargin : 0, 118 asNavFor: carousel_options.hasOwnProperty('asNavFor') ? carousel_options.asNavFor : '', 119 after: carousel_options.hasOwnProperty('after') ? carousel_options.after() : function(){}, 120 before: create_car ? function(){} : getbefore(pixelname) 121 }); 122 }); 123 }; 124 125 function has_nodename(elm, name) { 126 if (elm.nodeName === name) return true; 127 var n = elm.parentNode; 128 while (n) { 129 if (n.nodeName === "FORM") return false;
130 if (n.nodeName === "BUTTON") return true; 131 n = n.parentNode; 132 } 133 return false; 134 } 135 136 o.newsletter_arena_setup = function() { 137 if ($('#nl_order_form').length == 0) { 138 return; 139 } 140 141 // Check Form-Fields 142 $('#nl_order_form').on('click', function( event ) { 143 144 if (event.target.name === 'OKverify' || !has_nodename(event.target, 'BUTTON')) 145 { 146 return true; 147 } 148 149 event.preventDefault(); 150 if($('#nl_form_error').length){ 151 $('#nl_form_error').remove(); 152 } 153 var self = $(this); 154 $.ajax({ 155 url: self.attr("action"), 156 type: 'POST', 157 data: self.serialize(), 158 dataType: 'json', 159 success: function(data) { 160 var err_msg_nl = []; 161 $.each(data.error, function( key, val ) { 162 err_msg_nl.push(val); 163 }); 164 dfv_iom_rpl(); 165 var fo_send = { 166 'hitType': 'event', 167 'eventCategory': 'Newsletter-Bühne', 168 'eventAction': 'send', 169 'eventLabel': 'Success', 170 'page': window.location.pathname, 171 'location': window.location.href 172 }; 173 if(err_msg_nl.length === 0) { 174 $('#nl_order_form').empty(); 175 $('#nl_order_form').html(data.content); 176 dfv_ga_repl(fo_send); 177 178 } else { 179 $("#i_us_csrf").val(data.csrf); 180 fo_send.eventLabel = "Error"; 181 dfv_ga_repl(fo_send); 182 $('.newsletter.stage-publisher').append('<div id="nl_form_error"></div>'); 183 $('#nl_form_error').html(err_msg_nl.join("<br/><br/>")); 184 } 185 186 } 187 }); 188 }); 189 190 }; 191 192 o.storecheckcarousel_init = function(adoptions) { 193 194 $(document).ready(function() { 195 $( "section.storecheck .cs-item" ).hover(function() { 196 $( "img", this ).css( "opacity", "1" ); 197 }); 198 var options = {}; 199 if($('#covercarousel').length){ 200 $('#covercarousel').covercarousel(options); 201 $('#covercarousel').covercarousel.api.setAddAdVars(adoptions.adid,adoptions.numpics); 202 203 // Initialer Aufbau mit nur einem Bild 204 $.ajax({ 205 url: '/gallery/ajaxactions.php', 206 type: 'POST', 207 data: { action: 'loadgallery', 208 i_news_id: $(".cover-nav span:first").attr('data-id'), 209 i_gallery_id: $(".cover-nav span:nth-child(2)").attr('data-id'), 210 i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id') 211 }, 212 dataType: 'json', 213 success: function(covers) { 214 if (covers.length > 0){ 215 $('#covercarousel').covercarousel.api.loadfirstCover(covers); 216 $(".cover-nav .cs-item:first").addClass("active"); 217 } 218 if (covers.length == 1) { 219 $(".cs_start").remove(); 220 } 221 } 222 }); 223 // Text der related News 224 $.ajax({ 225 url: '/gallery/ajaxactions.php', 226 type: 'POST', 227 data: { action: 'loadnews', 228 i_news_id: $(".cover-nav span:first").attr('data-id'), 229 i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id') 230 }, 231 dataType: 'json', 232 success: function(text) { 233 if(text.length > 0){ 234 $('.covertext').append("<a href=\""+text[0]['link']+"\" data-te=\"news"+text[0]['items_id']+"\"><div class=\"tagline\">" 235 +text[0]['kicker']+"</div>\n\ 236 <h3 class=\"post-title x-large serif\">"+text[0]['title']+"</h3><p class=\"excerpt\">"+text[0]['shorttext']+" <span class=\"read-more\">Mehr ›</span></p>\n\ 237 </a>"); 238 if(text[0]['special']){ 239 $('.covertext a:first').append('<p class="storecheck-hint"><img src="/img/storecheck.png" alt="360°-Tour starten" /> 360°-Tour starten ></p>'); 240 } 241 } 242 } 243 }); 244 } 245 // Covershow-Selektion, nachladen der Galerie-Bilder 246 $(".cover-nav .cs-item").on("click", function(event){ 247 248 $('#covercarousel').covercarousel.api.setAddAdVars(adoptions.adid,adoptions.numpics); 249 250 $(".cover-nav .cs-item.active").removeClass("active"); 251 $(this).addClass("active"); 252 $.ajax({ 253 url: '/gallery/ajaxactions.php', 254 type: 'POST', 255 data: { action: 'loadgallery', 256 i_news_id: $(":first", this).attr('data-id'), 257 i_gallery_id: $(":nth-child(2)", this).attr('data-id'), 258 i_special_id: $(":nth-child(3)", this).attr('data-id'), 259 }, 260 dataType: 'json', 261 success: function(covers) { 262 if (covers.length > 0){ 263 $(".cs_start").remove(); 264 $(".storecheck .cevents .nextcover").show(); 265 $('#covercarousel').covercarousel.api.loadCovers(covers);
266 $(".cover-nav .cs-item").css("border-top", ""); 267 $(".cover-nav .cs-item").css("padding-top", ""); 268 } 269 if (covers.length == 1) { 270 $(".storecheck .cevents .nextcover").hide(); 271 $(".cs_start").remove(); 272 } 273 } 274 }); 275 // Text der related News 276 $.ajax({ 277 url: '/gallery/ajaxactions.php', 278 type: 'POST', 279 data: { action: 'loadnews', 280 i_news_id: $(":first", this).attr('data-id'), 281 i_special_id: $(":nth-child(3)", this).attr('data-id'), 282 }, 283 dataType: 'json', 284 success: function(text) { 285 if(text.length > 0){ 286 $('.covertext').empty(); 287 $('.covertext').css('display', 'block'); 288 $('.covertext').append("<a href=\""+text[0]['link']+"\" data-te=\"news"+text[0]['items_id']+"\"><div class=\"tagline\">"+text[0]['kicker']+"</div><h3 class=\"post-title x-large serif\">"+text[0]['title']+"</h3><p class=\"excerpt\">"+text[0]['shorttext']+" <span class=\"read-more\">Mehr ›</span></p></a>"); 289 if(text[0]['special']){ 290 $('.covertext a:first').append('<p class="storecheck-hint"><img src="/img/storecheck.png" alt="360°-Tour starten" /> 360°-Tour starten ></p>'); 291 } 292 } 293 } 294 }); 295 296 window.dfv_iom_rpl(); 297 window.dfv_ga_vpageview('/homepage/storecheck/navigation'); 298 299 }); 300 301 // Button zum Covershow-Start 302 $("body").on("click",".cs_start", function(){ 303 $(".cs_start").remove(); 304 305 $.ajax({ 306 url: '/gallery/ajaxactions.php', 307 type: 'POST', 308 data: { action: 'loadgallery', 309 i_news_id: $(".cover-nav span:first").attr('data-id'), 310 i_gallery_id: $(".cover-nav span:nth-child(2)").attr('data-id'), 311 i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id') 312 }, 313 dataType: 'json', 314 success: function(covers) { 315 if(covers.length > 0){ 316 $('#covercarousel').covercarousel.api.loadCovers(covers); 317 $(".cover-nav .cs-item").css("border-top", ""); 318 $(".cover-nav .cs-item").css("padding-top", ""); 319 $('#covercarousel').covercarousel.api.nextCover(); 320 } 321 } 322 }); 323 }); 324 325 /* Touch Gesten für Storecheck Bühne */ 326 var touchPos, touchMove; 327 $("#covercarousel").on("touchstart", ".cover-inner, .sad", function(e){ 328 touchPos = e.originalEvent.touches[0].pageX; 329 }); 330 331 $("#covercarousel").on("touchmove", ".cover-inner, .sad", function(e){ 332 e.preventDefault(); 333 touchMove = e.originalEvent.touches[0].pageX; 334 // Zieh-Effekt darstellen 335 var margin = touchMove - touchPos; 336 $(this).css("margin-left", margin); 337 338 }); 339 340 $("#covercarousel").on("touchend", ".cover-inner, .sad", function(e){ 341 $(this).css("margin-left", 0); 342 var touchDiff = touchPos - touchMove; 343 344 if(touchDiff < -80){ 345 // vorheriges Bild 346 console.log("prev"); 347 348 // Nicht beim ersten Bild 349 if(!$(this).is($("#covercarousel .coverbox .cover-inner").first())){ 350 $('#covercarousel').covercarousel.api.prevCover(); 351 } 352 } 353 else if(touchDiff > 80){ 354 if($("#covercarousel .coverbox .cover-inner").length == 1){ 355 console.log("start"); 356 $(".cs_start").click(); 357 } 358 else{ 359 // nächstes Bild 360 console.log("next"); 361 $('#covercarousel').covercarousel.api.nextCover(); 362 } 363 } 364 }); 365 366 367 368 }); 369 }; 370 371 o.jwplayer_add_ga_events = function(player, category, label) { 372 jwplayer(player).onPlay(function(event){ 373 var fo_play = { 374 'hitType': 'event', 375 'eventCategory': category, 376 'eventAction': 'play', 377 'eventLabel': label, 378 'page': window.location.pathname, 379 'location': window.location.href 380 }; 381 dfv_ga_repl(fo_play); 382 }); 383 jwplayer(player).onPause(function(event){ 384 var fo_pause = { 385 'hitType': 'event', 386 'eventCategory': category, 387 'eventAction': 'pause', 388 'eventLabel': label, 389 'page': window.location.pathname, 390 'location': window.location.href 391 }; 392 dfv_ga_repl(fo_pause); 393 }); 394 jwplayer(player).onComplete(function(event){ 395 var fo_complete = { 396 'hitType': 'event', 397 'eventCategory': category, 398 'eventAction': 'complete', 399 'eventLabel': label, 400 'page': window.location.pathname, 401 'location': window.location.href 402 }; 403 dfv_ga_repl(fo_complete); 404 }); 405 jwplayer(player).onAdPlay(function(event){ 406 var fo_adplay = { 407 'hitType': 'event', 408 'eventCategory': category, 409 'eventAction': 'ad_play', 410 'eventLabel': label, 411 'page': window.location.pathname, 412 'location': window.location.href 413 }; 414 dfv_ga_repl(fo_adplay); 415 }); 416 jwplayer(player).onAdSkipped(function(event){ 417 var fo_adskipped = { 418 'hitType': 'event', 419 'eventCategory': category, 420 'eventAction': 'ad_skipped', 421 'eventLabel': label, 422 'page': window.location.pathname, 423 'location': window.location.href 424 }; 425 dfv_ga_repl(fo_adskipped); 426 }); 427 jwplayer(player).onAdComplete(function(event){ 428 var fo_adcomplete = { 429 'hitType': 'event', 430 'eventCategory': category, 431 'eventAction': 'ad_complete', 432 'eventLabel': label, 433 'page': window.location.pathname, 434 'location': window.location.href 435 }; 436 dfv_ga_repl(fo_adcomplete); 437 }); 438 439 }; 440 441 o.youtube_ga_events = function(event, category, label) { 442 let state = event.data; 443 if(state === YT.PlayerState.PLAYING){ 444 var fo_play = { 445 'hitType': 'event', 446 'eventCategory': category, 447 'eventAction': 'play', 448 'eventLabel': label, 449 'page': window.location.pathname, 450 'location': window.location.href 451 }; 452 dfv_ga_repl(fo_play); 453 } 454 if(state === YT.PlayerState.PAUSED){ 455 var fo_pause = { 456 'hitType': 'event', 457 'eventCategory': category, 458 'eventAction': 'pause', 459 'eventLabel': label, 460 'page': window.location.pathname, 461 'location': window.location.href 462 }; 463 dfv_ga_repl(fo_pause); 464 } 465 if(state === YT.PlayerState.ENDED){ 466 var fo_complete = { 467 'hitType': 'event', 468 'eventCategory': category, 469 'eventAction': 'complete', 470 'eventLabel': label, 471 'page': window.location.pathname, 472 'location': window.location.href 473 }; 474 dfv_ga_repl(fo_complete); 475 } 476 }; 477 478 o.newsletter_single_arena_setup = function() { 479 if ($('#nl_order_single_form').length == 0) { 480 return; 481 } 482 // Check Form-Fields 483 $('#nl_order_single_form').on('click', function( event ) { 484 485 if (event.target.name === 'OKverify' || !has_nodename(event.target, 'BUTTON')) { 486 return true; 487 } 488 event.preventDefault(); 489 var arena_title = $('#nl_order_single_form [name=i_nlsingle_title]').val(); 490 491 var self = $(this); 492 var url = self.attr("action"); 493 494 $.ajax({ 495 url: self.attr("action"), 496 type: 'POST', 497 data: self.serialize(), 498 dataType: 'json', 499 async: true, 500 success: function(data) { 501 var err_msg_nl = []; 502 if (data.error){ 503 $.each(data.error, function( key, val ) { 504 err_msg_nl.push(val); 505 }); 506 } 507 dfv_iom_rpl(); 508 var fo_send = { 509 'hitType': 'event', 510 'eventCategory': 'Newsletter-Single-Bühne '+ arena_title, 511 'eventAction': 'send', 512 'eventLabel': 'Success', 513 'page': window.location.pathname, 514 'location': window.location.href 515 }; 516 if (err_msg_nl.length === 0) { 517 $('#nl_order_single_form').empty(); 518 $('#nl_order_single_form').html(data.content); 519 dfv_ga_repl(fo_send); 520 } else { 521 $("#i_us_csrf").val(data.csrf); 522 fo_send.eventLabel = "Error"; 523 dfv_ga_repl(fo_send); 524 } 525 $('#nl_single_form_error').html(err_msg_nl.join("<br /><br />")).css('display', 'block'); 526 } 527 }); 528 }); 529 530 }; 531 532 return o; 533})(); 534 535 536(function webpackUniversalModuleDefinition(root, factory) { 537 if(typeof exports === 'object' && typeof module === 'object') 538 module.exports = factory(); 539 else if(typeof define === 'function' && define.amd) 540 define("Amplitude", [], factory); 541 else if(typeof exports === 'object') 542 exports["Amplitude"] = factory(); 543 else 544 root["Amplitude"] = factory(); 545})(this, function() { 546return /******/ (function(modules) { // webpackBootstrap 547/******/ // The module cache 548/******/ var installedModules = {}; 549/******/ 550/******/ // The require function 551/******/ function __webpack_require__(moduleId) { 552/******/ 553/******/ // Check if module is in cache 554/******/ if(installedModules[moduleId]) { 555/******/ return installedModules[moduleId].exports; 556/******/ } 557/******/ // Create a new module (and put it into the cache) 558/******/ var module = installedModules[moduleId] = { 559/******/ i: moduleId, 560/******/ l: false, 561/******/ exports: {} 562/******/ }; 563/******/ 564/******/ // Execute the module function 565/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 566/******/ 567/******/ // Flag the module as loaded
vendor: 4,320 bytes, lines 568-732
568/******/ module.l = true; 569/******/ 570/******/ // Return the exports of the module 571/******/ return module.exports; 572/******/ } 573/******/ 574/******/ 575/******/ // expose the modules object (__webpack_modules__) 576/******/ __webpack_require__.m = modules; 577/******/ 578/******/ // expose the module cache 579/******/ __webpack_require__.c = installedModules; 580/******/ 581/******/ // identity function for calling harmony imports with the correct context 582/******/ __webpack_require__.i = function(value) { return value; }; 583/******/ 584/******/ // define getter function for harmony exports 585/******/ __webpack_require__.d = function(exports, name, getter) { 586/******/ if(!__webpack_require__.o(exports, name)) { 587/******/ Object.defineProperty(exports, name, { 588/******/ configurable: false, 589/******/ enumerable: true, 590/******/ get: getter 591/******/ }); 592/******/ } 593/******/ }; 594/******/ 595/******/ // getDefaultExport function for compatibility with non-harmony modules 596/******/ __webpack_require__.n = function(module) { 597/******/ var getter = module && module.__esModule ? 598/******/ function getDefault() { return module['default']; } : 599/******/ function getModuleExports() { return module; }; 600/******/ __webpack_require__.d(getter, 'a', getter); 601/******/ return getter; 602/******/ }; 603/******/ 604/******/ // Object.prototype.hasOwnProperty.call 605/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 606/******/ 607/******/ // __webpack_public_path__ 608/******/ __webpack_require__.p = ""; 609/******/ 610/******/ // Load entry module and return exports 611/******/ return __webpack_require__(__webpack_require__.s = 47); 612/******/ }) 613/************************************************************************/ 614/******/ ([ 615/* 0 */ 616/***/ (function(module, exports, __webpack_require__) { 617 618"use strict"; 619 620 621var _package = __webpack_require__(59); 622 623module.exports = { 624 version: _package.version, 625 626 audio: new Audio(), 627 628 active_metadata: {}, 629 630 active_album: "", 631 632 active_index: 0, 633 634 active_playlist: null, 635 636 playback_speed: 1.0, 637 638 callbacks: {}, 639 640 songs: [], 641 642 playlists: {}, 643 644 start_song: "", 645 646 starting_playlist: "", 647 648 starting_playlist_song: "", 649 650 repeat: false, 651 652 repeat_song: false, 653 654 shuffle_list: {}, 655 656 shuffle_on: false, 657 658 default_album_art: "", 659 660 default_playlist_art: "", 661 662 debug: false, 663 664 volume: 0.5, 665 666 pre_mute_volume: 0.5, 667 668 volume_increment: 5, 669 670 volume_decrement: 5, 671 672 soundcloud_client: "", 673 674 soundcloud_use_art: false, 675 676 soundcloud_song_count: 0, 677 678 soundcloud_songs_ready: 0, 679 680 is_touch_moving: false, 681 682 buffered: 0, 683 684 bindings: {}, 685 686 continue_next: true, 687 688 delay: 0, 689 690 player_state: "stopped", 691 692 web_audio_api_available: false, 693 694 context: null, 695 696 source: null, 697 698 analyser: null, 699 700 visualizations: { 701 available: [], 702 703 active: [], 704 705 backup: "" 706 }, 707 708 waveforms: { 709 sample_rate: 100, 710 711 built: [] 712 } 713}; /** 714 * These variables make Amplitude run. The config is the most important 715 * containing active settings and parameters. 716 * 717 * The config JSON is the global settings for ALL of Amplitude functions. 718 * This is global and contains all of the user preferences. The default 719 * settings are set, and the user overwrites them when they initialize 720 * Amplitude. 721 * 722 * @module config 723 * @type {object} 724 * @property {string} config.version - The current version of AmplitudeJS. 725 * @property {object} config.audio - Handles all of the audio. 726 * @property {object} config.active_metadata - Contains the active metadata for the song. 727 * @property {string} config.active_album - Holds the active album name. Used to check and see if the album changed and run the album changed callback. 728 * @property {number} config.active_index - Contains the index of the actively playing song. 729 * @property {string} config.active_playlist - Contains the key to the active playlist index. 730 * @property {number} config.playback_speed - Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0 731 * @property {object} config.callbacks - The user can pass a JSON object with a key => value store of callbacks to be run at certain events. 732 * @property {array}
732 config.songs - Contains all of the songs the user has passed to Amplitude to use. 733 * @property {object} config.playlists - Contains all of the playlists the user created. 734 * @property {object} config.start_song - The index of the song that AmplitudeJS should start with. 735 * @property {string} config.starting_playlist - The starting playlist the player will intiialize to. 736 * @property {string} config.starting_playlist_song - The index of the song in the playlist that should be started. 737 * @property {boolean} config.repeat - When repeat is on, when the song ends the song will replay itself. 738 * @property {object} config.shuffle_list - When shuffled, gets populated with the songs the user provided in a random order. 739 * @property {boolean} config.shuffle_on - When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list 740 * @property {string} config.default_album_art - The user can set default album art to be displayed if the song they set doesn't contain album art. 741 * @property {string} config.default_playlist_art - The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture. 742 * @property {boolean} config.debug - When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user. 743 * @property {number} config.volume - The user can set the initial volume to a number between 0 and 1 over-riding the default of .5 744 * @property {number} config.pre_mute_volume - This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to. 745 * @property {number} config.volume_increment - The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button. 746 * @property {number} config.volume_decrement - The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button. 747 * @property {string} config.soundcloud_client - When using SoundCloud, the user will have to provide their API Client ID 748 * @property {boolean} config.soundcloud_use_art - The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API 749 * @property {number} config.soundcloud_song_count - Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration 750 * @property {number} config.soundcloud_songs_ready - Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config. 751 * @property {integer} config.is_touch_moving - Flag for if the user is moving the screen. 752 * @property {boolean} config.buffered - How much of the song is buffered. 753 * @property {object} config.bindings - Array of bindings to certain key events. 754 * @property {boolean} config.continue_next - Determines when a song ends, we should continue to the next song. 755 * @property {number} config.delay - Sets the delay between songs in MS. 756 * @property {boolean} config.use_web_audio_api - Flag that determines if the user wants to use Web Audio API Components. 757 * @property {boolean} config.web_audio_api_available - Flag that determines if the Web Audio API is available. 758 * @property {object} config.context - Web Audio API Context 759 * @property {object} config.source - Web Audio API Source 760 * @property {object} config.analyser - Web Audio API Analyser 761 * @property {string} config.player_state - The current state of the player. 762 */ 763 764/***/ }), 765/* 1 */ 766/***/ (function(module, exports, __webpack_require__) { 767 768"use strict"; 769 770 771Object.defineProperty(exports, "__esModule", { 772 value: true 773}); 774 775var _config = __webpack_require__(0); 776 777var _config2 = _interopRequireDefault(_config); 778 779var _checks = __webpack_require__(5); 780 781var _checks2 = _interopRequireDefault(_checks); 782 783var _audioNavigation = __webpack_require__(3); 784 785var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 786 787var _playPauseElements = __webpack_require__(2); 788 789var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 790 791var _metaDataElements = __webpack_require__(8); 792 793var _metaDataElements2 = _interopRequireDefault(_metaDataElements); 794 795var _callbacks = __webpack_require__(7); 796 797var _callbacks2 = _interopRequireDefault(_callbacks); 798 799var _debug = __webpack_require__(4); 800 801var _debug2 = _interopRequireDefault(_debug); 802 803var _visualizations = __webpack_require__(16); 804 805var _visualizations2 = _interopRequireDefault(_visualizations); 806 807function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 808 809/** 810 * Interacts directly with native functions of the Audio element. Logic 811 * leading up to these methods are handled by click handlers which call 812 * helpers and visual synchronizers. These are the core functions of AmplitudeJS. 813 * Every other function that leads to these prepare the information to be 814 * acted upon by these functions. 815 * 816 * @module core/Core 817 */ 818 819 820/** 821 * Imports AmplitudeJS Debug Utility 822 * @module utilities/debug 823 */ 824 825 826/** 827 * Imports the Meta Data Visual Elements module. 828 * @module visual/metaDataElements 829 */ 830 831 832/** 833 * Imports the Audio Navigation module. 834 * @module utilities/audioNavigation 835 */ 836/** 837 * Imports the config module 838 * @module config 839 */ 840var Core = function () { 841 /** 842 * Plays the active song. If the current song is live, it reconnects 843 * the stream before playing. 844 * 845 * Public Accessor: Amplitude.play() 846 * 847 * @access public 848 */ 849 function play() { 850 _visualizations2.default.stop(); 851 _visualizations2.default.run(); 852 853 /* 854 If the audio is live we re-conenct the stream. 855 */ 856 if (_config2.default.active_metadata.live) { 857 reconnectStream(); 858 } 859 860 /* 861 Mobile remote sources need to be reconnected on play. I think this is 862 because mobile browsers are optimized not to load all resources 863 for speed reasons. We only do this if mobile and the paused button 864 is not clicked. If the pause button was clicked then we don't reconnect 865 or the user will lose their place in the stream. 866 */ 867 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !_config2.default.paused) { 868 reconnectStream(); 869 } 870 871 /* 872 Play the song and set the playback rate to the playback 873 speed. 874 */
vendor: 26,871 bytes, lines 875-1866
875 var playPromise = _config2.default.audio.play(); 876 877 if (playPromise !== undefined) { 878 playPromise.then(function (_) {}).catch(function (error) {}); 879 } 880 _config2.default.audio.play(); 881 _config2.default.audio.playbackRate = _config2.default.playback_speed; 882 } 883 884 /** 885 * Pauses the active song. If it's live, it disconnects the stream. 886 * 887 * Public Accessor: Amplitude.pause() 888 * 889 * @access public 890 */ 891 function pause() { 892 _visualizations2.default.stop(); 893 894 /* 895 Pause the active song. 896 */ 897 _config2.default.audio.pause(); 898 899 /* 900 Flag that pause button was clicked. 901 */ 902 _config2.default.paused = true; 903 904 /* 905 If the song is live, we disconnect the stream so we aren't 906 saving it to memory. 907 */ 908 if (_config2.default.active_metadata.live) { 909 disconnectStream(); 910 } 911 } 912 913 /** 914 * Stops the active song by setting the current song time to 0. 915 * When the user resumes, it will be from the beginning. 916 * If it's a live stream it disconnects. 917 * 918 * Public Accessor: Amplitude.stop() 919 * 920 * @access public 921 */ 922 function stop() { 923 _visualizations2.default.stop(); 924 925 /* 926 Set the current time of the song to 0 which will reset the song. 927 */ 928 if (_config2.default.audio.currentTime != 0) { 929 _config2.default.audio.currentTime = 0; 930 } 931 932 /* 933 Run pause so the song will stop 934 */ 935 _config2.default.audio.pause(); 936 937 /* 938 If the song is live, disconnect the stream. 939 */ 940 if (_config2.default.active_metadata.live) { 941 disconnectStream(); 942 } 943 944 /* 945 Run the stop callback 946 */ 947 _callbacks2.default.run("stop"); 948 } 949 950 /** 951 * Sets the song volume. 952 * 953 * Public Accessor: Amplitude.setVolume( volumeLevel ) 954 * 955 * @access public 956 * @param {number} volumeLevel - A number between 1 and 100 as a percentage of 957 * min to max for a volume level. 958 */ 959 function setVolume(volumeLevel) { 960 /* 961 If the volume is set to mute somewhere else, we sync the display. 962 */ 963 if (volumeLevel == 0) { 964 _config2.default.audio.muted = true; 965 } else { 966 _config2.default.audio.muted = false; 967 } 968 969 /* 970 Sets the volume in the config so we can reference it later on. 971 */ 972 _config2.default.volume = volumeLevel; 973 974 /* 975 Set the volume of the active song. 976 */ 977 _config2.default.audio.volume = volumeLevel / 100; 978 } 979 980 /** 981 * Sets the song percentage. If it's a live song, we ignore this because 982 * we can't skip ahead. This is an issue if you have a playlist with 983 * a live source. 984 * 985 * Public Accessor: Amplitude.setSongLocation( songPercentage ) 986 * 987 * @access public 988 * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion. 989 */ 990 function setSongLocation(songPercentage) { 991 /* 992 As long as the song is not live, we can set the current time of the 993 song to the percentage the user passed in. 994 */ 995 if (!_config2.default.active_metadata.live) { 996 _config2.default.audio.currentTime = _config2.default.audio.duration * (songPercentage / 100); 997 } 998 } 999 1000 /** 1001 * Skips to a location in a song 1002 * 1003 * Public Accessor: Amplitude.skipToLocation( seconds ) 1004 * 1005 * @access public 1006 * @param {number} seconds - An integer containing the seconds to skip to 1007 */ 1008 function skipToLocation(seconds) { 1009 /* 1010 When the active song can be played through, we can check to 1011 see if the seconds will work. We only bind the event handler 1012 once and remove it once it's fired. 1013 */ 1014 _config2.default.audio.addEventListener("canplaythrough", function () { 1015 /* 1016 If the active song duration is greater than or equal to the 1017 amount of seconds the user wants to skip to and the seconds 1018 is greater than 0, we skip to the seconds defined. 1019 */ 1020 if (_config2.default.audio.duration >= seconds && seconds > 0) { 1021 _config2.default.audio.currentTime = seconds; 1022 } else { 1023 _debug2.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0"); 1024 } 1025 }, { once: true }); 1026 } 1027 1028 /** 1029 * Disconnects the live stream 1030 * 1031 * Public Accessor: Amplitude.disconnectStream() 1032 * 1033 * @access public 1034 */ 1035 function disconnectStream() { 1036 _config2.default.audio.src = ""; 1037 _config2.default.audio.load(); 1038 } 1039 1040 /** 1041 * Reconnects the live stream 1042 * 1043 * Public Accessor: Amplitude.reconnectStream() 1044 * 1045 * @access public\ 1046 */ 1047 function reconnectStream() { 1048 _config2.default.audio.src = _config2.default.active_metadata.url; 1049 _config2.default.audio.load(); 1050 } 1051 1052 /** 1053 * Sets the playback speed for the song. 1054 * 1055 * @param {number} playbackSpeed The speed we want the song to play back at. 1056 */ 1057 function setPlaybackSpeed(playbackSpeed) { 1058 /* 1059 Set the config playback speed. 1060 */ 1061 _config2.default.playback_speed = playbackSpeed; 1062 1063 /* 1064 Set the active song playback rate. 1065 */ 1066 _config2.default.audio.playbackRate = _config2.default.playback_speed; 1067 } 1068 1069 /* 1070 Return publically facing functions 1071 */ 1072 return { 1073 play: play, 1074 pause: pause, 1075 stop: stop, 1076 setVolume: setVolume, 1077 setSongLocation: setSongLocation, 1078 skipToLocation: skipToLocation, 1079 disconnectStream: disconnectStream, 1080 reconnectStream: reconnectStream, 1081 setPlaybackSpeed: setPlaybackSpeed 1082 }; 1083}(); 1084 1085/** 1086 * Import the Visualizations from the FX module. 1087 * @module fx/visualizations 1088 */ 1089 1090 1091/** 1092 * Imports AmplitudeJS Callback Utility 1093 * @module utilities/callbacks 1094 */ 1095 1096 1097/** 1098 * Imports the Play/Pause Visual Elements module. 1099 * @module visual/playPauseElements 1100 */ 1101 1102 1103/** 1104 * Imports the Checks module. 1105 * @module utilities/checks 1106 */ 1107exports.default = Core; 1108module.exports = exports["default"]; 1109 1110/***/ }), 1111/* 2 */ 1112/***/ (function(module, exports, __webpack_require__) { 1113 1114"use strict"; 1115 1116 1117Object.defineProperty(exports, "__esModule", { 1118 value: true 1119}); 1120 1121var _config = __webpack_require__(0); 1122 1123var _config2 = _interopRequireDefault(_config); 1124 1125function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 1126 1127/** 1128 * Defines the visual representation of AmplitudeJS play pause elements. 1129 * @module visual/PlayPauseElements 1130 */ 1131var PlayPauseElements = function () { 1132 /** 1133 * Syncs all play pause elements. 1134 * 1135 * @access public 1136 */ 1137 function sync() { 1138 syncGlobal(); 1139 syncPlaylist(); 1140 syncSong(); 1141 syncSongInPlaylist(); 1142 } 1143 1144 /** 1145 * Syncs the global play pause buttons to the state of the active song. 1146 * 1147 * @access public 1148 */ 1149 function syncGlobal() { 1150 /* 1151 Get the active song state. 1152 */ 1153 var state = _config2.default.audio.paused ? "paused" : "playing"; 1154 1155 /* 1156 Get all play pause buttons. 1157 */ 1158 var playPauseElements = document.querySelectorAll(".amplitude-play-pause"); 1159 1160 /* 1161 Iterate over all of the play pause elements syncing the 1162 display visually. 1163 */ 1164 for (var i = 0; i < playPauseElements.length; i++) { 1165 /* 1166 Grab the playlist and song attributes from the element. 1167 */ 1168 var playlist = playPauseElements[i].getAttribute("data-amplitude-playlist"); 1169 var song = playPauseElements[i].getAttribute("data-amplitude-song-index"); 1170 1171 /* 1172 This method is responsible for only the global elements, 1173 so we make sure there are no playlist or songs defined on 1174 the element. 1175 */ 1176 if (playlist == null && song == null) { 1177 /* 1178 Determines what classes we should add and remove 1179 from the elements. 1180 */ 1181 switch (state) { 1182 case "playing": 1183 setElementPlay(playPauseElements[i]); 1184 break; 1185 case "paused": 1186 setElementPause(playPauseElements[i]); 1187 break; 1188 } 1189 } 1190 } 1191 } 1192 1193 /** 1194 * Syncs the main playlist play pause buttons to the state of the active song. 1195 * 1196 * @access public 1197 */ 1198 function syncPlaylist() { 1199 var state = _config2.default.audio.paused ? "paused" : "playing"; 1200 1201 /* 1202 Get all of the main playlist play pause elements 1203 */ 1204 var playlistPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 1205 1206 /* 1207 Iterate over the play pause elements, syncing the state accordingly. 1208 */ 1209 for (var i = 0; i < playlistPlayPauseElements.length; i++) { 1210 /* 1211 Grab the song attributes from the element. 1212 */ 1213 var song = playlistPlayPauseElements[i].getAttribute("data-amplitude-song-index"); 1214 1215 /* 1216 We want only the play pause elements for the main on a 1217 playlist nothing else. We have another method for the 1218 song in playlist play pause method. 1219 */ 1220 if (song == null) { 1221 /* 1222 Determines what classes we should add and remove 1223 from the elements. 1224 */ 1225 switch (state) { 1226 case "playing": 1227 setElementPlay(playlistPlayPauseElements[i]); 1228 break; 1229 case "paused": 1230 setElementPause(playlistPlayPauseElements[i]); 1231 break; 1232 } 1233 } 1234 } 1235 } 1236 1237 /** 1238 * Syncs the song play pause buttons to the state of the active song. 1239 * 1240 * @access public 1241 */ 1242 function syncSong() { 1243 var state = _config2.default.audio.paused ? "paused" : "playing"; 1244 1245 /* 1246 Get all of the individual song play pause buttons. These have an 1247 amplitude-song-index that matches the active index attribute. 1248 */ 1249 var songPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 1250 1251 /* 1252 Iterate over all of the song play pause elements 1253 */ 1254 for (var i = 0; i < songPlayPauseElements.length; i++) { 1255 /* 1256 Grab the playlist attributes from the element. 1257 */ 1258 var playlist = songPlayPauseElements[i].getAttribute("data-amplitude-playlist"); 1259 1260 /* 1261 We want only the song play pause buttons, not ones scoped in a playlist. 1262 */ 1263 if (playlist == null) { 1264 /* 1265 Determines what classes we should add and remove 1266 from the elements. 1267 */ 1268 switch (state) { 1269 case "playing": 1270 setElementPlay(songPlayPauseElements[i]); 1271 break; 1272 case "paused": 1273 setElementPause(songPlayPauseElements[i]); 1274 break; 1275 } 1276 } 1277 } 1278 } 1279 1280 /** 1281 * Syncs the song in playlist play pause buttons to the state of 1282 * the active song. 1283 * 1284 * @access public 1285 */ 1286 function syncSongInPlaylist() { 1287 var state = _config2.default.audio.paused ? "paused" : "playing"; 1288 1289 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 1290 1291 /* 1292 Get all of the individual song play pause buttons. These have an 1293 amplitude-song-index attribute. Some have amplitude-playlist which 1294 means they are individual songs within a playlist. 1295 */ 1296 var songInPlaylistPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 1297 1298 /* 1299 Iterate over all of the individual play pause elements for songs inspect 1300 a playlist. 1301 */ 1302 for (var i = 0; i < songInPlaylistPlayPauseElements.length; i++) { 1303 /* 1304 Determines what classes we should add and remove 1305 from the elements. 1306 */ 1307 switch (state) { 1308 case "playing": 1309 setElementPlay(songInPlaylistPlayPauseElements[i]); 1310 break; 1311 case "paused": 1312 setElementPause(songInPlaylistPlayPauseElements[i]); 1313 break; 1314 } 1315 } 1316 } 1317 1318 /** 1319 * Sets all of the play pause buttons to paused. 1320 * 1321 * @access public 1322 */ 1323 function syncToPause() { 1324 /* 1325 Gets all of the play pause elements 1326 */ 1327 var playPauseElements = document.querySelectorAll(".amplitude-play-pause"); 1328 1329 /* 1330 Sets all of the elements to pause 1331 */ 1332 for (var i = 0; i < playPauseElements.length; i++) { 1333 setElementPause(playPauseElements[i]); 1334 } 1335 } 1336 1337 /** 1338 * Sets an element to be playing by removing the 'amplitude-paused' class 1339 * and adding the 'amplitude-playing' class 1340 * 1341 * @access public 1342 * @param {element} element - The element getting the playing class added. 1343 */ 1344 function setElementPlay(element) { 1345 element.classList.add("amplitude-playing"); 1346 element.classList.remove("amplitude-paused"); 1347 } 1348 1349 /** 1350 * Sets an element to be paused by adding the 'amplitude-paused' class 1351 * and removing the 'amplitude-playing' class 1352 * 1353 * @access public 1354 * @param {element} element - The element getting the paused class added. 1355 */ 1356 function setElementPause(element) { 1357 element.classList.remove("amplitude-playing"); 1358 element.classList.add("amplitude-paused"); 1359 } 1360 1361 /** 1362 * Returns the public facing methods 1363 */ 1364 return { 1365 sync: sync, 1366 syncGlobal: syncGlobal, 1367 syncPlaylist: syncPlaylist, 1368 syncSong: syncSong, 1369 syncSongInPlaylist: syncSongInPlaylist, 1370 syncToPause: syncToPause 1371 }; 1372}(); /** 1373 * Imports the config module 1374 * @module config 1375 */ 1376exports.default = PlayPauseElements; 1377module.exports = exports["default"]; 1378 1379/***/ }), 1380/* 3 */ 1381/***/ (function(module, exports, __webpack_require__) { 1382 1383"use strict"; 1384 1385 1386Object.defineProperty(exports, "__esModule", { 1387 value: true 1388}); 1389 1390var _config = __webpack_require__(0); 1391 1392var _config2 = _interopRequireDefault(_config); 1393 1394var _core = __webpack_require__(1); 1395 1396var _core2 = _interopRequireDefault(_core); 1397 1398var _callbacks = __webpack_require__(7); 1399 1400var _callbacks2 = _interopRequireDefault(_callbacks); 1401 1402var _checks = __webpack_require__(5); 1403 1404var _checks2 = _interopRequireDefault(_checks); 1405 1406var _playPauseElements = __webpack_require__(2); 1407 1408var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 1409 1410var _songSliderElements = __webpack_require__(14); 1411 1412var _songSliderElements2 = _interopRequireDefault(_songSliderElements); 1413 1414var _songPlayedProgressElements = __webpack_require__(20); 1415 1416var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements); 1417 1418var _timeElements = __webpack_require__(15); 1419 1420var _timeElements2 = _interopRequireDefault(_timeElements); 1421 1422var _metaDataElements = __webpack_require__(8); 1423 1424var _metaDataElements2 = _interopRequireDefault(_metaDataElements); 1425 1426var _containerElements = __webpack_require__(49); 1427 1428var _containerElements2 = _interopRequireDefault(_containerElements); 1429 1430function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 1431 1432/** 1433 * AmplitudeJS Audio Navigation Utility. 1434 * 1435 * @module utilities/AudioNavigation 1436 */ 1437 1438 1439/** 1440 * Meta Data Elements Module 1441 * 1442 * @module visual/MetaDataElements 1443 */ 1444 1445 1446/** 1447 * Imports the Song Played Progress Elements Module 1448 * 1449 * @module visual/SongPlayedProgressElements 1450 */ 1451 1452 1453/** 1454 * Imports the Play Pause Elements Module 1455 * 1456 * @module visual/PlayPauseElements 1457 */ 1458 1459 1460/** 1461 * Imports the Callbacks Module 1462 * 1463 * @module utilities/Callbacks 1464 */ 1465/** 1466 * Imports the config module 1467 * @module config 1468 */ 1469var AudioNavigation = function () { 1470 /** 1471 * Sets the next song 1472 * 1473 * @access public 1474 * @param {boolean} [songEnded=false] If the song ended, this is set to true 1475 * so we take into effect the repeat setting. 1476 */ 1477 function setNext() { 1478 var songEnded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 1479 1480 /* 1481 Initializes the next index variable. This will be the 1482 index of the song that is next. 1483 */ 1484 var nextIndex = null; 1485 var nextSong = {}; 1486 1487 /* 1488 Ensure we don't loop in the playlist if config.repeat is not true 1489 */ 1490 var endOfList = false; 1491 1492 /* 1493 Determines if we are repeating the song or not. If we are repeating, 1494 the next song will be the same song index. 1495 */ 1496 if (_config2.default.repeat_song) { 1497 /* 1498 If the playlist is shuffled, get the now playing index. 1499 */ 1500 if (_config2.default.shuffle_on) { 1501 nextIndex = _config2.default.shuffle_list[_config2.default.active_index].index; 1502 nextSong = _config2.default.shuffle_list[nextIndex]; 1503 } else { 1504 nextIndex = _config2.default.active_index; 1505 nextSong = _config2.default.songs[nextIndex]; 1506 } 1507 } else { 1508 /* 1509 If the shuffle is on, we use the shuffled list of 1510 songs to determine our next song. 1511 */ 1512 if (_config2.default.shuffle_on) { 1513 /* 1514 If the active shuffle index + 1 is less than the length, then 1515 we use the next shuffle otherwise we go to the beginning 1516 of the shuffle list. 1517 */ 1518 if (parseInt(_config2.default.active_index) + 1 < _config2.default.shuffle_list.length) { 1519 /* 1520 Set the next index to be the index of the song in the shuffle list. 1521 */ 1522 nextIndex = parseInt(_config2.default.active_index) + 1; 1523 } else { 1524 nextIndex = 0; 1525 endOfList = true; 1526 } 1527 1528 nextSong = _config2.default.shuffle_list[nextIndex]; 1529 } else { 1530 /* 1531 If the active index + 1 is less than the length of the songs, then 1532 we use the next song otherwise we go to the beginning of the 1533 song list. 1534 */ 1535 if (parseInt(_config2.default.active_index) + 1 < _config2.default.songs.length) { 1536 nextIndex = parseInt(_config2.default.active_index) + 1; 1537 } else { 1538 nextIndex = 0; 1539 endOfList = true; 1540 } 1541 1542 /* 1543 Sets the next index. 1544 */ 1545 nextSong = _config2.default.songs[nextIndex]; 1546 } 1547 } 1548 1549 /* 1550 Change the song after the next button has been pressed. 1551 */ 1552 changeSong(nextSong, nextIndex); 1553 1554 /* 1555 If it's the end of the list and repeat is not on, do nothing. 1556 */ 1557 if (endOfList && !_config2.default.repeat) {} else { 1558 /* 1559 If the song has ended and repeat is on, play the song. 1560 */ 1561 if (!(songEnded && !_config2.default.repeat && endOfList)) { 1562 _core2.default.play(); 1563 } 1564 } 1565 1566 /* 1567 Sync the play pause elements and run the 1568 after next callback. 1569 */ 1570 _playPauseElements2.default.sync(); 1571 _callbacks2.default.run("next"); 1572 1573 /* 1574 If we repeated the song, run the repeat song callback. 1575 */ 1576 if (_config2.default.repeat_song) { 1577 _callbacks2.default.run("song_repeated"); 1578 } 1579 } 1580 1581 /** 1582 * Sets the next song in a playlist 1583 * 1584 * @param {string} playlist - The playlist being shuffled 1585 * @param {boolean} [songEnded=false] - If the song ended, this is set to true 1586 * so we take into effect the repeat setting. 1587 */ 1588 function setNextPlaylist(playlist) { 1589 var songEnded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 1590 1591 /* 1592 Initializes the next index 1593 */ 1594 var nextIndex = null; 1595 var nextSong = {}; 1596 1597 /* 1598 Ensure we don't loop in the playlist if config.repeat is not true 1599 */ 1600 var endOfList = false; 1601 1602 /* 1603 If we are repeating the song, then we just start the song over. 1604 */ 1605 if (_config2.default.repeat_song) { 1606 /* 1607 If the playlist is shuffled, get the now playing index. 1608 */ 1609 if (_config2.default.playlists[playlist].shuffle) { 1610 nextIndex = _config2.default.playlists[playlist].active_index; 1611 nextSong = _config2.default.playlists[playlist].shuffle_list[nextIndex]; 1612 } else { 1613 nextIndex = _config2.default.playlists[playlist].active_index; 1614 nextSong = _config2.default.playlists[playlist].songs[nextIndex]; 1615 } 1616 } else { 1617 /* 1618 If the playlist is shuffled we get the next index of the playlist. 1619 */ 1620 if (_config2.default.playlists[playlist].shuffle) { 1621 /* 1622 If the active shuffle index + 1 is less than the length of the shuffle list, 1623 then we use the next shuffle otherwise we go to the beginning of the shuffle list. 1624 */ 1625 if (parseInt(_config2.default.playlists[playlist].active_index) + 1 < _config2.default.playlists[playlist].shuffle_list.length) { 1626 /* 1627 Set the next index to be the index of the song in the shuffle list. 1628 */ 1629 nextIndex = _config2.default.playlists[playlist].active_index + 1; 1630 } else { 1631 nextIndex = 0; 1632 endOfList = true; 1633 } 1634 1635 nextSong = _config2.default.playlists[playlist].shuffle_list[nextIndex]; 1636 } else { 1637 /* 1638 If the active index +1 is less than the length of the songs in the playlist, 1639 then we use the next song otherwise we go to the beginning of the playlist. 1640 */ 1641 if (parseInt(_config2.default.playlists[playlist].active_index) + 1 < _config2.default.playlists[playlist].songs.length) { 1642 nextIndex = parseInt(_config2.default.playlists[playlist].active_index) + 1; 1643 } else { 1644 nextIndex = 0; 1645 endOfList = true; 1646 } 1647 1648 /* 1649 Sets the next song. 1650 */ 1651 nextSong = _config2.default.playlists[playlist].songs[nextIndex]; 1652 } 1653 } 1654 1655 /* 1656 Sets the active playlist to the playlist we are on. 1657 */ 1658 setActivePlaylist(playlist); 1659 1660 /* 1661 Change the song within the playlist. 1662 */ 1663 changeSongPlaylist(playlist, nextSong, nextIndex); 1664 1665 /* 1666 If it's the end of the playlist and we aren't repeating, do nothing. 1667 */ 1668 if (endOfList && !_config2.default.repeat) {} else { 1669 if (!(songEnded && !_config2.default.repeat && endOfList)) { 1670 _core2.default.play(); 1671 } 1672 } 1673 1674 /* 1675 Sync the play pause buttons. 1676 */ 1677 _playPauseElements2.default.sync(); 1678 _callbacks2.default.run("next"); 1679 1680 /* 1681 Repeat the song. 1682 */ 1683 if (_config2.default.repeat_song) { 1684 _callbacks2.default.run("song_repeated"); 1685 } 1686 } 1687 1688 /** 1689 * Sets the previous song on the global songs array. 1690 * 1691 * @access private 1692 */ 1693 function setPrevious() { 1694 /* 1695 Initializes the previous index 1696 */ 1697 var previousIndex = null; 1698 var previousSong = {}; 1699 1700 /* 1701 If we are repeating the song, then we just start the song over. 1702 */ 1703 if (_config2.default.repeat_song) { 1704 /* 1705 If the config is shuffled, get the now playing index. 1706 */ 1707 if (_config2.default.shuffle_on) { 1708 previousIndex = _config2.default.active_index; 1709 previousSong = _config2.default.shuffle_list[previousIndex]; 1710 } else { 1711 previousIndex = _config2.default.active_index; 1712 previousSong = _config2.default.songs[previousIndex]; 1713 } 1714 } else { 1715 /* 1716 Get the previous index. If the previous index will be less than 0, get the 1717 last song of the array and continue. 1718 */ 1719 if (parseInt(_config2.default.active_index) - 1 >= 0) { 1720 previousIndex = parseInt(_config2.default.active_index - 1); 1721 } else { 1722 previousIndex = parseInt(_config2.default.songs.length - 1); 1723 } 1724 1725 /* 1726 If the config is shuffled, we grab the song from the shuffle list 1727 */ 1728 if (_config2.default.shuffle_on) { 1729 /* 1730 Grab song from the shuffle list 1731 */ 1732 previousSong = _config2.default.shuffle_list[previousIndex]; 1733 } else { 1734 /* 1735 Grab song from the songs array 1736 */ 1737 previousSong = _config2.default.songs[previousIndex]; 1738 } 1739 } 1740 /* 1741 Change the song after the next button has been pressed. 1742 */ 1743 changeSong(previousSong, previousIndex); 1744 1745 /* 1746 Play the newest song. 1747 */ 1748 _core2.default.play(); 1749 1750 /* 1751 Sync the play pause elements and run the 1752 after next callback. 1753 */ 1754 _playPauseElements2.default.sync(); 1755 _callbacks2.default.run("prev"); 1756 1757 /* 1758 If we repeated the song, run the repeat song callback. 1759 */ 1760 if (_config2.default.repeat_song) { 1761 _callbacks2.default.run("song_repeated"); 1762 } 1763 } 1764 1765 /** 1766 * Sets the previous playlist song. 1767 * 1768 * @access private 1769 * 1770 * @prop {string} playlist - The playlist we are navigating in. 1771 */ 1772 function setPreviousPlaylist(playlist) { 1773 /* 1774 Initializes the previous index 1775 */ 1776 var previousIndex = null; 1777 var previousSong = {}; 1778 1779 /* 1780 If we are repeating the song, then we just start the song over. 1781 */ 1782 if (_config2.default.repeat_song) { 1783 /* 1784 If the playlist is shuffled, get the now playing index. 1785 */ 1786 if (_config2.default.playlists[playlist].shuffle) { 1787 previousIndex = _config2.default.playlists[playlist].active_index; 1788 previousSong = _config2.default.playlists[playlist].shuffle_list[previousIndex]; 1789 } else { 1790 previousIndex = _config2.default.playlists[playlist].active_index; 1791 previousSong = _config2.default.playlists[playlist].songs[previousIndex]; 1792 } 1793 } else { 1794 /* 1795 Get the previous index. If the previous index will be less than 0, get the 1796 last song of the array and continue. 1797 */ 1798 if (parseInt(_config2.default.playlists[playlist].active_index) - 1 >= 0) { 1799 previousIndex = parseInt(_config2.default.playlists[playlist].active_index - 1); 1800 } else { 1801 previousIndex = parseInt(_config2.default.playlists[playlist].songs.length - 1); 1802 } 1803 1804 /* 1805 If the playlist is shuffled, we grab the song from the shuffle list 1806 */ 1807 if (_config2.default.playlists[playlist].shuffle) { 1808 /* 1809 Grab song from the shuffle list 1810 */ 1811 previousSong = _config2.default.playlists[playlist].shuffle_list[previousIndex]; 1812 } else { 1813 /* 1814 Grab song from the songs array 1815 */ 1816 previousSong = _config2.default.playlists[playlist].songs[previousIndex]; 1817 } 1818 } 1819 1820 /* 1821 Sets the active playlist to the playlist we are on. 1822 */ 1823 setActivePlaylist(playlist); 1824 1825 /* 1826 Change the song within the playlist. 1827 */ 1828 changeSongPlaylist(playlist, previousSong, previousIndex); 1829 1830 /* 1831 Plays the song 1832 */ 1833 _core2.default.play(); 1834 1835 /* 1836 Sync the play pause buttons. 1837 */ 1838 _playPauseElements2.default.sync(); 1839 _callbacks2.default.run("prev"); 1840 1841 /* 1842 Repeat the song. 1843 */ 1844 if (_config2.default.repeat_song) { 1845 _callbacks2.default.run("song_repeated"); 1846 } 1847 } 1848 1849 /** 1850 * Change song in the songs array. 1851 * 1852 * @access private 1853 * @prop {object} song - The song we are changing to. 1854 * @prop {number} index - The index we are changing to. 1855 */ 1856 function changeSong(song, index) { 1857 /* 1858 Prepare the song change. 1859 */ 1860 prepareSongChange(song); 1861 1862 /* 1863 Change the song. 1864 */ 1865 _config2.default.audio.src = song.url; 1866 _config2.default.active_metadata = song;
1867 _config2.default.active_album = song.album; 1868 1869 _config2.default.active_index = parseInt(index); 1870 1871 /* 1872 Set new information now that the song has changed. 1873 */ 1874 afterSongChange(); 1875 } 1876 1877 /** 1878 * Handles a song change in the playlist 1879 * 1880 * @access private 1881 * @prop {string} playlist - The playlist we are changing the song on. 1882 * @prop {object} song - The song we are changing to in the playlist. 1883 * @prop {number} index - The inded of the song we are changing to in the playlist. 1884 */ 1885 function changeSongPlaylist(playlist, song, index) { 1886 /* 1887 Prepare the song change. 1888 */ 1889 prepareSongChange(song); 1890 1891 /* 1892 Change the song. 1893 */ 1894 _config2.default.audio.src = song.url; 1895 _config2.default.active_metadata = song; 1896 _config2.default.active_album = song.album; 1897 _config2.default.active_index = null; 1898 1899 _config2.default.playlists[playlist].active_index = parseInt(index); 1900 1901 /* 1902 Set new information now that the song has changed. 1903 */ 1904 afterSongChange(); 1905 } 1906 1907 /** 1908 * Prepares a song change 1909 * 1910 * @access private 1911 * @prop {object} song - The song we change to. 1912 */ 1913 function prepareSongChange(song) { 1914 /* 1915 Stop the current song. 1916 */ 1917 _core2.default.stop(); 1918 1919 /* 1920 Sync all of the elements to a stopped song. 1921 */ 1922 _playPauseElements2.default.syncToPause(); 1923 _songSliderElements2.default.resetElements(); 1924 _songPlayedProgressElements2.default.resetElements(); 1925 _timeElements2.default.resetCurrentTimes(); 1926 1927 /* 1928 If an album changes, fire an album change. 1929 */ 1930 if (_checks2.default.newAlbum(song)) { 1931 _callbacks2.default.run("album_change"); 1932 } 1933 } 1934 1935 /** 1936 * Updates data on the display after a song has changed. 1937 * 1938 * @access private 1939 */ 1940 function afterSongChange() { 1941 _metaDataElements2.default.displayMetaData(); 1942 _containerElements2.default.setActive(
vendor: 10,130 bytes, lines 1942-2345
1942); 1943 _timeElements2.default.resetDurationTimes(); 1944 1945 /* 1946 Run the song change callback. 1947 */ 1948 _callbacks2.default.run("song_change"); 1949 } 1950 1951 /** 1952 * Sets the active playlist 1953 * 1954 * @access public 1955 * @param {string} playlist - The string of the playlist being set to active. 1956 */ 1957 function setActivePlaylist(playlist) { 1958 /* 1959 If the active playlist is different than the playlist being set, 1960 we run the `playlist_changed` callback. 1961 */ 1962 if (_config2.default.active_playlist != playlist) { 1963 _callbacks2.default.run("playlist_changed"); 1964 /* 1965 Set the active playlist to the playlist parameter. Only need to 1966 set if it's different. 1967 */ 1968 _config2.default.active_playlist = playlist; 1969 1970 if (playlist != null) { 1971 _config2.default.playlists[playlist].active_index = 0; 1972 } 1973 } 1974 } 1975 1976 /* 1977 Return the publically facing methods 1978 */ 1979 return { 1980 setNext: setNext, 1981 setNextPlaylist: setNextPlaylist, 1982 setPrevious: setPrevious, 1983 setPreviousPlaylist: setPreviousPlaylist, 1984 changeSong: changeSong, 1985 changeSongPlaylist: changeSongPlaylist, 1986 setActivePlaylist: setActivePlaylist 1987 }; 1988}(); 1989 1990/** 1991 * Container Elements Module 1992 * 1993 * @module visual/ContainerElements 1994 */ 1995 1996 1997/** 1998 * Imports the Time Elements Module 1999 * 2000 * @module visual/TimeElements 2001 */ 2002 2003 2004/** 2005 * Imports the Song Slider Elements Module 2006 * 2007 * @module visual/SongSliderElements 2008 */ 2009 2010 2011/** 2012 * Imports the Checks Module 2013 * 2014 * @module utilities/Checks 2015 */ 2016 2017 2018/** 2019 * Imports the Core Module 2020 * 2021 * @module core/Core 2022 */ 2023exports.default = AudioNavigation; 2024module.exports = exports["default"]; 2025 2026/***/ }), 2027/* 4 */ 2028/***/ (function(module, exports, __webpack_require__) { 2029 2030"use strict"; 2031 2032 2033Object.defineProperty(exports, "__esModule", { 2034 value: true 2035}); 2036 2037var _config = __webpack_require__(0); 2038 2039var _config2 = _interopRequireDefault(_config); 2040 2041function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2042 2043/** 2044 * Handles the debugging of AmplitudeJS 2045 * @module utilities/Debug 2046 */ 2047var Debug = function () { 2048 /** 2049 * Writes out debug message to the console if enabled. 2050 * 2051 * Public Accessor: Debug.writeMessage( message ) 2052 * 2053 * @access public 2054 * @param {string} message - The string that gets printed to alert the user of a debugging error. 2055 */ 2056 function writeMessage(message) { 2057 /* 2058 If the user has flagged AmplitudeJS to debug, we print out a message 2059 to the console. 2060 */ 2061 if (_config2.default.debug) { 2062 console.log(message); 2063 } 2064 } 2065 2066 /* 2067 Returns the public facing methods 2068 */ 2069 return { 2070 writeMessage: writeMessage 2071 }; 2072}(); /** 2073 * Imports the config module 2074 * @module config 2075 */ 2076exports.default = Debug; 2077module.exports = exports["default"]; 2078 2079/***/ }), 2080/* 5 */ 2081/***/ (function(module, exports, __webpack_require__) { 2082 2083"use strict"; 2084 2085 2086Object.defineProperty(exports, "__esModule", { 2087 value: true 2088}); 2089 2090var _config = __webpack_require__(0); 2091 2092var _config2 = _interopRequireDefault(_config); 2093 2094function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2095 2096/** 2097 * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists 2098 * 2099 * @module utilities/Checks 2100 */ 2101var Checks = function () { 2102 /** 2103 * Checks to see if the new song to be played is different than the song 2104 * that is currently playing. To be true, the user would have selected 2105 * play on a new song with a new index. To be false, the user would have 2106 * clicked play/pause on the song that was playing. 2107 * 2108 * Public Accessor: Checks.newSong( playlist, songIndex ) 2109 * @access public 2110 * @param {string} playlist - The playlist we are checking the new song for. Could be null 2111 * @param {number} songIndex - The index of the new song to be played. 2112 * @returns {boolean} True if we are setting a new song, false if we are not setting a new song. 2113 */ 2114 function newSong(playlist, songIndex) { 2115 /* 2116 If the playlists don't match, then it's definitely a new song. 2117 */ 2118 if (_config2.default.active_playlist != playlist) { 2119 return true; 2120 } else { 2121 /* 2122 If we aren't in a playlist, we check the active index. 2123 */ 2124 if (_config2.default.active_playlist == null && playlist == null) { 2125 /* 2126 If the active indexes don't match, then it's a new song. 2127 */ 2128 if (_config2.default.active_index != songIndex) { 2129 return true; 2130 } else { 2131 return false; 2132 } 2133 } else { 2134 /* 2135 If we are in a playlist, then we check to see if the 2136 new song index matches the active index. 2137 */ 2138 if (_config2.default.active_playlist == playlist && _config2.default.playlists[playlist].active_index != songIndex) { 2139 return true; 2140 } else { 2141 return false; 2142 } 2143 } 2144 } 2145 } 2146 2147 /** 2148 * Checks to see if there is a new album 2149 * 2150 * Public Accessor: Checks.newAlbum( album ) 2151 * 2152 * @access public 2153 * @param {string} album - Checks to see if the new song will have a new album. 2154 * @returns {boolean} True if there is a new album, false if there is not a new ablum. 2155 */ 2156 function newAlbum(album) { 2157 if (_config2.default.active_album != album) { 2158 return true; 2159 } else { 2160 return false; 2161 } 2162 } 2163 2164 /** 2165 * Checks to see if there is a new playlist 2166 * 2167 * Public Accessor: Checks.newPlaylist( playlist ) 2168 * 2169 * @access public 2170 * @param {string} playlist - The playlist passed in to check against the active playlist. 2171 * @returns {boolean} True if there is a new playlist, false if there is not a new playlist. 2172 */ 2173 function newPlaylist(playlist) { 2174 if (_config2.default.active_playlist != playlist) { 2175 return true; 2176 } else { 2177 return false; 2178 } 2179 } 2180 2181 /** 2182 * Determines if the string passed in is a URL or not 2183 * 2184 * Public Accessor: AmplitudeHelpers.isURL( url ) 2185 * 2186 * @access public 2187 * @param {string} url - The string we are testing to see if it's a URL. 2188 * @returns {boolean} True if the string is a url, false if it is not. 2189 */ 2190 function isURL(url) { 2191 /* 2192 Test the string against the URL pattern and return if it matches 2193 */ 2194 var pattern = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; 2195 2196 return pattern.test(url); 2197 } 2198 2199 /** 2200 * Determines if what is passed in is an integer or not. 2201 * 2202 * Public Accessor: AmplitudeHelpers.isInt( int ) 2203 * 2204 * @access public 2205 * @param {string|number} int - The variable we are testing to see is an integer or not. 2206 * @returns {boolean} If the variable is an integer or not. 2207 */ 2208 function isInt(int) { 2209 return !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10)); 2210 } 2211 2212 /** 2213 * Returns public facing methods 2214 */ 2215 return { 2216 newSong: newSong, 2217 newAlbum: newAlbum, 2218 newPlaylist: newPlaylist, 2219 isURL: isURL, 2220 isInt: isInt 2221 }; 2222}(); /** 2223 * Imports the config module 2224 * @module config 2225 */ 2226exports.default = Checks; 2227module.exports = exports["default"]; 2228 2229/***/ }), 2230/* 6 */ 2231/***/ (function(module, exports, __webpack_require__) { 2232 2233"use strict"; 2234 2235 2236Object.defineProperty(exports, "__esModule", { 2237 value: true 2238}); 2239 2240var _config = __webpack_require__(0); 2241 2242var _config2 = _interopRequireDefault(_config); 2243 2244function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2245 2246/** 2247 * Handles the state of the config object. 2248 * 2249 * @module utilities/ConfigState 2250 */ 2251var ConfigState = function () { 2252 /** 2253 * Resets the config to the default state. This is called on initialize 2254 * to ensure the user's config is what matters. 2255 * 2256 * Public Accessor: AmplitudeHelpers.resetConfig() 2257 * 2258 * @access public 2259 */ 2260 function resetConfig() { 2261 _config2.default.audio = new Audio(); 2262 _config2.default.active_metadata = {}; 2263 _config2.default.active_album = ""; 2264 _config2.default.active_index = 0; 2265 _config2.default.active_playlist = null; 2266 _config2.default.playback_speed = 1.0; 2267 _config2.default.callbacks = {}; 2268 _config2.default.songs = []; 2269 _config2.default.playlists = {}; 2270 _config2.default.start_song = ""; 2271 _config2.default.starting_playlist = ""; 2272 _config2.default.starting_playlist_song = ""; 2273 _config2.default.repeat = false; 2274 _config2.default.shuffle_list = {}; 2275 _config2.default.shuffle_on = false; 2276 _config2.default.default_album_art = ""; 2277 _config2.default.default_playlist_art = ""; 2278 _config2.default.debug = false; 2279 _config2.default.volume = 0.5; 2280 _config2.default.pre_mute_volume = 0.5; 2281 _config2.default.volume_increment = 5; 2282 _config2.default.volume_decrement = 5; 2283 _config2.default.soundcloud_client = ""; 2284 _config2.default.soundcloud_use_art = false; 2285 _config2.default.soundcloud_song_count = 0; 2286 _config2.default.soundcloud_songs_ready = 0; 2287 _config2.default.continue_next = true; 2288 } 2289 2290 /** 2291 * Sets the state of the player. 2292 */ 2293 function setPlayerState() { 2294 /* 2295 If paused and the current time is 0 the player is stopped. 2296 */ 2297 if (_config2.default.audio.paused && _config2.default.audio.currentTime == 0) { 2298 _config2.default.player_state = "stopped"; 2299 } 2300 2301 /* 2302 If paused and the current time is greater than 0 the player is 2303 paused. 2304 */ 2305 if (_config2.default.audio.paused && _config2.default.audio.currentTime > 0) { 2306 _config2.default.player_state = "paused"; 2307 } 2308 2309 /* 2310 If playing, the current state is playing. 2311 */ 2312 if (!_config2.default.audio.paused) { 2313 _config2.default.player_state = "playing"; 2314 } 2315 } 2316 2317 /* 2318 Returns the public facing methods 2319 */ 2320 return { 2321 resetConfig: resetConfig, 2322 setPlayerState: setPlayerState 2323 }; 2324}(); /** 2325 * Imports the config module 2326 * @module config 2327 */ 2328exports.default = ConfigState; 2329module.exports = exports["default"]; 2330 2331/***/ }), 2332/* 7 */ 2333/***/ (function(module, exports, __webpack_require__) { 2334 2335"use strict"; 2336 2337 2338Object.defineProperty(exports, "__esModule", { 2339 value: true 2340}); 2341 2342var _config = __webpack_require__(0); 2343 2344var _config2 = _interopRequireDefault(_config); 2345
2346var _debug = __webpack_require__(4); 2347 2348var _debug2 = _interopRequireDefault(_debug); 2349 2350function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2351 2352/** 2353 * AmplitudeJS Callback Utility 2354 * 2355 * @module utilities/callbacks 2356 */ 2357/** 2358 * Imports the config module 2359 * @module config 2360 */ 2361var Callbacks = function () { 2362 /** 2363 * Initializes the callbacks for the player. 2364 */ 2365 function initialize() { 2366 /* 2367 Event: abort 2368 https://www.w3schools.com/tags/av_event_abort.asp 2369 */ 2370 _config2.default.audio.addEventListener("abort", function () { 2371 run("abort"); 2372 }); 2373 2374 /* 2375 Event: error 2376 https://www.w3schools.com/tags/av_event_error.asp 2377 */ 2378 _config2.default.audio.addEventListener("error", function () { 2379 run("error"); 2380 }); 2381 2382 /* 2383 Event: loadeddata 2384 https://www.w3schools.com/tags/av_event_loadeddata.asp 2385 */ 2386 _config2.default.audio.addEventListener("loadeddata", function () { 2387 run("loadeddata"); 2388 }); 2389 2390 /* 2391 Event: loadedmetadata 2392 https://www.w3schools.com/tags/av_event_loadedmetadata.asp 2393 */ 2394 _config2.default.audio.addEventListener("loadedmetadata", function () { 2395 run("loadedmetadata"); 2396 }); 2397 2398 /* 2399 Event: loadstart 2400 https://www.w3schools.com/tags/av_event_loadstart.asp 2401 */ 2402 _config2.default.audio.addEventListener("loadstart", function () { 2403 run("loadstart"); 2404 }); 2405 2406 /* 2407 Event: pause 2408 https://www.w3schools.com/tags/av_event_pause.asp 2409 */ 2410 _config2.default.audio.addEventListener("pause", function () { 2411 run("pause"); 2412 }); 2413 2414 /* 2415 Event: playing 2416 https://www.w3schools.com/tags/av_event_playing.asp 2417 */ 2418 _config2.default.audio.addEventListener("playing", function () { 2419 run("playing"); 2420 }); 2421 2422 /* 2423 Event: play 2424 https://www.w3schools.com/tags/av_event_play.asp 2425 */ 2426 _config2.default.audio.addEventListener("play", function () { 2427 run("play"); 2428 }); 2429 2430 /* 2431 Event: progress 2432 https://www.w3schools.com/tags/av_event_progress.asp 2433 */ 2434 _config2.default.audio.addEventListener("progress", function () { 2435 run("progress"); 2436 }); 2437 2438 /* 2439 Event: ratechange 2440 https://www.w3schools.com/tags/av_event_ratechange.asp 2441 */ 2442 _config2.default.audio.addEventListener("ratechange", function () { 2443 run("ratechange"); 2444 }); 2445 2446 /* 2447 Event: seeked 2448 https://www.w3schools.com/tags/av_event_seeked.asp 2449 */ 2450 _config2.default.audio.addEventListener("seeked", function () { 2451 run("seeked"); 2452 }); 2453 2454 /* 2455 Event: seeking 2456 https://www.w3schools.com/tags/av_event_seeking.asp 2457 */ 2458 _config2.default.audio.addEventListener("seeking", function () { 2459 run("seeking"); 2460 }); 2461 2462 /* 2463 Event: stalled 2464 https://www.w3schools.com/tags/av_event_stalled.asp 2465 */ 2466 _config2.default.audio.addEventListener("stalled", function () { 2467 run("stalled"); 2468 }); 2469 2470 /* 2471 Event: suspend 2472 https://www.w3schools.com/tags/av_event_suspend.asp 2473 */ 2474 _config2.default.audio.addEventListener("suspend", function () { 2475 run("suspend"); 2476 }); 2477 2478 /* 2479 Event: timeupdate 2480 https://www.w3schools.com/tags/av_event_timeupdate.asp 2481 */ 2482 _config2.default.audio.addEventListener("timeupdate", function () { 2483 run("timeupdate"); 2484 }); 2485 2486 /* 2487 Event: volumechange 2488 https://www.w3schools.com/tags/av_event_volumechange.asp 2489 */ 2490 _config2.default.audio.addEventListener("volumechange", function () { 2491 run("volumechange"); 2492 }); 2493 2494 /* 2495 Event: waiting 2496 https://www.w3schools.com/tags/av_event_waiting.asp 2497 */ 2498 _config2.default.audio.addEventListener("waiting", function () { 2499 run("waiting"); 2500 }); 2501 2502 /* 2503 Event: canplay 2504 https://www.w3schools.com/tags/av_event_canplay.asp 2505 */ 2506 _config2.default.audio.addEventListener("canplay", function () { 2507 run("canplay"); 2508 }); 2509 2510 /* 2511 Event: canplaythrough 2512 https://www.w3schools.com/tags/av_event_canplaythrough.asp 2513 */ 2514 _config2.default.audio.addEventListener("canplaythrough", function () { 2515 run("canplaythrough"); 2516 }); 2517 2518 /* 2519 Event: durationchange 2520 https://www.w3schools.com/tags/av_event_durationchange.asp 2521 */ 2522 _config2.default.audio.addEventListener("durationchange", function () { 2523 run("durationchange"); 2524 }); 2525 2526 /* 2527 Event: ended 2528 https://www.w3schools.com/tags/av_event_ended.asp 2529 */ 2530 _config2.default.audio.addEventListener("ended", function () { 2531 run("ended"); 2532 }); 2533 } 2534 2535 /** 2536 * Runs a user defined callback method 2537 * 2538 * Public Accessor: Callbacks.run( callbackName ) 2539 * 2540 * @access public 2541 * @param {string} callbackName - The name of the callback we are going to run. 2542 */ 2543 function run(callbackName) { 2544 /* 2545 Checks to see if a user defined a callback method for the 2546 callback we are running. 2547 */ 2548 if (_config2.default.callbacks[callbackName]) { 2549 /* 2550 Build the callback function 2551 */ 2552 var callbackFunction = _config2.default.callbacks[callbackName]; 2553 2554 /* 2555 Write a debug message stating the callback we are running 2556 */ 2557 _debug2.default.writeMessage("Running Callback: " + callbackName); 2558 2559 /* 2560 Run the callback function and catch any errors 2561 */
vendor: 15,302 bytes, lines 2562-3027
2562 try { 2563 callbackFunction(); 2564 } catch (error) { 2565 if (error.message == "CANCEL EVENT") { 2566 throw error; 2567 } else { 2568 _debug2.default.writeMessage("Callback error: " + error.message); 2569 } 2570 } 2571 } 2572 } 2573 2574 return { 2575 initialize: initialize, 2576 run: run 2577 }; 2578}(); 2579 2580/** 2581 * Imports the debug module 2582 * @module utilities/debug 2583 */ 2584exports.default = Callbacks; 2585module.exports = exports["default"]; 2586 2587/***/ }), 2588/* 8 */ 2589/***/ (function(module, exports, __webpack_require__) { 2590 2591"use strict"; 2592 2593 2594Object.defineProperty(exports, "__esModule", { 2595 value: true 2596}); 2597 2598var _config = __webpack_require__(0); 2599 2600var _config2 = _interopRequireDefault(_config); 2601 2602function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2603 2604/** 2605 * These methods help display the audio's meta data 2606 * 2607 * @module visual/MetaDataElements 2608 */ 2609var MetaDataElements = function () { 2610 /** 2611 * Displays the active song's metadata. This is called after a song has 2612 * been changed. This method takes the active song and displays the 2613 * metadata. So once the new active song is set, we update all of the 2614 * screen elements. 2615 * 2616 * @access public 2617 */ 2618 function displayMetaData() { 2619 /* 2620 Define the image meta data keys. These are managed separately 2621 since we aren't actually changing the inner HTML of these elements. 2622 */ 2623 var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"]; 2624 2625 /* 2626 Get all of the song info elements 2627 */ 2628 var songInfoElements = document.querySelectorAll("[data-amplitude-song-info]"); 2629 2630 /* 2631 Iterate over all of the song info elements. We will either 2632 set these to the new values, or clear them if the active song 2633 doesn't have the info set. 2634 */ 2635 for (var i = 0; i < songInfoElements.length; i++) { 2636 /* 2637 Get the info so we can check if the active meta data has the 2638 key. 2639 */ 2640 var info = songInfoElements[i].getAttribute("data-amplitude-song-info"); 2641 2642 /* 2643 Grab the playlist and song index. 2644 */ 2645 var playlist = songInfoElements[i].getAttribute("data-amplitude-playlist"); 2646 var songIndex = songInfoElements[i].getAttribute("data-amplitude-song-index"); 2647 2648 /* 2649 Ensure that we don't set any individual elements now. We set this with the 2650 sync meta data method. The reason we don't set them here is because 2651 all individual songs would get the now playing artwork. If the playlists 2652 match or the element is a main element meaning it doesn't 2653 belong to a playlist or a song, then we set the song info. 2654 */ 2655 if (songIndex == null && (_config2.default.active_playlist == playlist || playlist == null && songIndex == null)) { 2656 /* 2657 If the active metadata has the key, then we set it, 2658 otherwise we clear it. If it's an image element then 2659 we default it to the default info if needed. 2660 */ 2661 var val = _config2.default.active_metadata[info] != undefined ? _config2.default.active_metadata[info] : null; 2662 if (imageMetaDataKeys.indexOf(info) >= 0) { 2663 val = val || _config2.default.default_album_art; 2664 songInfoElements[i].setAttribute("src", val); 2665 } else { 2666 val = val || ""; 2667 songInfoElements[i].innerHTML = val; 2668 } 2669 } 2670 } 2671 } 2672 2673 /** 2674 * Displays the playlist meta data. 2675 */ 2676 function displayPlaylistMetaData() { 2677 /* 2678 Define the image meta data keys. These are managed separately 2679 since we aren't actually changing the inner HTML of these elements. 2680 */ 2681 var imageMetaDataKeys = ["image_url"]; 2682 2683 /* 2684 Get all of the playlist info elements 2685 */ 2686 var playlistInfoElements = document.querySelectorAll("[data-amplitude-playlist-info]"); 2687 2688 /* 2689 Iterate over all of the playlist info elements. We will either 2690 set these to the new values, or clear them if the active song 2691 doesn't have the info set. 2692 */ 2693 for (var i = 0; i < playlistInfoElements.length; i++) { 2694 /* 2695 Get the info so we can check if the active meta data has the 2696 key. 2697 */ 2698 var info = playlistInfoElements[i].getAttribute("data-amplitude-playlist-info"); 2699 var playlist = playlistInfoElements[i].getAttribute("data-amplitude-playlist"); 2700 2701 if (_config2.default.playlists[playlist][info] != undefined) { 2702 if (imageMetaDataKeys.indexOf(info) >= 0) { 2703 playlistInfoElements[i].setAttribute("src", _config2.default.playlists[playlist][info]); 2704 } else { 2705 playlistInfoElements[i].innerHTML = _config2.default.playlists[playlist][info]; 2706 } 2707 } else { 2708 /* 2709 We look for the default album art because 2710 the actual key didn't exist. If the default album 2711 art doesn't exist then we set the src attribute 2712 to null. 2713 */ 2714 if (imageMetaDataKeys.indexOf(info) >= 0) { 2715 if (_config2.default.default_playlist_art != "") { 2716 playlistInfoElements[i].setAttribute("src", _config2.default.default_playlist_art); 2717 } else { 2718 playlistInfoElements[i].setAttribute("src", ""); 2719 } 2720 } else { 2721 playlistInfoElements[i].innerHTML = ""; 2722 } 2723 } 2724 } 2725 } 2726 2727 /** 2728 * Sets the first song in the playlist. This is used to fill in the meta 2729 * data in the playlist 2730 * 2731 * @param {object} song - The song we are setting to be the first song in the playlist 2732 * @param {string} playlist - Key of the playlist we are setting the first song in 2733 */ 2734 function setFirstSongInPlaylist(song, playlist) { 2735 /* 2736 Define the image meta data keys. These are managed separately 2737 since we aren't actually changing the inner HTML of these elements. 2738 */ 2739 var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"]; 2740 2741 /* 2742 Get all of the song info elements 2743 */ 2744 var songInfoElements = document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="' + playlist + '"]'); 2745 2746 /* 2747 Iterate over all of the song info elements. We will either 2748 set these to the new values, or clear them if the active song 2749 doesn't have the info set. 2750 */ 2751 for (var i = 0; i < songInfoElements.length; i++) { 2752 /* 2753 Get the info so we can check if the active meta data has the 2754 key. 2755 */ 2756 var info = songInfoElements[i].getAttribute("data-amplitude-song-info"); 2757 2758 /* 2759 Get the song info element playlist. 2760 */ 2761 var elementPlaylist = songInfoElements[i].getAttribute("data-amplitude-playlist"); 2762 2763 /* 2764 If the playlists match or the element is a main element, then 2765 we set the song info. 2766 */ 2767 if (elementPlaylist == playlist) { 2768 /* 2769 If the active metadata has the key, then we set it, 2770 otherwise we clear it. If it's an image element then 2771 we default it to the default info if needed. 2772 */ 2773 if (song[info] != undefined) { 2774 if (imageMetaDataKeys.indexOf(info) >= 0) { 2775 songInfoElements[i].setAttribute("src", song[info]); 2776 } else { 2777 songInfoElements[i].innerHTML = song[info]; 2778 } 2779 } else { 2780 /* 2781 We look for the default album art because 2782 the actual key didn't exist. If the default album 2783 art doesn't exist then we set the src attribute 2784 to null. 2785 */ 2786 if (imageMetaDataKeys.indexOf(info) >= 0) { 2787 if (song.default_album_art != "") { 2788 songInfoElements[i].setAttribute("src", song.default_album_art); 2789 } else { 2790 songInfoElements[i].setAttribute("src", ""); 2791 } 2792 } else { 2793 songInfoElements[i].innerHTML = ""; 2794 } 2795 } 2796 } 2797 } 2798 } 2799 2800 /** 2801 * Sets the meta data for songs loaded in the songs array 2802 */ 2803 function syncMetaData() { 2804 /* 2805 Define the image meta data keys. These are managed separately 2806 since we aren't actually changing the inner HTML of these elements. 2807 */ 2808 var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"]; 2809 2810 /* 2811 Get all of the song info elements 2812 */ 2813 var songInfoElements = document.querySelectorAll("[data-amplitude-song-info]"); 2814 2815 /* 2816 Iterate over all of the song info elements. We will either 2817 set these to the new values, or clear them if the active song 2818 doesn't have the info set. 2819 */ 2820 for (var i = 0; i < songInfoElements.length; i++) { 2821 var songIndex = songInfoElements[i].getAttribute("data-amplitude-song-index"); 2822 var playlist = songInfoElements[i].getAttribute("data-amplitude-playlist"); 2823 2824 if (songIndex != null && playlist == null) { 2825 var info = songInfoElements[i].getAttribute("data-amplitude-song-info"); 2826 2827 /* 2828 Get the song info value referenced on the element. Depending on the type of 2829 element, we may need to fallback to another value when the direct value 2830 we want isn't found. 2831 i.e. 2832 data-amplitude-song-info="cover_art_url" defaults to using the value 2833 of "default_album_art" when "cover_art_url" is missing on the song. 2834 */ 2835 var val = _config2.default.songs[songIndex][info] != undefined ? _config2.default.songs[songIndex][info] : null; 2836 /* 2837 If it's an image meta data key, then we set the src attribute of 2838 the element. Otherwise we set the inner HTML of the element. 2839 */ 2840 if (imageMetaDataKeys.indexOf(info) >= 0) { 2841 /* 2842 If this is an image meta data key and the individual song doesn't 2843 have the key, use the default_album_art 2844 */ 2845 val = val || _config2.default.default_album_art; 2846 songInfoElements[i].setAttribute("src", val); 2847 } else { 2848 songInfoElements[i].innerHTML = val; 2849 } 2850 } 2851 2852 /* 2853 If the song index and playlist are not null, continue. 2854 */ 2855 if (songIndex != null && playlist != null) { 2856 /* 2857 Get the info we are displaying. 2858 */ 2859 var _info = songInfoElements[i].getAttribute("data-amplitude-song-info"); 2860 2861 /* 2862 Set the meta data accordingly. 2863 */ 2864 if (_config2.default.playlists[playlist].songs[songIndex][_info] != undefined) { 2865 if (imageMetaDataKeys.indexOf(_info) >= 0) { 2866 songInfoElements[i].setAttribute("src", _config2.default.playlists[playlist].songs[songIndex][_info]); 2867 } else { 2868 songInfoElements[i].innerHTML = _config2.default.playlists[playlist].songs[songIndex][_info]; 2869 } 2870 } 2871 } 2872 } 2873 2874 /* 2875 Display the playlist meta data. 2876 */ 2877 displayPlaylistMetaData(); 2878 } 2879 2880 /** 2881 * Returns publically facing methods 2882 */ 2883 return { 2884 displayMetaData: displayMetaData, 2885 setFirstSongInPlaylist: setFirstSongInPlaylist, 2886 syncMetaData: syncMetaData, 2887 displayPlaylistMetaData: displayPlaylistMetaData 2888 }; 2889}(); /** 2890 * Imports the config module 2891 * @module config 2892 */ 2893exports.default = MetaDataElements; 2894module.exports = exports["default"]; 2895 2896/***/ }), 2897/* 9 */ 2898/***/ (function(module, exports, __webpack_require__) { 2899 2900"use strict"; 2901 2902 2903Object.defineProperty(exports, "__esModule", { 2904 value: true 2905}); 2906 2907var _config = __webpack_require__(0); 2908 2909var _config2 = _interopRequireDefault(_config); 2910 2911function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 2912 2913/** 2914 * Handles all of the visual syncing to the state of the config for the repeat 2915 * elements. 2916 * 2917 * @module visual/RepeatElements 2918 */ 2919var RepeatElements = function () { 2920 /** 2921 * Syncs repeat for all of the repeat buttons. Users 2922 * can apply styles to the 'amplitude-repeat-on' and 2923 * 'amplitude-repeat-off' classes. They represent the state 2924 * of the player. 2925 */ 2926 function syncRepeat() { 2927 /* 2928 Gets all of the repeat classes 2929 */ 2930 var repeatClasses = document.getElementsByClassName("amplitude-repeat"); 2931 2932 /* 2933 Iterate over all of the repeat classes. If repeat is on, 2934 then add the 'amplitude-repeat-on' class and remove the 2935 'amplitude-repeat-off' class. If it's off, then do the 2936 opposite. 2937 */ 2938 for (var i = 0; i < repeatClasses.length; i++) { 2939 if (_config2.default.repeat) { 2940 repeatClasses[i].classList.add("amplitude-repeat-on"); 2941 repeatClasses[i].classList.remove("amplitude-repeat-off"); 2942 } else { 2943 repeatClasses[i].classList.remove("amplitude-repeat-on"); 2944 repeatClasses[i].classList.add("amplitude-repeat-off"); 2945 } 2946 } 2947 } 2948 2949 /** 2950 * Syncs repeat for all of the playlist repeat buttons. Users 2951 * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off` 2952 * classes. They repreent the state of the playlist in the player. 2953 */ 2954 function syncRepeatPlaylist(playlist) { 2955 /* 2956 Gets all of the repeat buttons. 2957 */ 2958 var repeatButtons = document.getElementsByClassName("amplitude-repeat"); 2959 2960 /* 2961 Iterate over all of the repeat buttons 2962 */ 2963 for (var i = 0; i < repeatButtons.length; i++) { 2964 /* 2965 Ensure that the repeat button belongs to matches the 2966 playlist we are syncing the state for. 2967 */ 2968 if (repeatButtons[i].getAttribute("data-amplitude-playlist") == playlist) { 2969 /* 2970 If the state of the playlist is shuffled on, true, then 2971 we add the 'amplitude-repeat-on' class and remove the 2972 'amplitude-repeat-off' class. If the player is not shuffled 2973 then we do the opposite. 2974 */ 2975 if (_config2.default.playlists[playlist].repeat) { 2976 repeatButtons[i].classList.add("amplitude-repeat-on"); 2977 repeatButtons[i].classList.remove("amplitude-repeat-off"); 2978 } else { 2979 repeatButtons[i].classList.add("amplitude-repeat-off"); 2980 repeatButtons[i].classList.remove("amplitude-repeat-on"); 2981 } 2982 } 2983 } 2984 } 2985 2986 /** 2987 * Syncs repeat for all of the repeat song buttons. Users 2988 * can apply styles to the 'amplitude-repeat-song-on' and 2989 * 'amplitude-repeat-song-off' classes. They represent the state 2990 * of the player. 2991 */ 2992 function syncRepeatSong() { 2993 /* 2994 Gets all of the repeat song classes 2995 */ 2996 var repeatSongClasses = document.getElementsByClassName("amplitude-repeat-song"); 2997 2998 /* 2999 Iterate over all of the repeat song classes. If repeat is on, 3000 then add the 'amplitude-repeat-song-on' class and remove the 3001 'amplitude-repeat-song-off' class. If it's off, then do the 3002 opposite. 3003 */ 3004 for (var i = 0; i < repeatSongClasses.length; i++) { 3005 if (_config2.default.repeat_song) { 3006 repeatSongClasses[i].classList.add("amplitude-repeat-song-on"); 3007 repeatSongClasses[i].classList.remove("amplitude-repeat-song-off"); 3008 } else { 3009 repeatSongClasses[i].classList.remove("amplitude-repeat-song-on"); 3010 repeatSongClasses[i].classList.add("amplitude-repeat-song-off"); 3011 } 3012 } 3013 } 3014 3015 /* 3016 Returns the publically available methods. 3017 */ 3018 return { 3019 syncRepeat: syncRepeat, 3020 syncRepeatPlaylist: syncRepeatPlaylist, 3021 syncRepeatSong: syncRepeatSong 3022 }; 3023}(); /** 3024 * Imports the config module 3025 * @module config 3026 */ 3027exports.default = RepeatElement
vendor: 36,478 bytes, lines 3027-4194
3027s; 3028module.exports = exports["default"]; 3029 3030/***/ }), 3031/* 10 */ 3032/***/ (function(module, exports, __webpack_require__) { 3033 3034"use strict"; 3035 3036 3037Object.defineProperty(exports, "__esModule", { 3038 value: true 3039}); 3040/** 3041 * Handles the visual state for all of the mute elements. 3042 * 3043 * @module visual/MuteElements 3044 */ 3045var MuteElements = function () { 3046 /** 3047 * Syncs mute for all of the mute buttons. This represents the 3048 * state of the player if it's muted or not. 3049 * 3050 * @access public 3051 * @param {string} state - The muted state of the player. 3052 */ 3053 function setMuted(state) { 3054 /* 3055 Get all of the mute buttons. 3056 */ 3057 var muteClasses = document.getElementsByClassName("amplitude-mute"); 3058 3059 /* 3060 Iterate over all of the mute classes. If the state of the player 3061 is not-muted then we add the amplitude-not-muted classe and remove 3062 the amplitude muted class otherwise we do the opposite. 3063 */ 3064 for (var i = 0; i < muteClasses.length; i++) { 3065 if (!state) { 3066 muteClasses[i].classList.add("amplitude-not-muted"); 3067 muteClasses[i].classList.remove("amplitude-muted"); 3068 } else { 3069 muteClasses[i].classList.remove("amplitude-not-muted"); 3070 muteClasses[i].classList.add("amplitude-muted"); 3071 } 3072 } 3073 } 3074 3075 return { 3076 setMuted: setMuted 3077 }; 3078}(); 3079 3080exports.default = MuteElements; 3081module.exports = exports["default"]; 3082 3083/***/ }), 3084/* 11 */ 3085/***/ (function(module, exports, __webpack_require__) { 3086 3087"use strict"; 3088 3089 3090Object.defineProperty(exports, "__esModule", { 3091 value: true 3092}); 3093 3094var _config = __webpack_require__(0); 3095 3096var _config2 = _interopRequireDefault(_config); 3097 3098function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3099 3100/** 3101 * Keeps the volume slider elements in sync. 3102 * @module visual/VolumeSliderElements 3103 */ 3104var VolumeSliderElements = function () { 3105 /** 3106 * Visually syncs the volume sliders so they are all the same if there 3107 * are more than one. 3108 * 3109 * @access public 3110 */ 3111 function sync() { 3112 var volumeSliders = document.getElementsByClassName("amplitude-volume-slider"); 3113 3114 /* 3115 Iterates over all of the volume sliders for the song, setting the value 3116 to the config value. 3117 */ 3118 for (var i = 0; i < volumeSliders.length; i++) { 3119 volumeSliders[i].value = _config2.default.audio.volume * 100; 3120 } 3121 } 3122 3123 /** 3124 * Returns the public facing methods 3125 */ 3126 return { 3127 sync: sync 3128 }; 3129}(); /** 3130 * Imports the config module 3131 * @module config 3132 */ 3133exports.default = VolumeSliderElements; 3134module.exports = exports["default"]; 3135 3136/***/ }), 3137/* 12 */ 3138/***/ (function(module, exports, __webpack_require__) { 3139 3140"use strict"; 3141 3142 3143Object.defineProperty(exports, "__esModule", { 3144 value: true 3145}); 3146 3147var _config = __webpack_require__(0); 3148 3149var _config2 = _interopRequireDefault(_config); 3150 3151function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3152 3153/** 3154 * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios. 3155 * 3156 * @module utilities/Repeater 3157 */ 3158var Repeater = function () { 3159 /** 3160 * Sets the state of the repeat for a song. 3161 * 3162 * @access public 3163 * @param {boolean} repeat - A boolean representing whether the repeat should be on or off 3164 */ 3165 function setRepeat(repeat) { 3166 /* 3167 Set the global repeat to be toggled 3168 */ 3169 _config2.default.repeat = repeat; 3170 } 3171 3172 /** 3173 * Sets the state of the repeat for a playlist. 3174 * 3175 * @access public 3176 * @param {boolean} repeat - A boolean representing whether the repeat should be on or off 3177 * @param {string} playlist - The key of the playlist for repeating 3178 */ 3179 function setRepeatPlaylist(repeat, playlist) { 3180 /* 3181 Set the playlist repeat to be toggled. 3182 */ 3183 _config2.default.playlists[playlist].repeat = repeat; 3184 } 3185 3186 /** 3187 * Sets the state of the repeat song 3188 * 3189 * @access public 3190 * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song. 3191 */ 3192 function setRepeatSong(repeat) { 3193 _config2.default.repeat_song = repeat; 3194 } 3195 3196 /* 3197 Returns the public facing methods 3198 */ 3199 return { 3200 setRepeat: setRepeat, 3201 setRepeatPlaylist: setRepeatPlaylist, 3202 setRepeatSong: setRepeatSong 3203 }; 3204}(); /** 3205 * Imports the config module 3206 * @module config 3207 */ 3208exports.default = Repeater; 3209module.exports = exports["default"]; 3210 3211/***/ }), 3212/* 13 */ 3213/***/ (function(module, exports, __webpack_require__) { 3214 3215"use strict"; 3216 3217 3218Object.defineProperty(exports, "__esModule", { 3219 value: true 3220}); 3221 3222var _config = __webpack_require__(0); 3223 3224var _config2 = _interopRequireDefault(_config); 3225 3226function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3227 3228/** 3229 * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for 3230 * AmplitudeJS 3231 * 3232 * @module utilities/Shuffler 3233 */ 3234var Shuffler = function () { 3235 /** 3236 * Sets the shuffle state globally 3237 * 3238 * @access public 3239 * @param {boolean} shuffle - True when we are shuffling, false when we turn it off. 3240 */ 3241 function setShuffle(shuffle) { 3242 _config2.default.shuffle_on = shuffle; 3243 3244 if (shuffle) { 3245 shuffleSongs(); 3246 } else { 3247 _config2.default.shuffle_list = []; 3248 } 3249 } 3250 3251 /** 3252 * Toggles the shuffle status globally. 3253 * 3254 * @access public 3255 */ 3256 function toggleShuffle() { 3257 /* 3258 If shuffle is on, we toggle it off. If shuffle is off, we 3259 toggle on. 3260 */ 3261 if (_config2.default.shuffle_on) { 3262 _config2.default.shuffle_on = false; 3263 _config2.default.shuffle_list = []; 3264 } else { 3265 _config2.default.shuffle_on = true; 3266 shuffleSongs(); 3267 } 3268 } 3269 3270 /** 3271 * Sets the shuffle state for a playlist 3272 * 3273 * @access public 3274 * @param {string} playlist The key of the playlist we are shuffling. 3275 * @param {boolean} shuffle True when we are shuffling the playlist, false when we turn off shuffle. 3276 */ 3277 function setShufflePlaylist(playlist, shuffle) { 3278 _config2.default.playlists[playlist].shuffle = shuffle; 3279 3280 if (_config2.default.playlists[playlist].shuffle) { 3281 shufflePlaylistSongs(playlist); 3282 } else { 3283 _config2.default.playlists[playlist].shuffle_list = []; 3284 } 3285 } 3286 3287 /** 3288 * Sets the shuffle state for a playlist 3289 * 3290 * @access public 3291 * @param {string} playlist The key of the playlist we are shuffling. 3292 */ 3293 function toggleShufflePlaylist(playlist) { 3294 /* 3295 If the playlist shuffled is on, we toggle it off. If the 3296 playlist shuffled is off, we toggle it on. 3297 */ 3298 if (_config2.default.playlists[playlist].shuffle) { 3299 _config2.default.playlists[playlist].shuffle = false; 3300 _config2.default.playlists[playlist].shuffle_list = []; 3301 } else { 3302 _config2.default.playlists[playlist].shuffle = true; 3303 shufflePlaylistSongs(playlist); 3304 } 3305 } 3306 3307 /** 3308 * Shuffles individual songs in the config 3309 * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html 3310 * 3311 * Public Accessor: Shuffle.shuffleSongs() 3312 * 3313 * @access public 3314 */ 3315 function shuffleSongs() { 3316 /* 3317 Builds a temporary array with the length of the config. 3318 */ 3319 var shuffleTemp = new Array(_config2.default.songs.length); 3320 3321 /* 3322 Set the temporary array equal to the songs array. 3323 */ 3324 for (var i = 0; i < _config2.default.songs.length; i++) { 3325 shuffleTemp[i] = _config2.default.songs[i]; 3326 } 3327 3328 /* 3329 Iterate ove rthe songs and generate random numbers to 3330 swap the indexes of the shuffle array. 3331 */ 3332 for (var _i = _config2.default.songs.length - 1; _i > 0; _i--) { 3333 var randNum = Math.floor(Math.random() * _config2.default.songs.length + 1); 3334 shuffleSwap(shuffleTemp, _i, randNum - 1); 3335 } 3336 3337 /* 3338 Set the shuffle list to the shuffle temp. 3339 */ 3340 _config2.default.shuffle_list = shuffleTemp; 3341 } 3342 3343 /** 3344 * Shuffle songs in a playlist 3345 * 3346 * Public Accessor: Shuffle.shufflePlaylistSongs( playlist ) 3347 * 3348 * @access public 3349 * @param {string} playlist - The playlist we are shuffling. 3350 */ 3351 function shufflePlaylistSongs(playlist) { 3352 /* 3353 Builds a temporary array with the length of the playlist songs. 3354 */ 3355 var shuffleTemp = new Array(_config2.default.playlists[playlist].songs.length); 3356 3357 /* 3358 Set the temporary array equal to the playlist array. 3359 */ 3360 for (var i = 0; i < _config2.default.playlists[playlist].songs.length; i++) { 3361 shuffleTemp[i] = _config2.default.playlists[playlist].songs[i]; 3362 } 3363 3364 /* 3365 Iterate ove rthe songs and generate random numbers to 3366 swap the indexes of the shuffle array. 3367 */ 3368 for (var _i2 = _config2.default.playlists[playlist].songs.length - 1; _i2 > 0; _i2--) { 3369 var randNum = Math.floor(Math.random() * _config2.default.playlists[playlist].songs.length + 1); 3370 shuffleSwap(shuffleTemp, _i2, randNum - 1); 3371 } 3372 3373 /* 3374 Set the shuffle list to the shuffle temp. 3375 */ 3376 _config2.default.playlists[playlist].shuffle_list = shuffleTemp; 3377 } 3378 3379 /** 3380 * Swaps and randomizes the song shuffle. 3381 * 3382 * @access private 3383 * @param {object} shuffleList - The list of songs that is going to be shuffled 3384 * @param {number} original - The original index of he song in the songs array 3385 * @param {number} random - The randomized index that will be the new index of the song in the shuffle array. 3386 */ 3387 function shuffleSwap(shuffleList, original, random) { 3388 var temp = shuffleList[original]; 3389 shuffleList[original] = shuffleList[random]; 3390 shuffleList[random] = temp; 3391 } 3392 3393 /** 3394 * Returns public facing methods 3395 */ 3396 return { 3397 setShuffle: setShuffle, 3398 toggleShuffle: toggleShuffle, 3399 setShufflePlaylist: setShufflePlaylist, 3400 toggleShufflePlaylist: toggleShufflePlaylist, 3401 shuffleSongs: shuffleSongs, 3402 shufflePlaylistSongs: shufflePlaylistSongs 3403 }; 3404}(); /** 3405 * Imports the config module 3406 * @module config 3407 */ 3408exports.default = Shuffler; 3409module.exports = exports["default"]; 3410 3411/***/ }), 3412/* 14 */ 3413/***/ (function(module, exports, __webpack_require__) { 3414 3415"use strict"; 3416 3417 3418Object.defineProperty(exports, "__esModule", { 3419 value: true 3420}); 3421 3422var _config = __webpack_require__(0); 3423 3424var _config2 = _interopRequireDefault(_config); 3425 3426function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3427 3428/** 3429 * Defines the visual representation of AmplitudeJS song slider elements. 3430 * @module visual/SongSliderElements 3431 */ 3432var SongSliderElements = function () { 3433 /** 3434 * Syncs all of the song slider elements. 3435 * 3436 * @access public 3437 * @param {number} location - The location of the song as a percentage. 3438 * @param {string} playlist - The playlist we are setting the song slider for. 3439 * @param {number} songIndex - The index of the song we are adjusting the song slider for. 3440 */ 3441 function sync(location, playlist, songIndex) { 3442 syncMain(location); 3443 syncPlaylist(location, playlist); 3444 syncSong(location, songIndex); 3445 syncSongInPlaylist(location, playlist); 3446 } 3447 3448 /** 3449 * Syncs the main slider location 3450 * 3451 * @access public 3452 * @param {number} location - The location of the song as a percentage. 3453 */ 3454 function syncMain(location) { 3455 /* 3456 Ensure we have a location that's a number 3457 */ 3458 location = !isNaN(location) ? location : 0; 3459 3460 /* 3461 Gets the main song sliders 3462 */ 3463 var mainSongSliders = document.querySelectorAll(".amplitude-song-slider"); 3464 3465 /* 3466 Iterates over all of the main sliders and sets the value to the 3467 percentage of the song played. 3468 */ 3469 for (var i = 0; i < mainSongSliders.length; i++) { 3470 /* 3471 Grab the playlist and song attributes from the element. 3472 */ 3473 var playlist = mainSongSliders[i].getAttribute("data-amplitude-playlist"); 3474 var song = mainSongSliders[i].getAttribute("data-amplitude-song-index"); 3475 3476 /* 3477 This method is responsible for only the global elements, 3478 so we make sure there are no playlist or songs defined on 3479 the element. 3480 */ 3481 if (playlist == null && song == null) { 3482 mainSongSliders[i].value = location; 3483 } 3484 } 3485 } 3486 3487 /** 3488 * Syncs playlist song slider locations 3489 * 3490 * @access public 3491 * @param {number} location - The location of the song as a percentage. 3492 * @param {string} playlist - The playlist we are setting the song slider for. 3493 */ 3494 function syncPlaylist(location, playlist) { 3495 /* 3496 Ensure we have a location that's a number 3497 */ 3498 location = !isNaN(location) ? location : 0; 3499 3500 /* 3501 Gets the playlist song sliders 3502 */ 3503 var playlistSongSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-playlist="' + playlist + '"]'); 3504 3505 /* 3506 Iterates over all of the playlist sliders and sets the value to the 3507 percentage of the song played. 3508 */ 3509 for (var i = 0; i < playlistSongSliders.length; i++) { 3510 /* 3511 Grab the playlist and song attributes from the element. 3512 */ 3513 var playlistAttribute = playlistSongSliders[i].getAttribute("data-amplitude-playlist"); 3514 var songAttribute = playlistSongSliders[i].getAttribute("data-amplitude-song-index"); 3515 3516 /* 3517 This method is responsible for only the playlist elements, 3518 so we make sure the playlist attribute matches what is passed 3519 in. 3520 */ 3521 if (playlistAttribute == playlist && songAttribute == null) { 3522 playlistSongSliders[i].value = location; 3523 } 3524 } 3525 } 3526 3527 /** 3528 * Syncs individual song slider locations 3529 * 3530 * @access public 3531 * @param {number} location - The location of the song as a percentage. 3532 * @param {number} songIndex - The index of the song we are adjusting the song slider for. 3533 */ 3534 function syncSong(location, songIndex) { 3535 /* 3536 We only want to sync song sliders if the playlist is null. 3537 */ 3538 if (_config2.default.active_playlist == null) { 3539 /* 3540 Ensure we have a location that's a number 3541 */ 3542 location = !isNaN(location) ? location : 0; 3543 3544 /* 3545 Gets the individual song sliders 3546 */ 3547 var songSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-song-index="' + songIndex + '"]'); 3548 3549 /* 3550 Iterates over all of the individual song sliders and sets the value 3551 to the percentage of the song played. 3552 */ 3553 for (var i = 0; i < songSliders.length; i++) { 3554 /* 3555 Grab the playlist and song attributes from the element. 3556 */ 3557 var playlistAttribute = songSliders[i].getAttribute("data-amplitude-playlist"); 3558 var songAttribute = songSliders[i].getAttribute("data-amplitude-song-index"); 3559 3560 /* 3561 This method is responsible for only the playlist elements, 3562 so we make sure the playlist attribute matches what is passed 3563 in. 3564 */ 3565 if (playlistAttribute == null && songAttribute == songIndex) { 3566 songSliders[i].value = location; 3567 } 3568 } 3569 } 3570 } 3571 3572 /** 3573 * Syncs individual song slider locations 3574 * 3575 * @access public 3576 * @param {number} location - The location of the song as a percentage. 3577 * @param {string} playlist - The playlist we are setting the song slider for. 3578 */ 3579 function syncSongInPlaylist(location, playlist) { 3580 /* 3581 Ensure we have a location that's a number 3582 */ 3583 location = !isNaN(location) ? location : 0; 3584 3585 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 3586 3587 /* 3588 Gets the song in playlist sliders 3589 */ 3590 var songInPlaylistSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-playlist="' + playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 3591 3592 /* 3593 Iterates over all of the song in playlist sliders and sets the value 3594 to the percentage of the song played. 3595 */ 3596 for (var i = 0; i < songInPlaylistSliders.length; i++) { 3597 songInPlaylistSliders[i].value = location; 3598 } 3599 } 3600 3601 /** 3602 * Visually syncs the song sliders back to 0. This usually happens when 3603 * a song has changed, we ensure that all song sliders get reset. 3604 * 3605 * @access public 3606 */ 3607 function resetElements() { 3608 var songSliders = document.getElementsByClassName("amplitude-song-slider"); 3609 3610 /* 3611 Iterate over all of the song sliders and set them to 3612 0 essentially resetting them. 3613 */ 3614 for (var i = 0; i < songSliders.length; i++) { 3615 songSliders[i].value = 0; 3616 } 3617 } 3618 3619 /** 3620 * Returns the public facing methods 3621 */ 3622 return { 3623 sync: sync, 3624 syncMain: syncMain, 3625 syncPlaylist: syncPlaylist, 3626 syncSong: syncSong, 3627 syncSongInPlaylist: syncSongInPlaylist, 3628 resetElements: resetElements 3629 }; 3630}(); /** 3631 * Imports the config module 3632 * @module config 3633 */ 3634exports.default = SongSliderElements; 3635module.exports = exports["default"]; 3636 3637/***/ }), 3638/* 15 */ 3639/***/ (function(module, exports, __webpack_require__) { 3640 3641"use strict"; 3642 3643 3644Object.defineProperty(exports, "__esModule", { 3645 value: true 3646}); 3647 3648var _currentTimeElements = __webpack_require__(53); 3649 3650var _currentTimeElements2 = _interopRequireDefault(_currentTimeElements); 3651 3652var _currentHourElements = __webpack_require__(50); 3653 3654var _currentHourElements2 = _interopRequireDefault(_currentHourElements); 3655 3656var _currentMinuteElements = __webpack_require__(51); 3657 3658var _currentMinuteElements2 = _interopRequireDefault(_currentMinuteElements); 3659 3660var _currentSecondElements = __webpack_require__(52); 3661 3662var _currentSecondElements2 = _interopRequireDefault(_currentSecondElements); 3663 3664var _durationCountDownTimeElements = __webpack_require__(54); 3665 3666var _durationCountDownTimeElements2 = _interopRequireDefault(_durationCountDownTimeElements); 3667 3668var _durationHourElements = __webpack_require__(55); 3669 3670var _durationHourElements2 = _interopRequireDefault(_durationHourElements); 3671 3672var _durationMinuteElements = __webpack_require__(56); 3673 3674var _durationMinuteElements2 = _interopRequireDefault(_durationMinuteElements); 3675 3676var _durationSecondElements = __webpack_require__(57); 3677 3678var _durationSecondElements2 = _interopRequireDefault(_durationSecondElements); 3679 3680var _durationTimeElements = __webpack_require__(58); 3681 3682var _durationTimeElements2 = _interopRequireDefault(_durationTimeElements); 3683 3684function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3685 3686/** 3687 * Time Elements Interface. This allows us to update all of the sub time elements 3688 * through one central point. 3689 * @module visual/TimeElements 3690 */ 3691 3692 3693/** 3694 * Imports the AmplitudeJS Duration Second Elements 3695 * @module visual/time/DurationSecondElements 3696 */ 3697 3698 3699/** 3700 * Imports the AmplitudeJS Duration Hour Elements 3701 * @module visual/time/DurationHourElements 3702 */ 3703 3704 3705/** 3706 * Imports the AmplitudeJS Current Second Elements 3707 * @module visual/time/CurrentTimeElements 3708 */ 3709 3710 3711/** 3712 * Imports the AmplitudeJS Current Hour Elements 3713 * @module visual/time/CurrentHourElements 3714 */ 3715var TimeElements = function () { 3716 /** 3717 * Resets the current times. 3718 */ 3719 function resetCurrentTimes() { 3720 _currentTimeElements2.default.resetTimes(); 3721 _currentHourElements2.default.resetTimes(); 3722 _currentMinuteElements2.default.resetTimes(); 3723 _currentSecondElements2.default.resetTimes(); 3724 } 3725 3726 /** 3727 * Syncs the current time elements to the time provided. 3728 * 3729 * @param {Object} currentTime - An object representing the current time of the audio. 3730 */ 3731 function syncCurrentTimes(currentTime) { 3732 _currentTimeElements2.default.sync(currentTime); 3733 _currentHourElements2.default.sync(currentTime.hours); 3734 _currentMinuteElements2.default.sync(currentTime.minutes); 3735 _currentSecondElements2.default.sync(currentTime.seconds); 3736 } 3737 3738 /** 3739 * Resets the duration times. 3740 */ 3741 function resetDurationTimes() { 3742 _durationCountDownTimeElements2.default.resetTimes(); 3743 _durationHourElements2.default.resetTimes(); 3744 _durationMinuteElements2.default.resetTimes(); 3745 _durationSecondElements2.default.resetTimes(); 3746 _durationTimeElements2.default.resetTimes(); 3747 } 3748 3749 /** 3750 * Syncs the duration times to the times provided. 3751 * 3752 * @param {Object} currentTime - An object representing the current time of the audio. 3753 * @param {Object} songDuration - An object representing the duration of the audio 3754 */ 3755 function syncDurationTimes(currentTime, songDuration) { 3756 _durationCountDownTimeElements2.default.sync(currentTime, songDuration); 3757 _durationTimeElements2.default.sync(songDuration); 3758 _durationHourElements2.default.sync(songDuration.hours); 3759 _durationMinuteElements2.default.sync(songDuration.minutes); 3760 _durationSecondElements2.default.sync(songDuration.seconds); 3761 } 3762 3763 /** 3764 * Returns the publically accessible methods. 3765 */ 3766 return { 3767 resetCurrentTimes: resetCurrentTimes, 3768 syncCurrentTimes: syncCurrentTimes, 3769 resetDurationTimes: resetDurationTimes, 3770 syncDurationTimes: syncDurationTimes 3771 }; 3772}(); 3773 3774/** 3775 * Imports the AmplitudeJS Duration Time Elements 3776 * @module visual/time/DurationTimeElements 3777 */ 3778 3779 3780/** 3781 * Imports the AmplitudeJS Duration Minute Elements 3782 * @module visual/time/DurationMinuteElements 3783 */ 3784 3785 3786/** 3787 * Imports the AmplitudeJS Duration Count Down Time Elements 3788 * @module visual/time/DurationCountDownTimeElements 3789 */ 3790 3791 3792/** 3793 * Imports the AmplitudeJS Current Minute Elements 3794 * @module visual/time/CurrentMinuteElements 3795 */ 3796/** 3797 * Imports the AmplitudeJS Current Time 3798 * @module visual/time/CurrentTimeElements 3799 */ 3800exports.default = TimeElements; 3801module.exports = exports["default"]; 3802 3803/***/ }), 3804/* 16 */ 3805/***/ (function(module, exports, __webpack_require__) { 3806 3807"use strict"; 3808 3809 3810Object.defineProperty(exports, "__esModule", { 3811 value: true 3812}); 3813 3814var _config = __webpack_require__(0); 3815 3816var _config2 = _interopRequireDefault(_config); 3817 3818var _debug = __webpack_require__(4); 3819 3820var _debug2 = _interopRequireDefault(_debug); 3821 3822function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3823 3824/** 3825 * Handles the visualizations elements. 3826 * 3827 * @module Visualizations 3828 */ 3829/** 3830 * Imports the config module 3831 * @module config 3832 */ 3833var Visualizations = function () { 3834 /** 3835 * Runs all of the visualizations on the screen. 3836 */ 3837 function run() { 3838 /* 3839 Get all of the visualization elements on the page 3840 */ 3841 var visualizationElements = document.querySelectorAll(".amplitude-visualization"); 3842 3843 /* 3844 If the web audio API is available, we display the visualizations. 3845 */ 3846 if (_config2.default.web_audio_api_available) { 3847 /* 3848 If the visualization has not started, there are visualizations available, 3849 and we have at least one visualization element, then we continue. 3850 */ 3851 if (Object.keys(_config2.default.visualizations.available).length > 0 && visualizationElements.length > 0) { 3852 /* 3853 Iterate over all of the visualizations on the page and activate the 3854 ones we need. 3855 */ 3856 for (var i = 0; i < visualizationElements.length; i++) { 3857 /* 3858 Grab the playlist and song attributes from the visualization to 3859 determine which one we run. 3860 */ 3861 var playlist = visualizationElements[i].getAttribute("data-amplitude-playlist"); 3862 var song = visualizationElements[i].getAttribute("data-amplitude-song-index"); 3863 3864 /* 3865 If the playlist and song are null, it's a global visualization element. 3866 */ 3867 if (playlist == null && song == null) { 3868 runGlobalVisualization(visualizationElements[i]); 3869 } 3870 3871 /* 3872 if the playlist is not null and the song is null it's a playlist visualization 3873 element. 3874 */ 3875 if (playlist != null && song == null) { 3876 runPlaylistVisualization(visualizationElements[i], playlist); 3877 } 3878 3879 /* 3880 If the playlist is null and the song is not null it's a song visualization element. 3881 */ 3882 if (playlist == null && song != null) { 3883 runSongVisualization(visualizationElements[i], song); 3884 } 3885 3886 /* 3887 If the playlist and song are not null then it's a song in playlist visualization 3888 element. 3889 */ 3890 if (playlist != null && song != null) { 3891 runSongInPlaylistVisualization(visualizationElements[i], playlist, song); 3892 } 3893 } 3894 } 3895 } else { 3896 displayBackups(); 3897 } 3898 } 3899 3900 /** 3901 * Runs a global visualization 3902 * 3903 * @param {Node} element The container element that handles the visualization. 3904 */ 3905 function runGlobalVisualization(element) { 3906 /* 3907 Gets the global visualization index and the active song visualization indexes 3908 so we know which visualization to use. The song will override the global 3909 */ 3910 var globalVisualizationIndex = _config2.default.visualization; 3911 var activeSongVisualizationIndex = _config2.default.active_index != null ? _config2.default.songs[_config2.default.active_index].visualization : _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization; 3912 3913 /* 3914 If the active song visualization is defined and the visualization exists, 3915 use that visualization. 3916 */ 3917 if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) { 3918 addToActiveVisualizations(activeSongVisualizationIndex, element); 3919 3920 /* 3921 If the user defined a global visualization, use that one. 3922 */ 3923 } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) { 3924 addToActiveVisualizations(globalVisualizationIndex, element); 3925 3926 /* 3927 If the user didn't define a global visualization, use the first visualization 3928 registered if there is one. 3929 */ 3930 } else { 3931 /* 3932 Grab the first registered visualization. If it exists, use that one. 3933 */ 3934 var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null; 3935 3936 if (firstVisualization != null) { 3937 addToActiveVisualizations(firstVisualization, element); 3938 } 3939 } 3940 } 3941 3942 /** 3943 * Run a specific playlist visualization. 3944 * 3945 * @param {Node} element The container element that handles the visualization. 3946 * @param {string} playlist The key of the playlist we are running the visualization for. 3947 */ 3948 function runPlaylistVisualization(element, playlist) { 3949 /* 3950 If the playlist is equal to the active playlist, then we continue. 3951 */ 3952 if (playlist == _config2.default.active_playlist) { 3953 /* 3954 Checks if the song has a visualization and that visualization exists, 3955 run that visualization. 3956 */ 3957 var activeSongVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization; 3958 var activePlaylistVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].visualization; 3959 var globalVisualizationIndex = _config2.default.visualization; 3960 3961 /* 3962 If the actual song has a visualization, we run that. 3963 */ 3964 if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) { 3965 addToActiveVisualizations(activeSongVisualizationIndex, element); 3966 3967 /* 3968 If the actual playlist has a visualization, run that. 3969 */ 3970 } else if (activePlaylistVisualizationIndex != undefined && _config2.default.visualizations.available[activePlaylistVisualizationIndex] != undefined) { 3971 addToActiveVisualizations(activePlaylistVisualizationIndex, element); 3972 3973 /* 3974 If a global visualization is defined, run that. 3975 */ 3976 } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) { 3977 addToActiveVisualizations(globalVisualizationIndex, element); 3978 } else { 3979 /* 3980 Grab the first registered visualization. If it exists, use that one. 3981 */ 3982 var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null; 3983 3984 if (firstVisualization != null) { 3985 addToActiveVisualizations(firstVisualization, element); 3986 } 3987 } 3988 } 3989 } 3990 3991 /** 3992 * Run a song specific visualization. 3993 * 3994 * @param {Node} element The container element that handles the visualization. 3995 * @param {string} song The song index that we are running the visualization for. 3996 */ 3997 function runSongVisualization(element, song) { 3998 /* 3999 If the song is equal to the active song, then we continue. 4000 */ 4001 if (song == _config2.default.active_index) { 4002 /* 4003 Get the indexes of the song 4004 */ 4005 var activeSongVisualizationIndex = _config2.default.songs[_config2.default.active_index].visualization; 4006 var globalVisualizationIndex = _config2.default.visualization; 4007 4008 /* 4009 If the song has a visualization, run that. 4010 */ 4011 if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) { 4012 addToActiveVisualizations(activeSongVisualizationIndex, element); 4013 4014 /* 4015 If the global visualization is set, use that. 4016 */ 4017 } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) { 4018 addToActiveVisualizations(globalVisualizationIndex, element); 4019 } else { 4020 /* 4021 Grab the first registered visualization. If it exists, use that one. 4022 */ 4023 var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null; 4024 4025 if (firstVisualization != null) { 4026 addToActiveVisualizations(firstVisualization, element); 4027 } 4028 } 4029 } 4030 } 4031 4032 /** 4033 * Run a song in playlist visualization. 4034 * 4035 * @param {Node} element - The element containing the visualization. 4036 * @param {string} playlist - The string of the playlist key. 4037 * @param {index} song - The index of the song in the playlist. 4038 */ 4039 function runSongInPlaylistVisualization(element, playlist, song) { 4040 /* 4041 If the playlist is the same as the active playlist and the active 4042 index of the song is the same as the song, then we continue. 4043 */ 4044 if (playlist == _config2.default.active_playlist && _config2.default.playlists[playlist].active_index == song) { 4045 /* 4046 Checks if the song has a visualization and that visualization exists, 4047 run that visualization. 4048 */ 4049 var activeSongVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization; 4050 var activePlaylistVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].visualization; 4051 var globalVisualizationIndex = _config2.default.visualization; 4052 4053 /* 4054 If the active song has a visualization, we use that. 4055 */ 4056 if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) { 4057 addToActiveVisualizations(activeSongVisualizationIndex, element); 4058 4059 /* 4060 If the active playlist has a visualization, we use that. 4061 */ 4062 } else if (activePlaylistVisualizationIndex != undefined && _config2.default.visualizations.available[activePlaylistVisualizationIndex] != undefined) { 4063 addToActiveVisualizations(activePlaylistVisualizationIndex, element); 4064 4065 /* 4066 If the global visualization has been set, we use that. 4067 */ 4068 } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) { 4069 addToActiveVisualizations(globalVisualizationIndex, element); 4070 } else { 4071 /* 4072 Grab the first registered visualization. If it exists, use that one. 4073 */ 4074 var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null; 4075 4076 if (firstVisualization != null) { 4077 addToActiveVisualizations(firstVisualization, element); 4078 } 4079 } 4080 } 4081 } 4082 4083 /** 4084 * Add a visualization to the array of active visualizations. 4085 * 4086 * @param {string} key - The key of the active visualization. 4087 * @param {Node} element - The element that the visualization will be applied to. 4088 */ 4089 function addToActiveVisualizations(key, element) { 4090 var visualization = new _config2.default.visualizations.available[key]["object"](); 4091 visualization.setPreferences(_config2.default.visualizations.available[key]["preferences"]); 4092 visualization.startVisualization(element); 4093 _config2.default.visualizations.active.push(visualization); 4094 } 4095 4096 /** 4097 * Stops all active visualizations. 4098 */ 4099 function stop() { 4100 /* 4101 Iterates over all of the visualizations and stop the visualization. 4102 */ 4103 for (var i = 0; i < _config2.default.visualizations.active.length; i++) { 4104 _config2.default.visualizations.active[i].stopVisualization(); 4105 } 4106 4107 /* 4108 Clear the active visualizations. 4109 */ 4110 _config2.default.visualizations.active = []; 4111 } 4112 4113 /** 4114 * Registers any visualization we can use. 4115 * 4116 * @param {object} visualization The visualization object itself 4117 * @param {object} preferences User preferences overrides. 4118 */ 4119 function register(visualization, preferences) { 4120 /* 4121 Initialize the new visualization. 4122 */ 4123 var newVisualization = new visualization(); 4124 4125 /* 4126 Adds the visualization to the global config so it knows 4127 it can be used when playing songs. 4128 getID is a public function for getting a visualization's id. 4129 It becomes the key to access the visualization. 4130 */ 4131 _config2.default.visualizations.available[newVisualization.getID()] = new Array(); 4132 _config2.default.visualizations.available[newVisualization.getID()]["object"] = visualization; 4133 _config2.default.visualizations.available[newVisualization.getID()]["preferences"] = preferences; 4134 } 4135 4136 /** 4137 * Displays the backups for the visualizations. 4138 */ 4139 function displayBackups() { 4140 /* 4141 Get all of the visualization elements on the page 4142 */ 4143 var visualizationElements = document.querySelectorAll(".amplitude-visualization"); 4144 4145 if (visualizationElements.length > 0) { 4146 for (var x = 0; x < visualizationElements.length; x++) { 4147 /* 4148 Grab the playlist and song attributes from the visualization to 4149 determine which one we run. 4150 */ 4151 var playlist = visualizationElements[x].getAttribute("data-amplitude-playlist"); 4152 var song = visualizationElements[x].getAttribute("data-amplitude-song-index"); 4153 4154 /* 4155 If the playlist and song are null, it's a global visualization element. 4156 */ 4157 if (playlist == null && song == null) { 4158 displayGlobalBackup(visualizationElements[x]); 4159 } 4160 4161 /* 4162 if the playlist is not null and the song is null it's a playlist visualization 4163 element. 4164 */ 4165 if (playlist != null && song == null) { 4166 displayPlaylistBackup(visualizationElements[x], playlist); 4167 } 4168 4169 /* 4170 If the playlist is null and the song is not null it's a song visualization element. 4171 */ 4172 if (playlist == null && song != null) { 4173 displaySongBackup(visualizationElements[x], song); 4174 } 4175 4176 /* 4177 If the playlist and song are not null then it's a song in playlist visualization 4178 element. 4179 */ 4180 if (playlist != null && song != null) { 4181 displaySongInPlaylistBackup(visualizationElements[x], playlist, song); 4182 } 4183 } 4184 } 4185 } 4186 4187 /** 4188 * Displays the global backup which is the cover art of the image in the 4189 * visualization container. 4190 * 4191 * @param {node} element - The element we are adding the background image to. 4192 */ 4193 function displayGlobalBackup(element) { 4194 element.style.backgroundImage = "url("
4194/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")"; 4195 } 4196 4197 /** 4198 * Displays the playlist backup which is the cover art of the image in the 4199 * visualization container. 4200 * 4201 * @param {node} element - The element we are adding the background image to. 4202 */ 4203 function displayPlaylistBackup(element, playlist) { 4204 if (_config2.default.active_playlist == playlist) { 4205 element.style.backgroundImage = "url("/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")"; 4206 } 4207 } 4208 4209 /** 4210 * Displays the song backup which is the cover art of the image in the 4211 * visualization container. 4212 * 4213 * @param {node} element - The element we are adding the background image to. 4214 */ 4215 function displaySongBackup(element, song) { 4216 if (_config2.default.active_index == song) { 4217 element.style.backgroundImage = "url("/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")"; 4218 } 4219 } 4220 4221 /** 4222 * Displays the song in playlist backup which is the cover art of the image in the 4223 * visualization container. 4224 * 4225 * @param {node} element - The element we are adding the background image to. 4226 */ 4227 function displaySongInPlaylistBackup(element, playlist, song) { 4228 if (_config2.default.active_playlist == playlist && _config2.default.playlists[active_playlist].active_index == song) { 4229 element.style.backgroundImage = "url("/news/core/assets/bower_components/
vendor: 26,522 bytes, lines 4229-5147
4229amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")"; 4230 } 4231 } 4232 4233 /* 4234 Returns the public facing methods 4235 */ 4236 return { 4237 run: run, 4238 stop: stop, 4239 register: register 4240 }; 4241}(); 4242 4243/** 4244 * Imports the debug module 4245 * @module utilities/Debug 4246 */ 4247exports.default = Visualizations; 4248module.exports = exports["default"]; 4249 4250/***/ }), 4251/* 17 */ 4252/***/ (function(module, exports, __webpack_require__) { 4253 4254"use strict"; 4255 4256 4257Object.defineProperty(exports, "__esModule", { 4258 value: true 4259}); 4260 4261var _config = __webpack_require__(0); 4262 4263var _config2 = _interopRequireDefault(_config); 4264 4265var _init = __webpack_require__(21); 4266 4267var _init2 = _interopRequireDefault(_init); 4268 4269function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 4270 4271/** 4272 * These helpers wrap around the basic methods of the Soundcloud API 4273 * and get the information we need from SoundCloud to make the songs 4274 * streamable through Amplitude 4275 * 4276 * @module soundcloud/SoundCloud 4277 */ 4278/** 4279 * Imports the config module 4280 * @module config 4281 */ 4282var SoundCloud = function () { 4283 /** 4284 * Defines the temporary user config used while we configure soundcloud 4285 * @type {object} 4286 */ 4287 var tempUserConfig = {}; 4288 4289 /** 4290 * Loads the soundcloud SDK for use with Amplitude so the user doesn't have 4291 * to load it themselves. 4292 * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file 4293 * 4294 * @access public 4295 * @param {object} userConfig - The config defined by the user for AmplitudeJS 4296 */ 4297 function loadSoundCloud(userConfig) { 4298 /* 4299 Sets the temporary config to the config passed by the user so we can make changes 4300 and not break the actual config. 4301 */ 4302 tempUserConfig = userConfig; 4303 4304 /* 4305 Gets the head tag for the document and create a script element. 4306 */ 4307 var head = document.getElementsByTagName("head")[0]; 4308 var script = document.createElement("script"); 4309 4310 script.type = "text/javascript"; 4311 4312 /* 4313 URL to the remote soundcloud SDK 4314 */ 4315 script.src = "https://connect.soundcloud.com/sdk.js"; 4316 script.onreadystatechange = initSoundcloud; 4317 script.onload = initSoundcloud; 4318 4319 /* 4320 Add the script to the head of the document. 4321 */ 4322 head.appendChild(script); 4323 } 4324 4325 /** 4326 * Initializes soundcloud with the key provided. 4327 * 4328 * @access private 4329 */ 4330 function initSoundcloud() { 4331 /* 4332 Calls the SoundCloud initialize function 4333 from their API and sends it the client_id 4334 that the user passed in. 4335 */ 4336 SC.initialize({ 4337 client_id: _config2.default.soundcloud_client 4338 }); 4339 4340 /* 4341 Gets the streamable URLs to run through Amplitue. This is 4342 VERY important since Amplitude can't stream the copy and pasted 4343 link from the SoundCloud page, but can resolve the streaming 4344 URLs from the link. 4345 */ 4346 getStreamableURLs(); 4347 } 4348 4349 /** 4350 * Gets the streamable URL from the URL provided for 4351 * all of the soundcloud links. This will loop through 4352 * and set all of the information for the soundcloud 4353 * urls. 4354 * 4355 * @access private 4356 */ 4357 function getStreamableURLs() { 4358 /* 4359 Define the regex to find the soundcloud URLs 4360 */ 4361 var soundcloud_regex = /^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/; 4362 4363 for (var i = 0; i < _config2.default.songs.length; i++) { 4364 /* 4365 If the URL matches soundcloud, we grab 4366 that url and get the streamable link 4367 if there is one. 4368 */ 4369 if (_config2.default.songs[i].url.match(soundcloud_regex)) { 4370 _config2.default.soundcloud_song_count++; 4371 resolveStreamable(_config2.default.songs[i].url, i); 4372 } 4373 } 4374 } 4375 4376 /** 4377 * Resolves an individual streamable URL. 4378 * 4379 * @param {string} url - The URL of the SoundCloud song to get the streamable URL from. 4380 * @param {string} playlist - The playlist we are getting the streamable URL for. 4381 * @param {Integer} index - The index of the song in the playlist or the songs array. 4382 * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist. 4383 * 4384 */ 4385 function resolveIndividualStreamableURL(url, playlist, index) { 4386 var addToShuffleList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 4387 4388 SC.get("/resolve/?url=" + url, function (sound) { 4389 /* 4390 If streamable we get the url and bind the client ID to the end 4391 so Amplitude can just stream the song normally. We then overwrite 4392 the url the user provided with the streamable URL. 4393 */ 4394 if (sound.streamable) { 4395 if (playlist != null) { 4396 _config2.default.playlists[playlist].songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client; 4397 4398 if (addToShuffleList) { 4399 _config2.default.playlists[playlist].shuffle_list[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client; 4400 } 4401 /* 4402 If the user want's to use soundcloud art, we overwrite the 4403 cover_art_url with the soundcloud artwork url. 4404 */ 4405 if (_config2.default.soundcloud_use_art) { 4406 _config2.default.playlists[playlist].songs[index].cover_art_url = sound.artwork_url; 4407 4408 if (addToShuffleList) { 4409 _config2.default.playlists[playlist].shuffle_list[index].cover_art_url = sound.artwork_url; 4410 } 4411 } 4412 4413 /* 4414 Grab the extra metadata from soundcloud and bind it to the 4415 song. The user can get this through the public function: 4416 getActiveSongMetadata 4417 */ 4418 _config2.default.playlists[playlist].songs[index].soundcloud_data = sound; 4419 4420 if (addToShuffleList) { 4421 _config2.default.playlists[playlist].shuffle_list[index].soundcloud_data = sound; 4422 } 4423 } else { 4424 _config2.default.songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client; 4425 4426 if (addToShuffleList) { 4427 _config2.default.shuffle_list[index].stream_url + "?client_id=" + _config2.default.soundcloud_client; 4428 } 4429 4430 /* 4431 If the user want's to use soundcloud art, we overwrite the 4432 cover_art_url with the soundcloud artwork url. 4433 */ 4434 if (_config2.default.soundcloud_use_art) { 4435 _config2.default.songs[index].cover_art_url = sound.artwork_url; 4436 4437 if (addToShuffleList) { 4438 _config2.default.shuffle_list[index].cover_art_url = sound.artwork_url; 4439 } 4440 } 4441 4442 /* 4443 Grab the extra metadata from soundcloud and bind it to the 4444 song. The user can get this through the public function: 4445 getActiveSongMetadata 4446 */ 4447 _config2.default.songs[index].soundcloud_data = sound; 4448 4449 if (addToShuffleList) { 4450 _config2.default.shuffle_list[index].soundcloud_data = sound; 4451 } 4452 } 4453 } else { 4454 if (playlist != null) { 4455 AmplitudeHelpers.writeDebugMessage(_config2.default.playlists[playlist].songs[index].name + " by " + _config2.default.playlists[playlist].songs[index].artist + " is not streamable by the Soundcloud API"); 4456 } else { 4457 /* 4458 If not streamable, then we print a message to the user stating 4459 that the song with name X and artist X is not streamable. This 4460 gets printed ONLY if they have debug turned on. 4461 */ 4462 AmplitudeHelpers.writeDebugMessage(_config2.default.songs[index].name + " by " + _config2.default.songs[index].artist + " is not streamable by the Soundcloud API"); 4463 } 4464 } 4465 }); 4466 } 4467 4468 /** 4469 * Due to Soundcloud SDK being asynchronous, we need to scope the 4470 * index of the song in another function. The privateGetSoundcloudStreamableURLs 4471 * function does the actual iteration and scoping. 4472 * 4473 * @access private 4474 * @param {string} url - URL of the soundcloud song 4475 * @param {number} index - The index of the soundcloud song in the songs array. 4476 */ 4477 function resolveStreamable(url, index) { 4478 SC.get("/resolve/?url=" + url, function (sound) { 4479 /* 4480 If streamable we get the url and bind the client ID to the end 4481 so Amplitude can just stream the song normally. We then overwrite 4482 the url the user provided with the streamable URL. 4483 */ 4484 if (sound.streamable) { 4485 _config2.default.songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client; 4486 4487 /* 4488 If the user want's to use soundcloud art, we overwrite the 4489 cover_art_url with the soundcloud artwork url. 4490 */ 4491 if (_config2.default.soundcloud_use_art) { 4492 _config2.default.songs[index].cover_art_url = sound.artwork_url; 4493 } 4494 4495 /* 4496 Grab the extra metadata from soundcloud and bind it to the 4497 song. The user can get this through the public function: 4498 getActiveSongMetadata 4499 */ 4500 _config2.default.songs[index].soundcloud_data = sound; 4501 } else { 4502 /* 4503 If not streamable, then we print a message to the user stating 4504 that the song with name X and artist X is not streamable. This 4505 gets printed ONLY if they have debug turned on. 4506 */ 4507 AmplitudeHelpers.writeDebugMessage(_config2.default.songs[index].name + " by " + _config2.default.songs[index].artist + " is not streamable by the Soundcloud API"); 4508 } 4509 /* 4510 Increments the song ready counter. 4511 */ 4512 _config2.default.soundcloud_songs_ready++; 4513 4514 /* 4515 When all songs are accounted for, then amplitude is ready 4516 to rock and we set the rest of the config. 4517 */ 4518 if (_config2.default.soundcloud_songs_ready == _config2.default.soundcloud_song_count) { 4519 _init2.default.setConfig(tempUserConfig); 4520 } 4521 }); 4522 } 4523 4524 /** 4525 * Determines if a given URL is a SoundCloud URL. 4526 * 4527 * @param {string} url - The URL to test if it's a SoundCloud URL. 4528 */ 4529 function isSoundCloudURL(url) { 4530 var soundcloud_regex = /^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/; 4531 4532 return url.match(soundcloud_regex); 4533 } 4534 4535 /* 4536 Returns the publically accessible methods 4537 */ 4538 return { 4539 loadSoundCloud: loadSoundCloud, 4540 resolveIndividualStreamableURL: resolveIndividualStreamableURL, 4541 isSoundCloudURL: isSoundCloudURL 4542 }; 4543}(); 4544 4545/** 4546 * Imports the initializer 4547 * @module init/AmplitudeInitializer 4548 */ 4549exports.default = SoundCloud; 4550module.exports = exports["default"]; 4551 4552/***/ }), 4553/* 18 */ 4554/***/ (function(module, exports, __webpack_require__) { 4555 4556"use strict"; 4557 4558 4559Object.defineProperty(exports, "__esModule", { 4560 value: true 4561}); 4562 4563var _config = __webpack_require__(0); 4564 4565var _config2 = _interopRequireDefault(_config); 4566 4567function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 4568 4569/** 4570 * Defines the Playback Speed Visual Elements Handler 4571 * @module visual/PlaybackSpeedElements 4572 */ 4573var PlaybackSpeedElements = function () { 4574 /** 4575 * Sets all of the visual playback speed buttons to have the right class 4576 * to display the background image that represents the current playback 4577 * speed. 4578 * 4579 * @access public 4580 */ 4581 function sync() { 4582 /* 4583 Gets all of the playback speed classes. 4584 */ 4585 var playbackSpeedClasses = document.getElementsByClassName("amplitude-playback-speed"); 4586 4587 /* 4588 Iterates over all of the playback speed classes 4589 applying the right speed class for visual purposes. 4590 */ 4591 for (var i = 0; i < playbackSpeedClasses.length; i++) { 4592 /* 4593 Removes all of the old playback speed classes. 4594 */ 4595 playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-10"); 4596 playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-15"); 4597 playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-20"); 4598 4599 /* 4600 Switch the current playback speed and apply the appropriate 4601 speed class. 4602 */ 4603 switch (_config2.default.playback_speed) { 4604 case 1: 4605 playbackSpeedClasses[i].classList.add("amplitude-playback-speed-10"); 4606 break; 4607 case 1.5: 4608 playbackSpeedClasses[i].classList.add("amplitude-playback-speed-15"); 4609 break; 4610 case 2: 4611 playbackSpeedClasses[i].classList.add("amplitude-playback-speed-20"); 4612 break; 4613 } 4614 } 4615 } 4616 4617 /** 4618 * Returns the public facing methods 4619 */ 4620 return { 4621 sync: sync 4622 }; 4623}(); /** 4624 * Imports the config module 4625 * @module config 4626 */ 4627exports.default = PlaybackSpeedElements; 4628module.exports = exports["default"]; 4629 4630/***/ }), 4631/* 19 */ 4632/***/ (function(module, exports, __webpack_require__) { 4633 4634"use strict"; 4635 4636 4637Object.defineProperty(exports, "__esModule", { 4638 value: true 4639}); 4640 4641var _config = __webpack_require__(0); 4642 4643var _config2 = _interopRequireDefault(_config); 4644 4645function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 4646 4647/** 4648 * Handles all of the shuffle elements 4649 * @module visual/ShuffleElements 4650 */ 4651var ShuffleElements = function () { 4652 /** 4653 * Syncs the global shuffle button visual state. 4654 * 4655 * @access public 4656 */ 4657 function syncMain() { 4658 /* 4659 Gets the shuffle buttons. 4660 */ 4661 var shuffleButtons = document.getElementsByClassName("amplitude-shuffle"); 4662 4663 /* 4664 Iterate over all of the shuffle buttons. 4665 */ 4666 for (var i = 0; i < shuffleButtons.length; i++) { 4667 /* 4668 Ensure the shuffle button doesn't belong to a playlist. We have 4669 a separate method for that. 4670 */ 4671 if (shuffleButtons[i].getAttribute("data-amplitude-playlist") == null) { 4672 /* 4673 If the state of the player is shuffled on, true, then 4674 we add the 'amplitude-shuffle-on' class and remove the 4675 'amplitude-shuffle-off' class. If the player is not shuffled 4676 then we do the opposite. 4677 */ 4678 if (_config2.default.shuffle_on) { 4679 shuffleButtons[i].classList.add("amplitude-shuffle-on"); 4680 shuffleButtons[i].classList.remove("amplitude-shuffle-off"); 4681 } else { 4682 shuffleButtons[i].classList.add("amplitude-shuffle-off"); 4683 shuffleButtons[i].classList.remove("amplitude-shuffle-on"); 4684 } 4685 } 4686 } 4687 } 4688 4689 /** 4690 * Syncs the playlist shuffle button visual state. 4691 * 4692 * @access public 4693 * @param {string} playlist - The playlist string the shuffle button belongs to. 4694 */ 4695 function syncPlaylist(playlist) { 4696 /* 4697 Gets all of the shuffle buttons. 4698 */ 4699 var shuffleButtons = document.querySelectorAll('.amplitude-shuffle[data-amplitude-playlist="' + playlist + '"]'); 4700 4701 /* 4702 Iterate over all of the shuffle buttons 4703 */ 4704 for (var i = 0; i < shuffleButtons.length; i++) { 4705 /* 4706 If the state of the playlist is shuffled on, true, then 4707 we add the 'amplitude-shuffle-on' class and remove the 4708 'amplitude-shuffle-off' class. If the player is not shuffled 4709 then we do the opposite. 4710 */ 4711 if (_config2.default.playlists[playlist].shuffle) { 4712 shuffleButtons[i].classList.add("amplitude-shuffle-on"); 4713 shuffleButtons[i].classList.remove("amplitude-shuffle-off"); 4714 } else { 4715 shuffleButtons[i].classList.add("amplitude-shuffle-off"); 4716 shuffleButtons[i].classList.remove("amplitude-shuffle-on"); 4717 } 4718 } 4719 } 4720 4721 /** 4722 * Returns public facing methods 4723 */ 4724 return { 4725 syncMain: syncMain, 4726 syncPlaylist: syncPlaylist 4727 }; 4728}(); /** 4729 * Imports the config module 4730 * @module config 4731 */ 4732exports.default = ShuffleElements; 4733module.exports = exports["default"]; 4734 4735/***/ }), 4736/* 20 */ 4737/***/ (function(module, exports, __webpack_require__) { 4738 4739"use strict"; 4740 4741 4742Object.defineProperty(exports, "__esModule", { 4743 value: true 4744}); 4745 4746var _config = __webpack_require__(0); 4747 4748var _config2 = _interopRequireDefault(_config); 4749 4750function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 4751 4752/** 4753 * Handles the syncing of the song played progress elements. 4754 * 4755 * @module visual/SongPlayedProgressElements 4756 */ 4757var SongPlayedProgressElements = function () { 4758 /** 4759 * Syncs the song played progress bars. These are HTML5 progress elements. 4760 * 4761 * @access private 4762 * @param {number} songPlayedPercentage - The percentage of the song that has been played. 4763 */ 4764 function sync(songPlayedPercentage) { 4765 syncGlobal(songPlayedPercentage); 4766 syncPlaylist(songPlayedPercentage); 4767 syncSong(songPlayedPercentage); 4768 syncSongInPlaylist(songPlayedPercentage); 4769 } 4770 4771 /** 4772 * Sync how much has been played with a progress bar. This is the global progress bar. 4773 * 4774 * @access private 4775 * @param {number} songPlayedPercentage - The percent of the song completed. 4776 */ 4777 function syncGlobal(percentage) { 4778 /* 4779 Ensure that the song completion percentage is a number 4780 */ 4781 if (!isNaN(percentage)) { 4782 /* 4783 Get all of the song progress bars 4784 */ 4785 var songPlayedProgressBars = document.querySelectorAll(".amplitude-song-played-progress"); 4786 4787 for (var i = 0; i < songPlayedProgressBars.length; i++) { 4788 var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist"); 4789 var songIndex = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index"); 4790 4791 if (playlist == null && songIndex == null) { 4792 var max = songPlayedProgressBars[i].max; 4793 4794 songPlayedProgressBars[i].value = percentage / 100 * max; 4795 } 4796 } 4797 } 4798 } 4799 4800 /** 4801 * Sync how much has been played with a progress bar. This is the playlist progress bar. 4802 * 4803 * @access public 4804 * @param {number} songPlayedPercentage - The percent of the song completed. 4805 */ 4806 function syncPlaylist(percentage) { 4807 /* 4808 Ensure that the song completion percentage is a number 4809 */ 4810 if (!isNaN(percentage)) { 4811 /* 4812 Get all of the song progress bars 4813 */ 4814 var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 4815 4816 for (var i = 0; i < songPlayedProgressBars.length; i++) { 4817 var song = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index"); 4818 4819 if (song == null) { 4820 var max = songPlayedProgressBars[i].max; 4821 4822 songPlayedProgressBars[i].value = percentage / 100 * max; 4823 } 4824 } 4825 } 4826 } 4827 4828 /** 4829 * Sync how much has been played with a progress bar. This is for an individual song. 4830 * 4831 * @access private 4832 * @param {number} songPlayedPercentage - The percent of the song completed. 4833 */ 4834 function syncSong(percentage) { 4835 if (_config2.default.active_playlist == null) { 4836 /* 4837 Ensure that the song completion percentage is a number 4838 */ 4839 if (!isNaN(percentage)) { 4840 /* 4841 Get all of the song progress bars 4842 */ 4843 var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 4844 4845 for (var i = 0; i < songPlayedProgressBars.length; i++) { 4846 var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist"); 4847 4848 if (playlist == null) { 4849 var max = songPlayedProgressBars[i].max; 4850 4851 songPlayedProgressBars[i].value = percentage / 100 * max; 4852 } 4853 } 4854 } 4855 } 4856 } 4857 4858 /** 4859 * Sync how much has been played with a progress bar. This is for an individual song in playlist. 4860 * 4861 * @access private 4862 * @param {number} songPlayedPercentage - The percent of the song completed. 4863 */ 4864 function syncSongInPlaylist(percentage) { 4865 /* 4866 Ensure that the song completion percentage is a number 4867 */ 4868 if (!isNaN(percentage)) { 4869 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 4870 4871 /* 4872 Get all of the song progress bars 4873 */ 4874 var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 4875 4876 /* 4877 Iterates over all of the song played progress elements 4878 and sets them accordingly. 4879 */ 4880 for (var i = 0; i < songPlayedProgressBars.length; i++) { 4881 var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist"); 4882 var songIndex = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index"); 4883 4884 if (playlist != null && songIndex != null) { 4885 var max = songPlayedProgressBars[i].max; 4886 4887 songPlayedProgressBars[i].value = percentage / 100 * max; 4888 } 4889 } 4890 } 4891 } 4892 4893 /** 4894 * Sets all of the song played progress bars to 0 4895 * 4896 * @access public 4897 */ 4898 function resetElements() { 4899 var songPlayedProgressBars = document.getElementsByClassName("amplitude-song-played-progress"); 4900 4901 for (var i = 0; i < songPlayedProgressBars.length; i++) { 4902 songPlayedProgressBars[i].value = 0; 4903 } 4904 } 4905 4906 return { 4907 sync: sync, 4908 resetElements: resetElements 4909 }; 4910}(); /** 4911 * Imports the config module 4912 * @module config 4913 */ 4914exports.default = SongPlayedProgressElements; 4915module.exports = exports["default"]; 4916 4917/***/ }), 4918/* 21 */ 4919/***/ (function(module, exports, __webpack_require__) { 4920 4921"use strict"; 4922 4923 4924Object.defineProperty(exports, "__esModule", { 4925 value: true 4926}); 4927 4928var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** 4929 * Imports the config module 4930 * @module config 4931 */ 4932 4933 4934/** 4935 * AmplitudeJS Core Module 4936 * @module core/Core 4937 */ 4938 4939 4940/** 4941 * AmplitudeJS SoundCloud Module 4942 * @module soundcloud/SoundCloud 4943 */ 4944 4945 4946/** 4947 * Imports the utilities used by the main module. 4948 */ 4949/** 4950 * AmplitudeJS Config State Module 4951 * @module utilities/ConfigState 4952 */ 4953 4954 4955/** 4956 * AmplitudeJS Debug Module 4957 * @module utilities/Debug 4958 */ 4959 4960 4961/** 4962 * AmplitudeJS Checks Module 4963 * @module utilities/Checks 4964 */ 4965 4966 4967/** 4968 * AmplitudeJS Shuffler Module 4969 * @module utilities/Shuffler 4970 */ 4971 4972 4973/** 4974 * AmplitudeJS Events Module 4975 * @module events/Events 4976 */ 4977 4978 4979/** 4980 * AmplitudeJS FX Module 4981 * @module fx/Fx 4982 */ 4983 4984 4985/** 4986 * AmplitudeJS Visualizations Module 4987 * @module fx/Visualizations 4988 */ 4989 4990 4991/** 4992 * AmplitudeJS WaveForm Module 4993 * @module fx/WaveForm 4994 */ 4995 4996 4997/** 4998 * AmplitudeJS Audio Navigation Module. 4999 * @module utilities/AudioNavigation 5000 */ 5001 5002 5003/** 5004 * AmplitudeJS Callbacks Module 5005 * @module utilities/Callbacks 5006 */ 5007 5008 5009/** 5010 * AmplitudeJS Playlists Initializer Module 5011 * @module init/Playlists 5012 */ 5013 5014 5015/** 5016 * Imports the AmplitudeJS Shuffle Elements 5017 * @module visual/ShuffleElements 5018 */ 5019 5020 5021/** 5022 * Imports the AmplitudeJS Mute Elements 5023 * @module visual/MuteElements 5024 */ 5025 5026 5027/** 5028 * Imports the AmplitudeJS Volume Slider 5029 * @module visual/VolumeSliderElements 5030 */ 5031 5032 5033/** 5034 * Imports the AmplitudeJS Time Elements 5035 * @module visual/TimeElements 5036 */ 5037 5038 5039/** 5040 * Imports the AmplitudeJS Play/Pause Elements Module. 5041 * @module visual/PlayPauseElements 5042 */ 5043 5044 5045/** 5046 * Imports the AmplitudeJS MetaData Elements Module. 5047 * @module visual/MetaDataElements 5048 */ 5049 5050 5051/** 5052 * Imports the AmplitudeJS PlaybackSpeedElements Module. 5053 * @module visual/PlayBackSpeedElements 5054 */ 5055 5056 5057/** 5058 * Imports the AmplitudeJS Repeat Element 5059 * @module visual/RepeatElements 5060 */ 5061 5062 5063var _config = __webpack_require__(0); 5064 5065var _config2 = _interopRequireDefault(_config); 5066 5067var _core = __webpack_require__(1); 5068 5069var _core2 = _interopRequireDefault(_core); 5070 5071var _soundcloud = __webpack_require__(17); 5072 5073var _soundcloud2 = _interopRequireDefault(_soundcloud); 5074 5075var _configState = __webpack_require__(6); 5076 5077var _configState2 = _interopRequireDefault(_configState); 5078 5079var _debug = __webpack_require__(4); 5080 5081var _debug2 = _interopRequireDefault(_debug); 5082 5083var _checks = __webpack_require__(5); 5084 5085var _checks2 = _interopRequireDefault(_checks); 5086 5087var _shuffler = __webpack_require__(13); 5088 5089var _shuffler2 = _interopRequireDefault(_shuffler); 5090 5091var _events = __webpack_require__(26); 5092 5093var _events2 = _interopRequireDefault(_events); 5094 5095var _fx = __webpack_require__(46); 5096 5097var _fx2 = _interopRequireDefault(_fx); 5098 5099var _visualizations = __webpack_require__(16); 5100 5101var _visualizations2 = _interopRequireDefault(_visualizations); 5102 5103var _waveform = __webpack_require__(22); 5104 5105var _waveform2 = _interopRequireDefault(_waveform); 5106 5107var _audioNavigation = __webpack_require__(3); 5108 5109var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 5110 5111var _callbacks = __webpack_require__(7); 5112 5113var _callbacks2 = _interopRequireDefault(_callbacks); 5114 5115var _playlists = __webpack_require__(48); 5116 5117var _playlists2 = _interopRequireDefault(_playlists); 5118 5119var _shuffleElements = __webpack_require__(19); 5120 5121var _shuffleElements2 = _interopRequireDefault(_shuffleElements); 5122 5123var _muteElements = __webpack_require__(10); 5124 5125var _muteElements2 = _interopRequireDefault(_muteElements); 5126 5127var _volumeSliderElements = __webpack_require__(11); 5128 5129var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements); 5130 5131var _timeElements = __webpack_require__(15); 5132 5133var _timeElements2 = _interopRequireDefault(_timeElements); 5134 5135var _playPauseElements = __webpack_require__(2); 5136 5137var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 5138 5139var _metaDataElements = __webpack_require__(8); 5140 5141var _metaDataElements2 = _interopRequireDefault(_metaDataElements); 5142 5143var _playbackSpeedElements = __webpack_require__(18); 5144 5145var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements); 5146 5147var _repeatElements = __webpack_require__(9
vendor: 2,757 bytes, lines 5147-5239
5147); 5148 5149var _repeatElements2 = _interopRequireDefault(_repeatElements); 5150 5151function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 5152 5153/** 5154 * AmplitudeJS Initializer Module. Helps with the handling of all of the 5155 * initialization for AmplitudeJS. 5156 * 5157 * @module init/Initializer 5158 */ 5159var Initializer = function () { 5160 /** 5161 * The main init function. The user will call this through 5162 * Amplitude.init({}) and pass in their settings. 5163 * 5164 * Public Accessor: Amplitude.init( user_config_json ) 5165 * @access public 5166 * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS. 5167 */ 5168 function initialize(userConfig) { 5169 var ready = false; 5170 5171 /* 5172 Reset the config on init so we have a clean slate. This is if the 5173 user has to re-init. 5174 */ 5175 _configState2.default.resetConfig(); 5176 5177 /* 5178 Initialize event handlers on init. This will clear any old 5179 event handlers on the amplitude element and re-bind what is 5180 necessary. 5181 */ 5182 _events2.default.initialize(); 5183 5184 /* 5185 Initialize the callbacks we listen to for the audio object. 5186 */ 5187 _callbacks2.default.initialize(); 5188 5189 /* 5190 Initializes debugging right away so we can use it for the rest 5191 of the configuration. 5192 */ 5193 _config2.default.debug = userConfig.debug != undefined ? userConfig.debug : false; 5194 5195 /* 5196 Set default artwork, if specified. 5197 */ 5198 setArt(userConfig); 5199 5200 /* 5201 Checks to see if the user has songs defined. 5202 */ 5203 if (userConfig.songs) { 5204 /* 5205 Checks to see if the user has some songs in the songs array. 5206 */ 5207 if (userConfig.songs.length != 0) { 5208 /* 5209 Copies over the user defined songs. and prepares 5210 Amplitude for the rest of the configuration. 5211 */ 5212 _config2.default.songs = userConfig.songs; 5213 /* 5214 Flag amplitude as ready. 5215 */ 5216 ready = true; 5217 } else { 5218 _debug2.default.writeMessage("Please add some songs, to your songs object!"); 5219 } 5220 } else { 5221 _debug2.default.writeMessage("Please provide a songs object for AmplitudeJS to run!"); 5222 } 5223 5224 /* 5225 Initializes the audio context. In this method it checks to see if the 5226 user wants to use visualizations or not before proceeding. 5227 */ 5228 if (_fx2.default.webAudioAPIAvailable()) { 5229 if (_fx2.default.determineUsingAnyFX()) { 5230 /* 5231 Configure the Web Audio API If It's available. 5232 */ 5233 _fx2.default.configureWebAudioAPI(); 5234 5235 /* 5236 Activates the audio context after an event for the user. 5237 */ 5238 document.documentElement.addEventListener("mousedown", function () { 5239 if (_config2.default.context.state !==
vendor: 4,915 bytes, lines 5239-5386
5239'running') { 5240 _config2.default.context.resume(); 5241 } 5242 }); 5243 5244 document.documentElement.addEventListener("keydown", function () { 5245 if (_config2.default.context.state !== 'running') { 5246 _config2.default.context.resume(); 5247 } 5248 }); 5249 5250 document.documentElement.addEventListener("keyup", function () { 5251 if (_config2.default.context.state !== 'running') { 5252 _config2.default.context.resume(); 5253 } 5254 }); 5255 5256 /* 5257 Set the user waveform settings if provided. 5258 */ 5259 if (userConfig.waveforms != undefined && userConfig.waveforms.sample_rate != undefined) { 5260 _config2.default.waveforms.sample_rate = userConfig.waveforms.sample_rate; 5261 } 5262 5263 /* 5264 Initialize the waveform. 5265 */ 5266 _waveform2.default.init(); 5267 5268 /* 5269 If the user is registering visualizations on init, 5270 we set them right away. 5271 */ 5272 if (userConfig.visualizations != undefined && userConfig.visualizations.length > 0) { 5273 /* 5274 Iterate over all of the visualizations and 5275 register them in our player. 5276 */ 5277 for (var i = 0; i < userConfig.visualizations.length; i++) { 5278 _visualizations2.default.register(userConfig.visualizations[i].object, userConfig.visualizations[i].params); 5279 } 5280 } 5281 } 5282 } else { 5283 _debug2.default.writeMessage("The Web Audio API is not available on this platform. We are using your defined backups!"); 5284 } 5285 5286 /* 5287 Initialize default live settings 5288 */ 5289 initializeDefaultLiveSettings(); 5290 5291 /* 5292 Initialize default song indexes 5293 */ 5294 initializeDefaultSongIndexes(); 5295 5296 /* 5297 When the preliminary config is ready, we are ready to proceed. 5298 */ 5299 if (ready) { 5300 /* 5301 Copies over the soundcloud information to the global config 5302 which will determine where we go from there. 5303 */ 5304 _config2.default.soundcloud_client = userConfig.soundcloud_client != undefined ? userConfig.soundcloud_client : ""; 5305 5306 /* 5307 Checks if we want to use the art loaded from soundcloud. 5308 */ 5309 _config2.default.soundcloud_use_art = userConfig.soundcloud_use_art != undefined ? userConfig.soundcloud_use_art : ""; 5310 5311 /* 5312 If the user provides a soundcloud client then we assume that 5313 there are URLs in their songs that will reference SoundCloud. 5314 We then copy over the user config they provided to the 5315 temp_user_config so we don't mess up the global or their configs 5316 and load the soundcloud information. 5317 */ 5318 var tempUserConfig = {}; 5319 5320 /* 5321 If there's a soundcloud_client key set, we load the SoundCloud data 5322 for all of the songs in the array. 5323 */ 5324 if (_config2.default.soundcloud_client != "") { 5325 tempUserConfig = userConfig; 5326 5327 /* 5328 Load up SoundCloud for use with AmplitudeJS. 5329 */ 5330 _soundcloud2.default.loadSoundCloud(tempUserConfig); 5331 } else { 5332 /* 5333 The user is not using Soundcloud with Amplitude at this point 5334 so we just finish the configuration with the users's preferences. 5335 */ 5336 setConfig(userConfig); 5337 } 5338 } 5339 5340 /* 5341 Debug out what was initialized with AmplitudeJS. 5342 */ 5343 _debug2.default.writeMessage("Initialized With: "); 5344 _debug2.default.writeMessage(_config2.default); 5345 } 5346 5347 /** 5348 * Rebinds all of the elements in the display. 5349 * 5350 * Public Accessor: Amplitude.rebindDisplay() 5351 * @access public 5352 */ 5353 function rebindDisplay() { 5354 _events2.default.initialize(); 5355 _metaDataElements2.default.displayMetaData(); 5356 } 5357 5358 /** 5359 * Finishes the initalization of the config. Takes all of the user defined 5360 * parameters and makes sure they override the defaults. The important 5361 * config information is assigned in the publicInit() function. 5362 * 5363 * This function can be called from 2 different locations: 5364 * 1. Right away on init after the important settings are defined. 5365 * 5366 * 2. After all of the Soundcloud URLs are resolved properly and 5367 * soundcloud is configured. We will need the proper URLs from Soundcloud 5368 * to stream through Amplitude so we get those right away before we 5369 * set the information and the active song 5370 * 5371 * @access public 5372 * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS. 5373 */ 5374 function setConfig(userConfig) { 5375 /* 5376 Checks if the user has any playlists defined. If they do 5377 we have to initialize the functionality for the playlists. 5378 */ 5379 if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) { 5380 _playlists2.default.initialize(userConfig.playlists); 5381 } 5382 5383 /* 5384 Check to see if the user entered a start song 5385 */ 5386 if (userConfig.start_song != undefined &&
vendor: 9,069 bytes, lines 5386-5667
5386userConfig.starting_playlist) { 5387 /* 5388 Ensure what has been entered is an integer. 5389 */ 5390 if (_checks2.default.isInt(userConfig.start_song)) { 5391 _audioNavigation2.default.changeSong(_config2.default.songs[userConfig.start_song], userConfig.start_song); 5392 } else { 5393 _debug2.default.writeMessage("You must enter an integer index for the start song."); 5394 } 5395 } else { 5396 _audioNavigation2.default.changeSong(_config2.default.songs[0], 0); 5397 } 5398 5399 /* 5400 If the shuffle is on by default, shuffle the songs and 5401 switch to the shuffled song. 5402 */ 5403 if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) { 5404 _config2.default.shuffle_on = true; 5405 _shuffler2.default.shuffleSongs(); 5406 5407 _audioNavigation2.default.changeSong(_config2.default.shuffle_list[0], 0); 5408 } 5409 5410 /* 5411 Allows the user to set whether they want to continue to the next song 5412 when the current song finishes or not. In any scenario that's not a playlist, 5413 contining to the next song may not be desired. 5414 */ 5415 _config2.default.continue_next = userConfig.continue_next != undefined ? userConfig.continue_next : true; 5416 5417 /* 5418 If the user defined a playback speed, we copy over their 5419 preference here, otherwise we default to normal playback 5420 speed of 1.0. 5421 */ 5422 _config2.default.playback_speed = userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0; 5423 5424 /* 5425 Sets the audio playback speed. 5426 */ 5427 _core2.default.setPlaybackSpeed(_config2.default.playback_speed); 5428 5429 /* 5430 If the user wants the song to be pre-loaded for instant 5431 playback, they set it to true. By default it's set to just 5432 load the metadata. 5433 */ 5434 _config2.default.audio.preload = userConfig.preload != undefined ? userConfig.preload : "auto"; 5435 5436 /* 5437 Initializes the user defined callbacks. This should be a JSON 5438 object that contains a key->value store of the callback name 5439 and the name of the function the user needs to call. 5440 */ 5441 _config2.default.callbacks = userConfig.callbacks != undefined ? userConfig.callbacks : {}; 5442 5443 /* 5444 Initializes the user defined key bindings. This should be a JSON 5445 object that contains a key->value store of the key event number 5446 pressed and the method to be run. 5447 */ 5448 _config2.default.bindings = userConfig.bindings != undefined ? userConfig.bindings : {}; 5449 5450 /* 5451 The user can define a starting volume in a range of 0-100 with 5452 0 being muted and 100 being the loudest. After the config is set 5453 Amplitude sets the active song's volume to the volume defined 5454 by the user. 5455 */ 5456 _config2.default.volume = userConfig.volume != undefined ? userConfig.volume : 50; 5457 5458 /* 5459 Sets the delay between songs if the user has it set. This should be in MS. 5460 */ 5461 _config2.default.delay = userConfig.delay != undefined ? userConfig.delay : 0; 5462 5463 /* 5464 The user can set the volume increment and decrement values between 1 and 100 5465 for when the volume up or down button is pressed. The default is an increase 5466 or decrease of 5. 5467 */ 5468 _config2.default.volume_increment = userConfig.volume_increment != undefined ? userConfig.volume_increment : 5; 5469 5470 _config2.default.volume_decrement = userConfig.volume_decrement != undefined ? userConfig.volume_decrement : 5; 5471 5472 /* 5473 Set the volume to what is defined in the config. The user can define this, 5474 so we should set it up that way. 5475 */ 5476 _core2.default.setVolume(_config2.default.volume); 5477 5478 /* 5479 Set default artwork, if specified 5480 */ 5481 setArt(userConfig); 5482 5483 /* 5484 Initialize the visual elements 5485 */ 5486 initializeElements(); 5487 5488 /* 5489 If the user has selected a starting playlist, we need to set the starting playlist 5490 and sync the visuals 5491 */ 5492 if (userConfig.starting_playlist != undefined && userConfig.starting_playlist != "") { 5493 /* 5494 Set the active playlist to the starting playlist by the user 5495 */ 5496 _config2.default.active_playlist = userConfig.starting_playlist; 5497 5498 /* 5499 Check if the user defined a song to start with in the playlist. 5500 */ 5501 if (userConfig.starting_playlist_song != undefined && userConfig.starting_playlist_song != "") { 5502 /* 5503 Ensure the song is a valid index. 5504 */ 5505 if (_typeof(userConfig.playlists[userConfig.starting_playlist].songs[parseInt(userConfig.starting_playlist_song)]) != undefined) { 5506 /* 5507 Set the player to the song defined by the user. 5508 */ 5509 _audioNavigation2.default.changeSongPlaylist(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[parseInt(userConfig.starting_playlist_song)], parseInt(userConfig.starting_playlist_song)); 5510 } else { 5511 /* 5512 Set the player to the first song in the playlist 5513 */ 5514 _audioNavigation2.default.changeSongPlaylist(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[0], 0); 5515 /* 5516 Debug that the song index doesn't exist 5517 */ 5518 _debug2.default.writeMessage("The index of " + userConfig.starting_playlist_song + " does not exist in the playlist " + userConfig.starting_playlist); 5519 } 5520 } else { 5521 /* 5522 Set the player to the first song in the playlist 5523 */ 5524 _audioNavigation2.default.changeSong(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[0], 0); 5525 } 5526 5527 /* 5528 Sync the main and song play pause buttons. 5529 */ 5530 _playPauseElements2.default.sync(); 5531 } 5532 5533 /* 5534 Run after init callback 5535 */ 5536 _callbacks2.default.run("initialized"); 5537 } 5538 5539 /** 5540 * Sets the default_album_art and default_playlist_art from the 5541 * user supplied configuration. 5542 * 5543 * @access public 5544 * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS. 5545 */ 5546 function setArt(userConfig) { 5547 /* 5548 If the user defines default album art, this image will display if the active 5549 song doesn't have album art defined. 5550 */ 5551 if (userConfig.default_album_art != undefined) { 5552 _config2.default.default_album_art = userConfig.default_album_art; 5553 } else { 5554 _config2.default.default_album_art = ""; 5555 } 5556 5557 /* 5558 If the user defines default playlist art, this image will display if the user 5559 tries to set up a playlist meta data image tag but doesn't have one defined. 5560 */ 5561 if (userConfig.default_playlist_art != undefined) { 5562 _config2.default.default_playlist_art = userConfig.default_playlist_art; 5563 } else { 5564 _config2.default.default_playlist_art = ""; 5565 } 5566 } 5567 5568 /** 5569 * Initializes all of the elements on the page to the default starting point 5570 * to build from there. 5571 * 5572 * @access private 5573 */ 5574 function initializeElements() { 5575 /* 5576 Visually sync the shuffle statuses 5577 */ 5578 _shuffleElements2.default.syncMain(); 5579 5580 /* 5581 Sync Mute Elements. 5582 */ 5583 _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false); 5584 5585 /* 5586 Sync Volume Slider Elements 5587 */ 5588 _volumeSliderElements2.default.sync(); 5589 5590 /* 5591 Syncs all of the playback speed elements. 5592 */ 5593 _playbackSpeedElements2.default.sync(); 5594 5595 /* 5596 Syncs all of the visual time elements to 00. 5597 */ 5598 _timeElements2.default.resetCurrentTimes(); 5599 5600 /* 5601 Sets all of the play pause buttons to pause. 5602 */ 5603 _playPauseElements2.default.syncToPause(); 5604 5605 /* 5606 Sets the meta data for the songs automatically. 5607 */ 5608 _metaDataElements2.default.syncMetaData(); 5609 5610 /* 5611 Sets the repeat buttons automatically. 5612 */ 5613 _repeatElements2.default.syncRepeatSong(); 5614 } 5615 5616 /** 5617 * Counts the number of playlists the user has configured. This ensures 5618 * that the user has at least 1 playlist so we can validate the songs 5619 * defined in the playlist are correct and they didn't enter an invalid 5620 * ID. 5621 * 5622 * @access private 5623 * @param {object} playlists - 5624 */ 5625 function countPlaylists(playlists) { 5626 /* 5627 Initialize the placeholders to iterate through the playlists 5628 and find out how many we have to account for. 5629 */ 5630 var size = 0, 5631 key = void 0; 5632 5633 /* 5634 Iterate over playlists and if the user has the playlist defined, 5635 increment the size of playlists. 5636 */ 5637 for (key in playlists) { 5638 if (playlists.hasOwnProperty(key)) { 5639 size++; 5640 } 5641 } 5642 5643 /* 5644 Debug how many playlists are in the config. 5645 */ 5646 _debug2.default.writeMessage("You have " + size + " playlist(s) in your config"); 5647 5648 /* 5649 Return the number of playlists in the config. 5650 */ 5651 return size; 5652 } 5653 5654 /** 5655 * Intializes the default live settings for all of the songs. 5656 * 5657 * @access private 5658 */ 5659 function initializeDefaultLiveSettings() { 5660 for (var i = 0; i < _config2.default.songs.length; i++) { 5661 if (_config2.default.songs[i].live == undefined) { 5662 _config2.default.songs[i].live = false; 5663 } 5664 } 5665 } 5666 5667 /**
5667 5668 * Initializes the index of the song in the songs array so 5669 * we can reference it if needed 5670 * 5671 * @access private 5672 */ 5673 function initializeDefaultSongIndexes() { 5674 for (var i = 0; i < _config2.default.songs.length; i++) { 5675 _config2.default.songs[i].index = i; 5676 } 5677 } 5678 5679 /* 5680 Returns the publicly accessible methods 5681 */ 5682 return { 5683 initialize: initialize, 5684 setConfig: setConfig, 5685 rebindDisplay: rebindDisplay 5686 }; 5687}(); 5688 5689exports.default = Initializer; 5690module.exports = exports["default"]; 5691 5692/***/ }), 5693/* 22 */ 5694/***/ (function(module, exports, __webpack_require__) { 5695 5696"use strict"; 5697 5698 5699Object.defineProperty(exports, "__esModule", { 5700 value: true 5701}); 5702 5703var _config = __webpack_require__(0); 5704 5705var _config2 = _interopRequireDefault(_config); 5706 5707function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 5708 5709/** 5710 * Builds a waveform for the current audio. 5711 * Help from: https://robots.thoughtbot.com/javascript-audio-api 5712 * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages 5713 */ 5714var WaveForm = function () { 5715 /* 5716 Initialize the local variables used in the Waveform. 5717 */ 5718 var buffer = ""; 5719 var sampleRate = _config2.default.waveforms.sample_rate; 5720 var peaks = ""; 5721 5722 function init() {
vendor: 17,987 bytes, lines 5722-6367
5722 5723 /* 5724 Grabs all of the waveform elements on the page. 5725 */ 5726 var waveforms = document.querySelectorAll(".amplitude-wave-form"); 5727 5728 /* 5729 If there are waveforms, we iterate over them and set them up to display 5730 properly. 5731 */ 5732 if (waveforms.length > 0) { 5733 /* 5734 Iterate over all of the waveforms and build the SVG parts. 5735 */ 5736 for (var i = 0; i < waveforms.length; i++) { 5737 /* 5738 Clear the inner HTML of the element if we are replacing the waveform. 5739 */ 5740 waveforms[i].innerHTML = ""; 5741 5742 /* 5743 Inserts an SVG into the element. 5744 */ 5745 var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 5746 svg.setAttribute("viewBox", "0 -1 " + sampleRate + " 2"); 5747 svg.setAttribute("preserveAspectRatio", "none"); 5748 5749 /* 5750 Add a g component to the SVG 5751 */ 5752 var g = document.createElementNS("http://www.w3.org/2000/svg", "g"); 5753 svg.appendChild(g); 5754 5755 /* 5756 Add a path component to the g 5757 */ 5758 var path = document.createElementNS("http://www.w3.org/2000/svg", "path"); 5759 path.setAttribute("d", ""); 5760 path.setAttribute("id", "waveform"); 5761 5762 g.appendChild(path); 5763 5764 /* 5765 Append the SVG to the waveform. 5766 */ 5767 waveforms[i].appendChild(svg); 5768 } 5769 } 5770 } 5771 5772 /** 5773 * Builds each waveform for the page. 5774 */ 5775 function build() { 5776 if (_config2.default.web_audio_api_available) { 5777 /* 5778 If we don't have the wave form built, we need to build the waveform by loading 5779 the src with an array buffer. 5780 */ 5781 if (_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) { 5782 a = (a << 5) - a + b.charCodeAt(0); 5783 return a & a; 5784 }, 0))] == undefined) { 5785 /* 5786 Initializes a new XML Http Request. 5787 */ 5788 var req = new XMLHttpRequest(); 5789 5790 /* 5791 Opens the src parameter for the audio file to read in. 5792 */ 5793 req.open("GET", _config2.default.audio.src, true); 5794 req.responseType = "arraybuffer"; 5795 5796 /* 5797 When the ready state changes, check to see if we can render the 5798 wave form. 5799 */ 5800 req.onreadystatechange = function (e) { 5801 /* 5802 When the request is complete, then we begin decoding the 5803 audio to build the waveform. 5804 */ 5805 if (req.readyState == 4) { 5806 /* 5807 If the status is 200 means the response is a success and 5808 we decode the audio data. 5809 */ 5810 if (req.status == 200) { 5811 /* 5812 Decode the audio data and process the waveform. 5813 */ 5814 _config2.default.context.decodeAudioData(req.response, function (bufferedAudio) { 5815 /* 5816 Set the buffer to the audio returned. 5817 */ 5818 buffer = bufferedAudio; 5819 5820 /* 5821 Get the peaks in the audio. 5822 */ 5823 peaks = getPeaks(sampleRate, buffer); 5824 5825 /* 5826 Build the SVG 5827 */ 5828 process(sampleRate, buffer, peaks); 5829 }); 5830 } 5831 } 5832 }; 5833 req.send(); 5834 } else { 5835 /* 5836 If we already have a waveform, we grab the waveform that 5837 was created for the song and display it. We do a simple hash 5838 of the song URL so it's already unique. 5839 */ 5840 displayWaveForms(_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) { 5841 a = (a << 5) - a + b.charCodeAt(0); 5842 return a & a; 5843 }, 0))]); 5844 } 5845 } 5846 } 5847 5848 /** 5849 * Processes the audio and generates the waveform. 5850 * 5851 * @param {sampleRate} sampleRate - The rate we should sample the audio. 5852 * @param {arraybuffer} buffer - The Web Audio API 5853 * @param {array} peaks - The peaks in the audio. 5854 */ 5855 function process(sampleRate, buffer, peaks) { 5856 /* 5857 If we have a buffer, we find the peaks in the audio. 5858 */ 5859 if (buffer) { 5860 /* 5861 Get the total peaks in the song. 5862 */ 5863 var totalPeaks = peaks.length; 5864 5865 /* 5866 Figure out the depth of the peak. 5867 */ 5868 var d = ""; 5869 for (var peakNumber = 0; peakNumber < totalPeaks; peakNumber++) { 5870 if (peakNumber % 2 === 0) { 5871 d += " M" + ~~(peakNumber / 2) + ", " + peaks.shift(); 5872 } else { 5873 d += " L" + ~~(peakNumber / 2) + ", " + peaks.shift(); 5874 } 5875 } 5876 5877 /* 5878 Add the waveform to the built waveforms array. 5879 */ 5880 _config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) { 5881 a = (a << 5) - a + b.charCodeAt(0); 5882 return a & a; 5883 }, 0))] = d; 5884 5885 /* 5886 Display the waveform. 5887 */ 5888 displayWaveForms(_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) { 5889 a = (a << 5) - a + b.charCodeAt(0); 5890 return a & a; 5891 }, 0))]); 5892 } 5893 } 5894 5895 /** 5896 * Get the peaks of the audio for the waveform. 5897 * 5898 * @param {number} length - The sample size of the audio. 5899 * @param {array} buffer - The array buffer used to find the peaks in the audio. 5900 */ 5901 function getPeaks(length, buffer) { 5902 /* 5903 Set the parameters needed to build the SVG. 5904 */ 5905 var sampleSize = buffer.length / length; 5906 var sampleStep = ~~(sampleSize / 10) || 1; 5907 var numberOfChannels = buffer.numberOfChannels; 5908 var mergedPeaks = []; 5909 5910 /* 5911 Iterate over the channels and find the peaks. 5912 */ 5913 for (var channelNumber = 0; channelNumber < numberOfChannels; channelNumber++) { 5914 /* 5915 Initialize the peaks array and set the channel data to what 5916 the buffer has in its channel data. 5917 */ 5918 var _peaks = []; 5919 var channelData = buffer.getChannelData(channelNumber); 5920 5921 /* 5922 Iterate over peaks with respect to the sample size. 5923 */ 5924 for (var peakNumber = 0; peakNumber < length; peakNumber++) { 5925 /* 5926 Gt the start and end peak. 5927 */ 5928 var start = ~~(peakNumber * sampleSize); 5929 var end = ~~(start + sampleSize); 5930 5931 /* 5932 Set min and max to the channel data first peak. 5933 */ 5934 var min = channelData[0]; 5935 var max = channelData[0]; 5936 5937 /* 5938 Iterate over the parts of the song starting to the 5939 ending to display the waveform. 5940 */ 5941 for (var sampleIndex = start; sampleIndex < end; sampleIndex += sampleStep) { 5942 var value = channelData[sampleIndex]; 5943 5944 if (value > max) { 5945 max = value; 5946 } 5947 if (value < min) { 5948 min = value; 5949 } 5950 } 5951 5952 /* 5953 Set the max and min for the peak. 5954 */ 5955 _peaks[2 * peakNumber] = max; 5956 _peaks[2 * peakNumber + 1] = min; 5957 5958 /* 5959 Merge the peaks 5960 */ 5961 if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) { 5962 mergedPeaks[2 * peakNumber] = max; 5963 } 5964 5965 if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) { 5966 mergedPeaks[2 * peakNumber + 1] = min; 5967 } 5968 } 5969 } 5970 5971 /* 5972 Returns the merged peaks. 5973 */ 5974 return mergedPeaks; 5975 } 5976 5977 /** 5978 * Displays all of the waveforms necessary. 5979 * 5980 * @param {path} svg - The drawing of the waveform. 5981 */ 5982 function displayWaveForms(svg) { 5983 var waveformElements = document.querySelectorAll(".amplitude-wave-form"); 5984 5985 /* 5986 Iterate over all of the waveform elements and 5987 display the waveform. 5988 */ 5989 for (var i = 0; i < waveformElements.length; i++) { 5990 /* 5991 Get the playlist attribute of the waveform element. 5992 */ 5993 var playlist = waveformElements[i].getAttribute("data-amplitude-playlist"); 5994 5995 /* 5996 Get the song index attribute of the waveform element. 5997 */ 5998 var song = waveformElements[i].getAttribute("data-amplitude-song-index"); 5999 6000 /* 6001 If the playlist is null and the song is null it's a global element. 6002 */ 6003 if (playlist == null && song == null) { 6004 displayGlobalWaveform(waveformElements[i], svg); 6005 } 6006 6007 /* 6008 If the playlist is defined but the song is null it's a playlist element. 6009 */ 6010 if (playlist != null && song == null) { 6011 displayPlaylistWaveform(waveformElements[i], svg, playlist); 6012 } 6013 6014 /* 6015 If the playlist is not defined and the song is not null it's a song 6016 element. 6017 */ 6018 if (playlist == null && song != null) { 6019 displaySongWaveform(waveformElements[i], svg, song); 6020 } 6021 6022 /* 6023 If the playlist and song are defined it's a song in the playlist element. 6024 */ 6025 if (playlist != null && song != null) { 6026 displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song); 6027 } 6028 } 6029 } 6030 6031 /** 6032 * Displays a global wave form. 6033 * 6034 * @param {Node} element - Element to display the waveform in. 6035 * @param {SVG} svg - The waveform path. 6036 */ 6037 function displayGlobalWaveform(element, svg) { 6038 var waveformPath = element.querySelector("svg g path"); 6039 6040 waveformPath.setAttribute("d", svg); 6041 } 6042 6043 /** 6044 * Displays a playlist wave form. 6045 * 6046 * @param {Node} element - Element to display the waveform in. 6047 * @param {SVG} svg - The waveform path. 6048 * @param {string} playlist - The playlist we are displaying the waveform for. 6049 */ 6050 function displayPlaylistWaveform(element, svg, playlist) { 6051 /* 6052 Ensure the playlist is the active playlist. 6053 */ 6054 if (_config2.default.active_playlist == playlist) { 6055 var waveformPath = element.querySelector("svg g path"); 6056 6057 waveformPath.setAttribute("d", svg); 6058 } 6059 } 6060 6061 /** 6062 * Displays a song wave form. 6063 * 6064 * @param {Node} element - Element to display the waveform in. 6065 * @param {SVG} svg - The waveform path. 6066 * @param {Integer} song - The index of the song we are displaying the 6067 * waveform for. 6068 */ 6069 function displaySongWaveform(element, svg, song) { 6070 /* 6071 Ensure it's the active song being displayed. 6072 */ 6073 if (_config2.default.active_index == song) { 6074 var waveformPath = element.querySelector("svg g path"); 6075 6076 waveformPath.setAttribute("d", svg); 6077 } 6078 } 6079 6080 /** 6081 * Displays a song in playlist waveform. 6082 * 6083 * @param {Node} element - Element to display the waveform in. 6084 * @param {SVG} svg - The waveform path. 6085 * @param {String} playlist - The playlist the waveform is in. 6086 * @param {Integer} song - The index of the song we are displaying the waveform for. 6087 */ 6088 function displaySongInPlaylistWaveform(element, svg, playlist, song) { 6089 /* 6090 Ensure it's the active song in the active playlist. 6091 */ 6092 if (_config2.default.active_playlist == playlist && _config2.default.playlists[_config2.default.active_playlist].active_index == song) { 6093 var waveformPath = element.querySelector("svg g path"); 6094 6095 waveformPath.setAttribute("d", svg); 6096 } 6097 } 6098 6099 /** 6100 * Determines if the user is using waveforms 6101 */ 6102 function determineIfUsingWaveforms() { 6103 var waveforms = document.querySelectorAll(".amplitude-wave-form"); 6104 6105 if (waveforms.length > 0) { 6106 return true; 6107 } else { 6108 return false; 6109 } 6110 } 6111 6112 /* 6113 Return the public methods. 6114 */ 6115 return { 6116 init: init, 6117 build: build, 6118 determineIfUsingWaveforms: determineIfUsingWaveforms 6119 }; 6120}(); /** 6121 * Imports the config module 6122 * @module config 6123 */ 6124exports.default = WaveForm; 6125module.exports = exports["default"]; 6126 6127/***/ }), 6128/* 23 */ 6129/***/ (function(module, exports, __webpack_require__) { 6130 6131"use strict"; 6132 6133 6134Object.defineProperty(exports, "__esModule", { 6135 value: true 6136}); 6137 6138var _config = __webpack_require__(0); 6139 6140var _config2 = _interopRequireDefault(_config); 6141 6142function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 6143 6144/** 6145 * The utility to handle the computation of time in AmplitudeJS. 6146 * @module utilities/Time 6147 */ 6148var Time = function () { 6149 /** 6150 * Computes the current song time. Breaks down where the song is into 6151 * hours, minutes, seconds and formats it to be displayed to the user. 6152 * 6153 * @access public 6154 */ 6155 function computeCurrentTimes() { 6156 /* 6157 Initialize the current time object that will be returned. 6158 */ 6159 var currentTime = {}; 6160 6161 /* 6162 Computes the current seconds for the song. 6163 */ 6164 var currentSeconds = (Math.floor(_config2.default.audio.currentTime % 60) < 10 ? "0" : "") + Math.floor(_config2.default.audio.currentTime % 60); 6165 6166 /* 6167 Computes the current minutes for the song. 6168 */ 6169 var currentMinutes = Math.floor(_config2.default.audio.currentTime / 60); 6170 6171 /* 6172 Initialize the current hours variable. 6173 */ 6174 var currentHours = "00"; 6175 6176 /* 6177 If the current minutes is less than 10, we add a leading 0. 6178 */ 6179 if (currentMinutes < 10) { 6180 currentMinutes = "0" + currentMinutes; 6181 } 6182 6183 /* 6184 If the user is more than 60 minutes into the song, then 6185 we extract the hours. 6186 */ 6187 if (currentMinutes >= 60) { 6188 currentHours = Math.floor(currentMinutes / 60); 6189 currentMinutes = currentMinutes % 60; 6190 6191 /* 6192 If the user is less than 10 minutes in, we append the 6193 additional 0 to the minutes. 6194 */ 6195 if (currentMinutes < 10) { 6196 currentMinutes = "0" + currentMinutes; 6197 } 6198 } 6199 6200 /* 6201 Build a clean current time object and send back the appropriate information. 6202 */ 6203 currentTime.seconds = currentSeconds; 6204 currentTime.minutes = currentMinutes; 6205 currentTime.hours = currentHours; 6206 6207 return currentTime; 6208 } 6209 6210 /** 6211 * Computes the current song duration. Breaks down where the song is into 6212 * hours, minutes, seconds and formats it to be displayed to the user. 6213 * 6214 * @access public 6215 */ 6216 function computeSongDuration() { 6217 /* 6218 Initialize the song duration object that will be returned. 6219 */ 6220 var songDuration = {}; 6221 6222 /* 6223 Computes the duration of the song's seconds. 6224 */ 6225 var songDurationSeconds = (Math.floor(_config2.default.audio.duration % 60) < 10 ? "0" : "") + Math.floor(_config2.default.audio.duration % 60); 6226 6227 /* 6228 Computes the duration of the song's minutes. 6229 */ 6230 var songDurationMinutes = Math.floor(_config2.default.audio.duration / 60); 6231 6232 /* 6233 Initialize the hours duration variable. 6234 */ 6235 var songDurationHours = "00"; 6236 6237 /* 6238 If the song duration minutes is less than 10, we add a leading 0. 6239 */ 6240 if (songDurationMinutes < 10) { 6241 songDurationMinutes = "0" + songDurationMinutes; 6242 } 6243 6244 /* 6245 If there is more than 60 minutes in the song, then we 6246 extract the hours. 6247 */ 6248 if (songDurationMinutes >= 60) { 6249 songDurationHours = Math.floor(songDurationMinutes / 60); 6250 songDurationMinutes = songDurationMinutes % 60; 6251 6252 /* 6253 If the song duration minutes is less than 10 we append 6254 the additional 0. 6255 */ 6256 if (songDurationMinutes < 10) { 6257 songDurationMinutes = "0" + songDurationMinutes; 6258 } 6259 } 6260 6261 /* 6262 Build a clean song duration object and send back the appropriate information. 6263 */ 6264 songDuration.seconds = isNaN(songDurationSeconds) ? "00" : songDurationSeconds; 6265 songDuration.minutes = isNaN(songDurationMinutes) ? "00" : songDurationMinutes; 6266 songDuration.hours = isNaN(songDurationHours) ? "00" : songDurationHours.toString(); 6267 6268 return songDuration; 6269 } 6270 6271 /** 6272 * Computes the song completion percentage. 6273 * 6274 * @access public 6275 */ 6276 function computeSongCompletionPercentage() { 6277 return _config2.default.audio.currentTime / _config2.default.audio.duration * 100; 6278 } 6279 6280 /** 6281 * Sets the current time for the audio. 6282 * 6283 * @access public 6284 */ 6285 function setCurrentTime(time) { 6286 /* 6287 If the song is not live, we can set the current time. 6288 */ 6289 if (!_config2.default.active_metadata.live) { 6290 /* 6291 Makes sure the number is finite to set the time. 6292 */ 6293 if (isFinite(time)) { 6294 _config2.default.audio.currentTime = time; 6295 } 6296 } 6297 } 6298 6299 /** 6300 * Defines what is returned by the module 6301 */ 6302 return { 6303 computeCurrentTimes: computeCurrentTimes, 6304 computeSongDuration: computeSongDuration, 6305 computeSongCompletionPercentage: computeSongCompletionPercentage, 6306 setCurrentTime: setCurrentTime 6307 }; 6308}(); /** 6309 * Imports the config module 6310 * @module config 6311 */ 6312exports.default = Time; 6313module.exports = exports["default"]; 6314 6315/***/ }), 6316/* 24 */ 6317/***/ (function(module, exports, __webpack_require__) { 6318 6319"use strict"; 6320 6321 6322Object.defineProperty(exports, "__esModule", { 6323 value: true 6324}); 6325 6326var _config = __webpack_require__(0); 6327 6328var _config2 = _interopRequireDefault(_config); 6329 6330function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 6331 6332/** 6333 * AmplitudeJS Visual Handler for Buffered Progress Elements 6334 * 6335 * @module visual/BufferedProgressElements 6336 */ 6337var BufferedProgressElements = function () { 6338 /** 6339 * Syncs the buffered progress bars to the current percentage in the config 6340 * 6341 * @access public 6342 */ 6343 function sync() { 6344 syncGlobal(); 6345 syncPlaylist(); 6346 syncSong(); 6347 syncSongInPlaylist(); 6348 } 6349 6350 /** 6351 * Sync the global song buffered progress elements. 6352 */ 6353 function syncGlobal() { 6354 /* 6355 Gets all of the song buffered progress bars. 6356 */ 6357 var songBufferedProgressBars = document.getElementsByClassName("amplitude-buffered-progress"); 6358 6359 /* 6360 Iterate over all of the song buffered progress bar and 6361 set them to 0 which is like re-setting them. 6362 */ 6363 for (var i = 0; i < songBufferedProgressBars.length; i++) { 6364 var playlist = songBufferedProgressBars[i].getAttribute("data-amplitude-playlist"); 6365 var song = songBufferedProgressBars[i].getAttribute("data-amplitude-song-index"); 6366 6367 if (playlist == null && song == null
vendor: 5,872 bytes, lines 6367-6584
6367) { 6368 songBufferedProgressBars[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100); 6369 } 6370 } 6371 } 6372 6373 /** 6374 * Sync the playlist song buffered progress elements. 6375 */ 6376 function syncPlaylist() { 6377 /* 6378 Gets all of the song buffered progress bars. 6379 */ 6380 var songBufferedProgressBarsPlaylist = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 6381 6382 /* 6383 Iterate over all of the song buffered progress bar and 6384 set them to 0 which is like re-setting them. 6385 */ 6386 for (var i = 0; i < songBufferedProgressBarsPlaylist.length; i++) { 6387 var song = songBufferedProgressBarsPlaylist[i].getAttribute("data-amplitude-song-index"); 6388 6389 if (song == null) { 6390 songBufferedProgressBarsPlaylist[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100); 6391 } 6392 } 6393 } 6394 6395 /** 6396 * Sync the song song buffered progress elements. 6397 */ 6398 function syncSong() { 6399 /* 6400 Gets all of the song buffered progress bars. 6401 */ 6402 var songBufferedProgressBarsSongs = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 6403 6404 /* 6405 Iterate over all of the song buffered progress bar and 6406 set them to 0 which is like re-setting them. 6407 */ 6408 for (var i = 0; i < songBufferedProgressBarsSongs.length; i++) { 6409 var playlist = songBufferedProgressBarsSongs[i].getAttribute("data-amplitude-playlist"); 6410 6411 if (playlist == null) { 6412 songBufferedProgressBarsSongs[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100); 6413 } 6414 } 6415 } 6416 6417 /** 6418 * Sync the song in playlist song buffered progress elements. 6419 */ 6420 function syncSongInPlaylist() { 6421 var activePlaylistIndex = _config2.default.active_playlist != null && _config2.default.active_playlist != "" ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 6422 6423 /* 6424 Gets all of the song buffered progress bars. 6425 */ 6426 var songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 6427 6428 /* 6429 Iterate over all of the song buffered progress bar and 6430 set them to 0 which is like re-setting them. 6431 */ 6432 for (var i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) { 6433 songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100); 6434 } 6435 } 6436 6437 /** 6438 * Sets all of the song buffered progress bars to 0 6439 * 6440 * @access public 6441 */ 6442 function reset() { 6443 /* 6444 Gets all of the song buffered progress bars. 6445 */ 6446 var songBufferedProgressBars = document.getElementsByClassName("amplitude-buffered-progress"); 6447 6448 /* 6449 Iterate over all of the song buffered progress bar and 6450 set them to 0 which is like re-setting them. 6451 */ 6452 for (var i = 0; i < songBufferedProgressBars.length; i++) { 6453 songBufferedProgressBars[i].value = 0; 6454 } 6455 } 6456 6457 /** 6458 * Returns the public facing methods 6459 */ 6460 return { 6461 sync: sync, 6462 reset: reset 6463 }; 6464}(); /** 6465 * Imports the config module 6466 * @module config 6467 */ 6468exports.default = BufferedProgressElements; 6469module.exports = exports["default"]; 6470 6471/***/ }), 6472/* 25 */ 6473/***/ (function(module, exports, __webpack_require__) { 6474 6475"use strict"; 6476 6477 6478Object.defineProperty(exports, "__esModule", { 6479 value: true 6480}); 6481 6482var _config = __webpack_require__(0); 6483 6484var _config2 = _interopRequireDefault(_config); 6485 6486var _audioNavigation = __webpack_require__(3); 6487 6488var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 6489 6490var _callbacks = __webpack_require__(7); 6491 6492var _callbacks2 = _interopRequireDefault(_callbacks); 6493 6494var _core = __webpack_require__(1); 6495 6496var _core2 = _interopRequireDefault(_core); 6497 6498var _playPauseElements = __webpack_require__(2); 6499 6500var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 6501 6502function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 6503 6504/** 6505 * AmplitudeJS Ended Module. Handles the ended event on the audio. 6506 * 6507 * @module events/Ended 6508 */ 6509 6510 6511/** 6512 * Imports the AmplitudeJS Core Methods 6513 * @module core/Core 6514 */ 6515 6516 6517/** 6518 * Imports the Audio Navigation Utility 6519 * @module utilities/AudioNavigation 6520 */ 6521var Ended = function () { 6522 /** 6523 * When the song has ended, handles what to do next 6524 * 6525 * HANDLER FOR: ended 6526 * 6527 * @access public 6528 */ 6529 function handle() { 6530 /* 6531 Sets the time out for song ended. This determines if 6532 we should go to the next song or delay between songs. 6533 */ 6534 setTimeout(function () { 6535 /* 6536 If we continue next, we should move to the next song in the playlist. 6537 */ 6538 if (_config2.default.continue_next) { 6539 /* 6540 If the active playlist is not set, we set the 6541 next song that's in the songs array. 6542 */ 6543 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 6544 _audioNavigation2.default.setNext(true); 6545 } else { 6546 _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist, true); 6547 } 6548 } else { 6549 if (!_config2.default.is_touch_moving) { 6550 /* 6551 Stops the active song. 6552 */ 6553 AmplitudeCore.stop(); 6554 6555 /* 6556 Sync the play pause elements. 6557 */ 6558 _playPauseElements2.default.sync(); 6559 } 6560 } 6561 }, _config2.default.delay); 6562 } 6563 6564 /* 6565 Returns the public facing methods. 6566 */ 6567 return { 6568 handle: handle 6569 }; 6570}(); 6571 6572/** 6573 * Imports the AmplitudeJS Play Pause Elements 6574 * @module visual/PlayPauseElements 6575 */ 6576 6577 6578/** 6579 * Imports the Callback Utility 6580 * @module utilities/callbacks 6581 */ 6582/** 6583 * Imports the config module 6584 * @module config
vendor: 29,060 bytes, lines 6584-7479
6584 6585 */ 6586exports.default = Ended; 6587module.exports = exports["default"]; 6588 6589/***/ }), 6590/* 26 */ 6591/***/ (function(module, exports, __webpack_require__) { 6592 6593"use strict"; 6594 6595 6596Object.defineProperty(exports, "__esModule", { 6597 value: true 6598}); 6599 6600var _config = __webpack_require__(0); 6601 6602var _config2 = _interopRequireDefault(_config); 6603 6604var _keydown = __webpack_require__(27); 6605 6606var _keydown2 = _interopRequireDefault(_keydown); 6607 6608var _timeUpdate = __webpack_require__(42); 6609 6610var _timeUpdate2 = _interopRequireDefault(_timeUpdate); 6611 6612var _ended = __webpack_require__(25); 6613 6614var _ended2 = _interopRequireDefault(_ended); 6615 6616var _progress = __webpack_require__(35); 6617 6618var _progress2 = _interopRequireDefault(_progress); 6619 6620var _play = __webpack_require__(31); 6621 6622var _play2 = _interopRequireDefault(_play); 6623 6624var _pause = __webpack_require__(30); 6625 6626var _pause2 = _interopRequireDefault(_pause); 6627 6628var _playPause = __webpack_require__(32); 6629 6630var _playPause2 = _interopRequireDefault(_playPause); 6631 6632var _stop = __webpack_require__(41); 6633 6634var _stop2 = _interopRequireDefault(_stop); 6635 6636var _mute = __webpack_require__(28); 6637 6638var _mute2 = _interopRequireDefault(_mute); 6639 6640var _volumeUp = __webpack_require__(45); 6641 6642var _volumeUp2 = _interopRequireDefault(_volumeUp); 6643 6644var _volumeDown = __webpack_require__(43); 6645 6646var _volumeDown2 = _interopRequireDefault(_volumeDown); 6647 6648var _songSlider = __webpack_require__(40); 6649 6650var _songSlider2 = _interopRequireDefault(_songSlider); 6651 6652var _volumeSlider = __webpack_require__(44); 6653 6654var _volumeSlider2 = _interopRequireDefault(_volumeSlider); 6655 6656var _next = __webpack_require__(29); 6657 6658var _next2 = _interopRequireDefault(_next); 6659 6660var _prev = __webpack_require__(34); 6661 6662var _prev2 = _interopRequireDefault(_prev); 6663 6664var _repeat = __webpack_require__(36); 6665 6666var _repeat2 = _interopRequireDefault(_repeat); 6667 6668var _repeatSong = __webpack_require__(37); 6669 6670var _repeatSong2 = _interopRequireDefault(_repeatSong); 6671 6672var _playbackSpeed = __webpack_require__(33); 6673 6674var _playbackSpeed2 = _interopRequireDefault(_playbackSpeed); 6675 6676var _shuffle = __webpack_require__(38); 6677 6678var _shuffle2 = _interopRequireDefault(_shuffle); 6679 6680var _skipTo = __webpack_require__(39); 6681 6682var _skipTo2 = _interopRequireDefault(_skipTo); 6683 6684var _waveform = __webpack_require__(22); 6685 6686var _waveform2 = _interopRequireDefault(_waveform); 6687 6688var _debug = __webpack_require__(4); 6689 6690var _debug2 = _interopRequireDefault(_debug); 6691 6692function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 6693 6694/** 6695 * AmplitudeJS Events Module. Handles all of the events we listen to in 6696 * AmplitudeJS. 6697 * 6698 * @module events/Events 6699 */ 6700 6701 6702/** 6703 * Imports all of the handler objects used by the events. 6704 */ 6705var Events = function () { 6706 /** 6707 * Initializes the handlers for the events listened to by Amplitude 6708 * 6709 * @access public 6710 */ 6711 function initialize() { 6712 /* 6713 Write out debug message 6714 */ 6715 _debug2.default.writeMessage("Beginning initialization of event handlers.."); 6716 6717 /* 6718 Sets flag that the screen is moving and not a tap 6719 */ 6720 document.addEventListener("touchmove", function () { 6721 _config2.default.is_touch_moving = true; 6722 }); 6723 6724 /* 6725 On touch end if it was a touch move event, set moving to 6726 false 6727 */ 6728 document.addEventListener("touchend", function () { 6729 if (_config2.default.is_touch_moving) { 6730 _config2.default.is_touch_moving = false; 6731 } 6732 }); 6733 6734 /* 6735 On time update for the audio element, update visual displays that 6736 represent the time on either a visualized element or time display. 6737 */ 6738 bindTimeUpdate(); 6739 6740 /* 6741 Binds key down event handlers for matching key codes to functions. 6742 */ 6743 bindKeyDownEventHandlers(); 6744 6745 /* 6746 When the audio element has ended playing, we handle the song 6747 ending. In a single song or multiple modular song instance, 6748 this just synchronizes the visuals for time and song time 6749 visualization, but for a playlist it determines whether 6750 it should play the next song or not. 6751 */ 6752 bindSongEnded(); 6753 6754 /* 6755 Binds progress event so we can see how much of the song is loaded. 6756 */ 6757 bindProgress(); 6758 6759 /* 6760 Binds 'amplitude-play' event handlers 6761 */ 6762 bindPlay(); 6763 6764 /* 6765 Binds 'amplitude-pause' event handlers. 6766 */ 6767 bindPause(); 6768 6769 /* 6770 Binds 'amplitude-play-pause' event handlers. 6771 */ 6772 bindPlayPause(); 6773 6774 /* 6775 Binds 'amplitude-stop' event handlers. 6776 */ 6777 bindStop(); 6778 6779 /* 6780 Binds 'amplitude-mute' event handlers. 6781 */ 6782 bindMute(); 6783 6784 /* 6785 Binds 'amplitude-volume-up' event handlers 6786 */ 6787 bindVolumeUp(); 6788 6789 /* 6790 Binds 'amplitude-volume-down' event handlers 6791 */ 6792 bindVolumeDown(); 6793 6794 /* 6795 Binds 'amplitude-song-slider' event handlers 6796 */ 6797 bindSongSlider(); 6798 6799 /* 6800 Binds 'amplitude-volume-slider' event handlers. 6801 */ 6802 bindVolumeSlider(); 6803 6804 /* 6805 Binds 'amplitude-next' event handlers. 6806 */ 6807 bindNext(); 6808 6809 /* 6810 Binds 'amplitude-prev' event handlers. 6811 */ 6812 bindPrev(); 6813 6814 /* 6815 Binds 'amplitude-shuffle' event handlers. 6816 */ 6817 bindShuffle(); 6818 6819 /* 6820 Binds 'amplitude-repeat' event handlers. 6821 */ 6822 bindRepeat(); 6823 6824 /* 6825 Binds 'amplitude-repeat-song' event handlers. 6826 */ 6827 bindRepeatSong(); 6828 6829 /* 6830 Binds 'amplitude-playback-speed' event handlers. 6831 */ 6832 bindPlaybackSpeed(); 6833 6834 /* 6835 Binds 'amplitude-skip-to' event handlers. 6836 */ 6837 bindSkipTo(); 6838 6839 /* 6840 Binds `canplaythrough` event to build the waveform. 6841 */ 6842 bindCanPlayThrough(); 6843 } 6844 6845 /** 6846 * On time update for the audio element, update visual displays that 6847 * represent the time on either a visualized element or time display. 6848 * 6849 * @access private 6850 */ 6851 function bindTimeUpdate() { 6852 /* 6853 Bind for time update 6854 */ 6855 _config2.default.audio.removeEventListener("timeupdate", _timeUpdate2.default.handle); 6856 _config2.default.audio.addEventListener("timeupdate", _timeUpdate2.default.handle); 6857 6858 /* 6859 Bind for duration change 6860 */ 6861 _config2.default.audio.removeEventListener("durationchange", _timeUpdate2.default.handle); 6862 _config2.default.audio.addEventListener("durationchange", _timeUpdate2.default.handle); 6863 } 6864 6865 /** 6866 * On keydown, we listen to what key got pressed so we can map the key to 6867 * a function. This allows the user to map pause and play, next, etc. to key 6868 * presses. 6869 * 6870 * @access private 6871 */ 6872 function bindKeyDownEventHandlers() { 6873 document.removeEventListener("keydown", _keydown2.default.handle); 6874 document.addEventListener("keydown", _keydown2.default.handle); 6875 } 6876 6877 /** 6878 * When the audio element has ended playing, we handle the song 6879 * ending. In a single song or multiple modular song instance, 6880 * this just synchronizes the visuals for time and song time 6881 * visualization, but for a playlist it determines whether 6882 * it should play the next song or not. 6883 * 6884 * @access private 6885 */ 6886 function bindSongEnded() { 6887 _config2.default.audio.removeEventListener("ended", _ended2.default.handle); 6888 _config2.default.audio.addEventListener("ended", _ended2.default.handle); 6889 } 6890 6891 /** 6892 * As the audio is loaded, the progress event gets fired. We bind into this 6893 * to grab the buffered percentage of the song. We can then add more elements 6894 * to show the buffered amount. 6895 * 6896 * @access private 6897 */ 6898 function bindProgress() { 6899 _config2.default.audio.removeEventListener("progress", _progress2.default.handle); 6900 _config2.default.audio.addEventListener("progress", _progress2.default.handle); 6901 } 6902 6903 /** 6904 * Binds click and touchend events for AmplitudeJS play buttons 6905 * 6906 * @access private 6907 */ 6908 function bindPlay() { 6909 /* 6910 Gets all of the elements with the class amplitude-play 6911 */ 6912 var play_classes = document.getElementsByClassName("amplitude-play"); 6913 6914 /* 6915 Iterates over all of the play classes and binds the event interaction 6916 method to the element. If the browser is mobile, then the event is touchend 6917 otherwise it is click. 6918 */ 6919 for (var i = 0; i < play_classes.length; i++) { 6920 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 6921 play_classes[i].removeEventListener("touchend", _play2.default.handle); 6922 play_classes[i].addEventListener("touchend", _play2.default.handle); 6923 } else { 6924 play_classes[i].removeEventListener("click", _play2.default.handle); 6925 play_classes[i].addEventListener("click", _play2.default.handle); 6926 } 6927 } 6928 } 6929 6930 /** 6931 * Binds click and touchend events for AmplitudeJS pause buttons. 6932 * 6933 * @access private 6934 */ 6935 function bindPause() { 6936 /* 6937 Gets all of the elements with the class amplitude-pause 6938 */ 6939 var pause_classes = document.getElementsByClassName("amplitude-pause"); 6940 6941 /* 6942 Iterates over all of the pause classes and binds the event interaction 6943 method to the element. If the browser is mobile, then the event is touchend 6944 otherwise it is click. 6945 */ 6946 for (var i = 0; i < pause_classes.length; i++) { 6947 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 6948 pause_classes[i].removeEventListener("touchend", _pause2.default.handle); 6949 pause_classes[i].addEventListener("touchend", _pause2.default.handle); 6950 } else { 6951 pause_classes[i].removeEventListener("click", _pause2.default.handle); 6952 pause_classes[i].addEventListener("click", _pause2.default.handle); 6953 } 6954 } 6955 } 6956 6957 /** 6958 * Binds click and touchend events for AmplitudeJS play pause buttons 6959 * 6960 * @access private 6961 */ 6962 function bindPlayPause() { 6963 /* 6964 Gets all of the elements with the class amplitude-play-pause 6965 */ 6966 var play_pause_classes = document.getElementsByClassName("amplitude-play-pause"); 6967 6968 /* 6969 Iterates over all of the play/pause classes and binds the event interaction 6970 method to the element. If the browser is mobile, then the event is touchend 6971 otherwise it is click. 6972 */ 6973 for (var i = 0; i < play_pause_classes.length; i++) { 6974 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 6975 play_pause_classes[i].removeEventListener("touchend", _playPause2.default.handle); 6976 play_pause_classes[i].addEventListener("touchend", _playPause2.default.handle); 6977 } else { 6978 play_pause_classes[i].removeEventListener("click", _playPause2.default.handle); 6979 play_pause_classes[i].addEventListener("click", _playPause2.default.handle); 6980 } 6981 } 6982 } 6983 6984 /** 6985 * Binds click and touchend events for AmplitudeJS stop buttons 6986 * 6987 * @access private 6988 */ 6989 function bindStop() { 6990 /* 6991 Gets all of the elements with the class amplitude-stop 6992 */ 6993 var stop_classes = document.getElementsByClassName("amplitude-stop"); 6994 6995 /* 6996 Iterates over all of the stop classes and binds the event interaction 6997 method to the element. If the browser is mobile, then the event is touchend 6998 otherwise it is click. 6999 */ 7000 for (var i = 0; i < stop_classes.length; i++) { 7001 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7002 stop_classes[i].removeEventListener("touchend", _stop2.default.handle); 7003 stop_classes[i].addEventListener("touchend", _stop2.default.handle); 7004 } else { 7005 stop_classes[i].removeEventListener("click", _stop2.default.handle); 7006 stop_classes[i].addEventListener("click", _stop2.default.handle); 7007 } 7008 } 7009 } 7010 7011 /** 7012 * Binds click and touchend events for AmplitudeJS mute buttons 7013 * 7014 * @access private 7015 */ 7016 function bindMute() { 7017 /* 7018 Gets all of the elements with the class amplitue-mute 7019 */ 7020 var mute_classes = document.getElementsByClassName("amplitude-mute"); 7021 7022 /* 7023 Iterates over all of the mute classes and binds the event interaction 7024 method to the element. If the browser is mobile, then the event is touchend 7025 otherwise it is click. 7026 */ 7027 for (var i = 0; i < mute_classes.length; i++) { 7028 /* 7029 WARNING: If iOS, we don't do anything because iOS does not allow the 7030 volume to be adjusted through anything except the buttons on the side of 7031 the device. 7032 */ 7033 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7034 /* 7035 Checks for an iOS device and displays an error message if debugging 7036 is turned on. 7037 */ 7038 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 7039 _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4"); 7040 } else { 7041 mute_classes[i].removeEventListener("touchend", _mute2.default.handle); 7042 mute_classes[i].addEventListener("touchend", _mute2.default.handle); 7043 } 7044 } else { 7045 mute_classes[i].removeEventListener("click", _mute2.default.handle); 7046 mute_classes[i].addEventListener("click", _mute2.default.handle); 7047 } 7048 } 7049 } 7050 7051 /** 7052 * Binds click and touchend events for AmplitudeJS Volume Up Buttons 7053 * 7054 * @access private 7055 */ 7056 function bindVolumeUp() { 7057 /* 7058 Gets all of the elements with the class amplitude-volume-up 7059 */ 7060 var volume_up_classes = document.getElementsByClassName("amplitude-volume-up"); 7061 7062 /* 7063 Iterates over all of the volume up classes and binds the event interaction 7064 methods to the element. If the browser is mobile, then the event is touchend 7065 otherwise it is click. 7066 */ 7067 for (var i = 0; i < volume_up_classes.length; i++) { 7068 /* 7069 WARNING: If iOS, we don't do anything because iOS does not allow the 7070 volume to be adjusted through anything except the buttons on the side of 7071 the device. 7072 */ 7073 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7074 /* 7075 Checks for an iOS device and displays an error message if debugging 7076 is turned on. 7077 */ 7078 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 7079 _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4"); 7080 } else { 7081 volume_up_classes[i].removeEventListener("touchend", _volumeUp2.default.handle); 7082 volume_up_classes[i].addEventListener("touchend", _volumeUp2.default.handle); 7083 } 7084 } else { 7085 volume_up_classes[i].removeEventListener("click", _volumeUp2.default.handle); 7086 volume_up_classes[i].addEventListener("click", _volumeUp2.default.handle); 7087 } 7088 } 7089 } 7090 7091 /** 7092 * Binds click and touchend events for AmplitudeJS Volume Down Buttons 7093 * 7094 * @access private 7095 */ 7096 function bindVolumeDown() { 7097 /* 7098 Gets all of the elements with the class amplitude-volume-down 7099 */ 7100 var volume_down_classes = document.getElementsByClassName("amplitude-volume-down"); 7101 7102 /* 7103 Iterates over all of the volume down classes and binds the event interaction 7104 methods to the element. If the browser is mobile, then the event is touchend 7105 otherwise it is click. 7106 */ 7107 for (var i = 0; i < volume_down_classes.length; i++) { 7108 /* 7109 WARNING: If iOS, we don't do anything because iOS does not allow the 7110 volume to be adjusted through anything except the buttons on the side of 7111 the device. 7112 */ 7113 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7114 /* 7115 Checks for an iOS device and displays an error message if debugging 7116 is turned on. 7117 */ 7118 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 7119 _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4"); 7120 } else { 7121 volume_down_classes[i].removeEventListener("touchend", _volumeDown2.default.handle); 7122 volume_down_classes[i].addEventListener("touchend", _volumeDown2.default.handle); 7123 } 7124 } else { 7125 volume_down_classes[i].removeEventListener("click", _volumeDown2.default.handle); 7126 volume_down_classes[i].addEventListener("click", _volumeDown2.default.handle); 7127 } 7128 } 7129 } 7130 7131 /** 7132 * Binds change and input events for AmplitudeJS Song Slider Inputs 7133 * 7134 * @access private 7135 */ 7136 function bindSongSlider() { 7137 /* 7138 Gets browser so if we need to apply overrides, like we usually 7139 have to do for anything cool in IE, we can do that. 7140 */ 7141 var ua = window.navigator.userAgent; 7142 var msie = ua.indexOf("MSIE "); 7143 7144 /* 7145 Gets all of the elements with the class amplitude-song-slider 7146 */ 7147 var song_sliders = document.getElementsByClassName("amplitude-song-slider"); 7148 7149 /* 7150 Iterates over all of the song slider classes and binds the event interaction 7151 methods to the element. If the browser is IE we listen to the change event 7152 where if it is anything else, it's the input method. 7153 */ 7154 for (var i = 0; i < song_sliders.length; i++) { 7155 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 7156 song_sliders[i].removeEventListener("change", _songSlider2.default.handle); 7157 song_sliders[i].addEventListener("change", _songSlider2.default.handle); 7158 } else { 7159 song_sliders[i].removeEventListener("input", _songSlider2.default.handle); 7160 song_sliders[i].addEventListener("input", _songSlider2.default.handle); 7161 } 7162 } 7163 } 7164 7165 /** 7166 * Binds change and input events fro AmplitudeJS Volume Slider inputs 7167 * 7168 * @access private 7169 */ 7170 function bindVolumeSlider() { 7171 /* 7172 Gets browser so if we need to apply overrides, like we usually 7173 have to do for anything cool in IE, we can do that. 7174 */ 7175 var ua = window.navigator.userAgent; 7176 var msie = ua.indexOf("MSIE "); 7177 7178 /* 7179 Gets all of the elements with the class amplitude-volume-slider 7180 */ 7181 var volume_sliders = document.getElementsByClassName("amplitude-volume-slider"); 7182 7183 /* 7184 Iterates over all of the volume slider classes and binds the event interaction 7185 methods to the element. If the browser is IE we listen to the change event 7186 where if it is anything else, it's the input method. 7187 */ 7188 for (var i = 0; i < volume_sliders.length; i++) { 7189 /* 7190 WARNING: If iOS, we don't do anything because iOS does not allow the 7191 volume to be adjusted through anything except the buttons on the side of 7192 the device. 7193 */ 7194 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 7195 _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4"); 7196 } else { 7197 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 7198 volume_sliders[i].removeEventListener("change", _volumeSlider2.default.handle); 7199 volume_sliders[i].addEventListener("change", _volumeSlider2.default.handle); 7200 } else { 7201 volume_sliders[i].removeEventListener("input", _volumeSlider2.default.handle); 7202 volume_sliders[i].addEventListener("input", _volumeSlider2.default.handle); 7203 } 7204 } 7205 } 7206 } 7207 7208 /** 7209 * Binds click and touchend events fro AmplitudeJS Next buttons 7210 * 7211 * @access private 7212 */ 7213 function bindNext() { 7214 /* 7215 Gets all of the elements with the class amplitude-next 7216 */ 7217 var next_classes = document.getElementsByClassName("amplitude-next"); 7218 7219 /* 7220 Iterates over all of the next classes and binds the event interaction 7221 methods to the element. If the browser is mobile, then the event is touchend 7222 otherwise it is click. 7223 */ 7224 for (var i = 0; i < next_classes.length; i++) { 7225 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7226 next_classes[i].removeEventListener("touchend", _next2.default.handle); 7227 next_classes[i].addEventListener("touchend", _next2.default.handle); 7228 } else { 7229 next_classes[i].removeEventListener("click", _next2.default.handle); 7230 next_classes[i].addEventListener("click", _next2.default.handle); 7231 } 7232 } 7233 } 7234 7235 /** 7236 * Binds click and touchend events for AmplitudeJS prev buttons. 7237 * 7238 * @access private 7239 */ 7240 function bindPrev() { 7241 /* 7242 Gets all of the elements with the class amplitude-prev 7243 */ 7244 var prev_classes = document.getElementsByClassName("amplitude-prev"); 7245 7246 /* 7247 Iterates over all of the prev classes and binds the event interaction 7248 methods to the element. If the browser is mobile, then the event is touchend 7249 otherwise it is click. 7250 */ 7251 for (var i = 0; i < prev_classes.length; i++) { 7252 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7253 prev_classes[i].removeEventListener("touchend", _prev2.default.handle); 7254 prev_classes[i].addEventListener("touchend", _prev2.default.handle); 7255 } else { 7256 prev_classes[i].removeEventListener("click", _prev2.default.handle); 7257 prev_classes[i].addEventListener("click", _prev2.default.handle); 7258 } 7259 } 7260 } 7261 7262 /** 7263 * Binds click and touchend events for AmplitudeJS shuffle buttons. 7264 * 7265 * @access private 7266 */ 7267 function bindShuffle() { 7268 /* 7269 Gets all of the elements with the class amplitude-shuffle 7270 */ 7271 var shuffle_classes = document.getElementsByClassName("amplitude-shuffle"); 7272 7273 /* 7274 Iterates over all of the shuffle classes and binds the event interaction 7275 methods to the element. If the browser is mobile, then the event is touchend 7276 otherwise it is click. 7277 */ 7278 for (var i = 0; i < shuffle_classes.length; i++) { 7279 /* 7280 Since we are re-binding everything we remove any classes that signify 7281 a state of the shuffle control. 7282 */ 7283 shuffle_classes[i].classList.remove("amplitude-shuffle-on"); 7284 shuffle_classes[i].classList.add("amplitude-shuffle-off"); 7285 7286 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7287 shuffle_classes[i].removeEventListener("touchend", _shuffle2.default.handle); 7288 shuffle_classes[i].addEventListener("touchend", _shuffle2.default.handle); 7289 } else { 7290 shuffle_classes[i].removeEventListener("click", _shuffle2.default.handle); 7291 shuffle_classes[i].addEventListener("click", _shuffle2.default.handle); 7292 } 7293 } 7294 } 7295 7296 /** 7297 * Binds click and touchend events for AmplitudeJS repeat buttons. 7298 * 7299 * @access private 7300 */ 7301 function bindRepeat() { 7302 /* 7303 Gets all of the elements with the class amplitude-repeat 7304 */ 7305 var repeat_classes = document.getElementsByClassName("amplitude-repeat"); 7306 7307 /* 7308 Iterates over all of the repeat classes and binds the event interaction 7309 methods to the element. If the browser is mobile, then the event is touchend 7310 otherwise it is click. 7311 */ 7312 for (var i = 0; i < repeat_classes.length; i++) { 7313 /* 7314 Since we are re-binding everything we remove any classes that signify 7315 a state of the repeat control. 7316 */ 7317 repeat_classes[i].classList.remove("amplitude-repeat-on"); 7318 repeat_classes[i].classList.add("amplitude-repeat-off"); 7319 7320 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7321 repeat_classes[i].removeEventListener("touchend", _repeat2.default.handle); 7322 repeat_classes[i].addEventListener("touchend", _repeat2.default.handle); 7323 } else { 7324 repeat_classes[i].removeEventListener("click", _repeat2.default.handle); 7325 repeat_classes[i].addEventListener("click", _repeat2.default.handle); 7326 } 7327 } 7328 } 7329 7330 /** 7331 * Binds click and touchend events for AmplitudeJS repeat song buttons. 7332 * 7333 * @access private 7334 */ 7335 function bindRepeatSong() { 7336 /* 7337 Gets all of the elements with the class amplitude-repeat-song 7338 */ 7339 var repeat_song_classes = document.getElementsByClassName("amplitude-repeat-song"); 7340 7341 /* 7342 Iterates over all of the repeat song classes and binds the event interaction 7343 methods to the element. If the browser is mobile, then the event is touchend 7344 otherwise it is click. 7345 */ 7346 for (var i = 0; i < repeat_song_classes.length; i++) { 7347 /* 7348 Since we are re-binding everything we remove any classes that signify 7349 a state of the repeat control. 7350 */ 7351 repeat_song_classes[i].classList.remove("amplitude-repeat-on"); 7352 repeat_song_classes[i].classList.add("amplitude-repeat-off"); 7353 7354 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7355 repeat_song_classes[i].removeEventListener("touchend", _repeatSong2.default.handle); 7356 repeat_song_classes[i].addEventListener("touchend", _repeatSong2.default.handle); 7357 } else { 7358 repeat_song_classes[i].removeEventListener("click", _repeatSong2.default.handle); 7359 repeat_song_classes[i].addEventListener("click", _repeatSong2.default.handle); 7360 } 7361 } 7362 } 7363 7364 /** 7365 * Binds click and touchend events for AmplitudeJS playback speed buttons 7366 * 7367 * @access private 7368 */ 7369 function bindPlaybackSpeed() { 7370 /* 7371 Gets all of the elements with the class amplitude-playback-speed 7372 */ 7373 var playback_speed_classes = document.getElementsByClassName("amplitude-playback-speed"); 7374 7375 /* 7376 Iterates over all of the playback speed classes and binds the event interaction 7377 methods to the element. If the browser is mobile, then the event is touchend 7378 otherwise it is click. 7379 */ 7380 for (var i = 0; i < playback_speed_classes.length; i++) { 7381 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7382 playback_speed_classes[i].removeEventListener("touchend", _playbackSpeed2.default.handle); 7383 playback_speed_classes[i].addEventListener("touchend", _playbackSpeed2.default.handle); 7384 } else { 7385 playback_speed_classes[i].removeEventListener("click", _playbackSpeed2.default.handle); 7386 playback_speed_classes[i].addEventListener("click", _playbackSpeed2.default.handle); 7387 } 7388 } 7389 } 7390 7391 /** 7392 * Binds click and touchend events for AmplitudeJS skip to buttons. 7393 * 7394 * @access private 7395 */ 7396 function bindSkipTo() { 7397 /* 7398 Gets all of the skip to elements with the class 'amplitude-skip-to' 7399 */ 7400 var skipToClasses = document.getElementsByClassName("amplitude-skip-to"); 7401 7402 /* 7403 Iterates over all of the skip to classes and binds the event interaction 7404 methods to the element. If the browser is mobile, then the event is touchend 7405 otherwise it's a click. 7406 */ 7407 for (var i = 0; i < skipToClasses.length; i++) { 7408 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7409 skipToClasses[i].removeEventListener("touchend", _skipTo2.default.handle); 7410 skipToClasses[i].addEventListener("touchend", _skipTo2.default.handle); 7411 } else { 7412 skipToClasses[i].removeEventListener("click", _skipTo2.default.handle); 7413 skipToClasses[i].addEventListener("click", _skipTo2.default.handle); 7414 } 7415 } 7416 } 7417 7418 /** 7419 * Binds can play through to a song. 7420 * 7421 * @access private 7422 */ 7423 function bindCanPlayThrough() { 7424 if (_waveform2.default.determineIfUsingWaveforms()) { 7425 _config2.default.audio.removeEventListener("canplaythrough", _waveform2.default.build); 7426 _config2.default.audio.addEventListener("canplaythrough", _waveform2.default.build); 7427 } 7428 } 7429 7430 /* 7431 Returns the public facing functions. 7432 */ 7433 return { 7434 initialize: initialize 7435 }; 7436}(); 7437 7438/** 7439 * Imports the utility classes used by the evnets. 7440 */ 7441/* 7442 Import the necessary classes and config to use 7443 with the events. 7444*/ 7445exports.default = Events; 7446module.exports = exports["default"]; 7447 7448/***/ }), 7449/* 27 */ 7450/***/ (function(module, exports, __webpack_require__) { 7451 7452"use strict"; 7453 7454 7455Object.defineProperty(exports, "__esModule", { 7456 value: true 7457}); 7458 7459var _config = __webpack_require__(0); 7460 7461var _config2 = _interopRequireDefault(_config); 7462 7463var _core = __webpack_require__(1); 7464 7465var _core2 = _interopRequireDefault(_core); 7466 7467var _shuffler = __webpack_require__(13); 7468 7469var _shuffler2 = _interopRequireDefault(_shuffler); 7470 7471var _repeater = __webpack_require__(12); 7472 7473var _repeater2 = _interopRequireDefault(_repeater); 7474 7475var _audioNavigation = __webpack_require__(3); 7476 7477var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 7478 7479var _repeatElements = __webpack_require__(
vendor: 44,086 bytes, lines 7479-9289
74799); 7480 7481var _repeatElements2 = _interopRequireDefault(_repeatElements); 7482 7483var _playPauseElements = __webpack_require__(2); 7484 7485var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 7486 7487function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 7488 7489/** 7490 * AmplitudeJS Key Down event handler 7491 * 7492 * @module events/KeyDown 7493 */ 7494 7495 7496/** 7497 * Imports the Repeat Elements Visual Handler 7498 * @module visual/RepeatElements 7499 */ 7500 7501 7502/** 7503 * Imports the Repeater Utility 7504 * @module utilities/Repeater 7505 */ 7506 7507 7508/** 7509 * Imports the core of AmplitudeJS 7510 * @module core/Core 7511 */ 7512var KeyDown = function () { 7513 /** 7514 * When the keydown event is fired, we determine which function should be run 7515 * based on what was passed in. 7516 * 7517 * HANDLER FOR: keydown 7518 * 7519 * @access public 7520 * @prop {object} event The event object being passed in. 7521 */ 7522 function handle(event) { 7523 runKeyEvent(event.which); 7524 } 7525 7526 /** 7527 * Runs an event on key down 7528 * 7529 * @access public 7530 * @param {number} key - The key code the event is bound to. 7531 */ 7532 function runKeyEvent(key) { 7533 /* 7534 Checks to see if the user bound an event to the code pressed. 7535 */ 7536 if (_config2.default.bindings[key] != undefined) { 7537 /* 7538 Determine which event should be run if bound. 7539 */ 7540 switch (_config2.default.bindings[key]) { 7541 /* 7542 Fires a play pause event. 7543 */ 7544 case "play_pause": 7545 runPlayPauseKeyDownEvent(); 7546 break; 7547 7548 /* 7549 Fires a next event. 7550 */ 7551 case "next": 7552 runNextKeyDownEvent(); 7553 break; 7554 7555 /* 7556 Fires a previous event. 7557 */ 7558 case "prev": 7559 runPrevKeyDownEvent(); 7560 break; 7561 7562 /* 7563 Fires a stop event. 7564 */ 7565 case "stop": 7566 runStopKeyDownEvent(); 7567 break; 7568 7569 /* 7570 Fires a shuffle event. 7571 */ 7572 case "shuffle": 7573 runShuffleKeyDownEvent(); 7574 break; 7575 7576 /* 7577 Fires a repeat event. 7578 */ 7579 case "repeat": 7580 runRepeatKeyDownEvent(); 7581 break; 7582 } 7583 } 7584 } 7585 7586 /** 7587 * Runs the play pause method for key down. 7588 */ 7589 function runPlayPauseKeyDownEvent() { 7590 /* 7591 If the song is paused, we play the song. If the song is playing, 7592 we pause the song. 7593 */ 7594 if (_config2.default.audio.paused) { 7595 _core2.default.play(); 7596 } else { 7597 _core2.default.pause(); 7598 } 7599 7600 /* 7601 Now we sync all the elements to match the state of the audio. 7602 We don't need to do any checks on new songs or changed playlists 7603 in the global since it's whatever song is playing. 7604 */ 7605 _playPauseElements2.default.sync(); 7606 } 7607 7608 /** 7609 * Runs the next method for key down. 7610 */ 7611 function runNextKeyDownEvent() { 7612 /* 7613 Check to see if the current state of the player 7614 is in playlist mode or not playlist mode. 7615 */ 7616 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 7617 _audioNavigation2.default.setNext(); 7618 } else { 7619 _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist); 7620 } 7621 } 7622 7623 /** 7624 * Runs the previous method for key down. 7625 */ 7626 function runPrevKeyDownEvent() { 7627 /* 7628 Check to see if the current playlist has been set 7629 or null and set the previous song. 7630 */ 7631 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 7632 _audioNavigation2.default.setPrevious(); 7633 } else { 7634 _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist); 7635 } 7636 } 7637 7638 /** 7639 * Runs the stop method for key down. 7640 */ 7641 function runStopKeyDownEvent() { 7642 /* 7643 Syncs all of the play pause elements to pause. 7644 */ 7645 _playPauseElements2.default.syncToPause(); 7646 7647 /* 7648 Stops the active song. 7649 */ 7650 _core2.default.stop(); 7651 } 7652 7653 /** 7654 * Runs the shuffle method for key down. 7655 */ 7656 function runShuffleKeyDownEvent() { 7657 /* 7658 Check to see if the current playlist has been set 7659 or null and set the previous song. 7660 */ 7661 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 7662 _shuffler2.default.toggleShuffle(); 7663 } else { 7664 _shuffler2.default.toggleShufflePlaylist(_config2.default.active_playlist); 7665 } 7666 } 7667 7668 /** 7669 * Run the repeat method for key down. 7670 */ 7671 function runRepeatKeyDownEvent() { 7672 /* 7673 Toggles the repeat 7674 */ 7675 _repeater2.default.setRepeat(!_config2.default.repeat); 7676 7677 /* 7678 Visually sync repeat 7679 */ 7680 _repeatElements2.default.syncRepeat(); 7681 } 7682 7683 /** 7684 * Returns the public methods for the handler. 7685 */ 7686 return { 7687 handle: handle 7688 }; 7689}(); 7690 7691/** 7692 * Imports the Play Pause Elements Visual Handler 7693 * @module visual/PlayPauseElements 7694 */ 7695 7696 7697/** 7698 * Imports the Audio Navigation Utility 7699 * @module utilities/AudioNavigation 7700 */ 7701 7702 7703/** 7704 * Imports the Shuffle Utility 7705 * @module utilities/Shuffle 7706 */ 7707/** 7708 * Imports the config module 7709 * @module config 7710 */ 7711exports.default = KeyDown; 7712module.exports = exports["default"]; 7713 7714/***/ }), 7715/* 28 */ 7716/***/ (function(module, exports, __webpack_require__) { 7717 7718"use strict"; 7719 7720 7721Object.defineProperty(exports, "__esModule", { 7722 value: true 7723}); 7724 7725var _config = __webpack_require__(0); 7726 7727var _config2 = _interopRequireDefault(_config); 7728 7729var _core = __webpack_require__(1); 7730 7731var _core2 = _interopRequireDefault(_core); 7732 7733var _muteElements = __webpack_require__(10); 7734 7735var _muteElements2 = _interopRequireDefault(_muteElements); 7736 7737var _volumeSliderElements = __webpack_require__(11); 7738 7739var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements); 7740 7741function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 7742 7743/** 7744 * Handles all events for a mute event. 7745 * @module events/Mute 7746 */ 7747 7748 7749/** 7750 * Imports the AmplitudeJS Visual Mute Elements 7751 * @module visual/MuteElements 7752 */ 7753/** 7754 * Imports the config to use the values 7755 */ 7756var Mute = function () { 7757 /** 7758 * Handles an event for a mute element 7759 * 7760 * HANDLER FOR: class="amplitude-mute" 7761 * 7762 * @access public 7763 */ 7764 function handle() { 7765 /* 7766 We don't fire this if the user is touching the screen and it's moving. 7767 This could lead to a mis-fire 7768 */ 7769 if (!_config2.default.is_touch_moving) { 7770 /* 7771 If the current volume in the config is 0, we set the volume to the 7772 pre_mute level. This means that the audio is already muted and 7773 needs to be restored to the pre_mute level. 7774 Otherwise, we set pre_mute volume to the current volume 7775 and set the config volume to 0, muting the audio. 7776 */ 7777 if (_config2.default.volume == 0) { 7778 _core2.default.setVolume(_config2.default.pre_mute_volume); 7779 } else { 7780 _config2.default.pre_mute_volume = _config2.default.volume; 7781 _core2.default.setVolume(0); 7782 } 7783 7784 /* 7785 Sync Mute Elements. 7786 */ 7787 _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false); 7788 7789 /* 7790 Syncs the volume sliders so the visuals align up with the functionality. 7791 If the volume is at 0, then the sliders should represent that so the user 7792 has the right starting point. 7793 */ 7794 _volumeSliderElements2.default.sync(); 7795 } 7796 } 7797 7798 /** 7799 * Returns the public facing methods 7800 */ 7801 return { 7802 handle: handle 7803 }; 7804}(); 7805 7806/** 7807 * Imports the AmplitudeJS Visual Volume Slider Elements 7808 * @module visual/VolumeSliderElements 7809 */ 7810 7811 7812/** 7813 * Imports the AmplitudeJS Core Methods 7814 * @module core/core 7815 */ 7816exports.default = Mute; 7817module.exports = exports["default"]; 7818 7819/***/ }), 7820/* 29 */ 7821/***/ (function(module, exports, __webpack_require__) { 7822 7823"use strict"; 7824 7825 7826Object.defineProperty(exports, "__esModule", { 7827 value: true 7828}); 7829 7830var _config = __webpack_require__(0); 7831 7832var _config2 = _interopRequireDefault(_config); 7833 7834var _core = __webpack_require__(1); 7835 7836var _core2 = _interopRequireDefault(_core); 7837 7838var _playPauseElements = __webpack_require__(2); 7839 7840var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 7841 7842var _callbacks = __webpack_require__(7); 7843 7844var _callbacks2 = _interopRequireDefault(_callbacks); 7845 7846var _audioNavigation = __webpack_require__(3); 7847 7848var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 7849 7850var _debug = __webpack_require__(4); 7851 7852var _debug2 = _interopRequireDefault(_debug); 7853 7854function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 7855 7856/** 7857 * AmplitudeJS Next Event Handler 7858 * 7859 * @module events/Next 7860 */ 7861 7862 7863/** 7864 * Imports the Amplitude Audio Navigation Utility 7865 * @module utilities/AudioNavigation 7866 */ 7867 7868 7869/** 7870 * Imports the Play Pause Elements Module. 7871 * @module visual/PlayPauseElements 7872 */ 7873/** 7874 * Imports the config module 7875 * @module config 7876 */ 7877var Next = function () { 7878 /** 7879 * Handles an event on the next button 7880 * 7881 * HANDLER FOR: class="amplitude-next" 7882 * 7883 * GLOBAL: class="amplitude-next" 7884 * PLAYLIST: class="amplitude-next" amplitude-playlist="playlist_key" 7885 * 7886 * @access public 7887 */ 7888 function handle() { 7889 /* 7890 We don't fire this if the user is touching the screen and it's moving. 7891 This could lead to a mis-fire 7892 */ 7893 if (!_config2.default.is_touch_moving) { 7894 /* 7895 Gets the playlist attribute from the element. 7896 */ 7897 var playlist = this.getAttribute("data-amplitude-playlist"); 7898 7899 /* 7900 If the playlist is null, we handle the global next. 7901 */ 7902 if (playlist == null) { 7903 handleGlobalNext(); 7904 } 7905 7906 /* 7907 If the playlist is set, we handle the playlist next. 7908 */ 7909 if (playlist != null) { 7910 handlePlaylistNext(playlist); 7911 } 7912 } 7913 } 7914 7915 /** 7916 * Handles an event on a global enxt button. 7917 * 7918 * @access private 7919 */ 7920 function handleGlobalNext() { 7921 /* 7922 Check to see if the current state of the player 7923 is in playlist mode or not playlist mode. If we are in playlist mode, 7924 we set next on the playlist. 7925 */ 7926 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 7927 _audioNavigation2.default.setNext(); 7928 } else { 7929 _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist); 7930 } 7931 } 7932 7933 /** 7934 * Handles an event on a next playlist button. 7935 * 7936 * @access private 7937 * @prop {string} playlist - The playlist we are handling the next for. 7938 */ 7939 function handlePlaylistNext(playlist) { 7940 /* 7941 Ensure the playlist is the same as the active playlist. To get to change 7942 the scope to a new playlist, you need to play that playlist. 7943 */ 7944 if (playlist == _config2.default.active_playlist) { 7945 _audioNavigation2.default.setNextPlaylist(playlist); 7946 } else { 7947 _debug2.default.writeMessage("You can not go to the next song on a playlist that is not being played!"); 7948 } 7949 } 7950 7951 /* 7952 Returns the public facing methods. 7953 */ 7954 return { 7955 handle: handle 7956 }; 7957}(); 7958 7959/** 7960 * AmplitudeJS Debug Module 7961 * @module utilities/Debug 7962 */ 7963 7964 7965/** 7966 * Imports the Callbacks Module 7967 * @module utilities/Callbacks 7968 */ 7969 7970 7971/** 7972 * Imports the AmplitudeJS Core module. 7973 * @module core/core 7974 */ 7975exports.default = Next; 7976module.exports = exports["default"]; 7977 7978/***/ }), 7979/* 30 */ 7980/***/ (function(module, exports, __webpack_require__) { 7981 7982"use strict"; 7983 7984 7985Object.defineProperty(exports, "__esModule", { 7986 value: true 7987}); 7988 7989var _config = __webpack_require__(0); 7990 7991var _config2 = _interopRequireDefault(_config); 7992 7993var _configState = __webpack_require__(6); 7994 7995var _configState2 = _interopRequireDefault(_configState); 7996 7997var _core = __webpack_require__(1); 7998 7999var _core2 = _interopRequireDefault(_core); 8000 8001var _playPauseElements = __webpack_require__(2); 8002 8003var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 8004 8005function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 8006 8007/** 8008 * Handles all of the pause events 8009 * @module events/Pause 8010 */ 8011 8012 8013/** 8014 * Imports the AmplitudeJS Core Methods 8015 * @module core/Core 8016 */ 8017/** 8018 * Imports the config module 8019 * @module config 8020 */ 8021var Pause = function () { 8022 /** 8023 * Handles an event on a pause button 8024 * 8025 * HANDLER FOR: class="amplitude-pause" 8026 * 8027 * GLOBAL: class="amplitude-pause" 8028 * PLAYLIST: class="amplitude-pause" amplitude-playlist="playlist_key" 8029 * SONG: class="amplitude-pause" amplitude-song-index="song_index" 8030 * SONG IN PLAYLIST: class="amplitude-pause" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index" 8031 * 8032 * @access public 8033 */ 8034 function handle() { 8035 /* 8036 If the touch is moving, we do not want to accidentally touch the play 8037 pause element and fire an event. 8038 */ 8039 if (!_config2.default.is_touch_moving) { 8040 /* 8041 Gets the attribute for song index so we can check if 8042 there is a need to change the song. In some scenarios 8043 there might be multiple pause classes on the page. In that 8044 case it is possible the user could click a different pause 8045 class. 8046 */ 8047 var songIndexAttribute = this.getAttribute("data-amplitude-song-index"); 8048 var playlistAttribute = this.getAttribute("data-amplitude-playlist"); 8049 8050 /* 8051 Handle a global pause button. 8052 */ 8053 if (playlistAttribute == null && songIndexAttribute == null) { 8054 handleGlobalPause(); 8055 } 8056 8057 /* 8058 Handle a playlist pause button. 8059 */ 8060 if (playlistAttribute != null && songIndexAttribute == null) { 8061 handlePlaylistPause(playlistAttribute); 8062 } 8063 8064 /* 8065 Handle a song pause button. 8066 */ 8067 if (playlistAttribute == null && songIndexAttribute != null) { 8068 handleSongPause(songIndexAttribute); 8069 } 8070 8071 /* 8072 Handle a song in playlist pause button. 8073 */ 8074 if (playlistAttribute != null && songIndexAttribute != null) { 8075 handleSongInPlaylistPause(playlistAttribute, songIndexAttribute); 8076 } 8077 8078 _configState2.default.setPlayerState(); 8079 } 8080 } 8081 8082 /** 8083 * Handles global pause button which pauses whatever song is 8084 * active. 8085 * 8086 * @access private 8087 */ 8088 function handleGlobalPause() { 8089 /* 8090 Pauses the song. 8091 */ 8092 _core2.default.pause(); 8093 8094 /* 8095 Sync the play pause elements. 8096 */ 8097 _playPauseElements2.default.sync(); 8098 } 8099 8100 /** 8101 * Handles the playlist pause. 8102 * 8103 * @access private 8104 * @param {string} playlist The playlist the pause button belongs to. 8105 */ 8106 function handlePlaylistPause(playlist) { 8107 /* 8108 Checks to see if the active playlist is the same 8109 */ 8110 if (_config2.default.active_playlist == playlist) { 8111 /* 8112 Pauses the song. 8113 */ 8114 _core2.default.pause(); 8115 8116 /* 8117 Sync the play pause elements. 8118 */ 8119 _playPauseElements2.default.sync(); 8120 } 8121 } 8122 8123 /** 8124 * Handles the song pause. 8125 * 8126 * @access private 8127 * @param {integer} song The song the pause button belongs to. 8128 */ 8129 function handleSongPause(song) { 8130 /* 8131 Checks to see if the active playlist is null and the song matches 8132 the active index. 8133 */ 8134 if ((_config2.default.active_playlist == "" || _config2.default.active_playlist == null) && _config2.default.active_index == song) { 8135 /* 8136 Pauses the song. 8137 */ 8138 _core2.default.pause(); 8139 8140 /* 8141 Sync the play pause elements. 8142 */ 8143 _playPauseElements2.default.sync(); 8144 } 8145 } 8146 8147 /** 8148 * Handles the song in playlist pause. 8149 * 8150 * @access private 8151 * @param {string} playlist The playlist the pause button belongs to. 8152 * @param {integer} song The song the pause button belongs to. 8153 */ 8154 function handleSongInPlaylistPause(playlist, song) { 8155 /* 8156 Checks to see if the active song matches the song and the 8157 active playlist matches the playlist. This means the pause button is 8158 for the song in the playlist. 8159 */ 8160 if (_config2.default.active_playlist == playlist && _config2.default.playlists[playlist].active_index == song) { 8161 /* 8162 Pauses the song. 8163 */ 8164 _core2.default.pause(); 8165 8166 /* 8167 Sync the play pause elements. 8168 */ 8169 _playPauseElements2.default.sync(); 8170 } 8171 } 8172 8173 /* 8174 Returns the public facing elements 8175 */ 8176 return { 8177 handle: handle 8178 }; 8179}(); 8180 8181/** 8182 * Imports the AmplitudeJS Play Pause Elements 8183 * @module visual/PlayPauseElements 8184 */ 8185 8186 8187/** 8188 * Imports the ConfigState module. 8189 * @module utilities/ConfigState 8190 */ 8191exports.default = Pause; 8192module.exports = exports["default"]; 8193 8194/***/ }), 8195/* 31 */ 8196/***/ (function(module, exports, __webpack_require__) { 8197 8198"use strict"; 8199 8200 8201Object.defineProperty(exports, "__esModule", { 8202 value: true 8203}); 8204 8205var _config = __webpack_require__(0); 8206 8207var _config2 = _interopRequireDefault(_config); 8208 8209var _configState = __webpack_require__(6); 8210 8211var _configState2 = _interopRequireDefault(_configState); 8212 8213var _core = __webpack_require__(1); 8214 8215var _core2 = _interopRequireDefault(_core); 8216 8217var _checks = __webpack_require__(5); 8218 8219var _checks2 = _interopRequireDefault(_checks); 8220 8221var _audioNavigation = __webpack_require__(3); 8222 8223var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 8224 8225var _playPauseElements = __webpack_require__(2); 8226 8227var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 8228 8229function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 8230 8231/** 8232 * Handles all of the play events 8233 * @module events/Play 8234 */ 8235 8236 8237/** 8238 * Imports the AmplitudeJS Audio Navigation Utility 8239 * @module utilities/AudioNavigation 8240 */ 8241 8242 8243/** 8244 * Imports the AmplitudeJS Core Methods 8245 * @module core/Core 8246 */ 8247/** 8248 * Imports the config module 8249 * @module config 8250 */ 8251var Play = function () { 8252 /** 8253 * Handles an event on a play button in Amplitude. 8254 * 8255 * HANDLER FOR: class="amplitude-play" 8256 * 8257 * GLOBAL: class="amplitude-play" 8258 * PLAYLIST: class="amplitude-play" amplitude-playlist="playlist_key" 8259 * SONG: class="amplitude-play" amplitude-song-index="song_index" 8260 * SONG IN PLAYLIST: class="amplitude-play" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index" 8261 * 8262 * @access public 8263 */ 8264 function handle() { 8265 /* 8266 If the touch is moving, we do not want to accidentally touch the play 8267 pause element and fire an event. 8268 */ 8269 if (!_config2.default.is_touch_moving) { 8270 /* 8271 Gets the attribute for song index so we can check if 8272 there is a need to change the song. In some scenarios 8273 there might be multiple play classes on the page. In that 8274 case it is possible the user could click a different play 8275 class and change the song. 8276 */ 8277 var songIndexAttribute = this.getAttribute("data-amplitude-song-index"); 8278 var playlistAttribute = this.getAttribute("data-amplitude-playlist"); 8279 8280 /* 8281 Handle a global play button. 8282 */ 8283 if (playlistAttribute == null && songIndexAttribute == null) { 8284 handleGlobalPlay(); 8285 } 8286 8287 /* 8288 Handle a playlist play button. 8289 */ 8290 if (playlistAttribute != null && songIndexAttribute == null) { 8291 handlePlaylistPlay(playlistAttribute); 8292 } 8293 8294 /* 8295 Handle a song play button. 8296 */ 8297 if (playlistAttribute == null && songIndexAttribute != null) { 8298 handleSongPlay(songIndexAttribute); 8299 } 8300 8301 /* 8302 Handle a song in playlist play button. 8303 */ 8304 if (playlistAttribute != null && songIndexAttribute != null) { 8305 handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute); 8306 } 8307 8308 _configState2.default.setPlayerState(); 8309 } 8310 } 8311 8312 /** 8313 * Handles global play button which plays whatever song is 8314 * active. 8315 * 8316 * @access private 8317 */ 8318 function handleGlobalPlay() { 8319 /* 8320 Plays the song 8321 */ 8322 _core2.default.play(); 8323 8324 /* 8325 Sync the play pause elements. 8326 */ 8327 _playPauseElements2.default.sync(); 8328 } 8329 8330 /** 8331 * Handle the playlist play. 8332 * 8333 * @access private 8334 * @param {string} playlist The playlist the play button belongs to. 8335 */ 8336 function handlePlaylistPlay(playlist) { 8337 /* 8338 Checks if we have a new playlist. 8339 */ 8340 if (_checks2.default.newPlaylist(playlist)) { 8341 /* 8342 Sets the active playlist to what belongs to the playlist. 8343 */ 8344 _audioNavigation2.default.setActivePlaylist(playlist); 8345 8346 /* 8347 Play first song in the playlist since we just 8348 switched playlists, we start from the first song. 8349 If the user has shuffle on for the playlist, then 8350 we go from the first song in the shuffle playlist array. 8351 */ 8352 if (_config2.default.playlists[playlist].shuffle) { 8353 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].shuffle_list[0], 0); 8354 } else { 8355 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[0], 0); 8356 } 8357 } 8358 8359 /* 8360 Plays the song. 8361 */ 8362 _core2.default.play(); 8363 8364 /* 8365 Syncs the play pause elements since they are dependent upon this state 8366 of the player. 8367 */ 8368 _playPauseElements2.default.sync(); 8369 } 8370 8371 /** 8372 * Handles the song play button. 8373 * 8374 * @access private 8375 * @param {integer} song The index of the song we are playing. 8376 */ 8377 function handleSongPlay(song) { 8378 /* 8379 There can be multiple playlists on the page and there can be 8380 multiple songs on the page AND there can be songs in multiple 8381 playlists, so we have some checking to do. 8382 */ 8383 8384 /* 8385 Check to see if the playlist has changed. Essentially, if we are moving 8386 out of a playlist context. 8387 */ 8388 if (_checks2.default.newPlaylist(null)) { 8389 /* 8390 We've moved out of the playlist context, so we set the active playlist 8391 to null 8392 */ 8393 _audioNavigation2.default.setActivePlaylist(null); 8394 8395 /* 8396 We then change the song to the index selected. 8397 */ 8398 _audioNavigation2.default.changeSong(_config2.default.songs[song], song); 8399 } 8400 8401 /* 8402 Check to see if the song has changed. If it has, 8403 set the active song. If it was in a playlist, the 8404 song wouldn't change here, since we already set the 8405 song when we checked for a playlist. 8406 */ 8407 if (_checks2.default.newSong(null, song)) { 8408 /* 8409 The song selected is different, so we change the 8410 song. 8411 */ 8412 _audioNavigation2.default.changeSong(_config2.default.songs[song], song); 8413 } 8414 8415 /* 8416 Plays the song 8417 */ 8418 _core2.default.play(); 8419 8420 /* 8421 Syncs the play pause elements since they are dependent upon this state 8422 of the player. 8423 */ 8424 _playPauseElements2.default.sync(); 8425 } 8426 8427 /** 8428 * Handles the song in playlist play. 8429 * 8430 * @access private 8431 * @param {string} playlist The playlist the play button belongs to. 8432 * @param {integer} song The song the play button belongs to. 8433 */ 8434 function handleSongInPlaylistPlay(playlist, song) { 8435 /* 8436 There can be multiple playlists on the page and there can be 8437 multiple songs on the page AND there can be songs in multiple 8438 playlists, so we have some checking to do. 8439 */ 8440 8441 /* 8442 Check to see if the playlist has changed. Essentially, if we are moving 8443 out of a playlist context. 8444 */ 8445 if (_checks2.default.newPlaylist(playlist)) { 8446 /* 8447 We've moved out of the playlist context, so we set the active playlist 8448 to null 8449 */ 8450 _audioNavigation2.default.setActivePlaylist(playlist); 8451 8452 /* 8453 We then change the song to the index selected. 8454 */ 8455 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song); 8456 } 8457 8458 /* 8459 Check to see if the song has changed. If it has, 8460 set the active song. If it was in a playlist, the 8461 song wouldn't change here, since we already set the 8462 song when we checked for a playlist. 8463 */ 8464 if (_checks2.default.newSong(playlist, song)) { 8465 /* 8466 The song selected is different, so we change the 8467 song. 8468 */ 8469 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song); 8470 } 8471 8472 /* 8473 Plays the song 8474 */ 8475 _core2.default.play(); 8476 8477 /* 8478 Now we sync all the elements to match the state of the audio. 8479 We don't need to do any checks on new songs or changed playlists 8480 in the global since it's whatever song is playing. 8481 */ 8482 _playPauseElements2.default.sync(); 8483 } 8484 8485 /* 8486 Returns the public facing elements 8487 */ 8488 return { 8489 handle: handle 8490 }; 8491}(); 8492 8493/** 8494 * Imports the AmplitudeJS Play Pause Elements 8495 * @module visual/PlayPauseElements 8496 */ 8497 8498 8499/** 8500 * Imports the AmplitudeJS Checks Utility 8501 * @module utilities/Checks 8502 */ 8503 8504 8505/** 8506 * Imports the config state utility. 8507 * @module utilities/ConfigState 8508 */ 8509exports.default = Play; 8510module.exports = exports["default"]; 8511 8512/***/ }), 8513/* 32 */ 8514/***/ (function(module, exports, __webpack_require__) { 8515 8516"use strict"; 8517 8518 8519Object.defineProperty(exports, "__esModule", { 8520 value: true 8521}); 8522 8523var _config = __webpack_require__(0); 8524 8525var _config2 = _interopRequireDefault(_config); 8526 8527var _configState = __webpack_require__(6); 8528 8529var _configState2 = _interopRequireDefault(_configState); 8530 8531var _core = __webpack_require__(1); 8532 8533var _core2 = _interopRequireDefault(_core); 8534 8535var _checks = __webpack_require__(5); 8536 8537var _checks2 = _interopRequireDefault(_checks); 8538 8539var _audioNavigation = __webpack_require__(3); 8540 8541var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 8542 8543var _playPauseElements = __webpack_require__(2); 8544 8545var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 8546 8547function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 8548 8549/** 8550 * Handles all of the play pause events 8551 * @module events/PlayPause 8552 */ 8553 8554 8555/** 8556 * Imports the AmplitudeJS Audio Navigation Utility 8557 * @module utilities/AudioNavigation 8558 */ 8559 8560 8561/** 8562 * Imports the AmplitudeJS Core Methods 8563 * @module core/Core 8564 */ 8565/** 8566 * Imports the config module 8567 * @module config 8568 */ 8569var PlayPause = function () { 8570 /** 8571 * Handles an event on a play/pause button 8572 * 8573 * HANDLER FOR: class="amplitude-play-pause" 8574 * 8575 * GLOBAL: class="amplitude-play-pause" 8576 * PLAYLIST: class="amplitude-play-pause" amplitude-playlist="playlist_key" 8577 * SONG: class="amplitude-play-pause" amplitude-song-index="song_index" 8578 * SONG IN PLAYLIST: class="amplitude-play-pause" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index" 8579 * 8580 * @access public 8581 */ 8582 function handle() { 8583 /* 8584 If the touch is moving, we do not want to accidentally touch the play 8585 pause element and fire an event. 8586 */ 8587 if (!_config2.default.is_touch_moving) { 8588 /* 8589 Get the playlist and song from the element. It's alright if these 8590 are null. 8591 */ 8592 var playlist = this.getAttribute("data-amplitude-playlist"); 8593 var song = this.getAttribute("data-amplitude-song-index"); 8594 8595 /* 8596 Handle a global play pause button 8597 */ 8598 if (playlist == null && song == null) { 8599 handleGlobalPlayPause(); 8600 } 8601 8602 /* 8603 Handle a playlist play pause button 8604 */ 8605 if (playlist != null && song == null) { 8606 handlePlaylistPlayPause(playlist); 8607 } 8608 8609 /* 8610 Handle a song play pause button 8611 */ 8612 if (playlist == null && song != null) { 8613 handleSongPlayPause(song); 8614 } 8615 8616 /* 8617 Handle a song in playlist play pause button 8618 */ 8619 if (playlist != null && song != null) { 8620 handleSongInPlaylistPlayPause(playlist, song); 8621 } 8622 8623 _configState2.default.setPlayerState(); 8624 } 8625 } 8626 8627 /** 8628 * Sets the main play pause buttons to the current state of the song. 8629 * @access private 8630 */ 8631 function handleGlobalPlayPause() { 8632 /* 8633 If the song is paused, we play the song. If the song is playing, 8634 we pause the song. 8635 */ 8636 if (_config2.default.audio.paused) { 8637 _core2.default.play(); 8638 } else { 8639 _core2.default.pause(); 8640 } 8641 8642 /* 8643 Now we sync all the elements to match the state of the audio. 8644 We don't need to do any checks on new songs or changed playlists 8645 in the global since it's whatever song is playing. 8646 */ 8647 _playPauseElements2.default.sync(); 8648 } 8649 8650 /** 8651 * Sets the playlist main play pause buttons to the current state of the song. 8652 * @access private 8653 * @param {string} playlist The playlist the main play pause button controls 8654 */ 8655 function handlePlaylistPlayPause(playlist) { 8656 /* 8657 The only thing that can change when you click a playlist 8658 play pause is the playlist. Main play pauses have no change 8659 in song, song play pauses can change playlist and song. 8660 */ 8661 if (_checks2.default.newPlaylist(playlist)) { 8662 /* 8663 If there's a new playlist, then we set the new playlist. 8664 */ 8665 _audioNavigation2.default.setActivePlaylist(playlist); 8666 8667 /* 8668 Play first song in the playlist since we just 8669 switched playlists, we start from the first song. 8670 If the user has shuffle on for the playlist, then 8671 we go from the first song in the shuffle playlist array. 8672 */ 8673 if (_config2.default.playlists[playlist].shuffle) { 8674 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].shuffle_list[0], 0); 8675 } else { 8676 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[0], 0); 8677 } 8678 } 8679 8680 /* 8681 If the song is paused, we play the song. If the song is playing, 8682 we pause the song. 8683 */ 8684 if (_config2.default.audio.paused) { 8685 _core2.default.play(); 8686 } else { 8687 _core2.default.pause(); 8688 } 8689 8690 /* 8691 Now we sync all the elements to match the state of the audio. 8692 We don't need to do any checks on new songs or changed playlists 8693 in the global since it's whatever song is playing. 8694 */ 8695 _playPauseElements2.default.sync(); 8696 } 8697 8698 /** 8699 * Sets the playlist main play pause buttons to the current state of the song. 8700 * @access private 8701 * @param {string} song The index of the song being played/paused 8702 */ 8703 function handleSongPlayPause(song) { 8704 /* 8705 There can be multiple playlists on the page and there can be 8706 multiple songs on the page AND there can be songs in multiple 8707 playlists, so we have some checking to do. 8708 */ 8709 8710 /* 8711 Check to see if the playlist has changed. Essentially, if we are moving 8712 out of a playlist context. 8713 */ 8714 if (_checks2.default.newPlaylist(null)) { 8715 /* 8716 We've moved out of the playlist context, so we set the active playlist 8717 to null 8718 */ 8719 _audioNavigation2.default.setActivePlaylist(null); 8720 8721 /* 8722 We then change the song to the index selected. 8723 */ 8724 _audioNavigation2.default.changeSong(_config2.default.songs[song], song); 8725 } 8726 8727 /* 8728 Check to see if the song has changed. If it has, 8729 set the active song. If it was in a playlist, the 8730 song wouldn't change here, since we already set the 8731 song when we checked for a playlist. 8732 */ 8733 if (_checks2.default.newSong(null, song)) { 8734 /* 8735 The song selected is different, so we change the 8736 song. 8737 */ 8738 _audioNavigation2.default.changeSong(_config2.default.songs[song], song); 8739 } 8740 8741 /* 8742 If the song is paused, we play the song. If the song is playing, 8743 we pause the song. 8744 */ 8745 if (_config2.default.audio.paused) { 8746 _core2.default.play(); 8747 } else { 8748 _core2.default.pause(); 8749 } 8750 8751 /* 8752 Now we sync all the elements to match the state of the audio. 8753 We don't need to do any checks on new songs or changed playlists 8754 in the global since it's whatever song is playing. 8755 */ 8756 _playPauseElements2.default.sync(); 8757 } 8758 8759 /** 8760 * Sets the song in playlist play pause buttons to the current 8761 * state of the song. 8762 * @access private 8763 * @param {string} playlist The playlist the song is a part of 8764 * @param {number} song The index of the song being played/paused 8765 */ 8766 function handleSongInPlaylistPlayPause(playlist, song) { 8767 /* 8768 There can be multiple playlists on the page and there can be 8769 multiple songs on the page AND there can be songs in multiple 8770 playlists, so we have some checking to do. 8771 */ 8772 8773 /* 8774 Check to see if the playlist has changed. Essentially, if we are moving 8775 out of a playlist context. 8776 */ 8777 if (_checks2.default.newPlaylist(playlist)) { 8778 /* 8779 We've moved out of the playlist context, so we set the active playlist 8780 to null 8781 */ 8782 _audioNavigation2.default.setActivePlaylist(playlist); 8783 8784 /* 8785 We then change the song to the index selected. 8786 */ 8787 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song); 8788 } 8789 8790 /* 8791 Check to see if the song has changed. If it has, 8792 set the active song. If it was in a playlist, the 8793 song wouldn't change here, since we already set the 8794 song when we checked for a playlist. 8795 */ 8796 if (_checks2.default.newSong(playlist, song)) { 8797 /* 8798 The song selected is different, so we change the 8799 song. 8800 */ 8801 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song); 8802 } 8803 8804 /* 8805 If the song is paused, we play the song. If the song is playing, 8806 we pause the song. 8807 */ 8808 if (_config2.default.audio.paused) { 8809 _core2.default.play(); 8810 } else { 8811 _core2.default.pause(); 8812 } 8813 8814 /* 8815 Now we sync all the elements to match the state of the audio. 8816 We don't need to do any checks on new songs or changed playlists 8817 in the global since it's whatever song is playing. 8818 */ 8819 _playPauseElements2.default.sync(); 8820 } 8821 8822 /** 8823 * Returns the public facing methods 8824 */ 8825 return { 8826 handle: handle 8827 }; 8828}(); 8829 8830/** 8831 * Imports the AmplitudeJS Play Pause Elements 8832 * @module visual/PlayPauseElements 8833 */ 8834 8835 8836/** 8837 * Imports the AmplitudeJS Checks Utility 8838 * @module utilities/Checks 8839 */ 8840 8841 8842/** 8843 * Import the config state utility. 8844 * @module utilities/configState 8845 */ 8846exports.default = PlayPause; 8847module.exports = exports["default"]; 8848 8849/***/ }), 8850/* 33 */ 8851/***/ (function(module, exports, __webpack_require__) { 8852 8853"use strict"; 8854 8855 8856Object.defineProperty(exports, "__esModule", { 8857 value: true 8858}); 8859 8860var _config = __webpack_require__(0); 8861 8862var _config2 = _interopRequireDefault(_config); 8863 8864var _core = __webpack_require__(1); 8865 8866var _core2 = _interopRequireDefault(_core); 8867 8868var _playbackSpeedElements = __webpack_require__(18); 8869 8870var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements); 8871 8872function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 8873 8874/** 8875 * AmplitudeJS Playback Speed Event Handler 8876 * 8877 * @module events/PlaybackSpeed 8878 */ 8879 8880 8881/** 8882 * Imports the Amplitude Core module 8883 * @module core/Core 8884 */ 8885var PlaybackSpeed = function () { 8886 /** 8887 * Handles an event on the playback speed button 8888 * 8889 * HANDLER FOR: class="amplitude-playback-speed" 8890 * 8891 * @access public 8892 */ 8893 function handle() { 8894 if (!_config2.default.is_touch_moving) { 8895 /* 8896 We increment the speed by .5 everytime we click 8897 the button to change the playback speed. Once we are 8898 actively playing back at 2, we start back at 1 which 8899 is normal speed. 8900 */ 8901 switch (_config2.default.playback_speed) { 8902 case 1: 8903 _core2.default.setPlaybackSpeed(1.5); 8904 break; 8905 case 1.5: 8906 _core2.default.setPlaybackSpeed(2); 8907 break; 8908 case 2: 8909 _core2.default.setPlaybackSpeed(1); 8910 break; 8911 } 8912 8913 /* 8914 Visually sync the playback speed. 8915 */ 8916 _playbackSpeedElements2.default.sync(); 8917 } 8918 } 8919 8920 /* 8921 Returns public facing methods 8922 */ 8923 return { 8924 handle: handle 8925 }; 8926}(); 8927 8928/** 8929 * Imports the Playback Speed Visual Elements 8930 * @module visual/PlaybackSpeedElements 8931 */ 8932/** 8933 * Imports the config module 8934 * @module config 8935 */ 8936exports.default = PlaybackSpeed; 8937module.exports = exports["default"]; 8938 8939/***/ }), 8940/* 34 */ 8941/***/ (function(module, exports, __webpack_require__) { 8942 8943"use strict"; 8944 8945 8946Object.defineProperty(exports, "__esModule", { 8947 value: true 8948}); 8949 8950var _config = __webpack_require__(0); 8951 8952var _config2 = _interopRequireDefault(_config); 8953 8954var _audioNavigation = __webpack_require__(3); 8955 8956var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 8957 8958var _debug = __webpack_require__(4); 8959 8960var _debug2 = _interopRequireDefault(_debug); 8961 8962function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 8963 8964/** 8965 * AmplitudeJS Prev Event Handler 8966 * 8967 * @module events/Prev 8968 */ 8969 8970 8971/** 8972 * Imports the Amplitude Audio Navigation Utility 8973 * @module utilities/AudioNavigation 8974 */ 8975var Prev = function () { 8976 /** 8977 * Handles an event on the previous button 8978 * 8979 * HANDLER FOR: class="amplitude-prev" 8980 * 8981 * GLOBAL: class="amplitude-prev" 8982 * PLAYLIST: class="amplitude-prev" amplitude-playlist="playlist_key" 8983 * 8984 * @access public 8985 */ 8986 function handle() { 8987 /* 8988 We don't fire this if the user is touching the screen and it's moving. 8989 This could lead to a mis-fire 8990 */ 8991 if (!_config2.default.is_touch_moving) { 8992 /* 8993 Gets the playlist attribute from the element. 8994 */ 8995 var playlist = this.getAttribute("data-amplitude-playlist"); 8996 8997 /* 8998 If the playlist is null, we handle the global prev. 8999 */ 9000 if (playlist == null) { 9001 handleGlobalPrev(); 9002 } 9003 9004 /* 9005 If the playlist is set, we handle the playlist prev. 9006 */ 9007 if (playlist != null) { 9008 handlePlaylistPrev(playlist); 9009 } 9010 } 9011 } 9012 9013 /** 9014 * Handles an event on a global previous button. 9015 * 9016 * @access private 9017 */ 9018 function handleGlobalPrev() { 9019 /* 9020 Check to see if the current state of the player 9021 is in playlist mode or not playlist mode. If we are in playlist mode, 9022 we set prev on the playlist. 9023 */ 9024 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 9025 _audioNavigation2.default.setPrevious(); 9026 } else { 9027 _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist); 9028 } 9029 } 9030 9031 /** 9032 * Handles an event on a previous playlist button. 9033 * 9034 * @access private 9035 * @prop {string} playlist - The playlist we are handling the previous for. 9036 */ 9037 function handlePlaylistPrev(playlist) { 9038 /* 9039 Ensure the playlist is the same as the active playlist. To get to change 9040 the scope to a new playlist, you need to play that playlist. 9041 */ 9042 if (playlist == _config2.default.active_playlist) { 9043 _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist); 9044 } else { 9045 _debug2.default.writeMessage("You can not go to the previous song on a playlist that is not being played!"); 9046 } 9047 } 9048 9049 /* 9050 Returns the public facing methods. 9051 */ 9052 return { 9053 handle: handle 9054 }; 9055}(); 9056 9057/** 9058 * AmplitudeJS Debug Module 9059 * @module utilities/Debug 9060 */ 9061/** 9062 * Imports the config module 9063 * @module config 9064 */ 9065exports.default = Prev; 9066module.exports = exports["default"]; 9067 9068/***/ }), 9069/* 35 */ 9070/***/ (function(module, exports, __webpack_require__) { 9071 9072"use strict"; 9073 9074 9075Object.defineProperty(exports, "__esModule", { 9076 value: true 9077}); 9078 9079var _config = __webpack_require__(0); 9080 9081var _config2 = _interopRequireDefault(_config); 9082 9083var _bufferedProgressElements = __webpack_require__(24); 9084 9085var _bufferedProgressElements2 = _interopRequireDefault(_bufferedProgressElements); 9086 9087function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9088 9089/** 9090 * AmplitudeJS Event Handler for progress 9091 * 9092 * @module events/Progress 9093 */ 9094/** 9095 * Imports the config module 9096 * @module config 9097 */ 9098var Progress = function () { 9099 /** 9100 * As the song is buffered, we can display the buffered percentage in 9101 * a progress bar. 9102 * 9103 * HANDLER FOR: progress 9104 * 9105 * @access public 9106 */ 9107 function handle() { 9108 /* 9109 Help from: http://jsbin.com/badimipi/1/edit?html,js,output 9110 */ 9111 if (_config2.default.audio.buffered.length - 1 >= 0) { 9112 var bufferedEnd = _config2.default.audio.buffered.end(_config2.default.audio.buffered.length - 1); 9113 var duration = _config2.default.audio.duration; 9114 9115 /* 9116 Set the computed song buffered value to the config. 9117 */ 9118 _config2.default.buffered = bufferedEnd / duration * 100; 9119 } 9120 9121 /* 9122 Sync the buffered progress bars. 9123 */ 9124 _bufferedProgressElements2.default.sync(); 9125 } 9126 9127 /** 9128 * Returns the public facing methods 9129 */ 9130 return { 9131 handle: handle 9132 }; 9133}(); 9134 9135/** 9136 * Imports the BufferedProgressElements visual handler 9137 * @module visual/bufferedProgressElements.js 9138 */ 9139exports.default = Progress; 9140module.exports = exports["default"]; 9141 9142/***/ }), 9143/* 36 */ 9144/***/ (function(module, exports, __webpack_require__) { 9145 9146"use strict"; 9147 9148 9149Object.defineProperty(exports, "__esModule", { 9150 value: true 9151}); 9152 9153var _config = __webpack_require__(0); 9154 9155var _config2 = _interopRequireDefault(_config); 9156 9157var _repeater = __webpack_require__(12); 9158 9159var _repeater2 = _interopRequireDefault(_repeater); 9160 9161var _repeatElements = __webpack_require__(9); 9162 9163var _repeatElements2 = _interopRequireDefault(_repeatElements); 9164 9165function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9166 9167/** 9168 * AmplitudeJS Repeat Event Handler 9169 * 9170 * @module events/Repeat 9171 */ 9172 9173 9174/** 9175 * Imports the repeater utility module. 9176 * @module utilities/Repeater 9177 */ 9178var Repeat = function () { 9179 /** 9180 * Handles an event on the repeat button 9181 * 9182 * HANDLER FOR: class="amplitude-repeat" 9183 * 9184 * GLOBAL: class="amplitude-repeat" 9185 * PLAYLIST: class="amplitude-repeat" amplitude-playlist="playlist_key" 9186 * 9187 * @access public 9188 */ 9189 function handle() { 9190 /* 9191 We don't fire this if the user is touching the screen and it's moving. 9192 This could lead to a mis-fire 9193 */ 9194 if (!_config2.default.is_touch_moving) { 9195 /* 9196 Gets the playlist attribute from the element. 9197 */ 9198 var playlist = this.getAttribute("data-amplitude-playlist"); 9199 9200 /* 9201 If the playlist is null, we handle the global repeat. 9202 */ 9203 if (playlist == null) { 9204 handleGlobalRepeat(); 9205 } 9206 9207 /* 9208 If the playlist is set, we handle the playlist repeat. 9209 */ 9210 if (playlist != null) { 9211 handlePlaylistRepeat(playlist); 9212 } 9213 } 9214 } 9215 9216 /** 9217 * Handles an event on a global repeat button. 9218 * 9219 * @access private 9220 */ 9221 function handleGlobalRepeat() { 9222 /* 9223 Sets repeat to the opposite of what it was set to 9224 */ 9225 _repeater2.default.setRepeat(!_config2.default.repeat); 9226 9227 /* 9228 Visually sync repeat 9229 */ 9230 _repeatElements2.default.syncRepeat(); 9231 } 9232 9233 /** 9234 * Handles an event on a playlist repeat button. 9235 * 9236 * @access private 9237 * @prop {string} playlist - The playlist we are handling the repeat store. 9238 */ 9239 function handlePlaylistRepeat(playlist) { 9240 /* 9241 Sets repeat to the opposite of what it was set to for the playlist. 9242 */ 9243 _repeater2.default.setRepeatPlaylist(!_config2.default.playlists[playlist].repeat, playlist); 9244 9245 /* 9246 Visually sync playlist repeat 9247 */ 9248 _repeatElements2.default.syncRepeatPlaylist(playlist); 9249 } 9250 9251 /* 9252 Returns the public facing methods. 9253 */ 9254 return { 9255 handle: handle 9256 }; 9257}(); 9258 9259/** 9260 * Imports the visual repeat elements module 9261 * @module visual/RepeatElements 9262 */ 9263/** 9264 * Imports the config module 9265 * @module config 9266 */ 9267exports.default = Repeat; 9268module.exports = exports["default"]; 9269 9270/***/ }), 9271/* 37 */ 9272/***/ (function(module, exports, __webpack_require__) { 9273 9274"use strict"; 9275 9276 9277Object.defineProperty(exports, "__esModule", { 9278 value: true 9279}); 9280 9281var _config = __webpack_require__(0); 9282 9283var _config2 = _interopRequireDefault(_config); 9284 9285var _repeater = __webpack_require__(12); 9286 9287var _repeater2 = _interopRequireDefault(_repeater); 9288 9289var _repeatElements = __webpack_require__(9
vendor: 17,156 bytes, lines 9289-9961
9289); 9290 9291var _repeatElements2 = _interopRequireDefault(_repeatElements); 9292 9293function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9294 9295/** 9296 * Handles an event on the Amplitude Repeat Song. 9297 * 9298 * @module events/RepeatSong 9299 */ 9300 9301 9302/** 9303 * Imports the repeat utility 9304 * @module utilities/Repeater 9305 */ 9306var RepeatSong = function () { 9307 /** 9308 * Handles an event on the repeat song button 9309 * 9310 * HANDLER FOR: 'amplitude-repeat-song' 9311 * 9312 * @access public 9313 */ 9314 function handle() { 9315 /* 9316 If the touch is moving, we do not want to accidentally touch the play 9317 pause element and fire an event. 9318 */ 9319 if (!_config2.default.is_touch_moving) { 9320 /* 9321 Sets repeat song to the opposite of what it was set to 9322 */ 9323 _repeater2.default.setRepeatSong(!_config2.default.repeat_song); 9324 9325 /* 9326 Visually sync repeat song 9327 */ 9328 _repeatElements2.default.syncRepeatSong(); 9329 } 9330 } 9331 9332 /** 9333 * Returns the public facing methods 9334 */ 9335 return { 9336 handle: handle 9337 }; 9338}(); 9339 9340/** 9341 * Imports the AmplitudeJS Repeat Element 9342 * @module visual/RepeatElements 9343 */ 9344/** 9345 * Imports the config module 9346 * @module config 9347 */ 9348exports.default = RepeatSong; 9349module.exports = exports["default"]; 9350 9351/***/ }), 9352/* 38 */ 9353/***/ (function(module, exports, __webpack_require__) { 9354 9355"use strict"; 9356 9357 9358Object.defineProperty(exports, "__esModule", { 9359 value: true 9360}); 9361 9362var _config = __webpack_require__(0); 9363 9364var _config2 = _interopRequireDefault(_config); 9365 9366var _shuffler = __webpack_require__(13); 9367 9368var _shuffler2 = _interopRequireDefault(_shuffler); 9369 9370var _shuffleElements = __webpack_require__(19); 9371 9372var _shuffleElements2 = _interopRequireDefault(_shuffleElements); 9373 9374function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9375 9376/** 9377 * Handles all of the shuffle events 9378 * @module events/Shuffle 9379 */ 9380 9381 9382/** 9383 * Imports the shuffler utility 9384 * @module utilities/Shuffler 9385 */ 9386var Shuffle = function () { 9387 /** 9388 * Handles an event on the shuffle button 9389 * 9390 * HANDLER FOR: class="amplitude-shuffle" 9391 * 9392 * GLOBAL: class="amplitude-shuffle" 9393 * PLAYLIST: class="amplitude-shuffle" amplitude-playlist="playlist_key" 9394 * 9395 * @access public 9396 */ 9397 function handle() { 9398 /* 9399 If the touch is moving, we do not want to accidentally touch the play 9400 pause element and fire an event. 9401 */ 9402 if (!_config2.default.is_touch_moving) { 9403 /* 9404 Get the playlist attribute 9405 */ 9406 var playlist = this.getAttribute("data-amplitude-playlist"); 9407 9408 /* 9409 Check to see if the shuffle button belongs to a playlist 9410 */ 9411 if (playlist == null) { 9412 handleGlobalShuffle(); 9413 } else { 9414 handlePlaylistShuffle(playlist); 9415 } 9416 } 9417 } 9418 9419 /** 9420 * Handles the event on the global shuffle button. 9421 */ 9422 function handleGlobalShuffle() { 9423 /* 9424 Either shuffles or removes shuffle on the global state. 9425 */ 9426 _shuffler2.default.toggleShuffle(); 9427 9428 /* 9429 Visualize the shuffle state change. 9430 */ 9431 _shuffleElements2.default.syncMain(_config2.default.shuffle_on); 9432 } 9433 9434 /** 9435 * Handles the event on the playlist shuffle button. 9436 * 9437 * @param {string} playlist - The playlist string the shuffle button belongs to. 9438 */ 9439 function handlePlaylistShuffle(playlist) { 9440 /* 9441 Either shuffles or removes shuffle on the playlist state. 9442 */ 9443 _shuffler2.default.toggleShufflePlaylist(playlist); 9444 9445 /* 9446 Visually sync the playlist shuffle statuses. 9447 */ 9448 _shuffleElements2.default.syncPlaylist(playlist); 9449 } 9450 9451 /** 9452 * Returns public facing methods 9453 */ 9454 return { 9455 handle: handle 9456 }; 9457}(); 9458 9459/** 9460 * Imports the visual shuffle elements 9461 * @module visual/ShuffleElements 9462 */ 9463/** 9464 * Imports the config module 9465 * @module config 9466 */ 9467exports.default = Shuffle; 9468module.exports = exports["default"]; 9469 9470/***/ }), 9471/* 39 */ 9472/***/ (function(module, exports, __webpack_require__) { 9473 9474"use strict"; 9475 9476 9477Object.defineProperty(exports, "__esModule", { 9478 value: true 9479}); 9480 9481var _config = __webpack_require__(0); 9482 9483var _config2 = _interopRequireDefault(_config); 9484 9485var _debug = __webpack_require__(4); 9486 9487var _debug2 = _interopRequireDefault(_debug); 9488 9489var _audioNavigation = __webpack_require__(3); 9490 9491var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 9492 9493var _checks = __webpack_require__(5); 9494 9495var _checks2 = _interopRequireDefault(_checks); 9496 9497var _core = __webpack_require__(1); 9498 9499var _core2 = _interopRequireDefault(_core); 9500 9501var _playPauseElements = __webpack_require__(2); 9502 9503var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 9504 9505function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9506 9507/** 9508 * Handles the skip to event. 9509 * 9510 * @module events/SkipTo 9511 */ 9512 9513 9514/** 9515 * Imports the AmplitudeJS Core Methods 9516 * @module core/Core 9517 */ 9518 9519 9520/** 9521 * Imports the AmplitudeJS Audio Navigation Utility 9522 * @module utilities/AudioNavigation 9523 */ 9524/** 9525 * Imports the config module 9526 * @module config 9527 */ 9528var SkipTo = function () { 9529 /** 9530 * Handles an event on a skip to button. 9531 * 9532 * HANDLER FOR: class="amplitude-skip-to" 9533 * 9534 * GLOBAL: class="amplitude-skip-to" amplitude-song-index="song_index" amplitude-location="seconds" 9535 * PLAYLIST: class="amplitude-skip-to" amplitude-playlist="playlist_key" amplitude-song-index="song_index" amplitude-location="seconds" 9536 * 9537 * @access public 9538 */ 9539 function handle() { 9540 /* 9541 If the touch is moving, we do not want to accidentally touch the play 9542 pause element and fire an event. 9543 */ 9544 if (!_config2.default.is_touch_moving) { 9545 /* 9546 Extracts the needed attributes from the element. 9547 */ 9548 var playlist = this.getAttribute("data-amplitude-playlist"); 9549 var songIndex = this.getAttribute("data-amplitude-song-index"); 9550 var location = this.getAttribute("data-amplitude-location"); 9551 9552 /* 9553 If the location is null, write a message. We can't skip to a location 9554 that is null 9555 */ 9556 if (location == null) { 9557 _debug2.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element."); 9558 } 9559 9560 /* 9561 If the song index is null, write a debug message. We can't skip to a location 9562 of a null song. 9563 */ 9564 if (songIndex == null) { 9565 _debug2.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element."); 9566 } 9567 9568 /* 9569 If the location and song index are set, continue. 9570 */ 9571 if (location != null && songIndex != null) { 9572 /* 9573 Determines if the skip to button is in the scope of a playlist. 9574 */ 9575 if (playlist == null) { 9576 handleSkipToSong(parseInt(songIndex), parseInt(location)); 9577 } else { 9578 handleSkipToPlaylist(playlist, parseInt(songIndex), parseInt(location)); 9579 } 9580 } 9581 } 9582 } 9583 9584 /** 9585 * Handles the skipping to a specific song 9586 * 9587 * @access private 9588 * @param {string} songIndex - The index of the song being skipped to 9589 * @param {number} location - The seconds location of the song in the playlist. 9590 */ 9591 function handleSkipToSong(songIndex, location) { 9592 /* 9593 Changes the song to where it's being skipped and then 9594 play the song. 9595 */ 9596 _audioNavigation2.default.changeSong(_config2.default.songs[songIndex], songIndex); 9597 _core2.default.play(); 9598 9599 /* 9600 Syncs all of the play pause buttons now that we've skipped. 9601 */ 9602 _playPauseElements2.default.syncGlobal(); 9603 _playPauseElements2.default.syncSong(); 9604 9605 /* 9606 Skip to the location in the song. 9607 */ 9608 _core2.default.skipToLocation(location); 9609 } 9610 9611 /** 9612 * Handles the skipping to a song that's in a playlist. 9613 * 9614 * @access private 9615 * @param {string} playlist - The playlist being skipped to 9616 * @param {string} songIndex - The index of the song in the playlist 9617 * @param {number} location - The seconds location of the song in the playlist. 9618 */ 9619 function handleSkipToPlaylist(playlist, songIndex, location) { 9620 /* 9621 Checks if we are skipping to a new playlist 9622 */ 9623 if (_checks2.default.newPlaylist(playlist)) { 9624 _audioNavigation2.default.setActivePlaylist(playlist); 9625 } 9626 9627 /* 9628 Changes the song to where it's being skipped and then 9629 play the song. 9630 */ 9631 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[songIndex], songIndex); 9632 _core2.default.play(); 9633 9634 /* 9635 Sync all of the play pause elements. 9636 */ 9637 _playPauseElements2.default.syncGlobal(); 9638 _playPauseElements2.default.syncPlaylist(); 9639 _playPauseElements2.default.syncSong(); 9640 9641 /* 9642 Skip to the location in the song. 9643 */ 9644 _core2.default.skipToLocation(location); 9645 } 9646 9647 /** 9648 * Return public facing methods 9649 */ 9650 return { 9651 handle: handle 9652 }; 9653}(); 9654 9655/** 9656 * Imports the AmplitudeJS play pause elements. 9657 * @module visual/PlayPauseElements 9658 */ 9659 9660 9661/** 9662 * Imports the AmplitudeJS Checks Utility 9663 * @module utilities/Checks 9664 */ 9665 9666 9667/** 9668 * Imports AmplitudeJS Debug Utility 9669 * @module utilities/debug 9670 */ 9671exports.default = SkipTo; 9672module.exports = exports["default"]; 9673 9674/***/ }), 9675/* 40 */ 9676/***/ (function(module, exports, __webpack_require__) { 9677 9678"use strict"; 9679 9680 9681Object.defineProperty(exports, "__esModule", { 9682 value: true 9683}); 9684 9685var _config = __webpack_require__(0); 9686 9687var _config2 = _interopRequireDefault(_config); 9688 9689var _time = __webpack_require__(23); 9690 9691var _time2 = _interopRequireDefault(_time); 9692 9693var _songSliderElements = __webpack_require__(14); 9694 9695var _songSliderElements2 = _interopRequireDefault(_songSliderElements); 9696 9697function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9698 9699/** 9700 * Handles the song slider to event. 9701 * 9702 * @module events/SongSlider 9703 */ 9704 9705 9706/** 9707 * Imports the time utility 9708 * @module utilities/Time 9709 */ 9710var SongSlider = function () { 9711 /** 9712 * Handles a song slider element. 9713 * 9714 * HANDLER FOR: class="amplitude-song-slider" 9715 * 9716 * GLOBAL: class="amplitude-song-slider" 9717 * PLAYLIST: class="amplitude-song-slider" amplitude-playlist="playlist_key" 9718 * SONG: class="amplitude-song-slider" amplitude-song-index="song_index" 9719 * SONG IN PLAYLIST: class="amplitude-song-slider" amplitude-playlist="playlist_key" amplitude-song-index="song_index" 9720 * 9721 * @access public 9722 */ 9723 function handle() { 9724 /* 9725 Gets the percentage of the song we will be setting the location for. 9726 */ 9727 var locationPercentage = this.value; 9728 9729 /* 9730 Computes the time in seconds for the current song. 9731 */ 9732 var computedTime = _config2.default.audio.duration * (locationPercentage / 100); 9733 9734 /* 9735 Gets the attributes for playlist and index for the element. 9736 */ 9737 var playlist = this.getAttribute("data-amplitude-playlist"); 9738 var song = this.getAttribute("data-amplitude-song-index"); 9739 9740 /* 9741 If no playlist or song is defined, then it's a global song slider. 9742 */ 9743 if (playlist == null && song == null) { 9744 handleGlobalSongSlider(computedTime, locationPercentage); 9745 } 9746 9747 /* 9748 If a playlist but no song is defined, then it's playlist slider. 9749 */ 9750 if (playlist != null && song == null) { 9751 handlePlaylistSongSlider(computedTime, locationPercentage, playlist); 9752 } 9753 9754 /* 9755 If no playlist but a song is defined, then it's a song slider. 9756 */ 9757 if (playlist == null && song != null) { 9758 handleSongSongSlider(computedTime, locationPercentage, song); 9759 } 9760 9761 /* 9762 If playlist and song are defined then it's a song in a playlist 9763 slider. 9764 */ 9765 if (playlist != null && song != null) { 9766 handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, song); 9767 } 9768 } 9769 9770 /** 9771 * Handles a change on a global audio slider 9772 * 9773 * @access private 9774 * @param {integer} computedTime - The time we will set the audio to. 9775 * @param {float} locationPercentage - The percent through the song. 9776 */ 9777 function handleGlobalSongSlider(computedTime, locationPercentage) { 9778 /* 9779 If the active song is not live, set the current time and adjust the slider. 9780 */ 9781 if (!_config2.default.active_metadata.live) { 9782 _time2.default.setCurrentTime(computedTime); 9783 9784 /* 9785 Sync song slider elements. 9786 */ 9787 _songSliderElements2.default.sync(locationPercentage, _config2.default.active_playlist, _config2.default.active_index); 9788 } 9789 } 9790 9791 /** 9792 * Handles a change on a playlist audio slider 9793 * 9794 * @access private 9795 * @param {integer} computedTime - The time we will set the audio to. 9796 * @param {float} locationPercentage - The percent through the song. 9797 * @param {string} playlist = The playlist the song slider belongs to. 9798 */ 9799 function handlePlaylistSongSlider(computedTime, locationPercentage, playlist) { 9800 /* 9801 We don't want to song slide a playlist that's not the 9802 active placylist. 9803 */ 9804 if (_config2.default.active_playlist == playlist) { 9805 /* 9806 If the active song is not live, set the current time 9807 */ 9808 if (!_config2.default.active_metadata.live) { 9809 _time2.default.setCurrentTime(computedTime); 9810 9811 /* 9812 Sync song slider elements. 9813 */ 9814 _songSliderElements2.default.sync(locationPercentage, playlist, _config2.default.active_index); 9815 } 9816 } 9817 } 9818 9819 /** 9820 * Handles a change on a song audio slider 9821 * 9822 * @access private 9823 * @param {integer} computedTime - The time we will set the audio to. 9824 * @param {float} locationPercentage - The percent through the song. 9825 * @param {integer} songIndex = The song being navigated. 9826 */ 9827 function handleSongSongSlider(computedTime, locationPercentage, songIndex) { 9828 /* 9829 We only want to move the slider if the active song is the 9830 same as the song being selected. 9831 */ 9832 if (_config2.default.active_index == songIndex && _config2.default.active_playlist == null) { 9833 /* 9834 If the active song is not live, set the current time 9835 */ 9836 if (!_config2.default.active_metadata.live) { 9837 _time2.default.setCurrentTime(computedTime); 9838 9839 /* 9840 Sync song slider elements. 9841 */ 9842 _songSliderElements2.default.sync(locationPercentage, _config2.default.active_playlist, songIndex); 9843 } 9844 } 9845 } 9846 9847 /** 9848 * Handles a change on a song audio slider 9849 * 9850 * @access private 9851 * @param {integer} computedTime - The time we will set the audio to. 9852 * @param {float} locationPercentage - The percent through the song. 9853 * @param {integer} playlist = The playlist the song belongs to. 9854 * @param {integer} songIndex = The song being navigated. 9855 */ 9856 function handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, songIndex) { 9857 /* 9858 We only want to move the slider if the active song is the 9859 same as the song being selected and the active playlist is the same 9860 as the playlist selected. 9861 */ 9862 if (_config2.default.playlists[playlist].active_index == songIndex && _config2.default.active_playlist == playlist) { 9863 /* 9864 If the active song is not live, set the current time 9865 */ 9866 if (!_config2.default.active_metadata.live) { 9867 _time2.default.setCurrentTime(computedTime); 9868 9869 /* 9870 Sync song slider elements. 9871 */ 9872 _songSliderElements2.default.sync(locationPercentage, playlist, songIndex); 9873 } 9874 } 9875 } 9876 9877 /* 9878 Return public facing methods 9879 */ 9880 return { 9881 handle: handle 9882 }; 9883}(); 9884 9885/** 9886 * Imports the song slider elements. 9887 * @module visual/SongSliderElements 9888 */ 9889/** 9890 * Imports the config module 9891 * @module config 9892 */ 9893exports.default = SongSlider; 9894module.exports = exports["default"]; 9895 9896/***/ }), 9897/* 41 */ 9898/***/ (function(module, exports, __webpack_require__) { 9899 9900"use strict"; 9901 9902 9903Object.defineProperty(exports, "__esModule", { 9904 value: true 9905}); 9906 9907var _config = __webpack_require__(0); 9908 9909var _config2 = _interopRequireDefault(_config); 9910 9911var _configState = __webpack_require__(6); 9912 9913var _configState2 = _interopRequireDefault(_configState); 9914 9915var _playPauseElements = __webpack_require__(2); 9916 9917var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 9918 9919var _core = __webpack_require__(1); 9920 9921var _core2 = _interopRequireDefault(_core); 9922 9923function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9924 9925/** 9926 * Handles all of the stop events 9927 * @module events/Stop 9928 */ 9929 9930 9931/** 9932 * Imports the AmplitudeJS Play Pause Elements 9933 * @module visual/PlayPauseElements 9934 */ 9935/** 9936 * Imports the config module 9937 * @module config 9938 */ 9939var Stop = function () { 9940 /** 9941 * Handles an event on a stop element. 9942 * 9943 * HANDLER FOR: class="amplitude-stop" 9944 * 9945 * @access public 9946 */ 9947 function handle() { 9948 /* 9949 If touch is not moving, we run. We don't want to accidentally press 9950 stop if touch is moving. 9951 */ 9952 if (!_config2.default.is_touch_moving) { 9953 /* 9954 Sets all of the play/pause buttons to pause 9955 */ 9956 _playPauseElements2.default.syncToPause(); 9957 9958 /* 9959 Stops the active song. 9960 */ 9961 _core2.default.stop();
9962 9963 /* 9964 Set the state of the player. 9965 */ 9966 _configState2.default.setPlayerState(); 9967 } 9968 } 9969 9970 /** 9971 * Returns public facing methods 9972 */ 9973 return { 9974 handle: handle 9975 }; 9976}(); 9977 9978/** 9979 * Imports the AmplitudeJS Core Methods 9980 * @module core/Core 9981 */ 9982 9983 9984/** 9985 * Imports the config state module. 9986 * @module utilities/configState 9987 */ 9988exports.default = Stop; 9989module.exports = exports["default"]; 9990 9991/***/ }), 9992/* 42 */ 9993/***/ (function(module, exports, __webpack_require__) { 9994 9995"use strict"; 9996 9997 9998Object.defineProperty(exports, "__esModule", { 9999 value: true 10000}); 10001 10002var _config = __webpack_require__(0); 10003 10004var _config2 = _interopRequireDefault(_config); 10005 10006var _bufferedProgressElements = __webpack_require__(24); 10007 10008var _bufferedProgressElements2 = _interopRequireDefault(_bufferedProgressElements); 10009 10010var _timeElements = __webpack_require__(15); 10011 10012var _timeElements2 = _interopRequireDefault(_timeElements); 10013 10014var _songSliderElements = __webpack_require__(14); 10015 10016var _songSliderElements2 = _interopRequireDefault(_songSliderElements); 10017 10018var _songPlayedProgressElements = __webpack_require__(20); 10019 10020var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements); 10021 10022var _time = __webpack_require__(23); 10023 10024var _time2 = _interopRequireDefault(_time); 10025 10026var _callbacks = __webpack_require__(7
vendor: 16,958 bytes, lines 10026-10712
10026); 10027 10028var _callbacks2 = _interopRequireDefault(_callbacks); 10029 10030function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10031 10032/** 10033 * AmplitudeJS Event Handler for Time Update 10034 * 10035 * @module events/TimeUpdate 10036 */ 10037 10038 10039/** 10040 * Imports the Time utility class 10041 * @module utilities/Time 10042 */ 10043 10044 10045/** 10046 * Imports the Song Slider Elements visual class. 10047 * @module visual/songSliderElements 10048 */ 10049 10050 10051/** 10052 * Imports the Buffered Progress Elements visual class 10053 * @module visual/bufferedProgressElements 10054 */ 10055var TimeUpdate = function () { 10056 /** 10057 * When the time updates on the active song, we sync the current time displays 10058 * 10059 * HANDLER FOR: timeupdate 10060 * 10061 * @access public 10062 */ 10063 function handle() { 10064 /* 10065 Computes the buffered time. 10066 */ 10067 computeBufferedTime(); 10068 10069 /* 10070 Sync the buffered progress elements. 10071 */ 10072 _bufferedProgressElements2.default.sync(); 10073 10074 /* 10075 Updates the current time information. 10076 */ 10077 updateTimeInformation(); 10078 10079 /* 10080 Run time callbacks 10081 */ 10082 runTimeCallbacks(); 10083 } 10084 10085 /** 10086 * Computes the buffered time 10087 */ 10088 function computeBufferedTime() { 10089 /* 10090 Help from: http://jsbin.com/badimipi/1/edit?html,js,output 10091 */ 10092 if (_config2.default.audio.buffered.length - 1 >= 0) { 10093 var bufferedEnd = _config2.default.audio.buffered.end(_config2.default.audio.buffered.length - 1); 10094 var duration = _config2.default.audio.duration; 10095 10096 _config2.default.buffered = bufferedEnd / duration * 100; 10097 } 10098 } 10099 10100 /** 10101 * Updates the current time information. 10102 * @access private 10103 */ 10104 function updateTimeInformation() { 10105 /* 10106 If the current song is not live, then 10107 we can update the time information. Otherwise the 10108 current time updates wouldn't mean much since the time 10109 is infinite. 10110 */ 10111 if (!_config2.default.active_metadata.live) { 10112 /* 10113 Compute the current time 10114 */ 10115 var currentTime = _time2.default.computeCurrentTimes(); 10116 10117 /* 10118 Compute the song completion percentage 10119 */ 10120 var songCompletionPercentage = _time2.default.computeSongCompletionPercentage(); 10121 10122 /* 10123 Computes the song duration 10124 */ 10125 var songDuration = _time2.default.computeSongDuration(); 10126 10127 /* 10128 Sync the current time elements with the current 10129 location of the song and the song duration elements with 10130 the duration of the song. 10131 */ 10132 _timeElements2.default.syncCurrentTimes(currentTime); 10133 10134 /* 10135 Sync the song slider elements. 10136 */ 10137 _songSliderElements2.default.sync(songCompletionPercentage, _config2.default.active_playlist, _config2.default.active_index); 10138 10139 /* 10140 Sync the song played progress elements. 10141 */ 10142 _songPlayedProgressElements2.default.sync(songCompletionPercentage); 10143 10144 /* 10145 Sync the duration time elements. 10146 */ 10147 _timeElements2.default.syncDurationTimes(currentTime, songDuration); 10148 } 10149 } 10150 10151 /** 10152 * Runs a callback at a certain time in the song. 10153 */ 10154 function runTimeCallbacks() { 10155 /* 10156 Gets the current seconds into the song. 10157 */ 10158 var currentSeconds = Math.floor(_config2.default.audio.currentTime); 10159 10160 /* 10161 Checks to see if there is a callback at the certain seconds into the song. 10162 */ 10163 if (_config2.default.active_metadata.time_callbacks != undefined && _config2.default.active_metadata.time_callbacks[currentSeconds] != undefined) { 10164 /* 10165 Checks to see if the callback has been run. Since the time updates more than 10166 one second, we don't want the callback to run X times. 10167 */ 10168 if (!_config2.default.active_metadata.time_callbacks[currentSeconds].run) { 10169 _config2.default.active_metadata.time_callbacks[currentSeconds].run = true; 10170 _config2.default.active_metadata.time_callbacks[currentSeconds](); 10171 } 10172 } else { 10173 /* 10174 Iterate over all of the callbacks for a song. If the song has one, we flag 10175 the run as false. This occurs because we have passed the active second for 10176 the callback, so we flag it as not run. It will either run again if the user 10177 seeks back or not run in the future. 10178 */ 10179 for (var seconds in _config2.default.active_metadata.time_callbacks) { 10180 if (_config2.default.active_metadata.time_callbacks.hasOwnProperty(seconds)) { 10181 _config2.default.active_metadata.time_callbacks[seconds].run = false; 10182 } 10183 } 10184 } 10185 } 10186 /** 10187 * Returns public functions 10188 */ 10189 return { 10190 handle: handle 10191 }; 10192}(); 10193 10194/** 10195 * Imports the Callback utility class 10196 * @module utilities/Callbacks 10197 */ 10198 10199 10200/** 10201 * Imports the Song Played Progress Elements visual class. 10202 * @module visual/songPlayedProgressElements 10203 */ 10204 10205 10206/** 10207 * Imports the Time Elements visual class. 10208 * @module visual/timeElements 10209 */ 10210/** 10211 * Imports the config module 10212 * @module config 10213 */ 10214exports.default = TimeUpdate; 10215module.exports = exports["default"]; 10216 10217/***/ }), 10218/* 43 */ 10219/***/ (function(module, exports, __webpack_require__) { 10220 10221"use strict"; 10222 10223 10224Object.defineProperty(exports, "__esModule", { 10225 value: true 10226}); 10227 10228var _config = __webpack_require__(0); 10229 10230var _config2 = _interopRequireDefault(_config); 10231 10232var _core = __webpack_require__(1); 10233 10234var _core2 = _interopRequireDefault(_core); 10235 10236var _muteElements = __webpack_require__(10); 10237 10238var _muteElements2 = _interopRequireDefault(_muteElements); 10239 10240var _volumeSliderElements = __webpack_require__(11); 10241 10242var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements); 10243 10244function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10245 10246/** 10247 * Handles all events for a volume down event. 10248 * @module events/VolumeDown 10249 */ 10250 10251 10252/** 10253 * Imports the AmplitudeJS Visual Mute Elements 10254 * @module visual/MuteElements 10255 */ 10256/** 10257 * Imports the config to use the values 10258 */ 10259var VolumeDown = function () { 10260 /** 10261 * Handles a click on a volume down element. 10262 * 10263 * HANDLER FOR: class="amplitude-volume-down" 10264 * 10265 * @access public 10266 */ 10267 function handle() { 10268 /* 10269 We don't fire this if the user is touching the screen and it's moving. 10270 This could lead to a mis-fire 10271 */ 10272 if (!_config2.default.is_touch_moving) { 10273 /* 10274 The volume range is from 0 to 1 for an audio element. We make this 10275 a base of 100 for ease of working with. 10276 If the new value is less than 100, we use the new calculated 10277 value which gets converted to the proper unit for the audio element. 10278 If the new value is greater than 100, we set the volume to 1 which 10279 is the max for the audio element. 10280 */ 10281 var volume = null; 10282 10283 if (_config2.default.volume - _config2.default.volume_increment > 0) { 10284 volume = _config2.default.volume - _config2.default.volume_increment; 10285 } else { 10286 volume = 0; 10287 } 10288 10289 /* 10290 Calls the core function to set the volume to the computed value 10291 based on the user's intent. 10292 */ 10293 _core2.default.setVolume(volume); 10294 10295 /* 10296 Sync Mute Elements. 10297 */ 10298 _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false); 10299 10300 /* 10301 Sync Volume Slider Elements 10302 */ 10303 _volumeSliderElements2.default.sync(); 10304 } 10305 } 10306 10307 /** 10308 * Returns the public facing methods 10309 */ 10310 return { 10311 handle: handle 10312 }; 10313}(); 10314 10315/** 10316 * Imports the AmplitudeJS Visual Volume Slider Elements 10317 * @module visual/VolumeSliderElements 10318 */ 10319 10320 10321/** 10322 * Imports the AmplitudeJS Core Methods 10323 * @module core/core 10324 */ 10325exports.default = VolumeDown; 10326module.exports = exports["default"]; 10327 10328/***/ }), 10329/* 44 */ 10330/***/ (function(module, exports, __webpack_require__) { 10331 10332"use strict"; 10333 10334 10335Object.defineProperty(exports, "__esModule", { 10336 value: true 10337}); 10338 10339var _config = __webpack_require__(0); 10340 10341var _config2 = _interopRequireDefault(_config); 10342 10343var _core = __webpack_require__(1); 10344 10345var _core2 = _interopRequireDefault(_core); 10346 10347var _muteElements = __webpack_require__(10); 10348 10349var _muteElements2 = _interopRequireDefault(_muteElements); 10350 10351var _volumeSliderElements = __webpack_require__(11); 10352 10353var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements); 10354 10355function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10356 10357/** 10358 * Handles all events for a volume up event. 10359 * @module events/VolumeSlider 10360 */ 10361 10362 10363/** 10364 * Imports the AmplitudeJS Visual Mute Elements 10365 * @module visual/MuteElements 10366 */ 10367/** 10368 * Imports the config to use the values 10369 */ 10370var VolumeSlider = function () { 10371 /** 10372 * Handles a change on the volume slider 10373 * 10374 * HANDLER FOR: class="amplitude-volume-slider" 10375 * 10376 * @access public 10377 */ 10378 function handle() { 10379 /* 10380 Calls the core function to set the volume to the computed value 10381 based on the user's intent. 10382 */ 10383 _core2.default.setVolume(this.value); 10384 10385 /* 10386 Sync Mute Elements. 10387 */ 10388 _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false); 10389 10390 /* 10391 Sync the volume slider locations 10392 */ 10393 _volumeSliderElements2.default.sync(); 10394 } 10395 10396 /** 10397 * Returns the public facing methods 10398 */ 10399 return { 10400 handle: handle 10401 }; 10402}(); 10403 10404/** 10405 * Imports the AmplitudeJS Visual Volume Slider Elements 10406 * @module visual/VolumeSliderElements 10407 */ 10408 10409 10410/** 10411 * Imports the AmplitudeJS Core Methods 10412 * @module core/core 10413 */ 10414exports.default = VolumeSlider; 10415module.exports = exports["default"]; 10416 10417/***/ }), 10418/* 45 */ 10419/***/ (function(module, exports, __webpack_require__) { 10420 10421"use strict"; 10422 10423 10424Object.defineProperty(exports, "__esModule", { 10425 value: true 10426}); 10427 10428var _config = __webpack_require__(0); 10429 10430var _config2 = _interopRequireDefault(_config); 10431 10432var _core = __webpack_require__(1); 10433 10434var _core2 = _interopRequireDefault(_core); 10435 10436var _muteElements = __webpack_require__(10); 10437 10438var _muteElements2 = _interopRequireDefault(_muteElements); 10439 10440var _volumeSliderElements = __webpack_require__(11); 10441 10442var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements); 10443 10444function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10445 10446/** 10447 * Handles all events for a volume up event. 10448 * @module events/VolumeUp 10449 */ 10450 10451 10452/** 10453 * Imports the AmplitudeJS Visual Mute Elements 10454 * @module visual/MuteElements 10455 */ 10456/** 10457 * Imports the config to use the values 10458 */ 10459var VolumeUp = function () { 10460 /** 10461 * Handles a click on a volume up element. 10462 * 10463 * HANDLER FOR: class="amplitude-volume-up" 10464 * 10465 * @access public 10466 */ 10467 function handle() { 10468 /* 10469 We don't fire this if the user is touching the screen and it's moving. 10470 This could lead to a mis-fire 10471 */ 10472 if (!_config2.default.is_touch_moving) { 10473 /* 10474 The volume range is from 0 to 1 for an audio element. We make this 10475 a base of 100 for ease of working with. 10476 If the new value is less than 100, we use the new calculated 10477 value which gets converted to the proper unit for the audio element. 10478 If the new value is greater than 100, we set the volume to 1 which 10479 is the max for the audio element. 10480 */ 10481 var volume = null; 10482 10483 if (_config2.default.volume + _config2.default.volume_increment <= 100) { 10484 volume = _config2.default.volume + _config2.default.volume_increment; 10485 } else { 10486 volume = 100; 10487 } 10488 10489 /* 10490 Calls the core function to set the volume to the computed value 10491 based on the user's intent. 10492 */ 10493 _core2.default.setVolume(volume); 10494 10495 /* 10496 Sync Mute Elements. 10497 */ 10498 _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false); 10499 10500 /* 10501 Sync Volume Slider Elements 10502 */ 10503 _volumeSliderElements2.default.sync(); 10504 } 10505 } 10506 10507 /** 10508 * Returns the public facing methods 10509 */ 10510 return { 10511 handle: handle 10512 }; 10513}(); 10514 10515/** 10516 * Imports the AmplitudeJS Visual Volume Slider Elements 10517 * @module visual/VolumeSliderElements 10518 */ 10519 10520 10521/** 10522 * Imports the AmplitudeJS Core Methods 10523 * @module core/core 10524 */ 10525exports.default = VolumeUp; 10526module.exports = exports["default"]; 10527 10528/***/ }), 10529/* 46 */ 10530/***/ (function(module, exports, __webpack_require__) { 10531 10532"use strict"; 10533 10534 10535Object.defineProperty(exports, "__esModule", { 10536 value: true 10537}); 10538 10539var _config = __webpack_require__(0); 10540 10541var _config2 = _interopRequireDefault(_config); 10542 10543function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10544 10545/** 10546 * AmplitudeJS FX Module. Helps with configuring and setting up visualizations 10547 * and any other features of the Web Audio API that Amplitude takes advantage 10548 * of. 10549 * 10550 * @module fx/FX 10551 */ 10552var Fx = function () { 10553 /** 10554 * Configures the Web Audio API to work with AmplitudeJS 10555 */ 10556 function configureWebAudioAPI() { 10557 /* 10558 Gets the context for the browser. If this is null, the Web Audio 10559 API is unavailable. 10560 */ 10561 var browserContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext; 10562 10563 /* 10564 If we have a context, the Web Audio API is available and we can continue, 10565 otherwise, we alert the user if they have debug turned on. 10566 */ 10567 if (browserContext) { 10568 /* 10569 Web Audio API is available, set the context in our config. 10570 */ 10571 _config2.default.context = new browserContext(); 10572 10573 /* 10574 Create an analyzer that we will use in the context. 10575 */ 10576 _config2.default.analyser = _config2.default.context.createAnalyser(); 10577 10578 /* 10579 Set cross origin to anonymous so we have a better chance of being able 10580 to use the power of the Web Audio API. 10581 */ 10582 _config2.default.audio.crossOrigin = "anonymous"; 10583 10584 /* 10585 Bind the source to the Javascript Audio Element. 10586 */ 10587 _config2.default.source = _config2.default.context.createMediaElementSource(_config2.default.audio); 10588 10589 /* 10590 Connect the analyser to the source 10591 */ 10592 _config2.default.source.connect(_config2.default.analyser); 10593 10594 /* 10595 Connect the context destination to the analyser. 10596 */ 10597 _config2.default.analyser.connect(_config2.default.context.destination); 10598 } else { 10599 AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!"); 10600 } 10601 } 10602 10603 /** 10604 * Determines if the web audio API is available or not. 10605 */ 10606 function webAudioAPIAvailable() { 10607 /* 10608 Gets the context for the browser. If this is null, the Web Audio 10609 API is unavailable. 10610 */ 10611 var browserContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext; 10612 _config2.default.web_audio_api_available = false; 10613 10614 /* 10615 Determines if the Web Audio API is available or not. 10616 */ 10617 if (browserContext) { 10618 /* 10619 Set the flag in the config that the Web Audio API is available 10620 */ 10621 _config2.default.web_audio_api_available = true; 10622 return true; 10623 } else { 10624 /* 10625 Set the flag in the config that the Web Audio API is not available 10626 */ 10627 _config2.default.web_audio_api_available = false; 10628 return false; 10629 } 10630 } 10631 10632 /** 10633 * Determines if the user is using any of the web audio API features. 10634 */ 10635 function determineUsingAnyFX() { 10636 var waveforms = document.querySelectorAll(".amplitude-wave-form"); 10637 var visualizationElements = document.querySelectorAll(".amplitude-visualization"); 10638 10639 if (waveforms.length > 0 || visualizationElements.length > 0) { 10640 return true; 10641 } else { 10642 return false; 10643 } 10644 } 10645 10646 /* 10647 Returns the publicly accessible methods 10648 */ 10649 return { 10650 configureWebAudioAPI: configureWebAudioAPI, 10651 webAudioAPIAvailable: webAudioAPIAvailable, 10652 determineUsingAnyFX: determineUsingAnyFX 10653 }; 10654}(); /** 10655 * Imports the config module 10656 * @module config 10657 */ 10658exports.default = Fx; 10659module.exports = exports["default"]; 10660 10661/***/ }), 10662/* 47 */ 10663/***/ (function(module, exports, __webpack_require__) { 10664 10665"use strict"; 10666 10667 10668Object.defineProperty(exports, "__esModule", { 10669 value: true 10670}); 10671 10672var _init = __webpack_require__(21); 10673 10674var _init2 = _interopRequireDefault(_init); 10675 10676var _config = __webpack_require__(0); 10677 10678var _config2 = _interopRequireDefault(_config); 10679 10680var _core = __webpack_require__(1); 10681 10682var _core2 = _interopRequireDefault(_core); 10683 10684var _shuffler = __webpack_require__(13); 10685 10686var _shuffler2 = _interopRequireDefault(_shuffler); 10687 10688var _configState = __webpack_require__(6); 10689 10690var _configState2 = _interopRequireDefault(_configState); 10691 10692var _audioNavigation = __webpack_require__(3); 10693 10694var _audioNavigation2 = _interopRequireDefault(_audioNavigation); 10695 10696var _repeater = __webpack_require__(12); 10697 10698var _repeater2 = _interopRequireDefault(_repeater); 10699 10700var _checks = __webpack_require__(5); 10701 10702var _checks2 = _interopRequireDefault(_checks); 10703 10704var _visualizations = __webpack_require__(16); 10705 10706var _visualizations2 = _interopRequireDefault(_visualizations); 10707 10708var _shuffleElements = __webpack_require__(19); 10709 10710var _shuffleElements2 = _interopRequireDefault(_shuffleElements); 10711 10712var _repeatElements = __webpack_require__(
vendor: 48,059 bytes, lines 10712-12451
107129); 10713 10714var _repeatElements2 = _interopRequireDefault(_repeatElements); 10715 10716var _songSliderElements = __webpack_require__(14); 10717 10718var _songSliderElements2 = _interopRequireDefault(_songSliderElements); 10719 10720var _songPlayedProgressElements = __webpack_require__(20); 10721 10722var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements); 10723 10724var _timeElements = __webpack_require__(15); 10725 10726var _timeElements2 = _interopRequireDefault(_timeElements); 10727 10728var _playPauseElements = __webpack_require__(2); 10729 10730var _playPauseElements2 = _interopRequireDefault(_playPauseElements); 10731 10732var _metaDataElements = __webpack_require__(8); 10733 10734var _metaDataElements2 = _interopRequireDefault(_metaDataElements); 10735 10736var _playbackSpeedElements = __webpack_require__(18); 10737 10738var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements); 10739 10740var _debug = __webpack_require__(4); 10741 10742var _debug2 = _interopRequireDefault(_debug); 10743 10744var _soundcloud = __webpack_require__(17); 10745 10746var _soundcloud2 = _interopRequireDefault(_soundcloud); 10747 10748function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10749 10750/** 10751 * Amplitude should just be an interface to the public functions. 10752 * Everything else should be handled by other objects 10753 * 10754 * @module Amplitude 10755 */ 10756 10757 10758/** 10759 * Meta Data Elements 10760 * @module visual/MetaDataElements 10761 */ 10762 10763 10764/** 10765 * Time Elements 10766 * @module visual/TimeElements 10767 */ 10768 10769 10770/** 10771 * Song Slider Elements 10772 * @module visual/SongSliderElements 10773 */ 10774 10775 10776/**************************************************** 10777 * Elements 10778 ****************************************************/ 10779/** 10780 * Visual Shuffle Elements 10781 * @module visual/ShuffleElements 10782 */ 10783 10784 10785/** 10786 * Imports the checks 10787 * @module utilities/Checks 10788 */ 10789 10790 10791/** 10792 * Imports the audio navigation 10793 * @module utilities/AudioNavigation 10794 */ 10795 10796 10797/**************************************************** 10798 * Utilities 10799 ****************************************************/ 10800/** 10801 * Shuffler Module 10802 * @module utilities/Shuffler 10803 */ 10804 10805 10806/**************************************************** 10807 * Config 10808 ****************************************************/ 10809/** 10810 * Imports the config module 10811 * @module config 10812 */ 10813var Amplitude = function () { 10814 /** 10815 * The main init function. The user will call this through 10816 * Amplitude.init({}) and pass in their settings. 10817 * 10818 * Public Accessor: Amplitude.init( user_config_json ); 10819 * 10820 * @access public 10821 * @param {object} userConfig - A JSON object of user defined values that helps configure and initialize AmplitudeJS. 10822 */ 10823 function init(userConfig) { 10824 _init2.default.initialize(userConfig); 10825 } 10826 10827 /** 10828 * Returns the current config for AmplitudeJS 10829 */ 10830 function getConfig() { 10831 return _config2.default; 10832 } 10833 10834 /** 10835 * Binds new elements that were added to the page. 10836 * 10837 * Public Accessor: Amplitude.bindNewElements() 10838 * 10839 * @access public 10840 */ 10841 function bindNewElements() { 10842 _init2.default.rebindDisplay(); 10843 } 10844 10845 /** 10846 * Returns the active playlist. 10847 * 10848 * Public Accessor: Amplitude.getActivePlaylist() 10849 * 10850 * @access public 10851 */ 10852 function getActivePlaylist() { 10853 return _config2.default.active_playlist; 10854 } 10855 10856 /** 10857 * Returns the current playback speed. 10858 * 10859 * Public Accessor: Amplitude.getPlaybackSpeed() 10860 * 10861 * @access public 10862 */ 10863 function getPlaybackSpeed() { 10864 return _config2.default.playback_speed; 10865 } 10866 10867 /** 10868 * Sets the playback speed 10869 * 10870 * Public Accessor: Amplitude.setPlaybackSpeed( speed ) 10871 * 10872 * @access public 10873 */ 10874 function setPlaybackSpeed(speed) { 10875 /* 10876 Increments are set in .5 We only accept values 10877 1, 1.5, 2 10878 1 -> Regular Speed 10879 1.5 -> 50% faster 10880 2 -> Twice as fast 10881 */ 10882 _core2.default.setPlaybackSpeed(speed); 10883 10884 /* 10885 Visually sync the playback speed. 10886 */ 10887 _playbackSpeedElements2.default.sync(); 10888 } 10889 10890 /** 10891 * Gets the repeat state of the player. 10892 * 10893 * Public Accessor: Amplitude.getRepeat() 10894 * 10895 * @access public 10896 */ 10897 function getRepeat() { 10898 return _config2.default.repeat; 10899 } 10900 10901 /** 10902 * Gets the repeat state for a playlist 10903 * 10904 * Public Accessor: Amplitude.getRepeatPlaylist() 10905 * 10906 * @access public 10907 */ 10908 function getRepeatPlaylist(playlistKey) { 10909 return _config2.default.playlists[playlistKey].repeat; 10910 } 10911 10912 /** 10913 * Returns the shuffle state of the player. 10914 * 10915 * Public Accessor: Amplitude.getShuffle() 10916 * 10917 * @access public 10918 */ 10919 function getShuffle() { 10920 return _config2.default.shuffle_on; 10921 } 10922 10923 /** 10924 * Returns the shuffle state of the playlist. 10925 * 10926 * Public Accessor: Amplitude.getShufflePlaylist( playlist ) 10927 * 10928 * @access public 10929 * @param {string} playlist - The key representing the playlist ID to see if it's shuffled or not. 10930 */ 10931 function getShufflePlaylist(playlist) { 10932 return _config2.default.playlists[playlist].shuffle; 10933 } 10934 10935 /** 10936 * Sets the shuffle state for the player. 10937 * 10938 * Public Accessor: Amplitude.setShuffle() 10939 * 10940 * @param {boolean} shuffle - True when we are shuffling the songs, false when we turn off shuffle. 10941 * 10942 * @access public 10943 */ 10944 function setShuffle(shuffle) { 10945 _shuffler2.default.setShuffle(shuffle); 10946 10947 _shuffleElements2.default.syncMain(); 10948 } 10949 10950 /** 10951 * Sets the shuffle state for the playlist 10952 * 10953 * Public Accessor: Amplitude.setShufflePlaylist( playlist ) 10954 * 10955 * @access public 10956 * @param {string} playlist - The key representing the playlist ID to to shuffle the playlist. 10957 * @param {boolean} shuffle - True when we are shuffling the playlist, false when we turn off shuffle. 10958 */ 10959 function setShufflePlaylist(playlist, shuffle) { 10960 _shuffler2.default.setShufflePlaylist(playlist, shuffle); 10961 10962 _shuffleElements2.default.syncMain(); 10963 _shuffleElements2.default.syncPlaylist(playlist); 10964 } 10965 10966 /** 10967 * Sets the repeat state for the player. 10968 * 10969 * Public Accessor: Amplitude.setRepeat() 10970 * 10971 * @access public 10972 * @param {boolean} repeatState - The state you want the repeat song to be in. 10973 */ 10974 function setRepeat(repeatState) { 10975 _repeater2.default.setRepeat(repeatState); 10976 _repeatElements2.default.syncRepeat(); 10977 } 10978 10979 /** 10980 * Sets the repeat state for a playlist. 10981 * 10982 * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey ) 10983 * 10984 * @access public 10985 * @param {string} playlist - The key representing the playlist ID to to shuffle the playlist. 10986 * @param {boolean} repeatState - The state you want the repeat playlist to be in. 10987 */ 10988 function setRepeatPlaylist(playlist, repeatState) { 10989 _repeater2.default.setRepeatPlaylist(repeatState, playlist); 10990 _repeatElements2.default.syncRepeatPlaylist(playlist); 10991 } 10992 10993 /** 10994 * Sets the repeat state for the song. 10995 * 10996 * Public Accessor: Amplitude.setRepeatSong() 10997 * 10998 * @access public 10999 * @param {boolean} repeatState - The state you want the repeat song status to be in. 11000 */ 11001 function setRepeatSong(repeatState) { 11002 if (!_config2.default.is_touch_moving) { 11003 /* 11004 Sets repeat to the opposite of what it was set to 11005 */ 11006 _repeater2.default.setRepeatSong(!_config2.default.repeat_song); 11007 11008 /* 11009 Visually sync repeat song 11010 */ 11011 _repeatElements2.default.syncRepeatSong(); 11012 } 11013 } 11014 11015 /** 11016 * Gets the default album art for the player 11017 * 11018 * Public Accessor: Amplitude.getDefaultAlbumArt() 11019 * 11020 * @access public 11021 */ 11022 function getDefaultAlbumArt() { 11023 return _config2.default.default_album_art; 11024 } 11025 11026 /** 11027 * Gets the default playlist art for the playlists 11028 * 11029 * Public Accessor: Amplitude.getDefaultPlaylistArt() 11030 * 11031 * @access public 11032 */ 11033 function getDefaultPlaylistArt() { 11034 return _config2.default.default_playlist_art; 11035 } 11036 11037 /** 11038 * Sets the default album art for the player 11039 * 11040 * Public Accessor: Amplitude.setDefaultAlbumArt( url ) 11041 * 11042 * @access public 11043 * @param {string} url - A string representing the URL of the new default album art. 11044 */ 11045 function setDefaultAlbumArt(url) { 11046 _config2.default.default_album_art = url; 11047 } 11048 11049 /** 11050 * Sets the default playlist art for the player 11051 * 11052 * Public Accessor: Amplitude.setDefaultPlaylistArt( url ) 11053 * 11054 * @access public 11055 * @param {string} url - A string representing the URL of the new default playlist art. 11056 */ 11057 function setDefaultPlaylistArt(url) { 11058 _config2.default.default_plalist_art = url; 11059 } 11060 11061 /** 11062 * Allows the user to get the percentage of the song played. 11063 * 11064 * Public Accessor: Amplitude.getSongPlayedPercentage(); 11065 * 11066 * @access public 11067 */ 11068 function getSongPlayedPercentage() { 11069 /* 11070 Returns the percentage of the song played. 11071 */ 11072 return _config2.default.audio.currentTime / _config2.default.audio.duration * 100; 11073 } 11074 11075 /** 11076 * Allows the user to get the amount of seconds the song has played. 11077 * 11078 * Public Accessor: Amplitude.getSongPlayed(); 11079 * 11080 * @access public 11081 */ 11082 function getSongPlayedSeconds() { 11083 /* 11084 Returns the amount of seconds the song has played. 11085 */ 11086 return _config2.default.audio.currentTime; 11087 } 11088 11089 /** 11090 * Allows the user to get the duration of the current song 11091 * 11092 * Public Accessor: Amplitude.getSongPlayed(); 11093 * 11094 * @access public 11095 */ 11096 function getSongDuration() { 11097 /* 11098 Returns the duration of the current song 11099 */ 11100 return _config2.default.audio.duration; 11101 } 11102 11103 /** 11104 * Allows the user to set how far into the song they want to be. This is 11105 * helpful for implementing custom range sliders. Only works on the current song. 11106 * 11107 * Public Accessor: Amplitude.setSongPlayedPercentage( float ); 11108 * 11109 * @access public 11110 * @param {number} percentage - The percentage of the song played 11111 */ 11112 function setSongPlayedPercentage(percentage) { 11113 /* 11114 Ensures the percentage is a number and is between 0 and 100. 11115 */ 11116 if (typeof percentage == "number" && percentage > 0 && percentage < 100) { 11117 /* 11118 Sets the current time of the song to the percentage. 11119 */ 11120 _config2.default.audio.currentTime = _config2.default.audio.duration * (percentage / 100); 11121 } 11122 } 11123 11124 /** 11125 * Allows the user to turn on debugging. 11126 * 11127 * Public Accessor: Amplitude.setDebug( bool ); 11128 * 11129 * @access public 11130 * @param {boolean} state - Turns debugging on and off. 11131 */ 11132 function setDebug(state) { 11133 /* 11134 Sets the global config debug on or off. 11135 */ 11136 _config2.default.debug = state; 11137 } 11138 11139 /** 11140 * Returns the active song meta data for the user to do what is 11141 * needed. 11142 * 11143 * Public Accessor: Amplitude.getActiveSongMetadata(); 11144 * 11145 * @access public 11146 * @returns {object} JSON Object with the active song information 11147 */ 11148 function getActiveSongMetadata() { 11149 return _config2.default.active_metadata; 11150 } 11151 11152 /** 11153 * Returns the active playlist meta data for the for the user to use. 11154 * 11155 * Public Accessor: Amplitude.getActivePlaylistMetadata(); 11156 * 11157 * @access public 11158 * @returns {object} JSON representation for the active playlist 11159 */ 11160 function getActivePlaylistMetadata() { 11161 return _config2.default.playlists[_config2.default.active_playlist]; 11162 } 11163 11164 /** 11165 * Returns a song in the songs array at that index 11166 * 11167 * Public Accessor: Amplitude.getSongAtIndex( song_index ) 11168 * 11169 * @access public 11170 * @param {number} index - The integer for the index of the song in the songs array. 11171 * @returns {object} JSON representation for the song at a specific index. 11172 */ 11173 function getSongAtIndex(index) { 11174 return _config2.default.songs[index]; 11175 } 11176 11177 /** 11178 * Returns a song at a playlist index 11179 * 11180 * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index 11181 * 11182 * @access public 11183 * @param {number} index - The integer for the index of the song in the playlist. 11184 * @param {string} playlist - The key of the playlist we are getting the song at the index for 11185 * @returns {object} JSON representation for the song at a specific index. 11186 */ 11187 function getSongAtPlaylistIndex(playlist, index) { 11188 var song = _config2.default.playlists[playlist].songs[index]; 11189 11190 return song; 11191 } 11192 11193 /** 11194 * Adds a song to the end of the config array. This will allow Amplitude 11195 * to play the song in a playlist type setting. 11196 * 11197 * Public Accessor: Amplitude.addSong( song_json ) 11198 * 11199 * @access public 11200 * @param {object} song - JSON representation of a song. 11201 * @returns {number} New index of the song. 11202 */ 11203 function addSong(song) { 11204 /* 11205 Ensures we have a songs array to push to. 11206 */ 11207 if (_config2.default.songs == undefined) { 11208 _config2.default.songs = []; 11209 } 11210 11211 _config2.default.songs.push(song); 11212 11213 if (_config2.default.shuffle_on) { 11214 _config2.default.shuffle_list.push(song); 11215 } 11216 11217 if (_soundcloud2.default.isSoundCloudURL(song.url)) { 11218 _soundcloud2.default.resolveIndividualStreamableURL(song.url, null, _config2.default.songs.length - 1, _config2.default.shuffle_on); 11219 } 11220 11221 return _config2.default.songs.length - 1; 11222 } 11223 11224 /** 11225 * Adds a song to a playlist. This will allow Amplitude to play the song in the 11226 * playlist 11227 * 11228 * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key ) 11229 * 11230 * @access public 11231 * @param {object} song - JSON representation of a song. 11232 * @param {string} playlist - Playlist we are adding the song to. 11233 * @returns {mixed} New index of song in playlist or null if no playlist exists 11234 */ 11235 function addSongToPlaylist(song, playlist) { 11236 if (_config2.default.playlists[playlist] != undefined) { 11237 _config2.default.playlists[playlist].songs.push(song); 11238 11239 if (_config2.default.playlists[playlist].shuffle) { 11240 _config2.default.playlists[playlist].shuffle_list.push(song); 11241 } 11242 11243 if (_soundcloud2.default.isSoundCloudURL(song.url)) { 11244 _soundcloud2.default.resolveIndividualStreamableURL(song.url, playlist, _config2.default.playlists[playlist].songs.length - 1, _config2.default.playlists[playlist].shuffle); 11245 } 11246 11247 return _config2.default.playlists[playlist].songs.length - 1; 11248 } else { 11249 _debug2.default.writeMessage("Playlist doesn't exist!"); 11250 return null; 11251 } 11252 } 11253 11254 /** 11255 * Adds a playlist to Amplitude. 11256 * 11257 * @param {string} key - The key of the playlist we are adding. 11258 * @param {object} data - The data relating to the playlist 11259 * @param {array} songs - The songs to add to the playlist 11260 */ 11261 function addPlaylist(key, data, songs) { 11262 /* 11263 Ensures the playlist is not already defined. 11264 */ 11265 if (_config2.default.playlists[key] == undefined) { 11266 /* 11267 Initialize the new playlist object. 11268 */ 11269 _config2.default.playlists[key] = {}; 11270 11271 /* 11272 Define the ignored keys that we don't want to copy over. 11273 */ 11274 var ignoredKeys = ["repeat", "shuffle", "shuffle_list", "songs", "src"]; 11275 11276 /* 11277 Iterate over all of the keys defined by the user and 11278 set them on the playlist. 11279 */ 11280 for (var dataKey in data) { 11281 if (ignoredKeys.indexOf(dataKey) < 0) { 11282 _config2.default.playlists[key][dataKey] = data[dataKey]; 11283 } 11284 } 11285 11286 /* 11287 Initialize the default parameters for the playlist and set the songs. 11288 */ 11289 _config2.default.playlists[key].songs = songs; 11290 _config2.default.playlists[key].active_index = null; 11291 _config2.default.playlists[key].repeat = false; 11292 _config2.default.playlists[key].shuffle = false; 11293 _config2.default.playlists[key].shuffle_list = []; 11294 11295 return _config2.default.playlists[key]; 11296 } else { 11297 _debug2.default.writeMessage("A playlist already exists with that key!"); 11298 return null; 11299 } 11300 } 11301 11302 /** 11303 * Removes a song from the song array 11304 * 11305 * Public Accessor: Amplitude.removeSong( index ) 11306 * 11307 * @access public 11308 * @param {integer} index - Index of the song being removed 11309 * @returns {boolean} True if removed false if not. 11310 */ 11311 function removeSong(index) { 11312 _config2.default.songs.splice(index, 1); 11313 } 11314 11315 /** 11316 * Removes a song from the playlist 11317 * 11318 * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist ) 11319 * 11320 * @access public 11321 * @param {integer} index - Index of the song being removed from the playlist. 11322 * @param {string} playlist - Playlist we are removing the song from. 11323 * @returns {boolean} True if removed false if not. 11324 */ 11325 function removeSongFromPlaylist(index, playlist) { 11326 if (_config2.default.playlists[playlist] != undefined) { 11327 _config2.default.playlists[playlist].songs.splice(index, 1); 11328 } 11329 } 11330 11331 /** 11332 * When you pass a song object it plays that song right awawy. It sets 11333 * the active song in the config to the song you pass in and synchronizes 11334 * the visuals. 11335 * 11336 * Public Accessor: Amplitude.playNow( song ) 11337 * 11338 * @access public 11339 * @param {object} song - JSON representation of a song. 11340 */ 11341 function playNow(song) { 11342 /* 11343 Makes sure the song object has a URL associated with it 11344 or there will be nothing to play. 11345 */ 11346 if (song.url) { 11347 _config2.default.audio.src = song.url; 11348 _config2.default.active_metadata = song; 11349 _config2.default.active_album = song.album; 11350 } else { 11351 /* 11352 Write error message since the song passed in doesn't 11353 have a URL. 11354 */ 11355 _debug2.default.writeMessage("The song needs to have a URL!"); 11356 } 11357 11358 /* 11359 Plays the song. 11360 */ 11361 _core2.default.play(); 11362 11363 /* 11364 Sets the main song control status visual 11365 */ 11366 _playPauseElements2.default.sync(); 11367 11368 /* 11369 Update the song meta data 11370 */ 11371 _metaDataElements2.default.displayMetaData(); 11372 11373 /* 11374 Reset the song sliders, song progress bar info, and 11375 reset times. This ensures everything stays in sync. 11376 */ 11377 _songSliderElements2.default.resetElements(); 11378 11379 /* 11380 Reset the song played progress elements. 11381 */ 11382 _songPlayedProgressElements2.default.resetElements(); 11383 11384 /* 11385 Reset all of the current time elements. 11386 */ 11387 _timeElements2.default.resetCurrentTimes(); 11388 11389 /* 11390 Reset all of the duration time elements. 11391 */ 11392 _timeElements2.default.resetDurationTimes(); 11393 11394 /* 11395 Sets the state of the player. 11396 */ 11397 _configState2.default.setPlayerState(); 11398 } 11399 11400 /** 11401 * Plays a song at the index passed in from the songs array. 11402 * 11403 * Public Accessor: Amplitude.playSongAtIndex( index ) 11404 * 11405 * @access public 11406 * @param {number} index - The number representing the song in the songs array. 11407 */ 11408 function playSongAtIndex(index) { 11409 /* 11410 Stop the current song. 11411 */ 11412 _core2.default.stop(); 11413 11414 /* 11415 Determine if there is a new playlist, if so set the active playlist and change the song. 11416 */ 11417 if (_checks2.default.newPlaylist(null)) { 11418 _audioNavigation2.default.setActivePlaylist(null); 11419 11420 _audioNavigation2.default.changeSong(_config2.default.songs[index], index); 11421 } 11422 11423 /* 11424 Check if the song is new. If so, change the song. 11425 */ 11426 if (_checks2.default.newSong(null, index)) { 11427 _audioNavigation2.default.changeSong(_config2.default.songs[index], index); 11428 } 11429 11430 /* 11431 Play the song 11432 */ 11433 _core2.default.play(); 11434 11435 /* 11436 Sets the state of the player. 11437 */ 11438 _configState2.default.setPlayerState(); 11439 11440 /* 11441 Sync all of the play pause buttons. 11442 */ 11443 _playPauseElements2.default.sync(); 11444 } 11445 11446 /** 11447 * Plays a song at the index passed in for the playlist provided. The index passed 11448 * in should be the index of the song in the playlist and not the songs array. 11449 * 11450 * @access public 11451 * @param {number} index - The number representing the song in the playlist array. 11452 * @param {string} playlist - The key string representing the playlist we are playing the song from. 11453 * 11454 */ 11455 function playPlaylistSongAtIndex(index, playlist) { 11456 _core2.default.stop(); 11457 11458 /* 11459 Determine if there is a new playlist, if so set the active playlist and change the song. 11460 */ 11461 if (_checks2.default.newPlaylist(playlist)) { 11462 _audioNavigation2.default.setActivePlaylist(playlist); 11463 11464 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[index], index); 11465 } 11466 11467 /* 11468 Check if the song is new. If so, change the song. 11469 */ 11470 if (_checks2.default.newSong(playlist, index)) { 11471 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[index], index); 11472 } 11473 11474 /* 11475 Sync all of the play pause buttons. 11476 */ 11477 _playPauseElements2.default.sync(); 11478 11479 /* 11480 Play the song 11481 */ 11482 _core2.default.play(); 11483 11484 /* 11485 Set the state of the player 11486 */ 11487 _configState2.default.setPlayerState(); 11488 } 11489 11490 /** 11491 * Allows the user to play whatever the active song is directly 11492 * through Javascript. Normally ALL of Amplitude functions that access 11493 * the core features are called through event handlers. 11494 * 11495 * Public Accessor: Amplitude.play(); 11496 * 11497 * @access public 11498 */ 11499 function play() { 11500 _core2.default.play(); 11501 11502 _configState2.default.setPlayerState(); 11503 } 11504 11505 /** 11506 * Allows the user to pause whatever the active song is directly 11507 * through Javascript. Normally ALL of Amplitude functions that access 11508 * the core features are called through event handlers. 11509 * 11510 * Public Accessor: Amplitude.pause(); 11511 * 11512 * @access public 11513 */ 11514 function pause() { 11515 _core2.default.pause(); 11516 11517 _configState2.default.setPlayerState(); 11518 } 11519 11520 /** 11521 * Returns the audio object used to play the audio 11522 * 11523 * Public Accessor: Amplitude.getAudio(); 11524 * 11525 * @access public 11526 */ 11527 function getAudio() { 11528 return _config2.default.audio; 11529 } 11530 11531 /** 11532 * Returns the Web Audio API ANalyser used for visualizations. 11533 * 11534 * Public Accessor: Amplitude.getAnalyser() 11535 * 11536 * @access public 11537 */ 11538 function getAnalyser() { 11539 return _config2.default.analyser; 11540 } 11541 11542 /** 11543 * Plays the next song either in the playlist or globally. 11544 * 11545 * Public Accessor: Amplitude.next( playlist ); 11546 * 11547 * @access public 11548 * @param {string} [playlist = null - The playlist key 11549 */ 11550 function next() { 11551 var playlist = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 11552 11553 var nextData = {}; 11554 /* 11555 If the playlist is empty or null, then we check the active 11556 playlist 11557 */ 11558 if (playlist == "" || playlist == null) { 11559 /* 11560 If the active playlist is null, then we set the next global 11561 song or we set the next in the playlist. 11562 */ 11563 if (_config2.default.active_playlist == null || _config2.default.active_playlist == "") { 11564 _audioNavigation2.default.setNext(); 11565 } else { 11566 _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist); 11567 } 11568 } else { 11569 _audioNavigation2.default.setNextPlaylist(playlist); 11570 } 11571 } 11572 11573 /** 11574 * Plays the prev song either in the playlist or globally. 11575 * 11576 * Public Accessor: Amplitude.prev( playlist ); 11577 * 11578 * @access public 11579 * @param {string} [playlist = null] - The playlist key 11580 */ 11581 function prev() { 11582 var playlist = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 11583 11584 var prevData = {}; 11585 11586 /* 11587 If the playlist is empty or null, then we check the active 11588 playlist 11589 */ 11590 if (playlist == "" || playlist == null) { 11591 /* 11592 If the active playlist is null, then we set the prev global 11593 song or we set the prev in the playlist. 11594 */ 11595 if (_config2.default.active_playlist == null || _config2.default.active_playlist == "") { 11596 _audioNavigation2.default.setPrevious(); 11597 } else { 11598 _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist); 11599 } 11600 } else { 11601 _audioNavigation2.default.setPreviousPlaylist(playlist); 11602 } 11603 } 11604 11605 /** 11606 * Gets all of the songs in the songs array 11607 * 11608 * Public Accessor: Amplitude.getSongs( ); 11609 * 11610 * @access public 11611 */ 11612 function getSongs() { 11613 return _config2.default.songs; 11614 } 11615 11616 /** 11617 * Gets all of the songs in a playlist 11618 * 11619 * Public Accessor: Amplitude.getSongsInPlaylist( playlist ); 11620 * 11621 * @access public 11622 * @param {string} playlist - The playlist key 11623 */ 11624 function getSongsInPlaylist(playlist) { 11625 return _config2.default.playlists[playlist].songs; 11626 } 11627 11628 /** 11629 * Get current state of songs. If shuffled, this will return the shuffled 11630 * songs. 11631 * 11632 * Public Accessor: Amplitude.getSongsState(); 11633 * 11634 * @access public 11635 */ 11636 function getSongsState() { 11637 if (_config2.default.shuffle_on) { 11638 return _config2.default.shuffle_list; 11639 } else { 11640 return _config2.default.songs; 11641 } 11642 } 11643 11644 /** 11645 * Get current state of songs in playlist. If shuffled, this will return the 11646 * shuffled songs. 11647 * 11648 * Public Accessor: Amplitude.getSongsStatePlaylist( playlist ); 11649 * 11650 * @access public 11651 * @param {string} playlist - The playlist key 11652 */ 11653 function getSongsStatePlaylist(playlist) { 11654 if (_config2.default.playlists[playlist].shuffle) { 11655 return _config2.default.playlists[playlist].shuffle_list; 11656 } else { 11657 return _config2.default.playlists[playlist].songs; 11658 } 11659 } 11660 11661 /** 11662 * Gets the active index of the player 11663 * 11664 * Public Accessor: Amplitude.getActiveIndex() 11665 * 11666 * @access public 11667 */ 11668 function getActiveIndex() { 11669 return parseInt(_config2.default.active_index); 11670 } 11671 11672 /** 11673 * Get the version of AmplitudeJS 11674 * 11675 * Public Accessor: Amplitude.getVersion() 11676 * 11677 * @access public 11678 */ 11679 function getVersion() { 11680 return _config2.default.version; 11681 } 11682 11683 /** 11684 * Get the buffered amount for the current song 11685 * 11686 * Public Accessor: Amplitude.getBuffered() 11687 * 11688 * @access public 11689 */ 11690 function getBuffered() { 11691 return _config2.default.buffered; 11692 } 11693 11694 /** 11695 * Skip to a certain location in a selected song. 11696 * 11697 * Public Accessor: Amplitude.getBuffered() 11698 * 11699 * @access public 11700 * @param {number} seconds - The amount of seconds we should skip to in the song. 11701 * @param {number} songIndex - The index of the song in the songs array. 11702 * @param {string} [playlist = null] - The playlist the song we are skipping to belogns to. 11703 */ 11704 function skipTo(seconds, songIndex) { 11705 var playlist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 11706 11707 seconds = parseInt(seconds); 11708 11709 if (playlist != null) { 11710 /* 11711 Checks if we are skipping to a new playlist 11712 */ 11713 if (_checks2.default.newPlaylist(playlist)) { 11714 _audioNavigation2.default.setActivePlaylist(playlist); 11715 } 11716 11717 /* 11718 Changes the song to where it's being skipped and then 11719 play the song. 11720 */ 11721 _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[songIndex], songIndex); 11722 _core2.default.play(); 11723 11724 /* 11725 Sync all of the play pause elements. 11726 */ 11727 _playPauseElements2.default.syncGlobal(); 11728 _playPauseElements2.default.syncPlaylist(); 11729 _playPauseElements2.default.syncSong(); 11730 11731 /* 11732 Skip to the location in the song. 11733 */ 11734 _core2.default.skipToLocation(seconds); 11735 } else { 11736 /* 11737 Changes the song to where it's being skipped and then 11738 play the song. 11739 */ 11740 _audioNavigation2.default.changeSong(_config2.default.songs[songIndex], songIndex); 11741 _core2.default.play(); 11742 11743 /* 11744 Syncs all of the play pause buttons now that we've skipped. 11745 */ 11746 _playPauseElements2.default.syncGlobal(); 11747 _playPauseElements2.default.syncSong(); 11748 11749 /* 11750 Skip to the location in the song. 11751 */ 11752 _core2.default.skipToLocation(seconds); 11753 } 11754 } 11755 11756 /** 11757 * Sets the meta data for a song in the songs array. This will set any 11758 * meta data for a song besides the URL. The URL could cause issues if the 11759 * song was playing. 11760 * 11761 * Public Accessor: Amplitude.setSongMetaData() 11762 * 11763 * @access public 11764 * @param {number} index - The index of the song in the songs array. 11765 * @param {object} metaData - The object containing the meta data we are updating. 11766 * @param {string} playlist - The playlist we are updating the song meta data for. 11767 */ 11768 function setSongMetaData(index, metaData) { 11769 var playlist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 11770 11771 /* 11772 Update the meta data for a song in a playlist. 11773 */ 11774 if (playlist != "" && playlist != null && _config2.default.playlists[playlist] != undefined) { 11775 /* 11776 Set all of the defined meta data properties 11777 */ 11778 for (var key in metaData) { 11779 if (metaData.hasOwnProperty(key)) { 11780 if (key != "url" && key != "URL" && key != "live" && key != "LIVE") { 11781 _config2.default.playlists[playlist].songs[index][key] = metaData[key]; 11782 } 11783 } 11784 } 11785 } else { 11786 /* 11787 Update the meta data for a song. 11788 */ 11789 for (var key in metaData) { 11790 if (metaData.hasOwnProperty(key)) { 11791 if (key != "url" && key != "URL" && key != "live" && key != "LIVE") { 11792 _config2.default.songs[index][key] = metaData[key]; 11793 } 11794 } 11795 } 11796 } 11797 11798 /* 11799 Display the updates on the screen. 11800 */ 11801 _metaDataElements2.default.displayMetaData(); 11802 _metaDataElements2.default.syncMetaData(); 11803 } 11804 11805 function setPlaylistMetaData(playlist, metaData) { 11806 if (_config2.default.playlists[playlist] != undefined) { 11807 /* 11808 These are the ignored keys that we won't be worrying about displaying. 11809 Every other key in the playlist object can be displayed. 11810 */ 11811 var ignoredKeys = ["repeat", "shuffle", "shuffle_list", "songs", "src"]; 11812 11813 for (var key in metaData) { 11814 if (metaData.hasOwnProperty(key)) { 11815 if (ignoredKeys.indexOf(key) < 0) { 11816 _config2.default.playlists[playlist][key] = metaData[key]; 11817 } 11818 } 11819 } 11820 11821 _metaDataElements2.default.displayPlaylistMetaData(); 11822 } else { 11823 _debug2.default.writeMessage("You must provide a valid playlist key!"); 11824 } 11825 } 11826 11827 /** 11828 * Sets the delay between the songs when they are finished. 11829 * 11830 * Public Accessor: Amplitude.setDelay() 11831 * 11832 * @access public 11833 * @param {number} delay - The millisecond delay time between songs 11834 */ 11835 function setDelay(time) { 11836 _config2.default.delay = time; 11837 } 11838 11839 /** 11840 * Returns the current delay between songs. 11841 * 11842 * Public Accessor: Amplitude.getDelay() 11843 * 11844 * @access public 11845 */ 11846 function getDelay() { 11847 return _config2.default.delay; 11848 } 11849 11850 /** 11851 * Returns the state of the player. 11852 * 11853 * Public Accessor: Amplitude.getPlayerState(); 11854 */ 11855 function getPlayerState() { 11856 return _config2.default.player_state; 11857 } 11858 11859 /** 11860 * Registers a visualization and sets that visualization's 11861 * preferences. When creating a visualization, you can set certain 11862 * preferences that the user can overwrite similar to Amplitude. 11863 * Public Accessor: Amplitude.registerVisualization( visualization, preferences ) 11864 * 11865 * @param {object} visualzation A visualization object that gets registered 11866 * with Amplitude 11867 * 11868 * @param {object} preferences A JSON object of preferences relating to the 11869 * visualization 11870 */ 11871 function registerVisualization(visualization, preferences) { 11872 _visualizations2.default.register(visualization, preferences); 11873 } 11874 11875 /** 11876 * Set the visualization for the playlist 11877 * 11878 * @param {string} playlist - The playlist we are setting the visualization for. 11879 * @param {string} visualizationKey - The key of the visualization we are adding to the playlist. 11880 */ 11881 function setPlaylistVisualization(playlist, visualizationKey) { 11882 if (_config2.default.playlists[playlist] != undefined) { 11883 if (_config2.default.visualizations.available[visualizationKey] != undefined) { 11884 _config2.default.playlists[playlist].visualization = visualizationKey; 11885 } else { 11886 _debug2.default.writeMessage("A visualization does not exist for the key provided."); 11887 } 11888 } else { 11889 _debug2.default.writeMessage("The playlist for the key provided does not exist"); 11890 } 11891 } 11892 11893 /** 11894 * Set a visualization for the song. 11895 * 11896 * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for. 11897 * @param {string} visualizationKey - The key of the visualization we are adding to the playlist. 11898 */ 11899 function setSongVisualization(songIndex, visualizationKey) { 11900 if (_config2.default.songs[songIndex]) { 11901 if (_config2.default.visualizations.available[visualizationKey] != undefined) { 11902 _config2.default.songs[songIndex].visualization = visualizationKey; 11903 } else { 11904 _debug2.default.writeMessage("A visualization does not exist for the key provided."); 11905 } 11906 } else { 11907 _debug2.default.writeMessage("A song at that index is undefined"); 11908 } 11909 } 11910 11911 /** 11912 * Set song in playlist visualization. 11913 * 11914 * @param {string} playlist - The playlist we are setting the song visualization for. 11915 * @param {number} songIndex - The index we are setting the visualization for. 11916 * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist. 11917 */ 11918 function setSongInPlaylistVisualization(playlist, songIndex, visualizationKey) { 11919 if (_config2.default.playlists[playlist].songs[songIndex] != undefined) { 11920 if (_config2.default.visualizations.available[visualizationKey] != undefined) { 11921 _config2.default.playlists[playlist].songs[songIndex].visualization = visualizationKey; 11922 } else { 11923 _debug2.default.writeMessage("A visualization does not exist for the key provided."); 11924 } 11925 } else { 11926 _debug2.default.writeMessage("The song in the playlist at that key is not defined"); 11927 } 11928 } 11929 11930 /** 11931 * Sets the global visualization default. 11932 */ 11933 function setGlobalVisualization(visualizationKey) { 11934 if (_config2.default.visualizations.available[visualizationKey] != undefined) { 11935 _config2.default.visualization = visualizationKey; 11936 } else { 11937 _debug2.default.writeMessage("A visualization does not exist for the key provided."); 11938 } 11939 } 11940 11941 /** 11942 * Sets the active volume. 11943 * @param {number} volumeLevel - A number between 1 and 100 as a percentage of 11944 * min to max for a volume level. 11945 */ 11946 function setVolume(volumeLevel) { 11947 _core2.default.setVolume(volumeLevel); 11948 } 11949 11950 /** 11951 * Gets the active volume. 11952 */ 11953 function getVolume() { 11954 return _config2.default.volume; 11955 } 11956 11957 /* 11958 Returns all of the publically accesible methods. 11959 */ 11960 return { 11961 init: init, 11962 getConfig: getConfig, 11963 bindNewElements: bindNewElements, 11964 getActivePlaylist: getActivePlaylist, 11965 getPlaybackSpeed: getPlaybackSpeed, 11966 setPlaybackSpeed: setPlaybackSpeed, 11967 getRepeat: getRepeat, 11968 getRepeatPlaylist: getRepeatPlaylist, 11969 getShuffle: getShuffle, 11970 getShufflePlaylist: getShufflePlaylist, 11971 setShuffle: setShuffle, 11972 setShufflePlaylist: setShufflePlaylist, 11973 setRepeat: setRepeat, 11974 setRepeatSong: setRepeatSong, 11975 setRepeatPlaylist: setRepeatPlaylist, 11976 getDefaultAlbumArt: getDefaultAlbumArt, 11977 setDefaultAlbumArt: setDefaultAlbumArt, 11978 getDefaultPlaylistArt: getDefaultPlaylistArt, 11979 setDefaultPlaylistArt: setDefaultPlaylistArt, 11980 getSongPlayedPercentage: getSongPlayedPercentage, 11981 setSongPlayedPercentage: setSongPlayedPercentage, 11982 getSongPlayedSeconds: getSongPlayedSeconds, 11983 getSongDuration: getSongDuration, 11984 setDebug: setDebug, 11985 getActiveSongMetadata: getActiveSongMetadata, 11986 getActivePlaylistMetadata: getActivePlaylistMetadata, 11987 getSongAtIndex: getSongAtIndex, 11988 getSongAtPlaylistIndex: getSongAtPlaylistIndex, 11989 addSong: addSong, 11990 addSongToPlaylist: addSongToPlaylist, 11991 removeSong: removeSong, 11992 removeSongFromPlaylist: removeSongFromPlaylist, 11993 playNow: playNow, 11994 playSongAtIndex: playSongAtIndex, 11995 playPlaylistSongAtIndex: playPlaylistSongAtIndex, 11996 play: play, 11997 pause: pause, 11998 getAudio: getAudio, 11999 getAnalyser: getAnalyser, 12000 next: next, 12001 prev: prev, 12002 getSongs: getSongs, 12003 getSongsInPlaylist: getSongsInPlaylist, 12004 getSongsState: getSongsState, 12005 getSongsStatePlaylist: getSongsStatePlaylist, 12006 getActiveIndex: getActiveIndex, 12007 getVersion: getVersion, 12008 getBuffered: getBuffered, 12009 skipTo: skipTo, 12010 setSongMetaData: setSongMetaData, 12011 setPlaylistMetaData: setPlaylistMetaData, 12012 setDelay: setDelay, 12013 getDelay: getDelay, 12014 getPlayerState: getPlayerState, 12015 addPlaylist: addPlaylist, 12016 registerVisualization: registerVisualization, 12017 setPlaylistVisualization: setPlaylistVisualization, 12018 setSongVisualization: setSongVisualization, 12019 setSongInPlaylistVisualization: setSongInPlaylistVisualization, 12020 setGlobalVisualization: setGlobalVisualization, 12021 getVolume: getVolume, 12022 setVolume: setVolume 12023 }; 12024}(); 12025 12026/** 12027 * Playback Speed Elements 12028 * @module visual/PlaybackSpeedElements 12029 */ 12030 12031 12032/** 12033 * Play Pause Elements 12034 * @module visual/PlayPauseElements 12035 */ 12036 12037 12038/** 12039 * Song Played Progress Elements 12040 * @module visual/SongPlayedProgressElements 12041 */ 12042 12043 12044/** 12045 * Visual Repeat Elements 12046 * @module visual/RepeatElements 12047 */ 12048 12049 12050/**************************************************** 12051 * FX Modules 12052 ****************************************************/ 12053/** 12054 * Imports the visualizations module 12055 * @module fx/Visualizations 12056 */ 12057 12058 12059/** 12060 * Repeater Module 12061 * 12062 * @module utilities/Repeater 12063 */ 12064 12065 12066/** 12067 * Imports the config state module. 12068 * @module ConfigState 12069 */ 12070 12071 12072/**************************************************** 12073 * Core 12074 ****************************************************/ 12075/** 12076 * AmplitudeJS Core Module 12077 * 12078 * @module core/Core 12079 */ 12080/** 12081 * @name Amplitude.js 12082 * @author Dan Pastori (521 Dimensions) <[email protected]> 12083 */ 12084/** 12085 * AmplitudeJS Initializer Module 12086 * 12087 * @module init/AmplitudeInitializer 12088 */ 12089exports.default = Amplitude; 12090module.exports = exports["default"]; 12091 12092/***/ }), 12093/* 48 */ 12094/***/ (function(module, exports, __webpack_require__) { 12095 12096"use strict"; 12097 12098 12099Object.defineProperty(exports, "__esModule", { 12100 value: true 12101}); 12102 12103var _config = __webpack_require__(0); 12104 12105var _config2 = _interopRequireDefault(_config); 12106 12107var _debug = __webpack_require__(4); 12108 12109var _debug2 = _interopRequireDefault(_debug); 12110 12111var _checks = __webpack_require__(5); 12112 12113var _checks2 = _interopRequireDefault(_checks); 12114 12115var _metaDataElements = __webpack_require__(8); 12116 12117var _metaDataElements2 = _interopRequireDefault(_metaDataElements); 12118 12119var _soundcloud = __webpack_require__(17); 12120 12121var _soundcloud2 = _interopRequireDefault(_soundcloud); 12122 12123function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12124 12125/** 12126 * Handles the initialization of the playlists. 12127 * 12128 * @module init/PlaylistsInitializer 12129 */ 12130 12131 12132/** 12133 * AmplitudeJS Visual Meta Data Elements Module 12134 * @module visual/MetaDataElements 12135 */ 12136 12137 12138/** 12139 * AmplitudeJS Debug Module 12140 * @module utilities/Debug 12141 */ 12142var PlaylistsInitializer = function () { 12143 /** 12144 * Initializes the playlists for AmplitudeJS 12145 * 12146 * @param {Object} playlists - The playlists defined by the user. 12147 */ 12148 function initialize(playlists) { 12149 /* 12150 Copy the playlists over to Amplitude 12151 */ 12152 _config2.default.playlists = playlists; 12153 12154 /* 12155 Copy songs over from songs array. 12156 */ 12157 copySongsToPlaylists(); 12158 12159 /* 12160 Grab any SoundCloud Data for the playlist songs if needed. 12161 */ 12162 grabSoundCloudData(); 12163 12164 /* 12165 Initialize a scoped active index for each playlist. 12166 */ 12167 initializePlaylistActiveIndexes(); 12168 12169 /* 12170 Initialize the shuffle status of the playlists. 12171 */ 12172 initializePlaylistShuffleStatuses(); 12173 12174 /* 12175 Initialize the repeat status for the playlits. 12176 */ 12177 initializePlaylistsRepeatStatuses(); 12178 12179 /* 12180 Initialize temporary place holders for shuffle lists. 12181 */ 12182 initializePlaylistShuffleLists(); 12183 12184 /* 12185 Initializes the first song in the playlist 12186 */ 12187 initializeFirstSongInPlaylistMetaData(); 12188 } 12189 12190 /** 12191 * Initializes a scoped active index for each playlist. 12192 * 12193 * @access private 12194 */ 12195 function initializePlaylistActiveIndexes() { 12196 /* 12197 Iterate over all of the playlists defined by the user 12198 and add an active index. 12199 */ 12200 for (var key in _config2.default.playlists) { 12201 _config2.default.playlists[key].active_index = null; 12202 } 12203 } 12204 12205 /** 12206 * Ensures the indexes in the playlists are valid indexes. The song has 12207 * to exist in the Amplitude config to be played correctly. If the index 12208 * is an integer, we ensure it exists and coy it to the array. 12209 * 12210 * @access private 12211 */ 12212 function copySongsToPlaylists() { 12213 /* 12214 Iterate over all of the config's playlists 12215 */ 12216 for (var key in _config2.default.playlists) { 12217 /* 12218 Checks if the playlist key is accurate. 12219 */ 12220 if (_config2.default.playlists.hasOwnProperty(key)) { 12221 /* 12222 Checks if the playlist has songs. 12223 */ 12224 if (_config2.default.playlists[key].songs) { 12225 /* 12226 Iterate over all of the songs in the playlist 12227 */ 12228 for (var i = 0; i < _config2.default.playlists[key].songs.length; i++) { 12229 if (_checks2.default.isInt(_config2.default.playlists[key].songs[i])) { 12230 _config2.default.playlists[key].songs[i] = _config2.default.songs[_config2.default.playlists[key].songs[i]]; 12231 12232 _config2.default.playlists[key].songs[i].index = i; 12233 } 12234 /* 12235 Check to see if the index for the song in the playlist 12236 exists in the songs config. 12237 */ 12238 if (_checks2.default.isInt(_config2.default.playlists[key].songs[i]) && !_config2.default.songs[_config2.default.playlists[key].songs[i]]) { 12239 _debug2.default.writeMessage("The song index: " + _config2.default.playlists[key].songs[i] + " in playlist with key: " + key + " is not defined in your songs array!"); 12240 } 12241 12242 /* 12243 If not an int, then is a dedicated song, just set the index. 12244 */ 12245 if (!_checks2.default.isInt(_config2.default.playlists[key].songs[i])) { 12246 _config2.default.playlists[key].songs[i].index = i; 12247 } 12248 } 12249 } 12250 } 12251 } 12252 } 12253 12254 /** 12255 * Grabs the SoundCloud data for any song in the playlist that 12256 * the user needs to grab data for. 12257 * 12258 * @access private 12259 */ 12260 function grabSoundCloudData() { 12261 /* 12262 Iterate over all of the config's playlists 12263 */ 12264 for (var key in _config2.default.playlists) { 12265 /* 12266 Checks if the playlist key is accurate. 12267 */ 12268 if (_config2.default.playlists.hasOwnProperty(key)) { 12269 /* 12270 Iterate over all of the songs in the playlist and see if 12271 they need to grab the SoundCloud data for the song. 12272 */ 12273 for (var i = 0; i < _config2.default.playlists[key].songs.length; i++) { 12274 /* 12275 Only Grab the data if the URL is a SoundCloud URL. 12276 */ 12277 if (_soundcloud2.default.isSoundCloudURL(_config2.default.playlists[key].songs[i].url)) { 12278 /* 12279 Only grab the data if the SoundCloud data has not already been 12280 grabbed for the audio. This could happen if the user defined the 12281 song in the songs array and was grabbed before. 12282 */ 12283 if (_config2.default.playlists[key].songs[i].soundcloud_data == undefined) { 12284 _soundcloud2.default.resolveIndividualStreamableURL(_config2.default.playlists[key].songs[i].url, key, i); 12285 } 12286 } 12287 } 12288 } 12289 } 12290 } 12291 12292 /** 12293 * Initializes the shuffle statuses for each of the playlists. These will 12294 * be referenced when we shuffle individual playlists. 12295 * 12296 * @access private 12297 */ 12298 function initializePlaylistShuffleStatuses() { 12299 /* 12300 Iterate over all of the playlists the user defined adding 12301 the playlist key to the shuffled playlist array and creating 12302 and empty object to house the statuses. 12303 */ 12304 for (var key in _config2.default.playlists) { 12305 _config2.default.playlists[key].shuffle = false; 12306 } 12307 } 12308 12309 /** 12310 * Initializes the repeat statuses for each of the playlists. These will 12311 * be referenced when we repeat individual playlits. 12312 * 12313 * @access private 12314 */ 12315 function initializePlaylistsRepeatStatuses() { 12316 /* 12317 Iterate over all of the playlists the user defined adding 12318 the playlist key to the repeated playlist array and creating 12319 and empty object to house the statuses. 12320 */ 12321 for (var key in _config2.default.playlists) { 12322 _config2.default.playlists[key].repeat = false; 12323 } 12324 } 12325 12326 /** 12327 * Initializes the shuffled playlist placeholders. These will be set for 12328 * playlists that are shuffled and contain the shuffled songs. 12329 * 12330 * @access private 12331 */ 12332 function initializePlaylistShuffleLists() { 12333 /* 12334 Iterate over all of the playlists the user defined adding 12335 the playlist key to the shuffled playlists array and creating 12336 and empty object to house the shuffled playlists 12337 */ 12338 for (var key in _config2.default.playlists) { 12339 _config2.default.playlists[key].shuffle_list = []; 12340 } 12341 } 12342 12343 /** 12344 * Intializes the display for the first song in the playlist meta data. 12345 * 12346 * @access private 12347 */ 12348 function initializeFirstSongInPlaylistMetaData() { 12349 /* 12350 Iterates over all of the playlists setting the meta data for the 12351 first song. 12352 */ 12353 for (var key in _config2.default.playlists) { 12354 _metaDataElements2.default.setFirstSongInPlaylist(_config2.default.playlists[key].songs[0], key); 12355 } 12356 } 12357 12358 /* 12359 Returns the public facing methods 12360 */ 12361 return { 12362 initialize: initialize 12363 }; 12364}(); 12365 12366/** 12367 * AmplitudeJS SoundCloud Meta module 12368 * @module soundcloud/Soundcloud 12369 */ 12370 12371 12372/** 12373 * AmplitudeJS Checks Utility. 12374 * @module utilities/Checks 12375 */ 12376/** 12377 * Imports the config module 12378 * @module config 12379 */ 12380exports.default = PlaylistsInitializer; 12381module.exports = exports["default"]; 12382 12383/***/ }), 12384/* 49 */ 12385/***/ (function(module, exports, __webpack_require__) { 12386 12387"use strict"; 12388 12389 12390Object.defineProperty(exports, "__esModule", { 12391 value: true 12392}); 12393 12394var _config = __webpack_require__(0); 12395 12396var _config2 = _interopRequireDefault(_config); 12397 12398function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12399 12400/** 12401 * Handles all of the container elements. 12402 * 12403 * @param visual/ContainerElements 12404 */ 12405var ContainerElements = function () { 12406 /** 12407 * Applies the class 'amplitude-active-song-container' to the element 12408 * containing visual information regarding the active song. 12409 * 12410 * @access public 12411 */ 12412 function setActive() { 12413 /* 12414 Gets all of the song container elements. 12415 */ 12416 var songContainers = document.getElementsByClassName("amplitude-song-container"); 12417 12418 /* 12419 Removes all of the active song containrs. 12420 */ 12421 for (var i = 0; i < songContainers.length; i++) { 12422 songContainers[i].classList.remove("amplitude-active-song-container"); 12423 } 12424 12425 /* 12426 Finds the active index and adds the active song container to the element 12427 that represents the song at the index. 12428 */ 12429 if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) { 12430 var activeIndex = ''; 12431 12432 if (_config2.default.shuffle_on) { 12433 activeIndex = _config2.default.shuffle_list[_config2.default.active_index].index; 12434 } else { 12435 activeIndex = _config2.default.active_index; 12436 } 12437 12438 if (document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activeIndex + '"]')) { 12439 var _songContainers = document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activeIndex + '"]'); 12440 12441 for (var _i = 0; _i < _songContainers.length; _i++) { 12442 if (!_songContainers[_i].hasAttribute("data-amplitude-playlist")) { 12443 _songContainers[_i].classList.add("amplitude-active-song-container"); 12444 } 12445 } 12446 } 12447 } else { 12448 if (_config2.default.active_playlist != null && _config2.default.active_playlist != '') { 12449 var activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].active_index; 12450 } else { 12451 var activePlaylistIndex = ''
vendor: 43,839 bytes, lines 12451-13893
12451; 12452 12453 if (_config2.default.playlists[_config2.default.active_playlist].shuffle) { 12454 activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].shuffle_list[_config2.default.playlists[_config2.default.active_playlist].active_index].index; 12455 } else { 12456 activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].active_index; 12457 } 12458 } 12459 12460 if (document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]')) { 12461 var _songContainers2 = document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 12462 12463 for (var _i2 = 0; _i2 < _songContainers2.length; _i2++) { 12464 _songContainers2[_i2].classList.add("amplitude-active-song-container"); 12465 } 12466 } 12467 } 12468 } 12469 12470 return { 12471 setActive: setActive 12472 }; 12473}(); /** 12474 * Imports the config module 12475 * @module config 12476 */ 12477exports.default = ContainerElements; 12478module.exports = exports["default"]; 12479 12480/***/ }), 12481/* 50 */ 12482/***/ (function(module, exports, __webpack_require__) { 12483 12484"use strict"; 12485 12486 12487Object.defineProperty(exports, "__esModule", { 12488 value: true 12489}); 12490 12491var _config = __webpack_require__(0); 12492 12493var _config2 = _interopRequireDefault(_config); 12494 12495function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12496 12497/** 12498 * Handles all of the current time hour elements. 12499 * 12500 * @module visual/time/CurrentHourElements 12501 */ 12502var CurrentHourElements = function () { 12503 function sync(hours) { 12504 syncGlobal(hours); 12505 syncPlaylist(hours); 12506 syncSong(hours); 12507 syncSongInPlaylist(hours); 12508 } 12509 12510 /** 12511 * Updates any elements that display the current hour for the song. 12512 * 12513 * @access public 12514 * @param {number} hours - An integer conaining how many hours into the song. 12515 */ 12516 function syncGlobal(hours) { 12517 /* 12518 Get all of the hour selectors 12519 */ 12520 var currentHourSelectors = document.querySelectorAll(".amplitude-current-hours"); 12521 12522 /* 12523 Set the current hour selector's inner html to hours passed in. 12524 */ 12525 for (var i = 0; i < currentHourSelectors.length; i++) { 12526 var playlist = currentHourSelectors[i].getAttribute("data-amplitude-playlist"); 12527 var songIndex = currentHourSelectors[i].getAttribute("data-amplitude-song-index"); 12528 12529 /* 12530 Updates the current hour selector for a global display. 12531 */ 12532 if (playlist == null && songIndex == null) { 12533 currentHourSelectors[i].innerHTML = hours; 12534 } 12535 } 12536 } 12537 12538 /** 12539 * Syncs the playlist current hour elements. 12540 * 12541 * @param {Integer} hour - The current audio hour. 12542 */ 12543 function syncPlaylist(hours) { 12544 /* 12545 Get all of the hour selectors 12546 */ 12547 var currentHourPlaylistSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 12548 12549 /* 12550 Set the current hour selector's inner html to hours passed in. 12551 */ 12552 for (var i = 0; i < currentHourPlaylistSelectors.length; i++) { 12553 var songIndex = currentHourPlaylistSelectors[i].getAttribute("data-amplitude-song-index"); 12554 12555 /* 12556 Updates the current hour selector for a global display. 12557 */ 12558 if (songIndex == null) { 12559 currentHourPlaylistSelectors[i].innerHTML = hours; 12560 } 12561 } 12562 } 12563 12564 /** 12565 * Syncs the song hour elements. 12566 * 12567 * @param {Integer} hour - The current audio hour. 12568 */ 12569 function syncSong(hours) { 12570 if (_config2.default.active_playlist == null) { 12571 /* 12572 Get all of the hour selectors 12573 */ 12574 var currentHourSongSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 12575 12576 /* 12577 Set the current hour selector's inner html to hours passed in. 12578 */ 12579 for (var i = 0; i < currentHourSongSelectors.length; i++) { 12580 var playlist = currentHourSongSelectors[i].getAttribute("data-amplitude-playlist"); 12581 12582 /* 12583 Updates the current hour selector for a global display. 12584 */ 12585 if (playlist == null) { 12586 currentHourSongSelectors[i].innerHTML = hours; 12587 } 12588 } 12589 } 12590 } 12591 12592 /** 12593 * Syncs the song in playlist song hour elements. 12594 * 12595 * @param {Integer} hour - The current audio hour. 12596 */ 12597 function syncSongInPlaylist(hours) { 12598 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 12599 /* 12600 Get all of the hour selectors 12601 */ 12602 var currentHourPlaylistSongSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 12603 12604 /* 12605 Set the current hour selector's inner html to hours passed in. 12606 */ 12607 for (var i = 0; i < currentHourPlaylistSongSelectors.length; i++) { 12608 currentHourPlaylistSongSelectors[i].innerHTML = hours; 12609 } 12610 } 12611 12612 /** 12613 * Reset the current hour elements. 12614 */ 12615 function resetTimes() { 12616 /* 12617 Gets the hour display elements 12618 */ 12619 var hourSelectors = document.querySelectorAll(".amplitude-current-hours"); 12620 12621 /* 12622 Iterates over all of the hour selectors and sets the inner HTML 12623 to 00. 12624 */ 12625 for (var i = 0; i < hourSelectors.length; i++) { 12626 hourSelectors[i].innerHTML = "00"; 12627 } 12628 } 12629 12630 /** 12631 * Returns the publically facing methods. 12632 */ 12633 return { 12634 sync: sync, 12635 resetTimes: resetTimes 12636 }; 12637}(); /** 12638 * Imports the config module 12639 * @module config 12640 */ 12641exports.default = CurrentHourElements; 12642module.exports = exports["default"]; 12643 12644/***/ }), 12645/* 51 */ 12646/***/ (function(module, exports, __webpack_require__) { 12647 12648"use strict"; 12649 12650 12651Object.defineProperty(exports, "__esModule", { 12652 value: true 12653}); 12654 12655var _config = __webpack_require__(0); 12656 12657var _config2 = _interopRequireDefault(_config); 12658 12659function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12660 12661/** 12662 * Handles all of the current time minutes elements. 12663 * 12664 * @module visual/time/CurrentMinuteElements 12665 */ 12666var CurrentMinuteElements = function () { 12667 /** 12668 * Syncs the current minutes elements. 12669 * 12670 * @param {Integer} minutes - The current audio minutes. 12671 */ 12672 function sync(minutes) { 12673 syncGlobal(minutes); 12674 syncPlaylist(minutes); 12675 syncSong(minutes); 12676 syncSongInPlaylist(minutes); 12677 } 12678 12679 /** 12680 * Syncs the global current minutes elements. 12681 * 12682 * @param {Integer} minutes - The current audio minutes. 12683 */ 12684 function syncGlobal(minutes) { 12685 /* 12686 Get all of the minute selectors 12687 */ 12688 var currentMinuteSelectors = document.querySelectorAll(".amplitude-current-minutes"); 12689 12690 /* 12691 Set the current minute selector's inner html to minutes passed in. 12692 */ 12693 for (var i = 0; i < currentMinuteSelectors.length; i++) { 12694 var playlist = currentMinuteSelectors[i].getAttribute("data-amplitude-playlist"); 12695 var songIndex = currentMinuteSelectors[i].getAttribute("data-amplitude-song-index"); 12696 12697 /* 12698 Updates the current minute selector for a global display. 12699 */ 12700 if (playlist == null && songIndex == null) { 12701 currentMinuteSelectors[i].innerHTML = minutes; 12702 } 12703 } 12704 } 12705 12706 /** 12707 * Syncs the playlist minutes elements. 12708 * 12709 * @param {Integer} minutes - The current audio minutes. 12710 */ 12711 function syncPlaylist(minutes) { 12712 /* 12713 Get all of the minute selectors 12714 */ 12715 var currentMinutePlaylistSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 12716 12717 /* 12718 Set the current minute selector's inner html to minutes passed in. 12719 */ 12720 for (var i = 0; i < currentMinutePlaylistSelectors.length; i++) { 12721 var songIndex = currentMinutePlaylistSelectors[i].getAttribute("data-amplitude-song-index"); 12722 12723 /* 12724 Updates the current minute selector for a global display. 12725 */ 12726 if (songIndex == null) { 12727 currentMinutePlaylistSelectors[i].innerHTML = minutes; 12728 } 12729 } 12730 } 12731 12732 /** 12733 * Syncs the current song minutes elements. 12734 * 12735 * @param {Integer} minutes - The current audio minutes. 12736 */ 12737 function syncSong(minutes) { 12738 if (_config2.default.active_playlist == null) { 12739 /* 12740 Get all of the minute selectors 12741 */ 12742 var currentMinuteSongSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 12743 12744 /* 12745 Set the current minute selector's inner html to minutes passed in. 12746 */ 12747 for (var i = 0; i < currentMinuteSongSelectors.length; i++) { 12748 var playlist = currentMinuteSongSelectors[i].getAttribute("data-amplitude-playlist"); 12749 12750 /* 12751 Updates the current minute selector for a global display. 12752 */ 12753 if (playlist == null) { 12754 currentMinuteSongSelectors[i].innerHTML = minutes; 12755 } 12756 } 12757 } 12758 } 12759 12760 /** 12761 * Syncs the current song in playlist minutes elements. 12762 * 12763 * @param {Integer} minutes - The current audio minutes. 12764 */ 12765 function syncSongInPlaylist(minutes) { 12766 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 12767 12768 /* 12769 Get all of the minute selectors 12770 */ 12771 var currentMinutePlaylistSongSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 12772 12773 /* 12774 Set the current minute selector's inner html to minutes passed in. 12775 */ 12776 for (var i = 0; i < currentMinutePlaylistSongSelectors.length; i++) { 12777 currentMinutePlaylistSongSelectors[i].innerHTML = minutes; 12778 } 12779 } 12780 12781 /** 12782 * Reset the current times. 12783 */ 12784 function resetTimes() { 12785 /* 12786 Gets the minute display elements 12787 */ 12788 var minuteSelectors = document.querySelectorAll(".amplitude-current-minutes"); 12789 12790 /* 12791 Iterates over all of the minute selectors and sets the inner HTML 12792 to 00. 12793 */ 12794 for (var i = 0; i < minuteSelectors.length; i++) { 12795 minuteSelectors[i].innerHTML = "00"; 12796 } 12797 } 12798 12799 /** 12800 * Returns the publically facing methods. 12801 */ 12802 return { 12803 sync: sync, 12804 resetTimes: resetTimes 12805 }; 12806}(); /** 12807 * Imports the config module 12808 * @module config 12809 */ 12810exports.default = CurrentMinuteElements; 12811module.exports = exports["default"]; 12812 12813/***/ }), 12814/* 52 */ 12815/***/ (function(module, exports, __webpack_require__) { 12816 12817"use strict"; 12818 12819 12820Object.defineProperty(exports, "__esModule", { 12821 value: true 12822}); 12823 12824var _config = __webpack_require__(0); 12825 12826var _config2 = _interopRequireDefault(_config); 12827 12828function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12829 12830/** 12831 * Handles all of the current time seconds elements. 12832 * 12833 * @module visual/time/CurrentSecondElements 12834 */ 12835var CurrentSecondElements = function () { 12836 /** 12837 * Syncs the current seconds elements. 12838 * 12839 * @param {Integer} seconds - The current audio seconds. 12840 */ 12841 function sync(seconds) { 12842 syncGlobal(seconds); 12843 syncPlaylist(seconds); 12844 syncSong(seconds); 12845 syncSongInPlaylist(seconds); 12846 } 12847 12848 /** 12849 * Syncs the global current seconds elements. 12850 * 12851 * @param {Integer} seconds - The current audio seconds. 12852 */ 12853 function syncGlobal(seconds) { 12854 /* 12855 Get all of the second selectors 12856 */ 12857 var currentSecondSelectors = document.querySelectorAll(".amplitude-current-seconds"); 12858 12859 /* 12860 Set the current second selector's inner html to seconds passed in. 12861 */ 12862 for (var i = 0; i < currentSecondSelectors.length; i++) { 12863 var playlist = currentSecondSelectors[i].getAttribute("data-amplitude-playlist"); 12864 var songIndex = currentSecondSelectors[i].getAttribute("data-amplitude-song-index"); 12865 12866 /* 12867 Updates the current second selector for a global display. 12868 */ 12869 if (playlist == null && songIndex == null) { 12870 currentSecondSelectors[i].innerHTML = seconds; 12871 } 12872 } 12873 } 12874 12875 /** 12876 * Syncs the playlist seconds elements. 12877 * 12878 * @param {Integer} seconds - The current audio seconds. 12879 */ 12880 function syncPlaylist(seconds) { 12881 /* 12882 Get all of the second selectors 12883 */ 12884 var currentSecondPlaylistSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 12885 12886 /* 12887 Set the current second selector's inner html to seconds passed in. 12888 */ 12889 for (var i = 0; i < currentSecondPlaylistSelectors.length; i++) { 12890 var songIndex = currentSecondPlaylistSelectors[i].getAttribute("data-amplitude-song-index"); 12891 12892 /* 12893 Updates the current second selector for a global display. 12894 */ 12895 if (songIndex == null) { 12896 currentSecondPlaylistSelectors[i].innerHTML = seconds; 12897 } 12898 } 12899 } 12900 12901 /** 12902 * Syncs the current song seconds elements. 12903 * 12904 * @param {Integer} seconds - The current audio seconds. 12905 */ 12906 function syncSong(seconds) { 12907 if (_config2.default.active_playlist == null) { 12908 /* 12909 Get all of the second selectors 12910 */ 12911 var currentSecondSongSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 12912 12913 /* 12914 Set the current second selector's inner html to seconds passed in. 12915 */ 12916 for (var i = 0; i < currentSecondSongSelectors.length; i++) { 12917 var playlist = currentSecondSongSelectors[i].getAttribute("data-amplitude-playlist"); 12918 12919 /* 12920 Updates the current second selector for a global display. 12921 */ 12922 if (playlist == null) { 12923 currentSecondSongSelectors[i].innerHTML = seconds; 12924 } 12925 } 12926 } 12927 } 12928 12929 /** 12930 * Syncs the current song in playlist seconds elements. 12931 * 12932 * @param {Integer} seconds - The current audio seconds. 12933 */ 12934 function syncSongInPlaylist(seconds) { 12935 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 12936 /* 12937 Get all of the second selectors 12938 */ 12939 var currentSecondPlaylistSongSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 12940 12941 /* 12942 Set the current second selector's inner html to seconds passed in. 12943 */ 12944 for (var i = 0; i < currentSecondPlaylistSongSelectors.length; i++) { 12945 currentSecondPlaylistSongSelectors[i].innerHTML = seconds; 12946 } 12947 } 12948 12949 /** 12950 * Reset the current seconds elements. 12951 */ 12952 function resetTimes() { 12953 /* 12954 Gets the second display elements 12955 */ 12956 var secondSelectors = document.querySelectorAll(".amplitude-current-seconds"); 12957 12958 /* 12959 Iterates over all of the second selectors and sets the inner HTML 12960 to 00. 12961 */ 12962 for (var i = 0; i < secondSelectors.length; i++) { 12963 secondSelectors[i].innerHTML = "00"; 12964 } 12965 } 12966 12967 /** 12968 * Returns the publically facing methods. 12969 */ 12970 return { 12971 sync: sync, 12972 resetTimes: resetTimes 12973 }; 12974}(); /** 12975 * Imports the config module 12976 * @module config 12977 */ 12978exports.default = CurrentSecondElements; 12979module.exports = exports["default"]; 12980 12981/***/ }), 12982/* 53 */ 12983/***/ (function(module, exports, __webpack_require__) { 12984 12985"use strict"; 12986 12987 12988Object.defineProperty(exports, "__esModule", { 12989 value: true 12990}); 12991 12992var _config = __webpack_require__(0); 12993 12994var _config2 = _interopRequireDefault(_config); 12995 12996function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12997 12998/** 12999 * These methods help sync visual time elements. 13000 * 13001 * @module visual/CurrentTimeElements 13002 */ 13003var CurrentTimeElements = function () { 13004 /** 13005 * Visually displays the current time on the screen. This is called on 13006 * time update for the current song. 13007 * 13008 * @access public 13009 * @param {object} currentTime - An object containing the current time for the song in seconds, minutes, and hours. 13010 */ 13011 function sync(currentTime) { 13012 /* 13013 Set current time display. 13014 */ 13015 syncGlobal(currentTime); 13016 syncPlaylist(currentTime); 13017 syncSong(currentTime); 13018 syncSongInPlaylist(currentTime); 13019 } 13020 13021 /** 13022 * Updates any elements that display the current time for the song. This 13023 * is a computed field that will be commonly used. 13024 * 13025 * @access public 13026 * @param {object} time - A json object conaining the parts for the current time for the song. 13027 */ 13028 function syncGlobal(time) { 13029 /* 13030 Get all of the time selectors. 13031 */ 13032 var currentTimeSelectors = document.querySelectorAll(".amplitude-current-time"); 13033 13034 /* 13035 Set the time selector's inner html to the current time for the song. The current 13036 time is computed by joining minutes and seconds. 13037 */ 13038 var timeText = time.minutes + ":" + time.seconds; 13039 13040 if (time.hours > 0) { 13041 timeText = time.hours + ":" + timeText; 13042 } 13043 13044 for (var i = 0; i < currentTimeSelectors.length; i++) { 13045 var playlist = currentTimeSelectors[i].getAttribute("data-amplitude-playlist"); 13046 var songIndex = currentTimeSelectors[i].getAttribute("data-amplitude-song-index"); 13047 13048 if (playlist == null && songIndex == null) { 13049 currentTimeSelectors[i].innerHTML = timeText; 13050 } 13051 } 13052 } 13053 13054 /** 13055 * Updates any elements that display the current time for the song. This 13056 * is a computed field that will be commonly used. 13057 * 13058 * @access public 13059 * @param {object} time - A json object conaining the parts for the current time for the song. 13060 */ 13061 function syncPlaylist(time) { 13062 /* 13063 Get all of the time selectors. 13064 */ 13065 var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13066 13067 /* 13068 Set the time selector's inner html to the current time for the song. The current 13069 time is computed by joining minutes and seconds. 13070 */ 13071 var timeText = time.minutes + ":" + time.seconds; 13072 13073 if (time.hours > 0) { 13074 timeText = time.hours + ":" + timeText; 13075 } 13076 13077 for (var i = 0; i < currentTimeSelectors.length; i++) { 13078 var songIndex = currentTimeSelectors[i].getAttribute("data-amplitude-song-index"); 13079 13080 if (songIndex == null) { 13081 currentTimeSelectors[i].innerHTML = timeText; 13082 } 13083 } 13084 } 13085 13086 /** 13087 * Updates any elements that display the current time for the song. This 13088 * is a computed field that will be commonly used. 13089 * 13090 * @access public 13091 * @param {object} time - A json object conaining the parts for the current time for the song. 13092 */ 13093 function syncSong(time) { 13094 if (_config2.default.active_playlist == null) { 13095 /* 13096 Get all of the time selectors. 13097 */ 13098 var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13099 13100 /* 13101 Set the time selector's inner html to the current time for the song. The current 13102 time is computed by joining minutes and seconds. 13103 */ 13104 var timeText = time.minutes + ":" + time.seconds; 13105 13106 if (time.hours > 0) { 13107 timeText = time.hours + ":" + timeText; 13108 } 13109 13110 for (var i = 0; i < currentTimeSelectors.length; i++) { 13111 var playlist = currentTimeSelectors[i].getAttribute("data-amplitude-playlist"); 13112 13113 if (playlist == null) { 13114 currentTimeSelectors[i].innerHTML = timeText; 13115 } 13116 } 13117 } 13118 } 13119 13120 /** 13121 * Updates any elements that display the current time for the song. This 13122 * is a computed field that will be commonly used. 13123 * 13124 * @access public 13125 * @param {object} time - A json object conaining the parts for the current time for the song. 13126 */ 13127 function syncSongInPlaylist(time) { 13128 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13129 /* 13130 Get all of the time selectors. 13131 */ 13132 var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13133 13134 /* 13135 Set the time selector's inner html to the current time for the song. The current 13136 time is computed by joining minutes and seconds. 13137 */ 13138 var timeText = time.minutes + ":" + time.seconds; 13139 13140 if (time.hours > 0) { 13141 timeText = time.hours + ":" + timeText; 13142 } 13143 13144 for (var i = 0; i < currentTimeSelectors.length; i++) { 13145 currentTimeSelectors[i].innerHTML = timeText; 13146 } 13147 } 13148 13149 /** 13150 * Resets the current time displays to 00:00 13151 * 13152 * @access public 13153 */ 13154 function resetTimes() { 13155 /* 13156 Gets the time selector display elements 13157 */ 13158 var timeSelectors = document.querySelectorAll(".amplitude-current-time"); 13159 13160 /* 13161 Iterates over all of the time selectors and sets the inner HTML 13162 to 00. 13163 */ 13164 for (var i = 0; i < timeSelectors.length; i++) { 13165 timeSelectors[i].innerHTML = "00:00"; 13166 } 13167 } 13168 13169 /** 13170 * Returns the publically facing methods 13171 */ 13172 return { 13173 sync: sync, 13174 resetTimes: resetTimes 13175 }; 13176}(); /** 13177 * Imports the config module 13178 * @module config 13179 */ 13180exports.default = CurrentTimeElements; 13181module.exports = exports["default"]; 13182 13183/***/ }), 13184/* 54 */ 13185/***/ (function(module, exports, __webpack_require__) { 13186 13187"use strict"; 13188 13189 13190Object.defineProperty(exports, "__esModule", { 13191 value: true 13192}); 13193 13194var _config = __webpack_require__(0); 13195 13196var _config2 = _interopRequireDefault(_config); 13197 13198function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13199 13200/** 13201 * Handles all of the duration countdown elements. 13202 * 13203 * @module visual/time/DurationCountDownTimeElements. 13204 */ 13205var DurationCountDownTimeElements = function () { 13206 /** 13207 * Syncs all of the countdown time elements. 13208 * 13209 * @param {object} countDownTime - The current time of the audio. 13210 * @param {object} songDuration - The song duration of the audio. 13211 */ 13212 function sync(countDownTime, songDuration) { 13213 var timeRemaining = computeTimeRemaining(countDownTime, songDuration); 13214 13215 syncGlobal(timeRemaining); 13216 syncPlaylist(timeRemaining); 13217 syncSong(timeRemaining); 13218 syncSongInPlaylist(timeRemaining); 13219 } 13220 13221 /** 13222 * Syncs the global count down time elements. 13223 * 13224 * @param {string} timeRemaining - The time remaining for the audio. 13225 */ 13226 function syncGlobal(timeRemaining) { 13227 var durationTimeRemainingSelectors = document.querySelectorAll(".amplitude-time-remaining"); 13228 13229 for (var i = 0; i < durationTimeRemainingSelectors.length; i++) { 13230 var playlist = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-playlist"); 13231 var songIndex = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-song-index"); 13232 13233 if (playlist == null && songIndex == null) { 13234 durationTimeRemainingSelectors[i].innerHTML = timeRemaining; 13235 } 13236 } 13237 } 13238 13239 /** 13240 * Syncs the playlist count down time elements. 13241 * 13242 * @param {string} timeRemaining - The time remaining for the audio. 13243 */ 13244 function syncPlaylist(timeRemaining) { 13245 var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13246 13247 for (var i = 0; i < durationTimeRemainingSelectors.length; i++) { 13248 var songIndex = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-song-index"); 13249 13250 if (songIndex == null) { 13251 durationTimeRemainingSelectors[i].innerHTML = timeRemaining; 13252 } 13253 } 13254 } 13255 13256 /** 13257 * Syncs the song count down time elements. 13258 * 13259 * @param {string} timeRemaining - The time remaining for the audio. 13260 */ 13261 function syncSong(timeRemaining) { 13262 if (_config2.default.active_playlist == null) { 13263 var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13264 13265 for (var i = 0; i < durationTimeRemainingSelectors.length; i++) { 13266 var playlist = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-playlist"); 13267 13268 if (playlist == null) { 13269 durationTimeRemainingSelectors[i].innerHTML = timeRemaining; 13270 } 13271 } 13272 } 13273 } 13274 13275 /** 13276 * Syncs the song in playlist count down time elements. 13277 * 13278 * @param {string} timeRemaining - The time remaining for the audio. 13279 */ 13280 function syncSongInPlaylist(timeRemaining) { 13281 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13282 13283 var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13284 13285 for (var i = 0; i < durationTimeRemainingSelectors.length; i++) { 13286 durationTimeRemainingSelectors[i].innerHTML = timeRemaining; 13287 } 13288 } 13289 13290 /** 13291 * Resets the count down times. 13292 */ 13293 function resetTimes() { 13294 var durationTimeRemainingSelectors = document.querySelectorAll(".amplitude-time-remaining"); 13295 13296 for (var i = 0; i < durationTimeRemainingSelectors.length; i++) { 13297 durationTimeRemainingSelectors[i].innerHTML = "00"; 13298 } 13299 } 13300 13301 /** 13302 * Computes the time remaining for the audio. 13303 * 13304 * @param {object} currentTime - The current time of the audio. 13305 * @param {object} songDuration - The duration of the audio. 13306 */ 13307 function computeTimeRemaining(currentTime, songDuration) { 13308 var timeRemaining = "00:00"; 13309 13310 /* 13311 Initialize the total current seconds and total duration seconds 13312 */ 13313 var totalCurrentSeconds = parseInt(currentTime.seconds) + parseInt(currentTime.minutes) * 60 + parseInt(currentTime.hours) * 60 * 60; 13314 var totalDurationSeconds = parseInt(songDuration.seconds) + parseInt(songDuration.minutes) * 60 + parseInt(songDuration.hours) * 60 * 60; 13315 13316 /* 13317 If the two variables are numbers we continue the computing. 13318 */ 13319 if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) { 13320 /* 13321 Find the total remaining seconds. 13322 */ 13323 var timeRemainingTotalSeconds = totalDurationSeconds - totalCurrentSeconds; 13324 13325 var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600); 13326 var remainingMinutes = Math.floor((timeRemainingTotalSeconds - remainingHours * 3600) / 60); 13327 var remainingSeconds = timeRemainingTotalSeconds - remainingHours * 3600 - remainingMinutes * 60; 13328 13329 timeRemaining = (remainingMinutes < 10 ? "0" + remainingMinutes : remainingMinutes) + ":" + (remainingSeconds < 10 ? "0" + remainingSeconds : remainingSeconds); 13330 13331 if (remainingHours > 0) { 13332 timeRemaining = remainingHours + ":" + timeRemaining; 13333 } 13334 } 13335 13336 return timeRemaining; 13337 } 13338 13339 /** 13340 * Returns the publically facing methods. 13341 */ 13342 return { 13343 sync: sync, 13344 resetTimes: resetTimes 13345 }; 13346}(); /** 13347 * Imports the config module 13348 * @module config 13349 */ 13350exports.default = DurationCountDownTimeElements; 13351module.exports = exports["default"]; 13352 13353/***/ }), 13354/* 55 */ 13355/***/ (function(module, exports, __webpack_require__) { 13356 13357"use strict"; 13358 13359 13360Object.defineProperty(exports, "__esModule", { 13361 value: true 13362}); 13363 13364var _config = __webpack_require__(0); 13365 13366var _config2 = _interopRequireDefault(_config); 13367 13368function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13369 13370/** 13371 * Handles all of the duration hours elements. 13372 * 13373 * @module visual/time/DurationHourElements. 13374 */ 13375var DurationHourElements = function () { 13376 /** 13377 * Sync the duration hours elements. 13378 * 13379 * @param {Integer} hours - The duration hours for the audio. 13380 */ 13381 function sync(hours) { 13382 syncGlobal(hours); 13383 syncPlaylist(hours); 13384 syncSong(hours); 13385 syncSongInPlaylist(hours); 13386 } 13387 13388 /** 13389 * Syncs the global duration hours elements. 13390 * 13391 * @param {Integer} hours - the duration hours for the audio. 13392 */ 13393 function syncGlobal(hours) { 13394 var durationHourSelectors = document.querySelectorAll(".amplitude-duration-hours"); 13395 13396 for (var i = 0; i < durationHourSelectors.length; i++) { 13397 var playlist = durationHourSelectors[i].getAttribute("data-amplitude-playlist"); 13398 var songIndex = durationHourSelectors[i].getAttribute("data-amplitude-song-index"); 13399 13400 if (playlist == null && songIndex == null) { 13401 durationHourSelectors[i].innerHTML = hours; 13402 } 13403 } 13404 } 13405 13406 /** 13407 * Syncs the playlist duration hours for the audio. 13408 * 13409 * @param {Integer} hours - The duration hours for the audio. 13410 */ 13411 function syncPlaylist(hours) { 13412 var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13413 13414 for (var i = 0; i < durationHourSelectors.length; i++) { 13415 var songIndex = durationHourSelectors[i].getAttribute("data-amplitude-song-index"); 13416 13417 if (songIndex == null) { 13418 durationHourSelectors[i].innerHTML = hours; 13419 } 13420 } 13421 } 13422 13423 /** 13424 * Syncs the song duration hours. 13425 * 13426 * @param {Integer} hours - The duration hours for the audio. 13427 */ 13428 function syncSong(hours) { 13429 if (_config2.default.active_playlist == null) { 13430 var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13431 13432 for (var i = 0; i < durationHourSelectors.length; i++) { 13433 var playlist = durationHourSelectors[i].getAttribute("data-amplitude-playlist"); 13434 13435 if (playlist == null) { 13436 durationHourSelectors[i].innerHTML = hours; 13437 } 13438 } 13439 } 13440 } 13441 13442 /** 13443 * Syncs the song in playlist duration hours. 13444 * 13445 * @param {Integer} hours - The duration hours of the audio. 13446 */ 13447 function syncSongInPlaylist(hours) { 13448 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13449 13450 var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13451 13452 for (var i = 0; i < durationHourSelectors.length; i++) { 13453 durationHourSelectors[i].innerHTML = hours; 13454 } 13455 } 13456 13457 /** 13458 * Resets the duration shours elements to '00' 13459 */ 13460 function resetTimes() { 13461 var durationHourSelectors = document.querySelectorAll(".amplitude-duration-hours"); 13462 13463 for (var i = 0; i < durationHourSelectors.length; i++) { 13464 durationHourSelectors[i].innerHTML = "00"; 13465 } 13466 } 13467 13468 /** 13469 * Returns the publically facing methods. 13470 */ 13471 return { 13472 sync: sync, 13473 resetTimes: resetTimes 13474 }; 13475}(); /** 13476 * Imports the config module 13477 * @module config 13478 */ 13479exports.default = DurationHourElements; 13480module.exports = exports["default"]; 13481 13482/***/ }), 13483/* 56 */ 13484/***/ (function(module, exports, __webpack_require__) { 13485 13486"use strict"; 13487 13488 13489Object.defineProperty(exports, "__esModule", { 13490 value: true 13491}); 13492 13493var _config = __webpack_require__(0); 13494 13495var _config2 = _interopRequireDefault(_config); 13496 13497function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13498 13499/** 13500 * Handles all of the duration minutes elements. 13501 * 13502 * @module visual/time/DurationMinuteElements. 13503 */ 13504var DurationMinuteElements = function () { 13505 /** 13506 * Sync the duration minutes elements. 13507 * 13508 * @param {Integer} minutes - The duration minutes for the audio. 13509 */ 13510 function sync(minutes) { 13511 syncGlobal(minutes); 13512 syncPlaylist(minutes); 13513 syncSong(minutes); 13514 syncSongInPlaylist(minutes); 13515 } 13516 13517 /** 13518 * Syncs the global duration minutes elements. 13519 * 13520 * @param {Integer} minutes - the duration minutes for the audio. 13521 */ 13522 function syncGlobal(minutes) { 13523 var durationMinuteSelectors = document.querySelectorAll(".amplitude-duration-minutes"); 13524 13525 for (var i = 0; i < durationMinuteSelectors.length; i++) { 13526 var playlist = durationMinuteSelectors[i].getAttribute("data-amplitude-playlist"); 13527 var songIndex = durationMinuteSelectors[i].getAttribute("data-amplitude-song-index"); 13528 13529 if (playlist == null && songIndex == null) { 13530 durationMinuteSelectors[i].innerHTML = minutes; 13531 } 13532 } 13533 } 13534 13535 /** 13536 * Syncs the playlist duration minutes for the audio. 13537 * 13538 * @param {Integer} minutes - The duration minutes for the audio. 13539 */ 13540 function syncPlaylist(minutes) { 13541 var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13542 13543 for (var i = 0; i < durationMinuteSelectors.length; i++) { 13544 var songIndex = durationMinuteSelectors[i].getAttribute("data-amplitude-song-index"); 13545 13546 if (songIndex == null) { 13547 durationMinuteSelectors[i].innerHTML = minutes; 13548 } 13549 } 13550 } 13551 13552 /** 13553 * Syncs the song duration minutes. 13554 * 13555 * @param {Integer} minutes - The duration minutes for the audio. 13556 */ 13557 function syncSong(minutes) { 13558 if (_config2.default.active_playlist == null) { 13559 var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13560 13561 for (var i = 0; i < durationMinuteSelectors.length; i++) { 13562 var playlist = durationMinuteSelectors[i].getAttribute("data-amplitude-playlist"); 13563 13564 if (playlist == null) { 13565 durationMinuteSelectors[i].innerHTML = minutes; 13566 } 13567 } 13568 } 13569 } 13570 13571 /** 13572 * Syncs the song in playlist duration minutes. 13573 * 13574 * @param {Integer} minutes - The duration minutes of the audio. 13575 */ 13576 function syncSongInPlaylist(minutes) { 13577 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13578 13579 var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13580 13581 for (var i = 0; i < durationMinuteSelectors.length; i++) { 13582 durationMinuteSelectors[i].innerHTML = minutes; 13583 } 13584 } 13585 13586 /** 13587 * Resets the duration minutes elements to '00' 13588 */ 13589 function resetTimes() { 13590 var durationMinuteSelectors = document.querySelectorAll(".amplitude-duration-minutes"); 13591 13592 for (var i = 0; i < durationMinuteSelectors.length; i++) { 13593 durationMinuteSelectors[i].innerHTML = "00"; 13594 } 13595 } 13596 13597 /** 13598 * Returns the publically facing methods. 13599 */ 13600 return { 13601 sync: sync, 13602 resetTimes: resetTimes 13603 }; 13604}(); /** 13605 * Imports the config module 13606 * @module config 13607 */ 13608exports.default = DurationMinuteElements; 13609module.exports = exports["default"]; 13610 13611/***/ }), 13612/* 57 */ 13613/***/ (function(module, exports, __webpack_require__) { 13614 13615"use strict"; 13616 13617 13618Object.defineProperty(exports, "__esModule", { 13619 value: true 13620}); 13621 13622var _config = __webpack_require__(0); 13623 13624var _config2 = _interopRequireDefault(_config); 13625 13626function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13627 13628/** 13629 * Handles all of the duration seconds elements. 13630 * 13631 * @module visual/time/DurationSecondElements. 13632 */ 13633var DurationSecondElements = function () { 13634 /** 13635 * Sync the duration seconds elements. 13636 * 13637 * @param {Integer} seconds - The duration seconds for the audio. 13638 */ 13639 function sync(seconds) { 13640 syncGlobal(seconds); 13641 syncPlaylist(seconds); 13642 syncSong(seconds); 13643 syncSongInPlaylist(seconds); 13644 } 13645 13646 /** 13647 * Syncs the global duration seconds elements. 13648 * 13649 * @param {Integer} seconds - the duration seconds for the audio. 13650 */ 13651 function syncGlobal(seconds) { 13652 var durationSecondSelectors = document.querySelectorAll(".amplitude-duration-seconds"); 13653 13654 for (var i = 0; i < durationSecondSelectors.length; i++) { 13655 var playlist = durationSecondSelectors[i].getAttribute("data-amplitude-playlist"); 13656 var songIndex = durationSecondSelectors[i].getAttribute("data-amplitude-song-index"); 13657 13658 if (playlist == null && songIndex == null) { 13659 durationSecondSelectors[i].innerHTML = seconds; 13660 } 13661 } 13662 } 13663 13664 /** 13665 * Syncs the playlist duration seconds for the audio. 13666 * 13667 * @param {Integer} seconds - The duration seconds for the audio. 13668 */ 13669 function syncPlaylist(seconds) { 13670 var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13671 13672 for (var i = 0; i < durationSecondSelectors.length; i++) { 13673 var songIndex = durationSecondSelectors[i].getAttribute("data-amplitude-song-index"); 13674 13675 if (songIndex == null) { 13676 durationSecondSelectors[i].innerHTML = seconds; 13677 } 13678 } 13679 } 13680 13681 /** 13682 * Syncs the song duration seconds. 13683 * 13684 * @param {Integer} seconds - The duration seconds for the audio. 13685 */ 13686 function syncSong(seconds) { 13687 if (_config2.default.active_playlist == null) { 13688 var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13689 13690 for (var i = 0; i < durationSecondSelectors.length; i++) { 13691 var playlist = durationSecondSelectors[i].getAttribute("data--amplitude-playlist"); 13692 13693 if (playlist == null) { 13694 durationSecondSelectors[i].innerHTML = seconds; 13695 } 13696 } 13697 } 13698 } 13699 13700 /** 13701 * Syncs the song in playlist duration seconds. 13702 * 13703 * @param {Integer} seconds - The duration seconds of the audio. 13704 */ 13705 function syncSongInPlaylist(seconds) { 13706 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13707 13708 var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13709 13710 for (var i = 0; i < durationSecondSelectors.length; i++) { 13711 durationSecondSelectors[i].innerHTML = seconds; 13712 } 13713 } 13714 13715 /** 13716 * Resets the duration seconds elements to '00' 13717 */ 13718 function resetTimes() { 13719 var durationSecondSelectors = document.querySelectorAll(".amplitude-duration-seconds"); 13720 13721 for (var i = 0; i < durationSecondSelectors.length; i++) { 13722 durationSecondSelectors[i].innerHTML = "00"; 13723 } 13724 } 13725 13726 /** 13727 * Returns the publically facing methods. 13728 */ 13729 return { 13730 sync: sync, 13731 resetTimes: resetTimes 13732 }; 13733}(); /** 13734 * Imports the config module 13735 * @module config 13736 */ 13737exports.default = DurationSecondElements; 13738module.exports = exports["default"]; 13739 13740/***/ }), 13741/* 58 */ 13742/***/ (function(module, exports, __webpack_require__) { 13743 13744"use strict"; 13745 13746 13747Object.defineProperty(exports, "__esModule", { 13748 value: true 13749}); 13750 13751var _config = __webpack_require__(0); 13752 13753var _config2 = _interopRequireDefault(_config); 13754 13755function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13756 13757/** 13758 * Handles all of the duration time elements. 13759 * 13760 * @module visual/time/DurationTimeElements. 13761 */ 13762var DurationTimeElements = function () { 13763 /** 13764 * Syncs the duration time for all elements. 13765 * 13766 * @param {Object} durationTime - The object containing all of the song duration times. 13767 */ 13768 function sync(durationTime) { 13769 var durationText = computeDurationText(durationTime); 13770 13771 syncGlobal(durationText); 13772 syncPlaylist(durationText); 13773 syncSong(durationText); 13774 syncSongInPlaylist(durationText); 13775 } 13776 13777 /** 13778 * Sync the global song duration elements. 13779 * 13780 * @param {Object} durationText - The text for the song duration. 13781 */ 13782 function syncGlobal(durationText) { 13783 var durationTimeSelectors = document.querySelectorAll(".amplitude-duration-time"); 13784 13785 for (var i = 0; i < durationTimeSelectors.length; i++) { 13786 var playlist = durationTimeSelectors[i].getAttribute("data-amplitude-playlist"); 13787 var songIndex = durationTimeSelectors[i].getAttribute("data-amplitude-song-index"); 13788 13789 if (playlist == null && songIndex == null) { 13790 durationTimeSelectors[i].innerHTML = durationText; 13791 } 13792 } 13793 } 13794 13795 /** 13796 * Sync the playlist duration times. 13797 * 13798 * @param {Object} durationText - The text for the song duration. 13799 */ 13800 function syncPlaylist(durationText) { 13801 var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"]'); 13802 13803 for (var i = 0; i < durationTimeSelectors.length; i++) { 13804 var songIndex = durationTimeSelectors[i].getAttribute("data-amplitude-song-index"); 13805 13806 if (songIndex == null) { 13807 durationTimeSelectors[i].innerHTML = durationText; 13808 } 13809 } 13810 } 13811 13812 /** 13813 * Sync the song duration times. 13814 * 13815 * @param {Object} durationText - The text for the song duration. 13816 */ 13817 function syncSong(durationText) { 13818 if (_config2.default.active_playlist == null) { 13819 var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-song-index="' + _config2.default.active_index + '"]'); 13820 13821 for (var i = 0; i < durationTimeSelectors.length; i++) { 13822 var playlist = durationTimeSelectors[i].getAttribute("data-amplitude-playlist"); 13823 13824 if (playlist == null) { 13825 durationTimeSelectors[i].innerHTML = durationText; 13826 } 13827 } 13828 } 13829 } 13830 13831 /** 13832 * Sync the song in playlist duration times. 13833 * 13834 * @param {Object} durationText - An object containing the duration text. 13835 */ 13836 function syncSongInPlaylist(durationText) { 13837 var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null; 13838 13839 var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]'); 13840 13841 for (var i = 0; i < durationTimeSelectors.length; i++) { 13842 durationTimeSelectors[i].innerHTML = durationText; 13843 } 13844 } 13845 13846 /** 13847 * Resets all of the duration times to empty. 13848 */ 13849 function resetTimes() { 13850 var durationTimeSelectors = document.querySelectorAll(".amplitude-duration-time"); 13851 13852 for (var i = 0; i < durationTimeSelectors.length; i++) { 13853 durationTimeSelectors[i].innerHTML = "00:00"; 13854 } 13855 } 13856 13857 /** 13858 * Computes the duration text 13859 * 13860 * @param {Object} durationTime - An object containint the duration times. 13861 */ 13862 function computeDurationText(durationTime) { 13863 var durationText = "00:00"; 13864 13865 if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) { 13866 durationText = durationTime.minutes + ":" + durationTime.seconds; 13867 if (!isNaN(durationTime.hours) && durationTime.hours > 0) { 13868 durationText = durationTime.hours + ":" + durationText; 13869 } 13870 } 13871 13872 return durationText; 13873 } 13874 13875 /** 13876 * Return publically accessible methods. 13877 */ 13878 return { 13879 sync: sync, 13880 resetTimes: resetTimes 13881 }; 13882}(); /** 13883 * Imports the config module 13884 * @module config 13885 */ 13886exports.default = DurationTimeElements; 13887module.exports = exports["default"]; 13888 13889/***/ }), 13890/* 59 */ 13891/***/ (function(module, exports) { 13892 13893module.exports = {"name":"amplitudejs","version":"5.
138930.3","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"funding":{"type":"opencollective","url":"https://opencollective.com/amplitudejs"},"scripts":{"build":"node_modules/.bin/webpack","watch":"watch 'node_modules/.bin/webpack' dist","prettier":"npx pretty-quick","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"} 13894 13895/***/ }) 13896/******/ ]); 13897}); 13898//# 13899 13900document.addEventListener('DOMContentLoaded', function () { 13901 13902 var amplitude_array_starts = []; 13903 var amplitude_array_ends = []; 13904 13905 function dfvMp3PlayerAppendEvents(players){ 13906 13907 var amplitude_songs_array = []; 13908 13909 for (var i = 0; i < players.length; ++i) { 13910 let player = players[i]; 13911 amplitude_array_starts[i] = amplitude_array_ends[i] = false; 13912 13913 amplitude_songs_array[amplitude_songs_array.length] = { 13914 "name" : player.dataset.title, 13915 "artist": 'xxxx', 13916 "album" : player.dataset.kicker, 13917 "url" : player.dataset.src, 13918 }; 13919 13920 } 13921 13922 // Amplitude.init 13923 Amplitude.init( { 13924 "songs": amplitude_songs_array, 13925 13926 "controls" : [ 13927 13928 'play-large', // The large play button in the center 13929 'rewind', // Rewind by the seek time (default 10 seconds) 13930 'play', // Play/pause playback 13931 'fast-forward', // Fast forward by the seek time (default 10 seconds) 13932 'progress', // The progress bar and scrubber for playback and buffering 13933 'current-time', // The current time of playback 13934 'volume', // Volume control 13935 ], 13936 "callbacks": { 13937 'play' : function(){ 13938 if(!amplitude_array_starts[ Amplitude.getActiveIndex() ]){ 13939 let player = players[Amplitude.getActiveIndex()]; 13940 console.log('play start:', Amplitude.getActiveIndex(), player.dataset.galabel); 13941 amplitude_array_starts[ Amplitude.getActiveIndex() ] = true; 13942 dfv_helper.podcast_ga_events('start', player.dataset.galabel, player.dataset.gacategory); 13943 } 13944 }, 13945 'ended': function(){ 13946 if(!ended){ 13947 let player = players[Amplitude.getActiveIndex()]; 13948 console.log('play ended:', Amplitude.getActiveIndex(), player.dataset.galabel); 13949 amplitude_array_ends[ Amplitude.getActiveIndex() ] = true; 13950 dfv_helper.podcast_ga_events('complete', player.dataset.galabel, player.dataset.gacategory); 13951 } 13952 } 13953 } 13954 }); 13955 13956 for (var i = 0; i < players.length; ++i) { 13957 let player = players[i]; 13958 player.getElementsByClassName('amplitude-song-played-progress')[0].addEventListener('click', function( e ){ 13959 //console.log( 'Amplitude.getActiveIndex()', Amplitude.getActiveIndex() ); //, 'currentSongIndex', currentSongIndex ); 13960 var offset = this.getBoundingClientRect(); 13961 var x = e.pageX - offset.left; 13962 Amplitude.setSongPlayedPercentage( ( parseFloat( x ) / parseFloat( this.offsetWidth) ) * 100 ); 13963 }); 13964 } 13965 13966 } 13967 13968 var players = document.querySelectorAll('.dfv_mp3_player'); 13969 13970 dfvMp3PlayerAppendEvents(players); 13971 13972}); 13973/* 13974 this file is kind of hack. 13975 social-buttons at sidebar are distinct from the player in the content. 13976 social-button php reachability has no information if a mp3-player exists in news. 13977 so social-button is hidden on page and if a mp3-player in the main news exists, it is set to visible via js. 13978 13979 click on social-button makes the mp3-player visible. 13980 */ 13981 13982document.addEventListener('DOMContentLoaded', function(){ 13983 if(document.getElementsByClassName('dfv_mp3_player').length > 0){ 13984 function showPlayer(){ 13985 //real mp3-player is hidden by default. when social-play-button is clicked, then it appears. 13986 let player = document.getElementsByClassName('dfv_mp3_player')[0]; 13987 player.style.display = 'block'; 13988 player.scrollIntoView({behavior: 'smooth'}); 13989 let playButton = player.getElementsByClassName('amplitude-play-pause')[0]; 13990 playButton.className = playButton.className.replace(/\bamplitude-paused\b/g, "amplitude-playing"); 13991 Amplitude.play(); 13992 } 13993 13994 //Socialbuttons 13995 let socialButton = document.getElementsByClassName('mp3player'); 13996 if(socialButton.length > 0){ 13997 let player = document.getElementsByClassName('dfv_mp3_player')[0]; 13998 // lznet15 != lz21 13999 //if (!socialButton[0].className.match(/ButtonSharing/)) { 14000 socialButton[0].style.display = 'flex'; 14001 //} 14002 socialButton[0].addEventListener('click', function(e){ 14003 showPlayer(); 14004 }); 14005 /* 14006 var xhr = new XMLHttpRequest(); 14007 xhr.open('HEAD', player.dataset.src); 14008 xhr.onload = function() { 14009 if (xhr.status === 200) { 14010 socialButton[0].style.display = 'flex'; 14011 socialButton[0].addEventListener('click', function(e){ 14012 showPlayer(); 14013 }); 14014 } 14015 }; 14016 xhr.send(); 14017 */ 14018 } 14019 14020 //Socialbuttons-mobile 14021 let socialButtonMobile = document.getElementsByClassName('dfv_mp3_player-mobile'); 14022 if(socialButtonMobile.length > 0){ 14023 socialButtonMobile[0].style.display = 'flex'; 14024 socialButtonMobile[0].addEventListener('click', function(e){ 14025 showPlayer(); 14026 }); 14027 } 14028 14029 } 14030});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.