$el.hammer(),e.$el.on("click","a",function(n){n.preventDefault(),e.gotoPosition(e.$el.find("a").index(t(this)))}),e},bindAPI:function(){var e=this;return e.$el.on("SonySlideNav:goto",function(t,n){e.gotoPosition(n)}),e.$el.on("SonySlideNav:update",function(){e.updatePoints()}),e},onDrag:function(e){var t=this,n=e.position.left;return t.$el.trigger("SonySlideNav:drag",n),t},gotoPosition:function(e){var t=this,n=t.$el.find(".scrubber"),r=t.$el.find("a"),i=r.eq(e);return i.length===0?!1:(n.sonyDraggable("snapTo","x",i.position().left/t.$el.width()*100),r.removeClass("active"),i.addClass("active"),t)},snapToNearest:function(){var e=this,t=e.$el.find("a"),r=e.$el.find(".scrubber"),i=n.getElementCenter(r.get(0)).x,s=[],o;return t.each(function(){s.push(n.getElementCenter(this).x)}),o=s.indexOf(n.closestInArray(s,i)),e.gotoPosition(o),e}},s}),define("modules/sony_slide_nav/index",["require","modules/sony_slide_nav/module"],function(e){var t=e("modules/sony_slide_nav/module"),n=$(".sony-slide-nav");n.length>0&&new t(n)}),define("modules/sony_audio_player/module",["require","jquery","modernizr","secondary/sony-draggable","secondary/sony-audio"],function(e){var t=e("jquery"),n=e("modernizr"),r=e("secondary/sony-draggable"),i=e("secondary/sony-audio"),s=function(e){var t=this,n;return n=t.init(e),n};return s.prototype={constructor:s,init:function(e){var n=this;n.$el=t(e);if(n.$el.length>1){var r=[];return n.$el.each(function(){r.push(new s(this))}),r}return n.bindNav(),n.setTrack(0),n},setTrack:function(e){var t=this,n=t.$el.find(".track").eq(e),r=n.find(".source"),s=new i({sources:t.getSourceList(r),oninit:function(){t.$el.removeClass("playing paused").addClass("loading"),t.$el.trigger("SonyAudioPlayer:isLoading")},onpause:function(){t.$el.removeClass("playing loading").addClass("paused"),t.$el.trigger("SonyAudioPlayer:isPaused")},onplay:function(){t.$el.removeClass("paused loading").addClass("playing"),t.$el.trigger("SonyAudioPlayer:isPlaying")},onfinish:function(){t.$el.removeClass("playing loading").addClass("paused"),t.$el.trigger("SonyAudioPlayer:isPaused")}});return t.bindModuleAPI(s).bindModuleResponse().setAlbumArt(e),t},getSourceList:function(e){var n={};return e.each(function(e,r){var i=t(this).text(),s=t(this).find("a").attr("href");n[i]=s}),n},bindNav:function(){var e=this;return e.$el.on("click",".play",function(t){t.preventDefault(),e.$el.trigger("SonyAudioPlayer:play")}),e.$el.on("click",".pause",function(t){t.preventDefault(),e.$el.trigger("SonyAudioPlayer:pause")}),e},bindModuleAPI:function(e){var t=this;return t.$el.on("SonyAudioPlayer:play",function(t,n){e.play(n)}),t.$el.on("SonyAudioPlayer:pause",function(t){e.pause()}),t.$el.on("SonyAudioPlayer:getPosition",function(t,n){n(e.getPosition())}),t.$el.on("SonyAudioPlayer:getDuration",function(t,n){n(e.getDuration())}),t.$el.on("SonyAudioPlayer:setPosition",function(t,n){e.setPosition(n)}),t.$el.on("SonyAudioPlayer:setVolume",function(t,n){e.setVolume(n)}),t},bindModuleResponse:function(){var e=this;return e.$el.on("SonyAudioPlayer:isLoading",function(e){}),e.$el.on("SonyAudioPlayer:isPlaying",function(t){e.createScrubber()}),e.$el.on("SonyAudioPlayer:isPaused",function(t){e.removeScrubber()}),e},setAlbumArt:function(e){var t=this,n=t.$el.find(".active-track"),r=t.$el.find(".track").eq(e),i=r.find("img"),s=i.attr("src"),o=r.data("active-art");return n.empty().append(i.clone()),t.$el.on("SonyAudioPlayer:isPlaying",function(e){n.find("img").attr("src",o)}),t.$el.on("SonyAudioPlayer:isPaused",function(e){n.find("img").attr("src",s)}),t},createScrubber:function(){var e=this,n=e.$el.find(".sap-hit-area"),r=n.find(".scrubber"),i={};return i.x={min:0,max:100},n.addClass("active"),e.$el.trigger("SonyAudioPlayer:getDuration",function(s){e.$el.trigger("SonyAudioPlayer:getPosition",function(o){r.sonyDraggable({axis:"x",unit:"%",containment:n,drag:t.proxy(e.onScrubberDrag,e),bounds:i}),r.sonyDraggable("setPositions",{x:o/s*100})})}),r.off("sonyDraggable:dragStart").on("sonyDraggable:dragStart",function(){e.clearScrubberInterval(),e.$el.trigger("SonyAudioPlayer:setVolume",0)}),r.off("sonyDraggable:dragEnd").on("sonyDraggable:dragEnd",function(){e.createScrubberInterval(),e.$el.trigger("SonyAudioPlayer:setVolume",25)}),e.createScrubberInterval(),e},onScrubberDrag:function(e){var t=this,n=e.position.left;return t.$el.trigger("SonyAudioPlayer:getDuration",function(e){t.$el.trigger("SonyAudioPlayer:setPosition",n/100*e)}),t},createScrubberInterval:function(){var e=this,t=e.$el.find(".scrubber");return e.scrubberInterval?!1:(e.scrubberInterval=setInterval(function(){e.$el.trigger("SonyAudioPlayer:getDuration",function(n){e.$el.trigger("SonyAudioPlayer:getPosition",function(e){t.sonyDraggable("setPositions",{x:e/n*100},!0)})})},250),e)},clearScrubberInterval:function(){var e=this;return e.scrubberInterval=clearInterval(e.scrubberInterval),e},removeScrubber:function(){var e=this,t=e.$el.find(".sap-hit-area");return t.removeClass("active"),t.find(".scrubber").sonyDraggable("destroy"),e.clearScrubberInterval(),e}},s}),define("modules/sony_audio_player/index",["require","modules/sony_audio_player/module"],function(e){var t=e("modules/sony_audio_player/module"),n=$(".sony-audio-player");new t(n)}),function(e){function g(e){return e=String(e),e.charAt(0).toUpperCase()+e.slice(1)}function y(e,t){var n=-1,r=e.length;if(r==r>>>0)while(++n<r)t(e[n],n,e);else w(e,t)}function b(e){return e=C(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:g(e)}function w(e,t){for(var n in e)S(e,n)&&t(e[n],n,e)}function E(e){return e==null?g(e):s.call(e).slice(8,-1)}function S(){return S=function(e,t){var n=e!=null&&(e.constructor||Object).prototype;return!!n&&t in Object(e)&&!(t in n&&e[t]===n[t])},E(c)=="Function"?S=function(e,t){return e!=null&&c.call(e,t)}:{}.__proto__==Object.prototype&&(S=function(e,t){var n=!1;return e!=null&&(e=Object(e),e.__proto__=[e.__proto__,e.__proto__=null,n=t in e][0]),n}),S.apply(this,arguments)}function x(e,t){var n=e!=null?typeof e[t]:"number";return!/^(?:boolean|number|string|undefined)$/.test(n)&&(n=="object"?!!e[t]:!0)}function T(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function N(e,t){var n=null;return y(e,function(r,i){n=t(n,r,i,e)}),n}function C(e){return String(e).
Back to home |
File page
Subscribe |
Register |
Login
| N