diff --git a/src/main/resources/static/app/js/podcastserver.js b/src/main/resources/static/app/js/podcastserver.js index ea7a386bf..659c847c6 100644 --- a/src/main/resources/static/app/js/podcastserver.js +++ b/src/main/resources/static/app/js/podcastserver.js @@ -213,7 +213,6 @@ 'ps.config.ngstomp', 'ps.config.module' ]); - angular.module('ps.config.imageLazyLoading', ['afkl.lazyImage']); angular.module('ps.config.loading', ['angular-loading-bar']).config(["cfpLoadingBarProvider", function (cfpLoadingBarProvider) { cfpLoadingBarProvider.includeSpinner = false; }]); diff --git a/src/main/resources/static/app/js/podcastserver.min.js b/src/main/resources/static/app/js/podcastserver.min.js index 686ba271d..3896b3b56 100644 --- a/src/main/resources/static/app/js/podcastserver.min.js +++ b/src/main/resources/static/app/js/podcastserver.min.js @@ -1,5 +1,5 @@ -!function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=function(){function t(t,e){for(var n=0;n]+>/gm,"")}}),_.mixin({updateinplace:function(t,e){var n=void 0===arguments[2]?function(t,e){return t.indexOf(e)}:arguments[2],a=void 0===arguments[3]?!1:arguments[3];return _.forEachRight(t.slice(),function(a,i){return-1===n(e,a)&&t.splice(i,1)}),_.forEach(e,function(e){return-1===n(t,e)&&t.push(e)}),a&&_.forEach(e,function(e,a){var i=t.splice(n(t,e),1)[0];t.splice(a,0,i)}),t}});var s=function B(){t(this,B),this.navCollapsed=!0},o=function(){function n(){t(this,n),this.transclude=!0,this.replace=!0,this.restrict="E",this.scope=!0,this.templateUrl="html/navbar.html",this.controller="navbarController",this.controllerAs="navbar"}return e(n,[{key:"link",value:function(t,e){e.removeClass("hidden")}}]),n}();angular.module("navbar",[]).directive("navbar",function(){return new o}).controller("navbarController",s);var l=function(){function n(){t(this,n),this.restrict="E",this.scope=!0,this.templateUrl="html/updating.html",this.controller="UpdatingController",this.controllerAs="uc"}return e(n,[{key:"link",value:function(t,e){var n=e.parent().parent()[0];n&&"LI"===n.tagName&&!function(){var e=angular.element(n);e.addClass("hidden"),t.$watch("uc.isUpdating",function(t){return t?e.removeClass("hidden"):e.addClass("hidden")})}()}}]),n}(),r=function(){function n(e,a){var i=this;t(this,n),this.ngstomp=e,this.isUpdating=!1,this.$scope=a,this.ngstomp.subscribe("/app/updating",function(t){return i.updateStatus(t)},a).subscribe("/topic/updating",function(t){return i.updateStatus(t)},a)}return n.$inject=["ngstomp","$scope"],e(n,[{key:"updateStatus",value:function(t){this.isUpdating=JSON.parse(t.body)}}]),n}();angular.module("updating",["AngularStompDK"]).directive("updateStatus",function(){return new l}).controller("UpdatingController",r),angular.module("ps.config",["ps.config.route","ps.config.loading","ps.config.restangular","ps.config.ngstomp","ps.config.module"]),angular.module("ps.config.imageLazyLoading",["afkl.lazyImage"]),angular.module("ps.config.loading",["angular-loading-bar"]).config(["cfpLoadingBarProvider",function(t){t.includeSpinner=!1}]),angular.module("ps.config.module",["ngTouch","ngAnimate","ui.bootstrap","truncate","ngFileUpload"]),angular.module("ps.config.ngstomp",["AngularStompDK"]).config(["ngstompProvider",function(t){return t.url("/ws").credential("login","password")["class"](SockJS)}]),angular.module("ps.config.restangular",["restangular"]).config(["RestangularProvider",function(t){t.setBaseUrl("/api/"),t.addElementTransformer("items",!1,function(t){return t.addRestangularMethod("reset","get","reset"),t.addRestangularMethod("download","get","addtoqueue"),t})}]),angular.module("ps.config.route",["ngRoute","cfp.hotkeys"]).constant("commonKey",[["h","Goto Home",function(t){t.preventDefault(),window.location.href="/items"}],["s","Goto Search",function(t){t.preventDefault(),window.location.href="/item/search"}],["p","Goto Podcast List",function(t){t.preventDefault(),window.location.href="/podcasts"}],["d","Goto Download List",function(t){t.preventDefault(),window.location.href="/download"}]]).config(["$routeProvider",function(t){return t.otherwise({redirectTo:"/items"})}]).config(["$locationProvider",function(t){return t.html5Mode(!0)}]);var c=function(){function n(e,a,i){var s=this;t(this,n),this.DonwloadManager=a,this.$notification=i,this.items=[],this.waitingitems=[],this.numberOfSimDl=0,this.DonwloadManager.getNumberOfSimDl().then(function(t){s.numberOfSimDl=parseInt(t)}),this.DonwloadManager.ws.subscribe("/app/download",function(t){return s.onSubscribeDownload(t)},e).subscribe("/app/waiting",function(t){return s.onSubscribeWaiting(t)},e).subscribe("/topic/download",function(t){return s.onDownloadUpdate(t)},e).subscribe("/topic/waiting",function(t){return s.onWaitingUpdate(t)},e)}return n.$inject=["$scope","DonwloadManager","$notification"],e(n,[{key:"onSubscribeDownload",value:function(t){this.items=JSON.parse(t.body)}},{key:"onSubscribeWaiting",value:function(t){this.waitingitems=JSON.parse(t.body)}},{key:"onDownloadUpdate",value:function(t){var e=JSON.parse(t.body),n=_.find(this.items,{id:e.id});switch(e.status){case"Started":case"Paused":n?_.assign(n,e):this.items.push(e);break;case"Finish":try{this.$notification("Téléchargement terminé",{body:e.title,icon:e.cover.url,delay:5e3})}catch(a){}this.onStoppedFromWS(n);break;case"Stopped":this.onStoppedFromWS(n)}}},{key:"onStoppedFromWS",value:function(t){t&&_.remove(this.items,function(e){return e.id===t.id})}},{key:"onWaitingUpdate",value:function(t){var e=JSON.parse(t.body);_.updateinplace(this.waitingitems,e,function(t,e){return _.findIndex(t,{id:e.id})},!0)}},{key:"getTypeFromStatus",value:function(t){return"Paused"===t.status?"warning":"info"}},{key:"updateNumberOfSimDl",value:function(t){this.DonwloadManager.updateNumberOfSimDl(t)}},{key:"download",value:function(t){this.DonwloadManager.download(t)}},{key:"stopDownload",value:function(t){this.DonwloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DonwloadManager.ws.toggle(t)}},{key:"stopAllDownload",value:function(){this.DonwloadManager.stopAllDownload()}},{key:"pauseAllDownload",value:function(){this.DonwloadManager.pauseAllDownload()}},{key:"restartAllCurrentDownload",value:function(){this.DonwloadManager.restartAllCurrentDownload()}},{key:"removeFromQueue",value:function(t){this.DonwloadManager.removeFromQueue(t)}},{key:"dontDonwload",value:function(t){this.DonwloadManager.dontDonwload(t)}},{key:"moveInWaitingList",value:function(t,e){this.DonwloadManager.moveInWaitingList(t,e)}}]),n}();angular.module("ps.download",["ps.config.route","ps.dataService.donwloadManager","notification"]).config(["$routeProvider","commonKey",function(t,e){return t.when("/download",{templateUrl:"html/download.html",controller:"DownloadCtrl",controllerAs:"dc",hotkeys:e})}]).controller("DownloadCtrl",c),angular.module("ps.partial",[]).run(["$templateCache",function(t){t.put("html/authorize-notification.html",'\n'),t.put("html/download.html",'
\n\n
\n
\n \n
\n \n
\n
\n
\n \n \n \n
\n
\n
\n\n
\n
\n \n \n
\n\n \n \n \n\n
\n
{{item.title | characters:100}}
\n
\n {{item.progression}}%\n
\n
\n\n\n
\n\n \n \n \n Liste d\'attente {{ dc.waitingitems.length }}\n \n
\n\n
\n
\n \n \n \n
\n\n \n \n \n\n
\n
{{item.title | characters:100}}
\n
\n
\n\n
\n
\n\n\n
'),t.put("html/item-detail.html",'\n
\n\n
\n \n\n
\n
\n
\n \n \n \n\n
\n\n
\n \n \n \n \n \n\n \n \n\n \n\n \n \n \n \n \n\n \n \n
\n
\n
\n
\n\n
\n
\n
\n

{{ idc.item.title }}

\n
\n
\n \n
\n
\n\n
\n
\n\n'),t.put("html/item-player.html",'
\n
\n \n\n
\n \n \n\n \n \n {{ currentTime | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n {{ timeLeft | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n \n \n
\n
\n\n \n \n \n
\n
\n
'),t.put("html/items-search.html",'\n
\n \n\n \n\n
\n \n \n
\n \n
\n \n
\n
\n'),t.put("html/navbar.html",''),t.put("html/player.html",'
\n
\n
\n \n \n\n \n \n {{ currentTime | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n {{ timeLeft | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n \n \n
\n
\n\n \n\n \n
\n
\n
\n
\n
Rafraichir
\n
Vider
\n
\n
\n\n \n\n \n \n \n\n
\n

{{ item.title }}

\n
\n
\n \n
\n\n
'),t.put("html/podcast-creation.html",'
\n
\n

Ajouter un Podcast

\n
\n
\n\n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n \n\n
\n \n
\n
\n\n\n
\n
\n
\n \n
\n
\n
\n\n
\n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n\n\n
\n
\n \n
\n
\n
\n
\n\n\n\n'), -t.put("html/podcast-detail.html",'\n\n
\n
\n \n\n
\n
\n
\n
\n

{{ pdc.podcast.title }}

\n

{{ pdc.podcast.totalItems }} Episodes

\n
\n
\n \n \n
\n
\n
\n
\n
\n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n
\n
\n\n\n\n'),t.put("html/podcast-details-edition.html",'
\n\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
\n
\n
\n \n \n \n
\n'),t.put("html/podcast-details-episodes.html",'
\n
\n
\n
\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n
\n\n \n \n \n \n
\n

{{ item.title }}

\n \n

{{item.pubdate | date : \'dd/MM/yyyy à HH:mm\' }}

\n
\n
\n\n
\n \n
\n
\n\n '),t.put("html/podcast-details-stats.html",'
\n
\n
\n - \n \n + \n
\n
\n
\n \n
\n'),t.put("html/podcast-details-upload.html",'
\n
\n
\n
\n Déposer un ou des fichiers ici\n
\n
\n
\n'),t.put("html/podcasts-list.html",'
\n\n \n\n\n
\n
\n \n \n \n
\n
\n
\n\n'),t.put("html/stats.html",'
\n
\n
\n
\n - \n \n + \n
\n
\n
\n \n
\n
'),t.put("html/updating.html",'\n \n')}]);var d=function(){function n(e,a,i,s,o,l){var r=this;t(this,n),this.item=l,this.$location=i,this.item.podcast=o,this.playlistService=s,this.DonwloadManager=a;var c="/topic/podcast/".concat(this.item.podcast.id);this.DonwloadManager.ws.subscribe(c,function(t){var e=JSON.parse(t.body);e.id==r.item.id&&_.assign(r.item,e)},e)}return n.$inject=["$scope","DonwloadManager","$location","playlistService","podcast","item"],e(n,[{key:"stopDownload",value:function(t){this.DonwloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DonwloadManager.ws.toggle(t)}},{key:"remove",value:function(t){var e=this;return t.remove().then(function(){e.playlistService.remove(t),e.$location.path("/podcasts/".concat(e.item.podcast.id))})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(n){_.assign(e.item,n),e.playlistService.remove(t)})}},{key:"toggleInPlaylist",value:function(){this.playlistService.addOrRemove(this.item)}},{key:"isInPlaylist",value:function(){return this.playlistService.contains(this.item)}}]),n}();angular.module("ps.item.details",["ps.dataService.donwloadManager","ps.player"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcasts/:podcastId/item/:itemId",{templateUrl:"html/item-detail.html",controller:"ItemDetailCtrl",controllerAs:"idc",hotkeys:e,resolve:{item:["itemService","$route",function(t,e){return t.findById(e.current.params.podcastId,e.current.params.itemId)}],podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("ItemDetailCtrl",d),angular.module("ps.item",["ps.item.details","ps.item.player"]);var u=function j(e,n,a,i){t(this,j),this.item=n,this.item.podcast=e,this.$timeout=a,this.config={autoPlay:!0,sources:[{src:this.item.proxyURL,type:this.item.mimeType}],plugins:{controls:{autoHide:!i.isTouchedDevice(),autoHideTime:2e3},poster:this.item.cover.url}}};u.$inject=["podcast","item","$timeout","deviceDetectorService"],angular.module("ps.item.player",["ngSanitize","ngRoute","device-detection","com.2fdevs.videogular","com.2fdevs.videogular.plugins.poster","com.2fdevs.videogular.plugins.controls","com.2fdevs.videogular.plugins.overlayplay","com.2fdevs.videogular.plugins.buffering"]).config(["$routeProvider",function(t){t.when("/podcasts/:podcastId/item/:itemId/play",{templateUrl:"html/item-player.html",controller:"ItemPlayerController",controllerAs:"ipc",resolve:{item:["itemService","$route",function(t,e){return t.findById(e.current.params.podcastId,e.current.params.itemId)}],podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("ItemPlayerController",u);var p=function(){function n(e,a,i){t(this,n),this.playlistService=e,this.$timeout=a,this.playlist=[],this.state=null,this.API=null,this.currentVideo={},this.config={autoPlay:!0,sources:[],plugins:{controls:{autoHide:!i.isTouchedDevice(),autoHideTime:2e3},poster:""}},this.reloadPlaylist()}return n.$inject=["playlistService","$timeout","deviceDetectorService"],e(n,[{key:"onPlayerReady",value:function(t){this.API=t,("play"==this.API.currentState||this.isCompleted)&&this.API.play(),this.isCompleted=!1,this.setVideo(0)}},{key:"onCompleteVideo",value:function(){var t=this.getIndexOfVideoInPlaylist(this.currentVideo);return this.isCompleted=!0,t+1===this.playlist.length?void(this.currentVideo=this.playlist[0]):void this.setVideo(t+1)}},{key:"reloadPlaylist",value:function(){_.updateinplace(this.playlist,this.playlistService.playlist(),function(t,e){return _.findIndex(t,{id:e.id})})}},{key:"setVideo",value:function(t){this.currentVideo=this.playlist[t],null!==this.currentVideo&&void 0!==this.currentVideo&&(this.API.stop(),this.config.sources=[{src:this.currentVideo.proxyURL,type:this.currentVideo.mimeType}],this.config.plugins.poster=this.currentVideo.cover.url)}},{key:"remove",value:function(t){this.playlistService.remove(t),this.reloadPlaylist(),this.config.sources.length>0&&this.config.sources[0].src===t.proxyURL&&this.setVideo(0)}},{key:"removeAll",value:function(){this.playlistService.removeAll(),this.reloadPlaylist()}},{key:"getIndexOfVideoInPlaylist",value:function(t){return this.playlist.indexOf(t)}}]),n}();angular.module("ps.player",["ngSanitize","ngRoute","device-detection","com.2fdevs.videogular","com.2fdevs.videogular.plugins.poster","com.2fdevs.videogular.plugins.controls","com.2fdevs.videogular.plugins.overlayplay","com.2fdevs.videogular.plugins.buffering","ps.player.playlist"]).config(["$routeProvider",function(t){t.when("/player",{templateUrl:"html/player.html",controller:"PlayerController",controllerAs:"pc"})}]).controller("PlayerController",p);var g=function(){function n(e){t(this,n),this.$localStorage=e,this.$localStorage.playlist=this.$localStorage.playlist||[]}return n.$inject=["$localStorage"],e(n,[{key:"playlist",value:function(){return this.$localStorage.playlist}},{key:"add",value:function(t){this.$localStorage.playlist.push(t)}},{key:"remove",value:function(t){this.$localStorage.playlist=_.remove(this.$localStorage.playlist,function(e){return e.id!==t.id})}},{key:"contains",value:function(t){return angular.isObject(_.find(this.$localStorage.playlist,{id:t.id}))}},{key:"addOrRemove",value:function(t){this.contains(t)?this.remove(t):this.add(t)}},{key:"removeAll",value:function(){this.$localStorage.playlist=[]}}]),n}();angular.module("ps.player.playlist",["ngStorage"]).service("playlistService",g);var h=function(){function n(e,a,i,s,o){t(this,n),this.podcastService=s,this.$location=e,this.tagService=i,this.podcast=angular.extend(this.podcastService.getNewPodcast(),a),this.types=o}return n.$inject=["$location","defaultPodcast","tagService","podcastService","types"],e(n,[{key:"findInfo",value:function(){var t=this;return this.podcastService.findInfo(this.podcast.url).then(function(e){t.podcast.title=e.title,t.podcast.description=e.description,t.podcast.type=e.type,t.podcast.cover.url=e.cover.url})}},{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"changeType",value:function(){this.podcast.type=/beinsports\.fr/i.test(this.podcast.url)?"BeInSports":/canalplus\.fr/i.test(this.podcast.url)?"CanalPlus":/jeuxvideo\.fr/i.test(this.podcast.url)?"JeuxVideoFR":/jeuxvideo\.com/i.test(this.podcast.url)?"JeuxVideoCom":/parleys\.com/i.test(this.podcast.url)?"Parleys":/pluzz\.francetv\.fr/i.test(this.podcast.url)?"Pluzz":/youtube\.com/i.test(this.podcast.url)?"Youtube":this.podcast.url.length>0?"RSS":"Send"}},{key:"save",value:function(){var t=this;this.podcastService.save(this.podcast).then(function(e){return t.$location.path("/podcasts/"+e.id)})}}]),n}();angular.module("ps.podcast.creation",["ps.config.route","ps.dataservice","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcast-creation",{templateUrl:"html/podcast-creation.html",controller:"PodcastAddCtrl",controllerAs:"pac",hotkeys:e,resolve:{types:["typeService",function(t){return t.findAll()}]}})}]).constant("defaultPodcast",{hasToBeDeleted:!0,cover:{height:200,width:200}}).controller("PodcastAddCtrl",h);var m=function z(e,n){t(this,z),this.podcasts=e,this.types=n,this.filters={title:"",type:""}};m.$inject=["podcasts","types"],angular.module("ps.podcast.list",["ps.config.route","ps.dataService.podcast","ps.dataService.type"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcasts",{templateUrl:"html/podcasts-list.html",controller:"PodcastsListCtrl",controllerAs:"plc",hotkeys:e,resolve:{podcasts:["podcastService",function(t){return t.findAll()}],types:["typeService",function(t){return t.findAll()}]}})}]).controller("PodcastsListCtrl",m),angular.module("ps.podcast",["ps.podcast.details","ps.podcast.creation","ps.podcast.list"]);var v=function(){function n(e,a){t(this,n),this.$sessionStorage=a,this.$sessionStorage.searchParameters=e}return n.$inject=["DefaultItemSearchParameters","$sessionStorage"],e(n,[{key:"getParameters",value:function(){return this.$sessionStorage.searchParameters}},{key:"page",value:function(t){return angular.isNumber(t)&&(this.$sessionStorage.searchParameters.page=t),this.$sessionStorage.searchParameters.page}},{key:"size",value:function(t){return angular.isNumber(t)&&(this.$sessionStorage.searchParameters.size=t),this.$sessionStorage.searchParameters.size}},{key:"updateSearchParam",value:function(t){this.$sessionStorage.searchParameters.term=t.term,this.$sessionStorage.searchParameters.tags=t.tags,this.$sessionStorage.searchParameters.direction=t.direction,this.$sessionStorage.searchParameters.properties=t.properties}}]),n}(),f=function(){function n(e,a,i,s,o,l,r,c){var d=this;t(this,n),this.$location=i,this.itemService=s,this.tagService=o,this.DownloadManager=l,this.playlistService=r,this.SearchItemCache=a,this.totalItems=Number.MAX_VALUE,this.maxSize=10,this.currentPage=this.SearchItemCache.page()+1,this.searchParameters=this.SearchItemCache.getParameters(),this.DownloadManager.ws.subscribe("/topic/download",function(t){return d.updateItemFromWS(t)},e),e.$on("$routeUpdate",function(){d.currentPage!==d.$location.search().page&&(d.currentPage=d.$location.search().page||1,d.changePage())}),this.attachResponse(c)}return n.$inject=["$scope","SearchItemCache","$location","itemService","tagService","DonwloadManager","playlistService","items"],e(n,[{key:"updateItemFromWS",value:function(t){var e=JSON.parse(t.body),n=_.find(this.items,{id:e.id});n&&_.assign(n,e)}},{key:"changePage",value:function(){var t=this;return this.SearchItemCache.page(this.calculatePage()),this.itemService.search(this.SearchItemCache.getParameters()).then(function(e){return t.attachResponse(e)})}},{key:"attachResponse",value:function(t){this.items=t.content,this.totalPages=t.totalPages,this.totalItems=t.totalElements,this.currentPage=this.SearchItemCache.page(t.number)+1,this.$location.search("page",this.currentPage)}},{key:"swipePage",value:function(t){return this.currentPage=this.SearchItemCache.page()+t+1,this.changePage()}},{key:"remove",value:function(t){var e=this;return t.remove().then(function(){return e.playlistService.remove(t)}).then(function(){return e.changePage()})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(t){var n=_.find(e.items,{id:t.id});return _.assign(n,t),n}).then(function(t){return e.playlistService.remove(t)})}},{key:"stopDownload",value:function(t){this.DownloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){return this.DownloadManager.ws.toggle(t)}},{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"addOrRemove",value:function(t){return this.playlistService.addOrRemove(t)}},{key:"isInPlaylist",value:function(t){return this.playlistService.contains(t)}},{key:"calculatePage",value:function(){return this.currentPage<=1?0:this.currentPage>Math.ceil(this.totalItems/this.SearchItemCache.size())?Math.ceil(this.totalItems/this.SearchItemCache.size())-1:this.currentPage-1}},{key:"resetSearch",value:function(){return this.currentPage=1,this.SearchItemCache.updateSearchParam(this.searchParameters),this.changePage()}}]),n}();angular.module("ps.search.item",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.tag","ps.player","ps.config.route","ngTagsInput","ngStorage"]).config(["$routeProvider","commonKey",function(t,e){t.when("/items",{templateUrl:"html/items-search.html",controller:"ItemsSearchCtrl",controllerAs:"isc",reloadOnSearch:!1,hotkeys:[["right","Next page","isc.swipePage(1)"],["left","Previous page","isc.swipePage(-1)"]].concat(e),resolve:{items:["itemService","SearchItemCache",function(t,e){return t.search(e.getParameters())}]}})}]).constant("DefaultItemSearchParameters",{page:0,size:12,term:void 0,tags:void 0,direction:"DESC",properties:"pubdate"}).controller("ItemsSearchCtrl",f).service("SearchItemCache",v),angular.module("ps.search",["ps.search.item"]);var y=function(){function n(e,a){t(this,n),this.statService=e,this.month=1,this.chartSeries=[],this.transform(a),this.chartConfig={options:{chart:{type:"spline"},plotOptions:{spline:{marker:{enabled:!0}}},xAxis:{type:"datetime",dateTimeLabelFormats:{month:"%e. %b",year:"%b"},title:{text:"Date"}}},series:this.chartSeries,title:{text:""},credits:{enabled:!1},loading:!1}}return n.$inject=["statService","stats"],e(n,[{key:"transform",value:function(t){var e=this;_.updateinplace(this.chartSeries,[]),angular.forEach(t,function(t){var a={name:t.type};a.data=_(t.values).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value(),e.chartSeries.push(a)})}},{key:"navigate",value:function(t){this.month+=t,this.generateChartData()}},{key:"generateChartData",value:function(){var t=this;return this.statService.statsByType(this.month).then(function(e){return t.transform(e)})}}],[{key:"dateMapper",value:function(){return function(t){return{date:Date.UTC(t.date[0],t.date[1]-1,t.date[2]),numberOfItems:t.numberOfItems}}}},{key:"highChartsMapper",value:function(){return function(t){return[t.date,t.numberOfItems]}}}]),n}();angular.module("ps.stats",["ps.dataService.stat"]).config(["$routeProvider","commonKey",function(t,e){t.when("/stats",{templateUrl:"html/stats.html",controller:"StatsController",controllerAs:"sc",hotkeys:e,resolve:{stats:["statService",function(t){return t.statsByType()}]}})}]).controller("StatsController",y),angular.module("ps.dataservice",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.podcast","ps.dataService.tag","ps.dataService.type","ps.dataService.updateService"]);var b=function(){function n(e,a){t(this,n),this.WS_DOWNLOAD_BASE=e,this.ngstomp=a}return e(n,[{key:"connect",value:function(){return this.ngstomp.connect()}},{key:"subscribe",value:function(t,e,n){return this.ngstomp.subscribe(t,e,n)}},{key:"unsubscribe",value:function(t){return this.ngstomp.unsubscribe(t)}},{key:"toggle",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/toogle",t)}},{key:"start",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/start",t)}},{key:"pause",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/pause",t)}},{key:"stop",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/stop",t)}}]),n}(),w=function(){function n(e,a){t(this,n),this.Restangular=e,this.baseTask=this.Restangular.one("task"),this.baseDownloadManager=this.baseTask.one("downloadManager"),this.WS_DOWNLOAD_BASE="/app/download",this.ws=new b(this.WS_DOWNLOAD_BASE,a)}return n.$inject=["Restangular","ngstomp"],e(n,[{key:"download",value:function(t){return this.Restangular.one("item").customGET(t.id+"/addtoqueue")}},{key:"stopDownload",value:function(t){return this.baseDownloadManager.customPOST(t.id,"stopDownload")}},{key:"toggleDownload",value:function(t){return this.baseDownloadManager.customPOST(t.id,"toogleDownload")}},{key:"stopAllDownload",value:function(){return this.baseDownloadManager.customGET("stopAllDownload")}},{key:"pauseAllDownload",value:function(){return this.baseDownloadManager.customGET("pauseAllDownload")}},{key:"restartAllCurrentDownload",value:function(){return this.baseDownloadManager.customGET("restartAllCurrentDownload")}},{key:"removeFromQueue",value:function(t){return this.baseDownloadManager.customDELETE("queue/"+t.id)}},{key:"updateNumberOfSimDl",value:function(t){return this.baseDownloadManager.customPOST(t,"limit")}},{key:"dontDonwload",value:function(t){return this.baseDownloadManager.customDELETE("queue/"+t.id+"/andstop")}},{key:"getDownloading",value:function(){return this.baseTask.all("downloadManager/downloading").getList()}},{key:"getNumberOfSimDl",value:function(){return this.baseDownloadManager.one("limit").get()}},{key:"moveInWaitingList",value:function(t,e){this.baseDownloadManager.customPOST({id:t.id,position:e},"move")}}]),n}();angular.module("ps.dataService.donwloadManager",["restangular","AngularStompDK"]).service("DonwloadManager",w);var S=function(){function n(e){t(this,n),this.Restangular=e,this.childRoute="items"}return n.$inject=["Restangular"],e(n,[{key:"search",value:function(){var t=this,e=void 0===arguments[0]?{page:0,size:12}:arguments[0];return this.Restangular.one("item/search").post(null,e).then(function(e){return e.content=t.restangularizedItems(e.content),e})}},{key:"findById",value:function(t,e){return this.Restangular.one("podcast",t).one(this.childRoute,e).get()}},{key:"getItemForPodcastWithPagination",value:function(t,e){return t.one("items").post(null,e)}},{key:"restangularizePodcastItem",value:function(t,e){return this.Restangular.restangularizeCollection(t,e,this.childRoute)}},{key:"restangularizedItems",value:function(t){var e=this,n=[];return angular.forEach(t,function(t){n.push(e.Restangular.restangularizeElement(e.Restangular.one("podcast",t.podcastId),t,e.childRoute))}),n}},{key:"upload",value:function(t,e){var n=new FormData;return n.append("file",e),t.all(this.childRoute).withHttpConfig({transformRequest:angular.identity}).customPOST(n,"upload",void 0,{"Content-Type":void 0})}}]),n}();angular.module("ps.dataService.item",["restangular"]).service("itemService",S);var P=function(){function n(e){t(this,n),this.Restangular=e,this.route="podcast"}return n.$inject=["Restangular"],e(n,[{key:"findById",value:function(t){return this.Restangular.one(this.route,t).get()}},{key:"findAll",value:function(){return this.Restangular.all(this.route).getList()}},{key:"save",value:function(t){return t.save()}},{key:"getNewPodcast",value:function(){return this.Restangular.one(this.route)}},{key:"patch",value:function(t){return t.patch()}},{key:"deletePodcast",value:function(t){return t.remove()}},{key:"findInfo",value:function(t){return this.Restangular.one(this.route).findInfo(t)}},{key:"statsByPubdate",value:function(t){var e=void 0===arguments[1]?6:arguments[1];return this.Restangular.one(this.route,t).one("stats").all("byPubdate").post(e)}},{key:"statsByByDownloaddate",value:function(t){var e=void 0===arguments[1]?6:arguments[1];return this.Restangular.one(this.route,t).one("stats").all("byDownloaddate").post(e)}}]),n}();angular.module("ps.dataService.podcast",["restangular"]).config(["RestangularProvider",function(t){t.addElementTransformer("podcast",!1,function(t){return t.addRestangularMethod("findInfo","post","fetch",void 0,{"Content-Type":"text/plain"}),t})}]).service("podcastService",P);var k=function(){function n(e){t(this,n),this.Restangular=e,this.base=this.Restangular.one("stats")}return n.$inject=["Restangular"],e(n,[{key:"statsByType",value:function(){var t=void 0===arguments[0]?1:arguments[0]; +!function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=function(){function t(t,e){for(var n=0;n]+>/gm,"")}}),_.mixin({updateinplace:function(t,e){var n=void 0===arguments[2]?function(t,e){return t.indexOf(e)}:arguments[2],a=void 0===arguments[3]?!1:arguments[3];return _.forEachRight(t.slice(),function(a,i){return-1===n(e,a)&&t.splice(i,1)}),_.forEach(e,function(e){return-1===n(t,e)&&t.push(e)}),a&&_.forEach(e,function(e,a){var i=t.splice(n(t,e),1)[0];t.splice(a,0,i)}),t}});var s=function B(){t(this,B),this.navCollapsed=!0},o=function(){function n(){t(this,n),this.transclude=!0,this.replace=!0,this.restrict="E",this.scope=!0,this.templateUrl="html/navbar.html",this.controller="navbarController",this.controllerAs="navbar"}return e(n,[{key:"link",value:function(t,e){e.removeClass("hidden")}}]),n}();angular.module("navbar",[]).directive("navbar",function(){return new o}).controller("navbarController",s);var l=function(){function n(){t(this,n),this.restrict="E",this.scope=!0,this.templateUrl="html/updating.html",this.controller="UpdatingController",this.controllerAs="uc"}return e(n,[{key:"link",value:function(t,e){var n=e.parent().parent()[0];n&&"LI"===n.tagName&&!function(){var e=angular.element(n);e.addClass("hidden"),t.$watch("uc.isUpdating",function(t){return t?e.removeClass("hidden"):e.addClass("hidden")})}()}}]),n}(),r=function(){function n(e,a){var i=this;t(this,n),this.ngstomp=e,this.isUpdating=!1,this.$scope=a,this.ngstomp.subscribe("/app/updating",function(t){return i.updateStatus(t)},a).subscribe("/topic/updating",function(t){return i.updateStatus(t)},a)}return n.$inject=["ngstomp","$scope"],e(n,[{key:"updateStatus",value:function(t){this.isUpdating=JSON.parse(t.body)}}]),n}();angular.module("updating",["AngularStompDK"]).directive("updateStatus",function(){return new l}).controller("UpdatingController",r),angular.module("ps.config",["ps.config.route","ps.config.loading","ps.config.restangular","ps.config.ngstomp","ps.config.module"]),angular.module("ps.config.loading",["angular-loading-bar"]).config(["cfpLoadingBarProvider",function(t){t.includeSpinner=!1}]),angular.module("ps.config.module",["ngTouch","ngAnimate","ui.bootstrap","truncate","ngFileUpload"]),angular.module("ps.config.ngstomp",["AngularStompDK"]).config(["ngstompProvider",function(t){return t.url("/ws").credential("login","password")["class"](SockJS)}]),angular.module("ps.config.restangular",["restangular"]).config(["RestangularProvider",function(t){t.setBaseUrl("/api/"),t.addElementTransformer("items",!1,function(t){return t.addRestangularMethod("reset","get","reset"),t.addRestangularMethod("download","get","addtoqueue"),t})}]),angular.module("ps.config.route",["ngRoute","cfp.hotkeys"]).constant("commonKey",[["h","Goto Home",function(t){t.preventDefault(),window.location.href="/items"}],["s","Goto Search",function(t){t.preventDefault(),window.location.href="/item/search"}],["p","Goto Podcast List",function(t){t.preventDefault(),window.location.href="/podcasts"}],["d","Goto Download List",function(t){t.preventDefault(),window.location.href="/download"}]]).config(["$routeProvider",function(t){return t.otherwise({redirectTo:"/items"})}]).config(["$locationProvider",function(t){return t.html5Mode(!0)}]);var c=function(){function n(e,a,i){var s=this;t(this,n),this.DonwloadManager=a,this.$notification=i,this.items=[],this.waitingitems=[],this.numberOfSimDl=0,this.DonwloadManager.getNumberOfSimDl().then(function(t){s.numberOfSimDl=parseInt(t)}),this.DonwloadManager.ws.subscribe("/app/download",function(t){return s.onSubscribeDownload(t)},e).subscribe("/app/waiting",function(t){return s.onSubscribeWaiting(t)},e).subscribe("/topic/download",function(t){return s.onDownloadUpdate(t)},e).subscribe("/topic/waiting",function(t){return s.onWaitingUpdate(t)},e)}return n.$inject=["$scope","DonwloadManager","$notification"],e(n,[{key:"onSubscribeDownload",value:function(t){this.items=JSON.parse(t.body)}},{key:"onSubscribeWaiting",value:function(t){this.waitingitems=JSON.parse(t.body)}},{key:"onDownloadUpdate",value:function(t){var e=JSON.parse(t.body),n=_.find(this.items,{id:e.id});switch(e.status){case"Started":case"Paused":n?_.assign(n,e):this.items.push(e);break;case"Finish":try{this.$notification("Téléchargement terminé",{body:e.title,icon:e.cover.url,delay:5e3})}catch(a){}this.onStoppedFromWS(n);break;case"Stopped":this.onStoppedFromWS(n)}}},{key:"onStoppedFromWS",value:function(t){t&&_.remove(this.items,function(e){return e.id===t.id})}},{key:"onWaitingUpdate",value:function(t){var e=JSON.parse(t.body);_.updateinplace(this.waitingitems,e,function(t,e){return _.findIndex(t,{id:e.id})},!0)}},{key:"getTypeFromStatus",value:function(t){return"Paused"===t.status?"warning":"info"}},{key:"updateNumberOfSimDl",value:function(t){this.DonwloadManager.updateNumberOfSimDl(t)}},{key:"download",value:function(t){this.DonwloadManager.download(t)}},{key:"stopDownload",value:function(t){this.DonwloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DonwloadManager.ws.toggle(t)}},{key:"stopAllDownload",value:function(){this.DonwloadManager.stopAllDownload()}},{key:"pauseAllDownload",value:function(){this.DonwloadManager.pauseAllDownload()}},{key:"restartAllCurrentDownload",value:function(){this.DonwloadManager.restartAllCurrentDownload()}},{key:"removeFromQueue",value:function(t){this.DonwloadManager.removeFromQueue(t)}},{key:"dontDonwload",value:function(t){this.DonwloadManager.dontDonwload(t)}},{key:"moveInWaitingList",value:function(t,e){this.DonwloadManager.moveInWaitingList(t,e)}}]),n}();angular.module("ps.download",["ps.config.route","ps.dataService.donwloadManager","notification"]).config(["$routeProvider","commonKey",function(t,e){return t.when("/download",{templateUrl:"html/download.html",controller:"DownloadCtrl",controllerAs:"dc",hotkeys:e})}]).controller("DownloadCtrl",c),angular.module("ps.partial",[]).run(["$templateCache",function(t){t.put("html/authorize-notification.html",'\n'),t.put("html/download.html",'
\n\n
\n
\n \n
\n \n
\n
\n
\n \n \n \n
\n
\n
\n\n
\n
\n \n \n
\n\n \n \n \n\n
\n
{{item.title | characters:100}}
\n
\n {{item.progression}}%\n
\n
\n\n\n
\n\n \n \n \n Liste d\'attente {{ dc.waitingitems.length }}\n \n
\n\n
\n
\n \n \n \n
\n\n \n \n \n\n
\n
{{item.title | characters:100}}
\n
\n
\n\n
\n
\n\n\n
'),t.put("html/item-detail.html",'\n
\n\n
\n \n\n
\n
\n
\n \n \n \n\n
\n\n
\n \n \n \n \n \n\n \n \n\n \n\n \n \n \n \n \n\n \n \n
\n
\n
\n
\n\n
\n
\n
\n

{{ idc.item.title }}

\n
\n
\n \n
\n
\n\n
\n
\n\n'),t.put("html/item-player.html",'
\n
\n \n\n
\n \n \n\n \n \n {{ currentTime | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n {{ timeLeft | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n \n \n
\n
\n\n \n \n \n
\n
\n
'),t.put("html/items-search.html",'\n
\n \n\n \n\n
\n \n \n
\n \n
\n \n
\n
\n'),t.put("html/navbar.html",''),t.put("html/player.html",'
\n
\n
\n \n \n\n \n \n {{ currentTime | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n {{ timeLeft | date:\'H:mm:ss\':\'+0000\' }}\n \n \n \n \n \n
\n
\n\n \n\n \n
\n
\n
\n
\n
Rafraichir
\n
Vider
\n
\n
\n\n \n\n \n \n \n\n
\n

{{ item.title }}

\n
\n
\n \n
\n\n
'),t.put("html/podcast-creation.html",'
\n
\n

Ajouter un Podcast

\n
\n
\n\n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n \n\n
\n \n
\n
\n\n\n
\n
\n
\n \n
\n
\n
\n\n
\n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n \n\n
\n \n
\n
\n
\n\n\n
\n
\n \n
\n
\n
\n
\n\n\n\n'), +t.put("html/podcast-detail.html",'\n\n
\n
\n \n\n
\n
\n
\n
\n

{{ pdc.podcast.title }}

\n

{{ pdc.podcast.totalItems }} Episodes

\n
\n
\n \n \n
\n
\n
\n
\n
\n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n
\n
\n\n\n\n'),t.put("html/podcast-details-edition.html",'
\n\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
\n
\n
\n \n \n \n
\n'),t.put("html/podcast-details-episodes.html",'
\n
\n
\n
\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n
\n\n \n \n \n \n
\n

{{ item.title }}

\n \n

{{item.pubdate | date : \'dd/MM/yyyy à HH:mm\' }}

\n
\n
\n\n
\n \n
\n
\n\n '),t.put("html/podcast-details-stats.html",'
\n
\n
\n - \n \n + \n
\n
\n
\n \n
\n'),t.put("html/podcast-details-upload.html",'
\n
\n
\n
\n Déposer un ou des fichiers ici\n
\n
\n
\n'),t.put("html/podcasts-list.html",'
\n\n \n\n\n
\n
\n \n \n \n
\n
\n
\n\n'),t.put("html/stats.html",'
\n
\n
\n
\n - \n \n + \n
\n
\n
\n \n
\n
'),t.put("html/updating.html",'\n \n')}]);var d=function(){function n(e,a,i,s,o,l){var r=this;t(this,n),this.item=l,this.$location=i,this.item.podcast=o,this.playlistService=s,this.DonwloadManager=a;var c="/topic/podcast/".concat(this.item.podcast.id);this.DonwloadManager.ws.subscribe(c,function(t){var e=JSON.parse(t.body);e.id==r.item.id&&_.assign(r.item,e)},e)}return n.$inject=["$scope","DonwloadManager","$location","playlistService","podcast","item"],e(n,[{key:"stopDownload",value:function(t){this.DonwloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DonwloadManager.ws.toggle(t)}},{key:"remove",value:function(t){var e=this;return t.remove().then(function(){e.playlistService.remove(t),e.$location.path("/podcasts/".concat(e.item.podcast.id))})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(n){_.assign(e.item,n),e.playlistService.remove(t)})}},{key:"toggleInPlaylist",value:function(){this.playlistService.addOrRemove(this.item)}},{key:"isInPlaylist",value:function(){return this.playlistService.contains(this.item)}}]),n}();angular.module("ps.item.details",["ps.dataService.donwloadManager","ps.player"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcasts/:podcastId/item/:itemId",{templateUrl:"html/item-detail.html",controller:"ItemDetailCtrl",controllerAs:"idc",hotkeys:e,resolve:{item:["itemService","$route",function(t,e){return t.findById(e.current.params.podcastId,e.current.params.itemId)}],podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("ItemDetailCtrl",d),angular.module("ps.item",["ps.item.details","ps.item.player"]);var u=function j(e,n,a,i){t(this,j),this.item=n,this.item.podcast=e,this.$timeout=a,this.config={autoPlay:!0,sources:[{src:this.item.proxyURL,type:this.item.mimeType}],plugins:{controls:{autoHide:!i.isTouchedDevice(),autoHideTime:2e3},poster:this.item.cover.url}}};u.$inject=["podcast","item","$timeout","deviceDetectorService"],angular.module("ps.item.player",["ngSanitize","ngRoute","device-detection","com.2fdevs.videogular","com.2fdevs.videogular.plugins.poster","com.2fdevs.videogular.plugins.controls","com.2fdevs.videogular.plugins.overlayplay","com.2fdevs.videogular.plugins.buffering"]).config(["$routeProvider",function(t){t.when("/podcasts/:podcastId/item/:itemId/play",{templateUrl:"html/item-player.html",controller:"ItemPlayerController",controllerAs:"ipc",resolve:{item:["itemService","$route",function(t,e){return t.findById(e.current.params.podcastId,e.current.params.itemId)}],podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("ItemPlayerController",u);var p=function(){function n(e,a,i){t(this,n),this.playlistService=e,this.$timeout=a,this.playlist=[],this.state=null,this.API=null,this.currentVideo={},this.config={autoPlay:!0,sources:[],plugins:{controls:{autoHide:!i.isTouchedDevice(),autoHideTime:2e3},poster:""}},this.reloadPlaylist()}return n.$inject=["playlistService","$timeout","deviceDetectorService"],e(n,[{key:"onPlayerReady",value:function(t){this.API=t,("play"==this.API.currentState||this.isCompleted)&&this.API.play(),this.isCompleted=!1,this.setVideo(0)}},{key:"onCompleteVideo",value:function(){var t=this.getIndexOfVideoInPlaylist(this.currentVideo);return this.isCompleted=!0,t+1===this.playlist.length?void(this.currentVideo=this.playlist[0]):void this.setVideo(t+1)}},{key:"reloadPlaylist",value:function(){_.updateinplace(this.playlist,this.playlistService.playlist(),function(t,e){return _.findIndex(t,{id:e.id})})}},{key:"setVideo",value:function(t){this.currentVideo=this.playlist[t],null!==this.currentVideo&&void 0!==this.currentVideo&&(this.API.stop(),this.config.sources=[{src:this.currentVideo.proxyURL,type:this.currentVideo.mimeType}],this.config.plugins.poster=this.currentVideo.cover.url)}},{key:"remove",value:function(t){this.playlistService.remove(t),this.reloadPlaylist(),this.config.sources.length>0&&this.config.sources[0].src===t.proxyURL&&this.setVideo(0)}},{key:"removeAll",value:function(){this.playlistService.removeAll(),this.reloadPlaylist()}},{key:"getIndexOfVideoInPlaylist",value:function(t){return this.playlist.indexOf(t)}}]),n}();angular.module("ps.player",["ngSanitize","ngRoute","device-detection","com.2fdevs.videogular","com.2fdevs.videogular.plugins.poster","com.2fdevs.videogular.plugins.controls","com.2fdevs.videogular.plugins.overlayplay","com.2fdevs.videogular.plugins.buffering","ps.player.playlist"]).config(["$routeProvider",function(t){t.when("/player",{templateUrl:"html/player.html",controller:"PlayerController",controllerAs:"pc"})}]).controller("PlayerController",p);var g=function(){function n(e){t(this,n),this.$localStorage=e,this.$localStorage.playlist=this.$localStorage.playlist||[]}return n.$inject=["$localStorage"],e(n,[{key:"playlist",value:function(){return this.$localStorage.playlist}},{key:"add",value:function(t){this.$localStorage.playlist.push(t)}},{key:"remove",value:function(t){this.$localStorage.playlist=_.remove(this.$localStorage.playlist,function(e){return e.id!==t.id})}},{key:"contains",value:function(t){return angular.isObject(_.find(this.$localStorage.playlist,{id:t.id}))}},{key:"addOrRemove",value:function(t){this.contains(t)?this.remove(t):this.add(t)}},{key:"removeAll",value:function(){this.$localStorage.playlist=[]}}]),n}();angular.module("ps.player.playlist",["ngStorage"]).service("playlistService",g);var h=function(){function n(e,a,i,s,o){t(this,n),this.podcastService=s,this.$location=e,this.tagService=i,this.podcast=angular.extend(this.podcastService.getNewPodcast(),a),this.types=o}return n.$inject=["$location","defaultPodcast","tagService","podcastService","types"],e(n,[{key:"findInfo",value:function(){var t=this;return this.podcastService.findInfo(this.podcast.url).then(function(e){t.podcast.title=e.title,t.podcast.description=e.description,t.podcast.type=e.type,t.podcast.cover.url=e.cover.url})}},{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"changeType",value:function(){this.podcast.type=/beinsports\.fr/i.test(this.podcast.url)?"BeInSports":/canalplus\.fr/i.test(this.podcast.url)?"CanalPlus":/jeuxvideo\.fr/i.test(this.podcast.url)?"JeuxVideoFR":/jeuxvideo\.com/i.test(this.podcast.url)?"JeuxVideoCom":/parleys\.com/i.test(this.podcast.url)?"Parleys":/pluzz\.francetv\.fr/i.test(this.podcast.url)?"Pluzz":/youtube\.com/i.test(this.podcast.url)?"Youtube":this.podcast.url.length>0?"RSS":"Send"}},{key:"save",value:function(){var t=this;this.podcastService.save(this.podcast).then(function(e){return t.$location.path("/podcasts/"+e.id)})}}]),n}();angular.module("ps.podcast.creation",["ps.config.route","ps.dataservice","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcast-creation",{templateUrl:"html/podcast-creation.html",controller:"PodcastAddCtrl",controllerAs:"pac",hotkeys:e,resolve:{types:["typeService",function(t){return t.findAll()}]}})}]).constant("defaultPodcast",{hasToBeDeleted:!0,cover:{height:200,width:200}}).controller("PodcastAddCtrl",h);var m=function N(e,n){t(this,N),this.podcasts=e,this.types=n,this.filters={title:"",type:""}};m.$inject=["podcasts","types"],angular.module("ps.podcast.list",["ps.config.route","ps.dataService.podcast","ps.dataService.type"]).config(["$routeProvider","commonKey",function(t,e){t.when("/podcasts",{templateUrl:"html/podcasts-list.html",controller:"PodcastsListCtrl",controllerAs:"plc",hotkeys:e,resolve:{podcasts:["podcastService",function(t){return t.findAll()}],types:["typeService",function(t){return t.findAll()}]}})}]).controller("PodcastsListCtrl",m),angular.module("ps.podcast",["ps.podcast.details","ps.podcast.creation","ps.podcast.list"]);var v=function(){function n(e,a){t(this,n),this.$sessionStorage=a,this.$sessionStorage.searchParameters=e}return n.$inject=["DefaultItemSearchParameters","$sessionStorage"],e(n,[{key:"getParameters",value:function(){return this.$sessionStorage.searchParameters}},{key:"page",value:function(t){return angular.isNumber(t)&&(this.$sessionStorage.searchParameters.page=t),this.$sessionStorage.searchParameters.page}},{key:"size",value:function(t){return angular.isNumber(t)&&(this.$sessionStorage.searchParameters.size=t),this.$sessionStorage.searchParameters.size}},{key:"updateSearchParam",value:function(t){this.$sessionStorage.searchParameters.term=t.term,this.$sessionStorage.searchParameters.tags=t.tags,this.$sessionStorage.searchParameters.direction=t.direction,this.$sessionStorage.searchParameters.properties=t.properties}}]),n}(),f=function(){function n(e,a,i,s,o,l,r,c){var d=this;t(this,n),this.$location=i,this.itemService=s,this.tagService=o,this.DownloadManager=l,this.playlistService=r,this.SearchItemCache=a,this.totalItems=Number.MAX_VALUE,this.maxSize=10,this.currentPage=this.SearchItemCache.page()+1,this.searchParameters=this.SearchItemCache.getParameters(),this.DownloadManager.ws.subscribe("/topic/download",function(t){return d.updateItemFromWS(t)},e),e.$on("$routeUpdate",function(){d.currentPage!==d.$location.search().page&&(d.currentPage=d.$location.search().page||1,d.changePage())}),this.attachResponse(c)}return n.$inject=["$scope","SearchItemCache","$location","itemService","tagService","DonwloadManager","playlistService","items"],e(n,[{key:"updateItemFromWS",value:function(t){var e=JSON.parse(t.body),n=_.find(this.items,{id:e.id});n&&_.assign(n,e)}},{key:"changePage",value:function(){var t=this;return this.SearchItemCache.page(this.calculatePage()),this.itemService.search(this.SearchItemCache.getParameters()).then(function(e){return t.attachResponse(e)})}},{key:"attachResponse",value:function(t){this.items=t.content,this.totalPages=t.totalPages,this.totalItems=t.totalElements,this.currentPage=this.SearchItemCache.page(t.number)+1,this.$location.search("page",this.currentPage)}},{key:"swipePage",value:function(t){return this.currentPage=this.SearchItemCache.page()+t+1,this.changePage()}},{key:"remove",value:function(t){var e=this;return t.remove().then(function(){return e.playlistService.remove(t)}).then(function(){return e.changePage()})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(t){var n=_.find(e.items,{id:t.id});return _.assign(n,t),n}).then(function(t){return e.playlistService.remove(t)})}},{key:"stopDownload",value:function(t){this.DownloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){return this.DownloadManager.ws.toggle(t)}},{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"addOrRemove",value:function(t){return this.playlistService.addOrRemove(t)}},{key:"isInPlaylist",value:function(t){return this.playlistService.contains(t)}},{key:"calculatePage",value:function(){return this.currentPage<=1?0:this.currentPage>Math.ceil(this.totalItems/this.SearchItemCache.size())?Math.ceil(this.totalItems/this.SearchItemCache.size())-1:this.currentPage-1}},{key:"resetSearch",value:function(){return this.currentPage=1,this.SearchItemCache.updateSearchParam(this.searchParameters),this.changePage()}}]),n}();angular.module("ps.search.item",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.tag","ps.player","ps.config.route","ngTagsInput","ngStorage"]).config(["$routeProvider","commonKey",function(t,e){t.when("/items",{templateUrl:"html/items-search.html",controller:"ItemsSearchCtrl",controllerAs:"isc",reloadOnSearch:!1,hotkeys:[["right","Next page","isc.swipePage(1)"],["left","Previous page","isc.swipePage(-1)"]].concat(e),resolve:{items:["itemService","SearchItemCache",function(t,e){return t.search(e.getParameters())}]}})}]).constant("DefaultItemSearchParameters",{page:0,size:12,term:void 0,tags:void 0,direction:"DESC",properties:"pubdate"}).controller("ItemsSearchCtrl",f).service("SearchItemCache",v),angular.module("ps.search",["ps.search.item"]);var y=function(){function n(e,a){t(this,n),this.statService=e,this.month=1,this.chartSeries=[],this.transform(a),this.chartConfig={options:{chart:{type:"spline"},plotOptions:{spline:{marker:{enabled:!0}}},xAxis:{type:"datetime",dateTimeLabelFormats:{month:"%e. %b",year:"%b"},title:{text:"Date"}}},series:this.chartSeries,title:{text:""},credits:{enabled:!1},loading:!1}}return n.$inject=["statService","stats"],e(n,[{key:"transform",value:function(t){var e=this;_.updateinplace(this.chartSeries,[]),angular.forEach(t,function(t){var a={name:t.type};a.data=_(t.values).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value(),e.chartSeries.push(a)})}},{key:"navigate",value:function(t){this.month+=t,this.generateChartData()}},{key:"generateChartData",value:function(){var t=this;return this.statService.statsByType(this.month).then(function(e){return t.transform(e)})}}],[{key:"dateMapper",value:function(){return function(t){return{date:Date.UTC(t.date[0],t.date[1]-1,t.date[2]),numberOfItems:t.numberOfItems}}}},{key:"highChartsMapper",value:function(){return function(t){return[t.date,t.numberOfItems]}}}]),n}();angular.module("ps.stats",["ps.dataService.stat"]).config(["$routeProvider","commonKey",function(t,e){t.when("/stats",{templateUrl:"html/stats.html",controller:"StatsController",controllerAs:"sc",hotkeys:e,resolve:{stats:["statService",function(t){return t.statsByType()}]}})}]).controller("StatsController",y),angular.module("ps.dataservice",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.podcast","ps.dataService.tag","ps.dataService.type","ps.dataService.updateService"]);var b=function(){function n(e,a){t(this,n),this.WS_DOWNLOAD_BASE=e,this.ngstomp=a}return e(n,[{key:"connect",value:function(){return this.ngstomp.connect()}},{key:"subscribe",value:function(t,e,n){return this.ngstomp.subscribe(t,e,n)}},{key:"unsubscribe",value:function(t){return this.ngstomp.unsubscribe(t)}},{key:"toggle",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/toogle",t)}},{key:"start",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/start",t)}},{key:"pause",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/pause",t)}},{key:"stop",value:function(t){return this.ngstomp.send(this.WS_DOWNLOAD_BASE+"/stop",t)}}]),n}(),w=function(){function n(e,a){t(this,n),this.Restangular=e,this.baseTask=this.Restangular.one("task"),this.baseDownloadManager=this.baseTask.one("downloadManager"),this.WS_DOWNLOAD_BASE="/app/download",this.ws=new b(this.WS_DOWNLOAD_BASE,a)}return n.$inject=["Restangular","ngstomp"],e(n,[{key:"download",value:function(t){return this.Restangular.one("item").customGET(t.id+"/addtoqueue")}},{key:"stopDownload",value:function(t){return this.baseDownloadManager.customPOST(t.id,"stopDownload")}},{key:"toggleDownload",value:function(t){return this.baseDownloadManager.customPOST(t.id,"toogleDownload")}},{key:"stopAllDownload",value:function(){return this.baseDownloadManager.customGET("stopAllDownload")}},{key:"pauseAllDownload",value:function(){return this.baseDownloadManager.customGET("pauseAllDownload")}},{key:"restartAllCurrentDownload",value:function(){return this.baseDownloadManager.customGET("restartAllCurrentDownload")}},{key:"removeFromQueue",value:function(t){return this.baseDownloadManager.customDELETE("queue/"+t.id)}},{key:"updateNumberOfSimDl",value:function(t){return this.baseDownloadManager.customPOST(t,"limit")}},{key:"dontDonwload",value:function(t){return this.baseDownloadManager.customDELETE("queue/"+t.id+"/andstop")}},{key:"getDownloading",value:function(){return this.baseTask.all("downloadManager/downloading").getList()}},{key:"getNumberOfSimDl",value:function(){return this.baseDownloadManager.one("limit").get()}},{key:"moveInWaitingList",value:function(t,e){this.baseDownloadManager.customPOST({id:t.id,position:e},"move")}}]),n}();angular.module("ps.dataService.donwloadManager",["restangular","AngularStompDK"]).service("DonwloadManager",w);var S=function(){function n(e){t(this,n),this.Restangular=e,this.childRoute="items"}return n.$inject=["Restangular"],e(n,[{key:"search",value:function(){var t=this,e=void 0===arguments[0]?{page:0,size:12}:arguments[0];return this.Restangular.one("item/search").post(null,e).then(function(e){return e.content=t.restangularizedItems(e.content),e})}},{key:"findById",value:function(t,e){return this.Restangular.one("podcast",t).one(this.childRoute,e).get()}},{key:"getItemForPodcastWithPagination",value:function(t,e){return t.one("items").post(null,e)}},{key:"restangularizePodcastItem",value:function(t,e){return this.Restangular.restangularizeCollection(t,e,this.childRoute)}},{key:"restangularizedItems",value:function(t){var e=this,n=[];return angular.forEach(t,function(t){n.push(e.Restangular.restangularizeElement(e.Restangular.one("podcast",t.podcastId),t,e.childRoute))}),n}},{key:"upload",value:function(t,e){var n=new FormData;return n.append("file",e),t.all(this.childRoute).withHttpConfig({transformRequest:angular.identity}).customPOST(n,"upload",void 0,{"Content-Type":void 0})}}]),n}();angular.module("ps.dataService.item",["restangular"]).service("itemService",S);var P=function(){function n(e){t(this,n),this.Restangular=e,this.route="podcast"}return n.$inject=["Restangular"],e(n,[{key:"findById",value:function(t){return this.Restangular.one(this.route,t).get()}},{key:"findAll",value:function(){return this.Restangular.all(this.route).getList()}},{key:"save",value:function(t){return t.save()}},{key:"getNewPodcast",value:function(){return this.Restangular.one(this.route)}},{key:"patch",value:function(t){return t.patch()}},{key:"deletePodcast",value:function(t){return t.remove()}},{key:"findInfo",value:function(t){return this.Restangular.one(this.route).findInfo(t)}},{key:"statsByPubdate",value:function(t){var e=void 0===arguments[1]?6:arguments[1];return this.Restangular.one(this.route,t).one("stats").all("byPubdate").post(e)}},{key:"statsByByDownloaddate",value:function(t){var e=void 0===arguments[1]?6:arguments[1];return this.Restangular.one(this.route,t).one("stats").all("byDownloaddate").post(e)}}]),n}();angular.module("ps.dataService.podcast",["restangular"]).config(["RestangularProvider",function(t){t.addElementTransformer("podcast",!1,function(t){return t.addRestangularMethod("findInfo","post","fetch",void 0,{"Content-Type":"text/plain"}),t})}]).service("podcastService",P);var k=function(){function n(e){t(this,n),this.Restangular=e,this.base=this.Restangular.one("stats")}return n.$inject=["Restangular"],e(n,[{key:"statsByType",value:function(){var t=void 0===arguments[0]?1:arguments[0]; -return this.base.all("byType").post(t)}}]),n}();angular.module("ps.dataService.stat",["restangular"]).service("statService",k);var D=function(){function n(e){t(this,n),this.baseAll=e.all("tag")}return n.$inject=["Restangular"],e(n,[{key:"getAll",value:function(){return this.baseAll.get()}},{key:"search",value:function(t){return this.baseAll.post(null,{name:t})}}]),n}();angular.module("ps.dataService.tag",["restangular"]).service("tagService",D);var $=function(){function n(e){t(this,n),this.baseAll=e.all("types")}return n.$inject=["Restangular"],e(n,[{key:"findAll",value:function(){return this.baseAll.getList()}}]),n}();angular.module("ps.dataService.type",["restangular"]).service("typeService",$);var I=function(){function n(e){t(this,n),this.Restangular=e}return n.$inject=["Restangular"],e(n,[{key:"forceUpdatePodcast",value:function(t){return this.Restangular.one("task").customPOST(t,"updateManager/updatePodcast/force")}}]),n}();angular.module("ps.dataService.updateService",["restangular"]).service("UpdateService",I);var x=function N(){t(this,N),this.restrict="E",this.templateUrl="html/podcast-details-edition.html",this.scope={podcast:"="},this.controller="podcastEditionCtrl",this.controllerAs="pec",this.bindToController=!0},C=function(){function n(e,a,i,s){t(this,n),this.$scope=e,this.$location=a,this.tagService=i,this.podcastService=s}return n.$inject=["$scope","$location","tagService","podcastService"],e(n,[{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"save",value:function(){var t=this,e=_.cloneDeep(this.podcast);return e.items=null,this.podcastService.patch(e).then(function(e){return _.assign(t.podcast,e)}).then(function(){return t.$scope.$emit("podcastEdition:save")})}},{key:"deletePodcast",value:function(){var t=this;return this.podcastService.deletePodcast(this.podcast).then(function(){return t.$location.path("/podcasts")})}}]),n}();angular.module("ps.podcast.details.edition",["ps.dataService.podcast","ps.dataService.tag","ngTagsInput"]).directive("podcastEdition",function(){return new x}).controller("podcastEditionCtrl",C);var T=function q(){t(this,q),this.restrict="E",this.templateUrl="html/podcast-details-episodes.html",this.scope={podcast:"="},this.controller="podcastItemsListCtrl",this.controllerAs="pic",this.bindToController=!0},A=function(){function n(e,a,i,s,o){var l=this;t(this,n),this.$scope=e,this.DownloadManager=a,this.itemService=s,this.playlistService=o,this.currentPage=1,this.itemPerPage=i,this.loadPage(),this.$scope.$on("podcastItems:refresh",function(){l.currentPage=1,l.loadPage()}),this.DownloadManager.ws.subscribe("/topic/podcast/".concat(this.podcast.id),function(t){return l.onMessageFromWS(t)},e)}return n.$inject=["$scope","DonwloadManager","PodcastItemPerPage","itemService","playlistService"],e(n,[{key:"onMessageFromWS",value:function(t){var e=JSON.parse(t.body),n=_.find(this.podcast.items,{id:e.id});_.assign(n,e)}},{key:"loadPage",value:function(){var t=this;return this.currentPage=this.currentPage<1?1:this.currentPage>Math.ceil(this.totalItems/this.itemPerPage)?Math.ceil(this.totalItems/this.itemPerPage):this.currentPage,this.itemService.getItemForPodcastWithPagination(this.podcast,{size:this.itemPerPage,page:this.currentPage-1,direction:"DESC",properties:"pubdate"}).then(function(e){t.podcast.items=t.itemService.restangularizePodcastItem(t.podcast,e.content),t.podcast.totalItems=e.totalElements})}},{key:"remove",value:function(t){var e=this;t.remove().then(function(){return e.podcast.items=_.reject(e.podcast.items,function(e){return e.id===t.id})}).then(function(){return e.playlistService.remove(t)}).then(function(){return e.loadPage()})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(t){var n=_.find(e.podcast.items,{id:t.id});return _.assign(n,t),n}).then(function(t){return e.playlistService.remove(t)})}},{key:"addOrRemoveInPlaylist",value:function(t){this.playlistService.addOrRemove(t)}},{key:"isInPlaylist",value:function(t){return this.playlistService.contains(t)}},{key:"swipePage",value:function(t){this.currentPage+=t,this.loadPage()}},{key:"stopDownload",value:function(t){this.DownloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DownloadManager.ws.toggle(t)}}]),n}();angular.module("ps.podcast.details.episodes",["ps.player"]).directive("podcastItemsList",function(){return new T}).constant("PodcastItemPerPage",10).controller("podcastItemsListCtrl",A);var R=function(){function n(e,a,i){var s=this;t(this,n),this.$scope=e,this.UpdateService=i,this.podcast=a,this.podcastTabs=[{heading:"Episodes",active:!0},{heading:"Edition",active:!1},{heading:"Upload",disabled:"send"!==this.podcast.type},{heading:"Stats",active:!1}],this.$scope.$on("podcastEdition:save",function(){return s.refreshItems()}),this.$scope.$on("podcastEdition:upload",function(){return s.refreshItems()})}return n.$inject=["$scope","podcast","UpdateService"],e(n,[{key:"refreshItems",value:function(){this.$scope.$broadcast("podcastItems:refresh")}},{key:"refresh",value:function(){var t=this;this.UpdateService.forceUpdatePodcast(this.podcast.id).then(function(){return t.refreshItems()})}},{key:"tabsActive",value:function(t){this.podcastTabs[t].active=!0}}]),n}();angular.module("ps.podcast.details",["ps.config.route","ps.podcast.details","ps.podcast.details.episodes","ps.podcast.details.edition","ps.podcast.details.upload","ps.podcast.details.stats","ps.dataService.updateService"]).config(["$routeProvider","commonKey",function(t,e){return t.when("/podcasts/:podcastId",{templateUrl:"html/podcast-detail.html",controller:"PodcastDetailCtrl",controllerAs:"pdc",hotkeys:e,resolve:{podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("PodcastDetailCtrl",R);var M=function W(){t(this,W),this.restrict="E",this.scope={podcast:"="},this.templateUrl="html/podcast-details-stats.html",this.controller="PodcastDetailsStatsCtrl",this.controllerAs="pdsc",this.bindToController=!0},O=function(){function n(e,a,i){var s=this;t(this,n),this.$q=a,this.podcastService=i,this.month=6,this.chartSeries=[],this.generateChartData(),this.chartConfig={options:{chart:{type:"spline"},plotOptions:{spline:{marker:{enabled:!0}}},xAxis:{type:"datetime",dateTimeLabelFormats:{month:"%e. %b",year:"%b"},title:{text:"Date"}}},series:this.chartSeries,title:{text:""},credits:{enabled:!1},loading:!1},e.$on("podcastItems:refresh",function(){return s.generateChartData()})}return n.$inject=["$scope","$q","podcastService"],e(n,[{key:"navigate",value:function(t){return this.month+=t,this.generateChartData()}},{key:"generateChartData",value:function(){var t=this;return n.resetChart(this.chartSeries),this.$q.all([this.podcastService.statsByByDownloaddate(this.podcast.id,this.month),this.podcastService.statsByPubdate(this.podcast.id,this.month)]).then(function(e){var a=_(e[0]).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value(),i=_(e[1]).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value();return t.chartSeries.push({name:"Download Date",data:a}),t.chartSeries.push({name:"Publication Date",data:i}),t.chartSeries})}}],[{key:"resetChart",value:function(t){_.updateinplace(t,[])}},{key:"dateMapper",value:function(){return function(t){return{date:Date.UTC(t.date[0],t.date[1]-1,t.date[2]),numberOfItems:t.numberOfItems}}}},{key:"highChartsMapper",value:function(){return function(t){return[t.date,t.numberOfItems]}}}]),n}();angular.module("ps.podcast.details.stats",["highcharts-ng"]).directive("podcastStats",function(){return new M}).controller("PodcastDetailsStatsCtrl",O);var L=function F(){t(this,F),this.restrcit="E",this.templateUrl="html/podcast-details-upload.html",this.scope={podcast:"="},this.controller="podcastUploadCtrl",this.controllerAs="puc",this.bindToController=!0},U=function(){function n(e,a,i){t(this,n),this.$scope=e,this.itemService=a,this.$notification=i}return n.$inject=["$scope","itemService","$notification"],e(n,[{key:"onFileSelect",value:function(t){var e=this;angular.forEach(t,function(t){e.itemService.upload(e.podcast,t).then(function(t){e.$scope.$emit("podcastEdition:upload");try{e.$notification("Upload effectué",{body:t.title,icon:t.cover.url,delay:5e3})}catch(n){}})})}}]),n}();angular.module("ps.podcast.details.upload",["ps.dataService.item","ngFileUpload","notification"]).directive("podcastUpload",function(){return new L}).controller("podcastUploadCtrl",U)}(); +return this.base.all("byType").post(t)}}]),n}();angular.module("ps.dataService.stat",["restangular"]).service("statService",k);var D=function(){function n(e){t(this,n),this.baseAll=e.all("tag")}return n.$inject=["Restangular"],e(n,[{key:"getAll",value:function(){return this.baseAll.get()}},{key:"search",value:function(t){return this.baseAll.post(null,{name:t})}}]),n}();angular.module("ps.dataService.tag",["restangular"]).service("tagService",D);var $=function(){function n(e){t(this,n),this.baseAll=e.all("types")}return n.$inject=["Restangular"],e(n,[{key:"findAll",value:function(){return this.baseAll.getList()}}]),n}();angular.module("ps.dataService.type",["restangular"]).service("typeService",$);var I=function(){function n(e){t(this,n),this.Restangular=e}return n.$inject=["Restangular"],e(n,[{key:"forceUpdatePodcast",value:function(t){return this.Restangular.one("task").customPOST(t,"updateManager/updatePodcast/force")}}]),n}();angular.module("ps.dataService.updateService",["restangular"]).service("UpdateService",I);var x=function q(){t(this,q),this.restrict="E",this.templateUrl="html/podcast-details-edition.html",this.scope={podcast:"="},this.controller="podcastEditionCtrl",this.controllerAs="pec",this.bindToController=!0},C=function(){function n(e,a,i,s){t(this,n),this.$scope=e,this.$location=a,this.tagService=i,this.podcastService=s}return n.$inject=["$scope","$location","tagService","podcastService"],e(n,[{key:"loadTags",value:function(t){return this.tagService.search(t)}},{key:"save",value:function(){var t=this,e=_.cloneDeep(this.podcast);return e.items=null,this.podcastService.patch(e).then(function(e){return _.assign(t.podcast,e)}).then(function(){return t.$scope.$emit("podcastEdition:save")})}},{key:"deletePodcast",value:function(){var t=this;return this.podcastService.deletePodcast(this.podcast).then(function(){return t.$location.path("/podcasts")})}}]),n}();angular.module("ps.podcast.details.edition",["ps.dataService.podcast","ps.dataService.tag","ngTagsInput"]).directive("podcastEdition",function(){return new x}).controller("podcastEditionCtrl",C);var T=function z(){t(this,z),this.restrict="E",this.templateUrl="html/podcast-details-episodes.html",this.scope={podcast:"="},this.controller="podcastItemsListCtrl",this.controllerAs="pic",this.bindToController=!0},A=function(){function n(e,a,i,s,o){var l=this;t(this,n),this.$scope=e,this.DownloadManager=a,this.itemService=s,this.playlistService=o,this.currentPage=1,this.itemPerPage=i,this.loadPage(),this.$scope.$on("podcastItems:refresh",function(){l.currentPage=1,l.loadPage()}),this.DownloadManager.ws.subscribe("/topic/podcast/".concat(this.podcast.id),function(t){return l.onMessageFromWS(t)},e)}return n.$inject=["$scope","DonwloadManager","PodcastItemPerPage","itemService","playlistService"],e(n,[{key:"onMessageFromWS",value:function(t){var e=JSON.parse(t.body),n=_.find(this.podcast.items,{id:e.id});_.assign(n,e)}},{key:"loadPage",value:function(){var t=this;return this.currentPage=this.currentPage<1?1:this.currentPage>Math.ceil(this.totalItems/this.itemPerPage)?Math.ceil(this.totalItems/this.itemPerPage):this.currentPage,this.itemService.getItemForPodcastWithPagination(this.podcast,{size:this.itemPerPage,page:this.currentPage-1,direction:"DESC",properties:"pubdate"}).then(function(e){t.podcast.items=t.itemService.restangularizePodcastItem(t.podcast,e.content),t.podcast.totalItems=e.totalElements})}},{key:"remove",value:function(t){var e=this;t.remove().then(function(){return e.podcast.items=_.reject(e.podcast.items,function(e){return e.id===t.id})}).then(function(){return e.playlistService.remove(t)}).then(function(){return e.loadPage()})}},{key:"reset",value:function(t){var e=this;return t.reset().then(function(t){var n=_.find(e.podcast.items,{id:t.id});return _.assign(n,t),n}).then(function(t){return e.playlistService.remove(t)})}},{key:"addOrRemoveInPlaylist",value:function(t){this.playlistService.addOrRemove(t)}},{key:"isInPlaylist",value:function(t){return this.playlistService.contains(t)}},{key:"swipePage",value:function(t){this.currentPage+=t,this.loadPage()}},{key:"stopDownload",value:function(t){this.DownloadManager.ws.stop(t)}},{key:"toggleDownload",value:function(t){this.DownloadManager.ws.toggle(t)}}]),n}();angular.module("ps.podcast.details.episodes",["ps.player"]).directive("podcastItemsList",function(){return new T}).constant("PodcastItemPerPage",10).controller("podcastItemsListCtrl",A);var R=function(){function n(e,a,i){var s=this;t(this,n),this.$scope=e,this.UpdateService=i,this.podcast=a,this.podcastTabs=[{heading:"Episodes",active:!0},{heading:"Edition",active:!1},{heading:"Upload",disabled:"send"!==this.podcast.type},{heading:"Stats",active:!1}],this.$scope.$on("podcastEdition:save",function(){return s.refreshItems()}),this.$scope.$on("podcastEdition:upload",function(){return s.refreshItems()})}return n.$inject=["$scope","podcast","UpdateService"],e(n,[{key:"refreshItems",value:function(){this.$scope.$broadcast("podcastItems:refresh")}},{key:"refresh",value:function(){var t=this;this.UpdateService.forceUpdatePodcast(this.podcast.id).then(function(){return t.refreshItems()})}},{key:"tabsActive",value:function(t){this.podcastTabs[t].active=!0}}]),n}();angular.module("ps.podcast.details",["ps.config.route","ps.podcast.details","ps.podcast.details.episodes","ps.podcast.details.edition","ps.podcast.details.upload","ps.podcast.details.stats","ps.dataService.updateService"]).config(["$routeProvider","commonKey",function(t,e){return t.when("/podcasts/:podcastId",{templateUrl:"html/podcast-detail.html",controller:"PodcastDetailCtrl",controllerAs:"pdc",hotkeys:e,resolve:{podcast:["podcastService","$route",function(t,e){return t.findById(e.current.params.podcastId)}]}})}]).controller("PodcastDetailCtrl",R);var M=function W(){t(this,W),this.restrict="E",this.scope={podcast:"="},this.templateUrl="html/podcast-details-stats.html",this.controller="PodcastDetailsStatsCtrl",this.controllerAs="pdsc",this.bindToController=!0},O=function(){function n(e,a,i){var s=this;t(this,n),this.$q=a,this.podcastService=i,this.month=6,this.chartSeries=[],this.generateChartData(),this.chartConfig={options:{chart:{type:"spline"},plotOptions:{spline:{marker:{enabled:!0}}},xAxis:{type:"datetime",dateTimeLabelFormats:{month:"%e. %b",year:"%b"},title:{text:"Date"}}},series:this.chartSeries,title:{text:""},credits:{enabled:!1},loading:!1},e.$on("podcastItems:refresh",function(){return s.generateChartData()})}return n.$inject=["$scope","$q","podcastService"],e(n,[{key:"navigate",value:function(t){return this.month+=t,this.generateChartData()}},{key:"generateChartData",value:function(){var t=this;return n.resetChart(this.chartSeries),this.$q.all([this.podcastService.statsByByDownloaddate(this.podcast.id,this.month),this.podcastService.statsByPubdate(this.podcast.id,this.month)]).then(function(e){var a=_(e[0]).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value(),i=_(e[1]).map(n.dateMapper()).sortBy("date").map(n.highChartsMapper()).value();return t.chartSeries.push({name:"Download Date",data:a}),t.chartSeries.push({name:"Publication Date",data:i}),t.chartSeries})}}],[{key:"resetChart",value:function(t){_.updateinplace(t,[])}},{key:"dateMapper",value:function(){return function(t){return{date:Date.UTC(t.date[0],t.date[1]-1,t.date[2]),numberOfItems:t.numberOfItems}}}},{key:"highChartsMapper",value:function(){return function(t){return[t.date,t.numberOfItems]}}}]),n}();angular.module("ps.podcast.details.stats",["highcharts-ng"]).directive("podcastStats",function(){return new M}).controller("PodcastDetailsStatsCtrl",O);var L=function F(){t(this,F),this.restrcit="E",this.templateUrl="html/podcast-details-upload.html",this.scope={podcast:"="},this.controller="podcastUploadCtrl",this.controllerAs="puc",this.bindToController=!0},U=function(){function n(e,a,i){t(this,n),this.$scope=e,this.itemService=a,this.$notification=i}return n.$inject=["$scope","itemService","$notification"],e(n,[{key:"onFileSelect",value:function(t){var e=this;angular.forEach(t,function(t){e.itemService.upload(e.podcast,t).then(function(t){e.$scope.$emit("podcastEdition:upload");try{e.$notification("Upload effectué",{body:t.title,icon:t.cover.url,delay:5e3})}catch(n){}})})}}]),n}();angular.module("ps.podcast.details.upload",["ps.dataService.item","ngFileUpload","notification"]).directive("podcastUpload",function(){return new L}).controller("podcastUploadCtrl",U)}(); //# sourceMappingURL=podcastserver.min.js.map \ No newline at end of file diff --git a/src/main/resources/static/app/js/podcastserver.min.js.map b/src/main/resources/static/app/js/podcastserver.min.js.map index 194878105..fa8be8aae 100644 --- a/src/main/resources/static/app/js/podcastserver.min.js.map +++ b/src/main/resources/static/app/js/podcastserver.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["podcastserver.js"],"names":["_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","angular","module","authorizeNotificationDirective","this","replace","restrict","scope","templateUrl","controllerAs","controller","authorizeNotificationController","$window","$notification","state","hasToBeShown","$inject","value","_this","requestPermission","then","Notification","permission","directive","deviceDetectorService","service","filter","text","String","_","mixin","updateinplace","localArray","remoteArray","comparisonFunction","undefined","arguments","inArray","elem","indexOf","withOrder","forEachRight","slice","splice","forEach","push","elementToMove","navbarController","navCollapsed","navbarDirective","transclude","element","removeClass","UpdatingDirective","liParent","parent","tagName","liElement","addClass","$watch","newValue","UpdatingController","ngstomp","$scope","_this2","isUpdating","subscribe","message","updateStatus","JSON","parse","body","config","cfpLoadingBarProvider","includeSpinner","ngstompProvider","url","credential","SockJS","RestangularProvider","setBaseUrl","addElementTransformer","item","addRestangularMethod","constant","event","preventDefault","window","location","href","$routeProvider","otherwise","redirectTo","$locationProvider","html5Mode","DownloadCtrl","DonwloadManager","_this3","items","waitingitems","numberOfSimDl","getNumberOfSimDl","parseInt","ws","onSubscribeDownload","onSubscribeWaiting","onDownloadUpdate","onWaitingUpdate","elemToUpdate","find","id","status","assign","title","icon","cover","delay","e","onStoppedFromWS","remove","remoteWaitingItems","findIndex","number","updateNumberOfSimDl","download","stop","toggle","stopAllDownload","pauseAllDownload","restartAllCurrentDownload","removeFromQueue","dontDonwload","position","moveInWaitingList","commonKey","when","hotkeys","run","$templateCache","put","ItemDetailCtrl","$location","playlistService","podcast","_this4","webSockedUrl","concat","itemFromWS","_this5","path","_this6","reset","itemReseted","addOrRemove","contains","resolve","itemService","$route","findById","current","params","podcastId","itemId","podcastService","ItemPlayerController","$timeout","autoPlay","sources","src","proxyURL","type","mimeType","plugins","controls","autoHide","isTouchedDevice","autoHideTime","poster","PlayerController","playlist","API","currentVideo","reloadPlaylist","currentState","isCompleted","play","setVideo","indexOfVideo","getIndexOfVideoInPlaylist","index","removeAll","PlaylistService","$localStorage","isObject","add","PodcastCreationController","defaultPodcast","tagService","types","extend","getNewPodcast","_this7","findInfo","podcastFetched","description","query","search","test","_this8","save","typeService","findAll","hasToBeDeleted","height","width","PodcastsListCtrl","podcasts","filters","SearchItemCache","DefaultItemSearchParameters","$sessionStorage","searchParameters","pageNumber","isNumber","page","sizeNumber","size","searchParam","term","tags","direction","properties","ItemSearchCtrl","_this9","DownloadManager","totalItems","Number","MAX_VALUE","maxSize","currentPage","getParameters","updateItemFromWS","$on","changePage","attachResponse","wsMessage","_this10","calculatePage","itemsResponse","content","totalPages","totalElements","val","_this11","_this12","itemInList","Math","ceil","updateSearchParam","reloadOnSearch","StatsController","statService","stats","month","chartSeries","transform","chartConfig","options","chart","plotOptions","spline","marker","enabled","xAxis","dateTimeLabelFormats","year","series","credits","loading","_this13","name","data","values","map","dateMapper","sortBy","highChartsMapper","offset","generateChartData","_this14","statsByType","date","Date","UTC","numberOfItems","wsDownloadManager","urlBase","WS_DOWNLOAD_BASE","connect","callback","unsubscribe","send","Restangular","baseTask","one","baseDownloadManager","customGET","customPOST","customDELETE","all","getList","get","childRoute","_this15","post","responseFromServer","restangularizedItems","pageParemeters","restangularizeCollection","itemList","_this16","restangularList","restangularizeElement","file","formData","FormData","append","withHttpConfig","transformRequest","identity","Content-Type","route","patch","numberOfMonth","base","baseAll","UpdateService","idPodcast","podcastEditionDirective","bindToController","podcastEditionCtrl","_this17","podcastToUpdate","cloneDeep","patchedPodcast","$emit","_this18","deletePodcast","podcastItemsListDirective","podcastItemsListCtrl","PodcastItemPerPage","_this19","itemPerPage","loadPage","onMessageFromWS","_this20","getItemForPodcastWithPagination","restangularizePodcastItem","_this21","reject","_this22","itemToRemove","PodcastDetailCtrl","_this23","podcastTabs","heading","active","disabled","refreshItems","$broadcast","_this24","forceUpdatePodcast","num","podcastStatsDirective","PodcastDetailsStatsCtrl","$q","_this25","_this26","resetChart","statsByByDownloaddate","statsByPubdate","arrayResult","downloadData","publicationData","podcastUploadDirective","restrcit","podcastUploadCtrl","$files","_this27","upload"],"mappings":"CAAC,WAAD,YAIA,SAASA,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAFhH,GAAIC,GAAgB,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,SAAWF,KAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAAiB,MAAO,UAAUR,EAAae,EAAYC,GAAiJ,MAA9HD,IAAYZ,EAAiBH,EAAYiB,UAAWF,GAAiBC,GAAab,EAAiBH,EAAagB,GAAqBhB,KAF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cAAgBA,EAwQzB,MAqHIqX,GAAkBlX,SAAW,SAAU,cAAe,iBAzI1D/B,EAzPEiZ,IA0PErY,IAAK,eACLoB,MAnPQ,SAACkX,GAoPL,GAAIC,GAAUhY,IAnPlBH,SAAQ2C,QAAQuV,EAAQ,SAAChE,GACrBiE,EAAKxO,YAAYyO,OAAOD,EAAKrP,QAASoL,GACjC/S,KAAK,SAAC8D,GACHkT,EAAKrU,OAAO0R,MAAM,wBAClB,KACI2C,EAAKvX,cAAc,mBACf0D,KAAMW,EAAK+B,MACXC,KAAMhC,EAAKiC,MAAMvC,IACjBwC,MAAO,MAEb,MAAOC,aAnBvB6Q,IA0BNjY,SAAQC,OAAO,6BACX,sBACA,eACA,iBAECqB,UAAU,gBAAiB,WAkP5B,MAlPkC,IAAIyW,KACrCtX,WAAW,oBAAqBwX","file":"podcastserver.min.js","sourcesContent":["angular.module('podcastApp', [\n 'ps.search',\n 'ps.podcast',\n 'ps.item',\n 'ps.download',\n 'ps.player',\n 'ps.stats',\n 'ps.common',\n 'ps.dataservice',\n 'ps.config',\n 'ps.partial'\n]);\n\nclass authorizeNotificationDirective {\n constructor() {\n this.replace = true;\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/authorize-notification.html';\n this.controllerAs = 'an';\n this.controller = 'authorizeNotificationController';\n }\n}\n\nclass authorizeNotificationController {\n constructor($window, $notification) {\n this.$window = $window;\n this.$notification = $notification;\n this.state = this.hasToBeShown();\n }\n\n manuallyactivate() {\n this.$notification\n .requestPermission()\n .then(() => { this.state = this.hasToBeShown();});\n }\n\n hasToBeShown() {\n return (('Notification' in this.$window) && this.$window.Notification.permission != 'granted');\n }\n}\n\nangular.module('authorize-notification', ['notification'])\n .directive('authorizeNotification', () => new authorizeNotificationDirective())\n .controller('authorizeNotificationController', authorizeNotificationController);\n\nangular.module('ps.common', [\n 'ps.filters',\n 'navbar',\n 'authorize-notification',\n 'device-detection',\n 'updating'\n]);\nclass deviceDetectorService {\n constructor($window) {\n this.$window = $window;\n }\n\n isTouchedDevice() {\n return 'ontouchstart' in this.$window;\n }\n}\n\nangular.module('device-detection', [])\n .service('deviceDetectorService', deviceDetectorService);\nangular.module('ps.filters', [])\n .filter('htmlToPlaintext', function () {\n return function(text) {\n return String(text || \"\").replace(/<[^>]+>/gm, '');\n };\n }\n);\n/**\n * Created by kevin on 14/08/2014.\n */\n\n_.mixin({\n // Update in place, does not preserve order\n updateinplace : function(localArray, remoteArray, comparisonFunction = (inArray, elem) => inArray.indexOf(elem), withOrder = false) {\n\n // Remove from localArray what is not in the remote array :\n _.forEachRight(localArray.slice(), (elem, key) => (comparisonFunction(remoteArray, elem) === -1) && localArray.splice(key, 1));\n\n // Add to localArray what is new in the remote array :\n _.forEach(remoteArray, (elem) => (comparisonFunction(localArray, elem) === -1) && localArray.push(elem));\n\n if (withOrder) {\n _.forEach(remoteArray, (elem, key) => {\n var elementToMove = localArray.splice(comparisonFunction(localArray, elem), 1)[0];\n localArray.splice(key, 0, elementToMove);\n });\n }\n \n return localArray;\n }\n});\n\nclass navbarController {\n constructor() {\n this.navCollapsed = true;\n }\n}\n\nclass navbarDirective {\n constructor() {\n this.transclude = true;\n this.replace = true;\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/navbar.html';\n this.controller = 'navbarController';\n this.controllerAs = 'navbar';\n }\n\n link(scope, element) {\n element.removeClass('hidden');\n }\n}\n\nangular.module('navbar', [])\n .directive('navbar', () => new navbarDirective())\n .controller('navbarController', navbarController);\n\nclass UpdatingDirective {\n constructor() {\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/updating.html';\n this.controller = 'UpdatingController';\n this.controllerAs = 'uc';\n }\n\n link(scope, element) {\n\n let liParent = element.parent().parent()[0];\n\n if (liParent && liParent.tagName === 'LI') {\n let liElement = angular.element(liParent);\n liElement.addClass('hidden');\n scope.$watch(\n 'uc.isUpdating',\n (newValue) => (newValue) ? liElement.removeClass('hidden') : liElement.addClass('hidden')\n );\n }\n }\n}\n\nclass UpdatingController {\n constructor(ngstomp, $scope) {\n this.ngstomp = ngstomp;\n this.isUpdating = false;\n this.$scope = $scope;\n\n this.ngstomp\n .subscribe('/app/updating', (message) => this.updateStatus(message), $scope)\n .subscribe('/topic/updating', (message) => this.updateStatus(message), $scope);\n }\n\n updateStatus(message) {\n this.isUpdating = JSON.parse(message.body);\n }\n}\n\nangular.module('updating', ['AngularStompDK'])\n .directive('updateStatus', () => new UpdatingDirective())\n .controller('UpdatingController', UpdatingController);\n\nangular.module('ps.config', [\n 'ps.config.route',\n 'ps.config.loading',\n 'ps.config.restangular',\n 'ps.config.ngstomp',\n 'ps.config.module'\n]);\nangular.module('ps.config.imageLazyLoading', [\n 'afkl.lazyImage'\n]);\nangular\n .module('ps.config.loading', [ 'angular-loading-bar' ])\n .config((cfpLoadingBarProvider) => { cfpLoadingBarProvider.includeSpinner = false; } );\nangular.module('ps.config.module', [\n 'ngTouch',\n 'ngAnimate',\n 'ui.bootstrap',\n 'truncate',\n 'ngFileUpload'\n]);\nangular\n .module('ps.config.ngstomp', ['AngularStompDK'])\n .config((ngstompProvider) => ngstompProvider.url('/ws').credential('login', 'password').class(SockJS));\nangular\n .module('ps.config.restangular', ['restangular'])\n .config((RestangularProvider) => {\n RestangularProvider.setBaseUrl('/api/');\n RestangularProvider.addElementTransformer('items', false, (item) => {\n item.addRestangularMethod('reset', 'get', 'reset');\n item.addRestangularMethod('download', 'get', 'addtoqueue');\n return item;\n });\n });\nangular\n .module('ps.config.route', ['ngRoute','cfp.hotkeys'])\n .constant('commonKey', [\n ['h', 'Goto Home', (event) => {\n event.preventDefault();\n window.location.href = '/items';\n }],\n ['s', 'Goto Search', (event) => {\n event.preventDefault();\n window.location.href = '/item/search';\n }],\n ['p', 'Goto Podcast List', (event) => {\n event.preventDefault();\n window.location.href = '/podcasts';\n }],\n ['d', 'Goto Download List', (event) => {\n event.preventDefault();\n window.location.href = '/download';\n }]\n ])\n .config($routeProvider => $routeProvider.otherwise({redirectTo: '/items'}))\n .config($locationProvider => $locationProvider.html5Mode(true));\n\nclass DownloadCtrl {\n\n constructor($scope, DonwloadManager, $notification) {\n this.DonwloadManager = DonwloadManager;\n this.$notification = $notification;\n this.items =[];\n this.waitingitems = [];\n this.numberOfSimDl = 0;\n\n this.DonwloadManager.getNumberOfSimDl().then((value) => {\n this.numberOfSimDl = parseInt(value);\n });\n\n /** Websocket Connection */\n this.DonwloadManager.ws\n .subscribe(\"/app/download\", (message) => this.onSubscribeDownload(message), $scope)\n .subscribe(\"/app/waiting\", (message) => this.onSubscribeWaiting(message), $scope)\n .subscribe(\"/topic/download\", (message) => this.onDownloadUpdate(message), $scope)\n .subscribe(\"/topic/waiting\", (message) => this.onWaitingUpdate(message), $scope);\n }\n\n onSubscribeDownload(message) {\n this.items = JSON.parse(message.body);\n }\n onSubscribeWaiting(message) {\n this.waitingitems = JSON.parse(message.body);\n }\n onDownloadUpdate(message) {\n let item = JSON.parse(message.body);\n let elemToUpdate = _.find(this.items, { 'id': item.id });\n switch (item.status) {\n case 'Started' :\n case 'Paused' :\n if (elemToUpdate)\n _.assign(elemToUpdate, item);\n else\n this.items.push(item);\n break;\n case 'Finish' :\n try {\n this.$notification('Téléchargement terminé', {\n body: item.title,\n icon: item.cover.url,\n delay: 5000\n });\n } catch (e) {\n\n }\n this.onStoppedFromWS(elemToUpdate);\n break;\n case 'Stopped' :\n this.onStoppedFromWS(elemToUpdate);\n break;\n }\n }\n\n onStoppedFromWS(elemToUpdate) {\n if (elemToUpdate) {\n _.remove(this.items, function (item) {\n return item.id === elemToUpdate.id;\n });\n }\n }\n\n onWaitingUpdate(message) {\n let remoteWaitingItems = JSON.parse(message.body);\n _.updateinplace(this.waitingitems, remoteWaitingItems, (inArray, elem) => _.findIndex(inArray, { 'id': elem.id }), true);\n }\n\n getTypeFromStatus(item) {\n if (item.status === \"Paused\")\n return \"warning\";\n return \"info\";\n }\n updateNumberOfSimDl(number) {\n this.DonwloadManager.updateNumberOfSimDl(number);\n }\n\n /** Spécifique aux éléments de la liste : **/\n download(item){\n this.DonwloadManager.download(item);\n }\n stopDownload(item){\n this.DonwloadManager.ws.stop(item);\n }\n toggleDownload(item){\n this.DonwloadManager.ws.toggle(item);\n }\n\n /** Global **/\n stopAllDownload(){\n this.DonwloadManager.stopAllDownload();\n }\n pauseAllDownload(){\n this.DonwloadManager.pauseAllDownload();\n }\n restartAllCurrentDownload(){\n this.DonwloadManager.restartAllCurrentDownload();\n }\n removeFromQueue(item){\n this.DonwloadManager.removeFromQueue(item);\n }\n dontDonwload(item){\n this.DonwloadManager.dontDonwload(item);\n }\n moveInWaitingList(item, position){\n this.DonwloadManager.moveInWaitingList(item, position);\n }\n\n}\n\nangular.module('ps.download', [\n 'ps.config.route',\n 'ps.dataService.donwloadManager',\n 'notification'\n])\n .config(($routeProvider, commonKey) =>\n $routeProvider.\n when('/download', {\n templateUrl: 'html/download.html',\n controller: 'DownloadCtrl',\n controllerAs: 'dc',\n hotkeys: commonKey\n })\n )\n .controller('DownloadCtrl', DownloadCtrl);\nangular.module(\"ps.partial\", []).run([\"$templateCache\", function($templateCache) {$templateCache.put(\"html/authorize-notification.html\",\"\\n\");\n$templateCache.put(\"html/download.html\",\"
\\n\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n\\n
\\n
\\n \\n \\n
\\n\\n \\n \\n \\n\\n
\\n
{{item.title | characters:100}}
\\n
\\n {{item.progression}}%\\n
\\n
\\n\\n\\n
\\n\\n 0\\\">\\n \\n \\n Liste d\\'attente {{ dc.waitingitems.length }}\\n \\n
\\n\\n
\\n
\\n \\n \\n
1\\\">\\n \\n \\n
\\n
\\n\\n \\n \\n \\n\\n
\\n
{{item.title | characters:100}}
\\n
\\n
\\n\\n
\\n
\\n\\n\\n
\");\n$templateCache.put(\"html/item-detail.html\",\"\\n
\\n\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ idc.item.podcast.title }}
  4. \\n
  5. {{ idc.item.title }}
  6. \\n
\\n\\n
\\n
\\n
\\n \\n \\n \\n\\n
\\n\\n
\\n \\n \\n \\n \\n \\n\\n \\n \\n\\n \\n\\n \\n \\n \\n \\n \\n\\n
\\n \\n \\n
\\n \\n
\\n
\\n
\\n
\\n\\n
\\n
\\n
\\n

{{ idc.item.title }}

\\n
\\n
\\n
Date de publication : {{idc.item.pubdate | date : \\'dd/MM/yyyy à HH:mm\\' }}
\\n
\\n
\\n\\n
\\n
\\n\\n\");\n$templateCache.put(\"html/item-player.html\",\"
\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ ipc.item.podcast.title }}
  4. \\n
  5. {{ ipc.item.title }}
  6. \\n
\\n\\n
\\n \\n \\n\\n \\n \\n {{ currentTime | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n {{ timeLeft | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n \\n \\n
\\n
\\n\\n \\n \\n \\n
\\n
\\n
\");\n$templateCache.put(\"html/items-search.html\",\"\\n
\\n \\n\\n
\\n
\\n
\\n \\n \\n
\\n
\\n\\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n\\n
\\n \\n
\\n\\n
\\n \\n \\n
\\n
\\n\\n
\\n 1\\\" items-per-page=\\\"12\\\" max-size=\\\"10\\\" boundary-links=\\\"true\\\" total-items=\\\"isc.totalItems\\\" ng-model=\\\"isc.currentPage\\\" ng-change=\\\"isc.changePage()\\\" class=\\\"pagination pagination-centered\\\" previous-text=\\\"‹\\\" next-text=\\\"›\\\" first-text=\\\"«\\\" last-text=\\\"»\\\">\\n \\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n\\n \\n \\n \\n
\\n \\n
\\n
\\n
\\n
1\\\">\\n \\n
\\n
\\n\");\n$templateCache.put(\"html/navbar.html\",\"\");\n$templateCache.put(\"html/player.html\",\"
\\n
\\n
\\n \\n \\n\\n \\n \\n {{ currentTime | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n {{ timeLeft | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n \\n \\n
\\n
\\n\\n \\n\\n \\n
\\n
\\n
\\n
\\n
Rafraichir
\\n
Vider
\\n
\\n
\\n\\n \\n\\n \\n \\n \\n\\n
\\n

{{ item.title }}

\\n
\\n
\\n \\n
\\n\\n
\");\n$templateCache.put(\"html/podcast-creation.html\",\"
\\n
\\n

Ajouter un Podcast

\\n
\\n
\\n\\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n\\n\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n\\n
\\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n\\n\\n\\n\");\n$templateCache.put(\"html/podcast-detail.html\",\"\\n\\n
\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ pdc.podcast.title }}
  4. \\n
\\n\\n
\\n
\\n
\\n
\\n

{{ pdc.podcast.title }}

\\n

{{ pdc.podcast.totalItems }} Episodes

\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n\\n
\\n
\\n\\n\\n\\n\");\n$templateCache.put(\"html/podcast-details-edition.html\",\"
\\n\\n \\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n\");\n$templateCache.put(\"html/podcast-details-episodes.html\",\"
\\n
\\n
\\n
\\n \\n \\n \\n \\n \\n\\n \\n \\n\\n \\n \\n \\n \\n \\n\\n \\n \\n
\\n\\n \\n \\n \\n \\n
\\n

{{ item.title }}

\\n

{{item.description | htmlToPlaintext | characters : 130 }}

\\n

{{item.pubdate | date : \\'dd/MM/yyyy à HH:mm\\' }}

\\n
\\n
\\n\\n
pic.itemPerPage\\\" class=\\\"text-center\\\">\\n \\n
\\n
\\n\\n \");\n$templateCache.put(\"html/podcast-details-stats.html\",\"
\\n
\\n
\\n - \\n \\n + \\n
\\n
\\n
\\n \\n
\\n\");\n$templateCache.put(\"html/podcast-details-upload.html\",\"
\\n
\\n
\\n
\\n Déposer un ou des fichiers ici\\n
\\n
\\n
\\n\");\n$templateCache.put(\"html/podcasts-list.html\",\"
\\n\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n\\n
\\n \\n
\\n
\\n \\n
\\n
\\n\\n
\\n\\n\\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n\\n\");\n$templateCache.put(\"html/stats.html\",\"
\\n
\\n
\\n
\\n - \\n \\n + \\n
\\n
\\n
\\n \\n
\\n
\");\n$templateCache.put(\"html/updating.html\",\"\\n \\n\");}]);\nclass ItemDetailCtrl {\n\n constructor($scope, DonwloadManager, $location, playlistService, podcast, item){\n this.item = item;\n this.$location = $location;\n this.item.podcast = podcast;\n this.playlistService = playlistService;\n this.DonwloadManager = DonwloadManager;\n\n //** WebSocket Inscription **//\n let webSockedUrl = \"/topic/podcast/\".concat(this.item.podcast.id);\n\n this.DonwloadManager\n .ws\n .subscribe(webSockedUrl, (message) => {\n let itemFromWS = JSON.parse(message.body);\n if (itemFromWS.id == this.item.id) {\n _.assign(this.item, itemFromWS);\n }\n }, $scope);\n\n }\n\n stopDownload(item) {\n this.DonwloadManager.ws.stop(item);\n }\n\n toggleDownload(item) {\n this.DonwloadManager.ws.toggle(item);\n }\n\n remove(item) {\n return item.remove()\n .then(() => {\n this.playlistService.remove(item);\n this.$location.path('/podcasts/'.concat(this.item.podcast.id));\n });\n }\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n _.assign(this.item, itemReseted);\n this.playlistService.remove(item);\n });\n }\n\n toggleInPlaylist() {\n this.playlistService.addOrRemove(this.item);\n }\n\n isInPlaylist() {\n return this.playlistService.contains(this.item);\n }\n}\n\nangular.module('ps.item.details', [\n 'ps.dataService.donwloadManager',\n 'ps.player'\n]).config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/podcasts/:podcastId/item/:itemId', {\n templateUrl: 'html/item-detail.html',\n controller: 'ItemDetailCtrl',\n controllerAs: 'idc',\n hotkeys: commonKey,\n resolve : {\n item : function (itemService, $route) {\n return itemService.findById($route.current.params.podcastId, $route.current.params.itemId);\n },\n podcast : function (podcastService, $route) {\n return podcastService.findById($route.current.params.podcastId);\n }\n }\n });\n})\n .controller('ItemDetailCtrl', ItemDetailCtrl);\n/**\n * Created by kevin on 01/11/14.\n */\n\nangular.module('ps.item', [\n 'ps.item.details',\n 'ps.item.player'\n]);\nclass ItemPlayerController {\n\n constructor(podcast, item, $timeout, deviceDetectorService) {\n this.item = item;\n this.item.podcast = podcast;\n this.$timeout = $timeout;\n\n this.config = {\n autoPlay: true,\n sources: [\n { src : this.item.proxyURL, type : this.item.mimeType }\n ],\n plugins: {\n controls: {\n autoHide: !deviceDetectorService.isTouchedDevice(),\n autoHideTime: 2000\n },\n poster: this.item.cover.url\n }\n };\n }\n}\n\nangular.module('ps.item.player', [\n 'ngSanitize',\n 'ngRoute',\n 'device-detection',\n 'com.2fdevs.videogular',\n 'com.2fdevs.videogular.plugins.poster',\n 'com.2fdevs.videogular.plugins.controls',\n 'com.2fdevs.videogular.plugins.overlayplay',\n 'com.2fdevs.videogular.plugins.buffering'\n])\n .config(($routeProvider) => {\n $routeProvider.\n when('/podcasts/:podcastId/item/:itemId/play', {\n templateUrl: 'html/item-player.html',\n controller: 'ItemPlayerController',\n controllerAs: 'ipc',\n resolve : {\n item : (itemService, $route) => itemService.findById($route.current.params.podcastId, $route.current.params.itemId),\n podcast : (podcastService, $route) => podcastService.findById($route.current.params.podcastId)\n }\n });\n })\n .controller('ItemPlayerController', ItemPlayerController);\n\nclass PlayerController {\n constructor(playlistService, $timeout, deviceDetectorService) {\n this.playlistService = playlistService;\n this.$timeout = $timeout;\n\n this.playlist = [];\n this.state = null;\n this.API = null;\n this.currentVideo = {};\n this.config = {\n autoPlay : true,\n sources: [],\n plugins: {\n controls: {\n autoHide : !deviceDetectorService.isTouchedDevice(),\n autoHideTime: 2000\n },\n poster: ''\n }\n };\n this.reloadPlaylist();\n }\n\n onPlayerReady(API) {\n this.API = API;\n\n if (this.API.currentState == 'play' || this.isCompleted)\n this.API.play();\n\n this.isCompleted = false;\n this.setVideo(0);\n }\n\n onCompleteVideo() {\n var indexOfVideo = this.getIndexOfVideoInPlaylist(this.currentVideo);\n this.isCompleted = true;\n\n if (indexOfVideo+1 === this.playlist.length) {\n this.currentVideo = this.playlist[0];\n return;\n }\n\n this.setVideo(indexOfVideo+1);\n }\n\n reloadPlaylist() {\n _.updateinplace(this.playlist, this.playlistService.playlist(), function(inArray, elem) { return _.findIndex(inArray, { 'id': elem.id });});\n }\n\n\n\n setVideo(index) {\n this.currentVideo = this.playlist[index];\n\n if (this.currentVideo !== null && this.currentVideo !== undefined) {\n this.API.stop();\n this.config.sources = [{src : this.currentVideo.proxyURL, type : this.currentVideo.mimeType }];\n this.config.plugins.poster = this.currentVideo.cover.url;\n }\n }\n\n remove(item) {\n this.playlistService.remove(item);\n this.reloadPlaylist();\n if (this.config.sources.length > 0 && this.config.sources[0].src === item.proxyURL) {\n this.setVideo(0);\n }\n }\n\n removeAll() {\n this.playlistService.removeAll();\n this.reloadPlaylist();\n }\n\n getIndexOfVideoInPlaylist(item) {\n return this.playlist.indexOf(item);\n }\n}\n\nangular.module('ps.player', [\n 'ngSanitize',\n 'ngRoute',\n 'device-detection',\n 'com.2fdevs.videogular',\n 'com.2fdevs.videogular.plugins.poster',\n 'com.2fdevs.videogular.plugins.controls',\n 'com.2fdevs.videogular.plugins.overlayplay',\n 'com.2fdevs.videogular.plugins.buffering',\n 'ps.player.playlist'\n])\n .config(($routeProvider) => {\n $routeProvider.\n when('/player', {\n templateUrl: 'html/player.html',\n controller: 'PlayerController',\n controllerAs: 'pc'\n });\n })\n .controller('PlayerController', PlayerController);\nclass PlaylistService {\n\n constructor($localStorage) {\n this.$localStorage = $localStorage;\n this.$localStorage.playlist = this.$localStorage.playlist || [];\n }\n\n playlist() {\n return this.$localStorage.playlist;\n }\n add(item) {\n this.$localStorage.playlist.push(item);\n }\n remove (item) {\n this.$localStorage.playlist = _.remove(this.$localStorage.playlist, function(elem) { return elem.id !== item.id; });\n }\n contains(item) {\n return angular.isObject(_.find(this.$localStorage.playlist, {id : item.id}));\n }\n addOrRemove (item) {\n (this.contains(item)) ? this.remove(item) : this.add(item);\n }\n removeAll () {\n this.$localStorage.playlist = [];\n }\n}\n\nangular.module('ps.player.playlist', [\n 'ngStorage'\n]).service('playlistService', PlaylistService);\n\nclass PodcastCreationController {\n\n constructor($location, defaultPodcast, tagService, podcastService, types) {\n this.podcastService = podcastService;\n this.$location = $location;\n this.tagService = tagService;\n this.podcast = angular.extend(this.podcastService.getNewPodcast(), defaultPodcast );\n this.types = types;\n }\n\n findInfo() {\n return this.podcastService.findInfo(this.podcast.url)\n .then((podcastFetched) => {\n this.podcast.title = podcastFetched.title;\n this.podcast.description = podcastFetched.description;\n this.podcast.type = podcastFetched.type;\n this.podcast.cover.url = podcastFetched.cover.url;\n });\n }\n\n loadTags(query) {\n return this.tagService.search(query);\n }\n\n changeType() {\n if (/beinsports\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"BeInSports\";\n } else if (/canalplus\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"CanalPlus\";\n } else if (/jeuxvideo\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"JeuxVideoFR\";\n } else if (/jeuxvideo\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"JeuxVideoCom\";\n } else if (/parleys\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"Parleys\";\n } else if (/pluzz\\.francetv\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"Pluzz\";\n } else if (/youtube\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"Youtube\";\n } else if (this.podcast.url.length > 0) {\n this.podcast.type = \"RSS\";\n } else {\n this.podcast.type = \"Send\";\n }\n }\n\n save() {\n this.podcastService.save(this.podcast)\n .then((podcast) => this.$location.path('/podcasts/' + podcast.id));\n }\n\n}\n\nangular.module('ps.podcast.creation', [\n 'ps.config.route',\n 'ps.dataservice',\n 'ngTagsInput'\n])\n .config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/podcast-creation', {\n templateUrl: 'html/podcast-creation.html',\n controller: 'PodcastAddCtrl',\n controllerAs: 'pac',\n hotkeys: commonKey,\n resolve : {\n types : typeService => typeService.findAll()\n }\n });\n })\n .constant('defaultPodcast', { hasToBeDeleted : true, cover : { height: 200, width: 200 } })\n .controller('PodcastAddCtrl', PodcastCreationController);\nclass PodcastsListCtrl {\n constructor(podcasts, types) {\n this.podcasts = podcasts;\n this.types = types;\n this.filters = {\n title : '',\n type : ''\n };\n }\n}\n\nangular.module('ps.podcast.list', [\n 'ps.config.route',\n 'ps.dataService.podcast',\n 'ps.dataService.type'\n])\n .config(($routeProvider, commonKey) => {\n $routeProvider.\n when('/podcasts', {\n templateUrl: 'html/podcasts-list.html',\n controller: 'PodcastsListCtrl',\n controllerAs: 'plc',\n hotkeys: commonKey,\n resolve: {\n podcasts: (podcastService) => podcastService.findAll(),\n types: typeService => typeService.findAll()\n }\n });\n })\n .controller('PodcastsListCtrl', PodcastsListCtrl);\n/**\n * Created by kevin on 01/11/14.\n */\n\nangular.module('ps.podcast', [\n 'ps.podcast.details',\n 'ps.podcast.creation',\n 'ps.podcast.list'\n]);\nclass SearchItemCache {\n constructor(DefaultItemSearchParameters, $sessionStorage) {\n this.$sessionStorage = $sessionStorage;\n this.$sessionStorage.searchParameters = DefaultItemSearchParameters;\n }\n\n getParameters() {\n return this.$sessionStorage.searchParameters;\n }\n\n page(pageNumber) {\n if (angular.isNumber(pageNumber)) {\n this.$sessionStorage.searchParameters.page = pageNumber;\n }\n\n return this.$sessionStorage.searchParameters.page;\n }\n\n size(sizeNumber) {\n if (angular.isNumber(sizeNumber)) {\n this.$sessionStorage.searchParameters.size = sizeNumber;\n }\n\n return this.$sessionStorage.searchParameters.size;\n }\n\n updateSearchParam(searchParam) {\n this.$sessionStorage.searchParameters.term = searchParam.term;\n this.$sessionStorage.searchParameters.tags = searchParam.tags;\n this.$sessionStorage.searchParameters.direction = searchParam.direction;\n this.$sessionStorage.searchParameters.properties = searchParam.properties;\n }\n}\n\nclass ItemSearchCtrl {\n\n constructor($scope, SearchItemCache, $location, itemService, tagService, DonwloadManager, playlistService, items) {\n /* DI */\n this.$location = $location;\n this.itemService = itemService;\n this.tagService = tagService;\n this.DownloadManager = DonwloadManager;\n this.playlistService = playlistService;\n this.SearchItemCache = SearchItemCache;\n\n /* Constructor Init */\n this.totalItems = Number.MAX_VALUE;\n this.maxSize = 10;\n this.currentPage = this.SearchItemCache.page()+1;\n this.searchParameters = this.SearchItemCache.getParameters();\n\n //** WebSocket Subscription **//\n this.DownloadManager\n .ws\n .subscribe(\"/topic/download\", (message) => this.updateItemFromWS(message), $scope);\n\n $scope.$on('$routeUpdate', () => {\n if (this.currentPage !== this.$location.search().page) {\n this.currentPage = this.$location.search().page || 1;\n this.changePage();\n }\n });\n\n /*this.changePage();*/\n this.attachResponse(items);\n }\n\n updateItemFromWS(wsMessage) {\n let item = JSON.parse(wsMessage.body);\n\n var elemToUpdate = _.find(this.items, { 'id': item.id });\n if (elemToUpdate)\n _.assign(elemToUpdate, item);\n }\n\n changePage() {\n this.SearchItemCache.page(this.calculatePage());\n return this.itemService\n .search(this.SearchItemCache.getParameters())\n .then((itemsResponse) => this.attachResponse(itemsResponse));\n }\n\n attachResponse(itemsResponse) {\n this.items = itemsResponse.content;\n this.totalPages = itemsResponse.totalPages;\n this.totalItems = itemsResponse.totalElements;\n this.currentPage = this.SearchItemCache.page(itemsResponse.number)+1;\n this.$location.search(\"page\", this.currentPage);\n }\n\n swipePage(val) {\n this.currentPage = this.SearchItemCache.page() + val + 1;\n return this.changePage();\n }\n\n //** Item Operation **//\n remove(item) {\n return item.remove()\n .then(() => this.playlistService.remove(item))\n .then(() => this.changePage());\n }\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n var itemInList = _.find(this.items, { 'id': itemReseted.id });\n _.assign(itemInList, itemReseted);\n return itemInList;\n })\n .then((itemInList) => this.playlistService.remove(itemInList));\n }\n\n stopDownload(item) {\n this.DownloadManager.ws.stop(item);\n }\n\n toggleDownload(item){\n return this.DownloadManager.ws.toggle(item);\n }\n\n loadTags(query){\n return this.tagService.search(query);\n }\n\n //** Playlist Manager **//\n addOrRemove(item) {\n return this.playlistService.addOrRemove(item);\n }\n\n isInPlaylist(item) {\n return this.playlistService.contains(item);\n }\n\n calculatePage() {\n if (this.currentPage <= 1) {\n return 0;\n } else if (this.currentPage > Math.ceil(this.totalItems / this.SearchItemCache.size())) {\n return Math.ceil(this.totalItems / this.SearchItemCache.size()) - 1;\n } else {\n return this.currentPage - 1;\n }\n }\n\n resetSearch() {\n this.currentPage = 1;\n this.SearchItemCache.updateSearchParam(this.searchParameters);\n return this.changePage();\n }\n}\n\nangular.module('ps.search.item', [\n 'ps.dataService.donwloadManager',\n 'ps.dataService.item',\n 'ps.dataService.tag',\n 'ps.player',\n 'ps.config.route',\n 'ngTagsInput',\n 'ngStorage'\n])\n .config(($routeProvider, commonKey) => {\n $routeProvider.\n when('/items', {\n templateUrl: 'html/items-search.html',\n controller: 'ItemsSearchCtrl',\n controllerAs: 'isc',\n reloadOnSearch: false,\n hotkeys: [\n ['right', 'Next page', 'isc.swipePage(1)'],\n ['left', 'Previous page', 'isc.swipePage(-1)']\n ].concat(commonKey),\n resolve : { items : (itemService, SearchItemCache) => itemService.search(SearchItemCache.getParameters()) }\n });\n })\n .constant('DefaultItemSearchParameters', {\n page : 0,\n size : 12,\n term : undefined,\n tags : undefined,\n direction : 'DESC',\n properties : 'pubdate'\n })\n .controller('ItemsSearchCtrl', ItemSearchCtrl)\n .service(\"SearchItemCache\", SearchItemCache);\nangular.module('ps.search', [\n 'ps.search.item'\n]);\n\n\nclass StatsController {\n\n constructor(statService, stats) {\n this.statService = statService;\n this.month = 1;\n\n this.chartSeries = [];\n this.transform(stats);\n\n this.chartConfig = {\n options: {\n chart: {\n type: 'spline'\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: true\n }\n }\n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Date'\n }\n }\n },\n series: this.chartSeries,\n title : {\n text : ''\n },\n credits: {\n enabled: false\n },\n loading: false\n };\n }\n\n transform(stats) {\n _.updateinplace(this.chartSeries, []);\n\n angular.forEach(stats, (value) => {\n let element = { name : value.type };\n element.data = _(value.values)\n .map(StatsController.dateMapper())\n .sortBy(\"date\")\n .map(StatsController.highChartsMapper())\n .value();\n this.chartSeries.push(element);\n });\n }\n\n static dateMapper() {\n return (value) => { return { date : Date.UTC(value.date[0], value.date[1]-1, value.date[2]), numberOfItems : value.numberOfItems }; };\n }\n\n static highChartsMapper() {\n return (value) => [value.date, value.numberOfItems];\n }\n\n navigate(offset) {\n this.month += offset;\n this.generateChartData();\n }\n\n generateChartData() {\n /*_.updateinplace(this.chartSeries, []);*/\n\n return this.statService\n .statsByType(this.month)\n .then(statsByType => this.transform(statsByType));\n }\n}\n\nangular.module('ps.stats', [\n 'ps.dataService.stat'\n])\n .config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/stats', {\n templateUrl: 'html/stats.html',\n controller: 'StatsController',\n controllerAs: 'sc',\n hotkeys: commonKey,\n resolve : {\n stats : statService => statService.statsByType()\n }\n });\n })\n .controller('StatsController', StatsController);\n/**\n * Created by kevin on 02/11/14.\n */\n\nangular.module('ps.dataservice', [\n 'ps.dataService.donwloadManager',\n 'ps.dataService.item',\n 'ps.dataService.podcast',\n 'ps.dataService.tag',\n 'ps.dataService.type',\n 'ps.dataService.updateService'\n]);\n\nclass wsDownloadManager {\n\n /*@ngNoInject*/\n constructor(urlBase, ngstomp) {\n this.WS_DOWNLOAD_BASE = urlBase;\n this.ngstomp = ngstomp;\n }\n\n connect() { return this.ngstomp.connect();}\n subscribe(url, callback, scope) {return this.ngstomp.subscribe(url, callback, scope);}\n unsubscribe(url) { return this.ngstomp.unsubscribe(url); }\n toggle(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/toogle', item); }\n start(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/start', item); }\n pause(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/pause', item); }\n stop(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/stop', item); }\n}\n\nclass DownloadManager {\n\n constructor(Restangular, ngstomp) {\n this.Restangular = Restangular;\n this.baseTask = this.Restangular.one(\"task\");\n this.baseDownloadManager = this.baseTask.one('downloadManager');\n this.WS_DOWNLOAD_BASE = '/app/download';\n\n this.ws = new wsDownloadManager(this.WS_DOWNLOAD_BASE, ngstomp);\n }\n\n download(item) {\n return this.Restangular.one(\"item\").customGET(item.id + \"/addtoqueue\");\n }\n stopDownload (item) {\n return this.baseDownloadManager.customPOST(item.id, \"stopDownload\");\n }\n toggleDownload (item) {\n return this.baseDownloadManager.customPOST(item.id, \"toogleDownload\");\n }\n stopAllDownload () {\n return this.baseDownloadManager.customGET(\"stopAllDownload\");\n }\n pauseAllDownload () {\n return this.baseDownloadManager.customGET(\"pauseAllDownload\");\n }\n restartAllCurrentDownload () {\n return this.baseDownloadManager.customGET(\"restartAllCurrentDownload\");\n }\n removeFromQueue (item) {\n return this.baseDownloadManager.customDELETE(\"queue/\" + item.id);\n }\n updateNumberOfSimDl (number) {\n return this.baseDownloadManager.customPOST(number, \"limit\");\n }\n dontDonwload (item) {\n return this.baseDownloadManager.customDELETE(\"queue/\" + item.id + \"/andstop\");\n }\n getDownloading () {\n return this.baseTask.all(\"downloadManager/downloading\").getList();\n }\n getNumberOfSimDl () {\n return this.baseDownloadManager.one(\"limit\").get();\n }\n moveInWaitingList (item, position) {\n this.baseDownloadManager.customPOST({id : item.id, position : position } , 'move');\n }\n\n}\n\nangular.module('ps.dataService.donwloadManager', [ 'restangular', 'AngularStompDK']) .service('DonwloadManager', DownloadManager);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass itemService {\n constructor(Restangular) {\n this.Restangular = Restangular;\n this.childRoute = \"items\";\n }\n\n search(searchParameters = { page : 0, size : 12} ) {\n return this.Restangular.one(\"item/search\")\n .post(null, searchParameters)\n .then((responseFromServer) => {\n responseFromServer.content = this.restangularizedItems(responseFromServer.content);\n return responseFromServer;\n });\n }\n\n findById(podcastId, itemId) {\n return this.Restangular.one(\"podcast\", podcastId).one(this.childRoute, itemId).get();\n }\n\n getItemForPodcastWithPagination(podcast, pageParemeters) {\n return podcast.one(\"items\").post(null, pageParemeters);\n }\n\n restangularizePodcastItem (podcast, items) {\n return this.Restangular.restangularizeCollection(podcast, items, this.childRoute);\n }\n\n restangularizedItems(itemList) {\n var restangularList = [];\n \n angular.forEach(itemList, (value) => {\n restangularList.push(this.Restangular.restangularizeElement(this.Restangular.one('podcast', value.podcastId), value, this.childRoute));\n });\n return restangularList;\n }\n\n upload(podcast, file) {\n var formData = new FormData();\n formData.append('file', file);\n return podcast.all(this.childRoute)\n .withHttpConfig({transformRequest: angular.identity})\n .customPOST(formData, 'upload', undefined, {'Content-Type': undefined});\n }\n}\n\nangular.module('ps.dataService.item', ['restangular']).service('itemService', itemService);\n\n/**\n * Created by kevin on 02/11/14.\n */\n\nclass podcastService {\n \n constructor(Restangular) {\n this.Restangular = Restangular;\n this.route = 'podcast';\n }\n\n findById(podcastId) {\n return this.Restangular.one(this.route, podcastId).get();\n }\n\n findAll() {\n return this.Restangular.all(this.route).getList();\n }\n\n save(podcast) {\n return podcast.save();\n }\n\n getNewPodcast() {\n return this.Restangular.one(this.route);\n }\n\n patch(item) {\n return item.patch();\n }\n\n deletePodcast(item) {\n return item.remove();\n }\n\n findInfo(url) {\n return this.Restangular.one(this.route).findInfo(url);\n }\n\n statsByPubdate(id, numberOfMonth = 6) {\n return this.Restangular.one(this.route, id).one('stats').all('byPubdate').post(numberOfMonth);\n }\n\n statsByByDownloaddate(id, numberOfMonth = 6) {\n return this.Restangular.one(this.route, id).one('stats').all('byDownloaddate').post(numberOfMonth);\n }\n \n}\n\nangular.module('ps.dataService.podcast', ['restangular'])\n .config((RestangularProvider) => {\n RestangularProvider.addElementTransformer('podcast', false, (podcast) => {\n podcast.addRestangularMethod('findInfo', 'post', 'fetch', undefined, {'Content-Type': 'text/plain'});\n return podcast;\n });\n })\n .service('podcastService', podcastService);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass statService {\n\n constructor(Restangular) {\n this.Restangular = Restangular;\n this.base = this.Restangular.one('stats');\n }\n\n statsByType(numberOfMonth = 1) {\n return this.base.all('byType').post(numberOfMonth);\n }\n}\n\nangular.module('ps.dataService.stat', ['restangular']).service('statService', statService);\n\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass tagService {\n \n constructor(Restangular) {\n this.baseAll = Restangular.all('tag'); \n }\n\n getAll() {\n return this.baseAll.get();\n }\n\n search(query) {\n return this.baseAll.post(null, {name : query});\n }\n \n}\n\nangular.module('ps.dataService.tag', ['restangular'])\n .service('tagService', tagService);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass typeService {\n\n constructor(Restangular) {\n this.baseAll = Restangular.all('types');\n }\n\n findAll() {\n return this.baseAll.getList();\n }\n}\n\nangular.module('ps.dataService.type', ['restangular'])\n .service('typeService', typeService);\n\nclass UpdateService {\n constructor(Restangular) {\n this.Restangular = Restangular;\n }\n\n forceUpdatePodcast(idPodcast) {\n return this.Restangular.one(\"task\").customPOST(idPodcast, \"updateManager/updatePodcast/force\");\n }\n} \n\nangular.module('ps.dataService.updateService', ['restangular']).service('UpdateService', UpdateService);\n\nclass podcastEditionDirective {\n constructor() {\n this.restrict = 'E';\n this.templateUrl = 'html/podcast-details-edition.html';\n this.scope = { podcast : '=' };\n this.controller = 'podcastEditionCtrl';\n this.controllerAs = 'pec';\n this.bindToController = true;\n }\n}\n\nclass podcastEditionCtrl {\n constructor($scope, $location, tagService, podcastService) {\n this.$scope = $scope;\n this.$location = $location;\n this.tagService = tagService;\n this.podcastService = podcastService;\n }\n\n loadTags(query) {\n return this.tagService.search(query);\n }\n\n save() {\n var podcastToUpdate = _.cloneDeep(this.podcast);\n podcastToUpdate.items = null;\n\n return this.podcastService\n .patch(podcastToUpdate)\n .then((patchedPodcast) => _.assign(this.podcast, patchedPodcast))\n .then(() => this.$scope.$emit('podcastEdition:save'));\n }\n\n deletePodcast() {\n return this.podcastService\n .deletePodcast(this.podcast)\n .then(() => this.$location.path('/podcasts'));\n }\n}\n\nangular.module('ps.podcast.details.edition', [\n 'ps.dataService.podcast',\n 'ps.dataService.tag',\n 'ngTagsInput'\n])\n .directive('podcastEdition', () => new podcastEditionDirective())\n .controller('podcastEditionCtrl', podcastEditionCtrl);\n\nclass podcastItemsListDirective{\n constructor() {\n this.restrict= 'E';\n this.templateUrl = 'html/podcast-details-episodes.html';\n this.scope = { podcast : '=' };\n this.controller = 'podcastItemsListCtrl';\n this.controllerAs = 'pic';\n this.bindToController = true;\n }\n}\n\nclass podcastItemsListCtrl {\n\n constructor($scope, DonwloadManager, PodcastItemPerPage, itemService, playlistService ) {\n /* DI */\n this.$scope = $scope;\n this.DownloadManager = DonwloadManager;\n this.itemService = itemService;\n this.playlistService = playlistService;\n\n this.currentPage = 1;\n this.itemPerPage = PodcastItemPerPage;\n this.loadPage();\n\n this.$scope.$on(\"podcastItems:refresh\", () => {\n this.currentPage = 1;\n this.loadPage();\n });\n\n this.DownloadManager\n .ws\n .subscribe( \"/topic/podcast/\".concat(this.podcast.id),\n (message) => this.onMessageFromWS(message),\n $scope);\n }\n\n onMessageFromWS(message) {\n var item = JSON.parse(message.body);\n var elemToUpdate = _.find(this.podcast.items, { 'id': item.id });\n _.assign(elemToUpdate, item);\n }\n\n loadPage() {\n this.currentPage = (this.currentPage < 1) ? 1 : (this.currentPage > Math.ceil(this.totalItems / this.itemPerPage)) ? Math.ceil(this.totalItems / this.itemPerPage) : this.currentPage;\n return this.itemService\n .getItemForPodcastWithPagination(this.podcast, {size: this.itemPerPage, page : this.currentPage - 1, direction : 'DESC', properties : 'pubdate'})\n .then((itemsResponse) => {\n this.podcast.items = this.itemService.restangularizePodcastItem(this.podcast, itemsResponse.content);\n this.podcast.totalItems = itemsResponse.totalElements;\n });\n }\n\n remove(item) {\n item.remove()\n .then(() => this.podcast.items = _.reject(this.podcast.items, (elem) => {return (elem.id === item.id); }))\n .then(() => this.playlistService.remove(item))\n .then(() => this.loadPage());\n }\n\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n var itemInList = _.find(this.podcast.items, { 'id': itemReseted.id });\n _.assign(itemInList, itemReseted);\n return itemInList;\n })\n .then((itemToRemove) => this.playlistService.remove(itemToRemove));\n }\n\n addOrRemoveInPlaylist(item) {\n this.playlistService.addOrRemove(item);\n }\n\n isInPlaylist(item) {\n return this.playlistService.contains(item);\n }\n\n swipePage(val) {\n this.currentPage += val;\n this.loadPage();\n }\n\n stopDownload(item) {\n this.DownloadManager.ws.stop(item);\n }\n toggleDownload(item) {\n this.DownloadManager.ws.toggle(item);\n }\n}\nangular.module('ps.podcast.details.episodes', [\n 'ps.player'\n])\n .directive('podcastItemsList', () => new podcastItemsListDirective())\n .constant('PodcastItemPerPage', 10)\n .controller('podcastItemsListCtrl', podcastItemsListCtrl);\n\nclass PodcastDetailCtrl {\n\n constructor($scope, podcast, UpdateService){\n this.$scope = $scope;\n this.UpdateService = UpdateService;\n this.podcast = podcast;\n\n this.podcastTabs= [\n { heading : 'Episodes', active : true},\n { heading : 'Edition', active : false},\n { heading : 'Upload', disabled : this.podcast.type !== 'send'},\n { heading : 'Stats', active : false}\n ];\n this.$scope.$on(\"podcastEdition:save\", () => this.refreshItems());\n this.$scope.$on(\"podcastEdition:upload\", () => this.refreshItems());\n }\n\n refreshItems() {\n this.$scope.$broadcast('podcastItems:refresh');\n }\n\n refresh() {\n this.UpdateService\n .forceUpdatePodcast(this.podcast.id)\n .then(() => this.refreshItems());\n }\n\n tabsActive(num) {\n this.podcastTabs[num].active = true;\n }\n\n}\n\nangular.module('ps.podcast.details', [\n 'ps.config.route',\n 'ps.podcast.details',\n 'ps.podcast.details.episodes',\n 'ps.podcast.details.edition',\n 'ps.podcast.details.upload',\n 'ps.podcast.details.stats',\n 'ps.dataService.updateService'\n]).config(($routeProvider, commonKey) =>\n $routeProvider.\n when('/podcasts/:podcastId', {\n templateUrl: 'html/podcast-detail.html',\n controller: 'PodcastDetailCtrl',\n controllerAs: 'pdc',\n /*hotkeys: [\n ['r', 'Refresh', 'pdc.refreshItems()'],\n ['f', 'Force Refresh', 'pdc.refresh()'],\n ['l', 'List of Items', 'pdc.tabsActive(0)'],\n ['m', 'Modification of Podcast', 'pdc.tabsActive(1)']\n ].concat(commonKey),*/\n hotkeys : commonKey,\n resolve : { podcast : (podcastService, $route) => podcastService.findById($route.current.params.podcastId) }\n })\n)\n .controller('PodcastDetailCtrl', PodcastDetailCtrl);\nclass podcastStatsDirective {\n constructor() {\n this.restrict = 'E';\n this.scope = { podcast : '='};\n this.templateUrl = 'html/podcast-details-stats.html';\n this.controller = 'PodcastDetailsStatsCtrl';\n this.controllerAs = 'pdsc';\n this.bindToController = true;\n }\n}\n\nclass PodcastDetailsStatsCtrl {\n\n constructor($scope, $q, podcastService) {\n this.$q = $q;\n this.podcastService = podcastService;\n this.month = 6;\n\n this.chartSeries = [];\n this.generateChartData();\n this.chartConfig = {\n options: {\n chart: {\n type: 'spline'\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: true\n }\n }\n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Date'\n }\n }\n },\n series: this.chartSeries,\n title : {\n text : ''\n },\n credits: {\n enabled: false\n },\n loading: false\n };\n\n $scope.$on(\"podcastItems:refresh\", () => this.generateChartData());\n }\n\n navigate(offset) {\n this.month += offset;\n return this.generateChartData();\n }\n\n generateChartData() {\n PodcastDetailsStatsCtrl.resetChart(this.chartSeries);\n\n return this.$q.all([\n this.podcastService.statsByByDownloaddate(this.podcast.id, this.month),\n this.podcastService.statsByPubdate(this.podcast.id, this.month)\n ]).then((arrayResult) => {\n let downloadData = _(arrayResult[0])\n .map(PodcastDetailsStatsCtrl.dateMapper())\n .sortBy(\"date\")\n .map(PodcastDetailsStatsCtrl.highChartsMapper())\n .value(),\n publicationData = _(arrayResult[1])\n .map(PodcastDetailsStatsCtrl.dateMapper())\n .sortBy(\"date\")\n .map(PodcastDetailsStatsCtrl.highChartsMapper())\n .value();\n\n this.chartSeries.push({\"name\": \"Download Date\", \"data\": downloadData});\n this.chartSeries.push({\"name\": \"Publication Date\", \"data\": publicationData});\n return this.chartSeries;\n });\n }\n\n static resetChart(chartSeries) {\n _.updateinplace(chartSeries, []);\n }\n\n static dateMapper() {\n return (value) => { return { date : Date.UTC(value.date[0], value.date[1]-1, value.date[2]), numberOfItems : value.numberOfItems }; };\n }\n\n static highChartsMapper() {\n return (value) => [value.date, value.numberOfItems];\n }\n}\n\n\nangular.module('ps.podcast.details.stats', [ 'highcharts-ng' ])\n .directive('podcastStats', () => new podcastStatsDirective())\n .controller('PodcastDetailsStatsCtrl', PodcastDetailsStatsCtrl);\n\nclass podcastUploadDirective {\n\n constructor() {\n this.restrcit = 'E';\n this.templateUrl = 'html/podcast-details-upload.html';\n this.scope = {\n podcast : '='\n };\n this.controller = 'podcastUploadCtrl';\n this.controllerAs = 'puc';\n this.bindToController = true;\n }\n}\n\nclass podcastUploadCtrl{\n\n constructor($scope, itemService, $notification) {\n this.$scope = $scope;\n this.itemService = itemService;\n this.$notification = $notification;\n }\n\n onFileSelect($files) {\n angular.forEach($files, (file) => {\n this.itemService.upload(this.podcast, file)\n .then((item) => {\n this.$scope.$emit(\"podcastEdition:upload\");\n try {\n this.$notification('Upload effectué', {\n body: item.title,\n icon: item.cover.url,\n delay: 5000\n });\n } catch (e) {}\n });\n });\n }\n}\n\n\nangular.module('ps.podcast.details.upload', [\n 'ps.dataService.item',\n 'ngFileUpload',\n 'notification'\n])\n .directive('podcastUpload', () => new podcastUploadDirective())\n .controller('podcastUploadCtrl', podcastUploadCtrl);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["podcastserver.js"],"names":["_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","angular","module","authorizeNotificationDirective","this","replace","restrict","scope","templateUrl","controllerAs","controller","authorizeNotificationController","$window","$notification","state","hasToBeShown","$inject","value","_this","requestPermission","then","Notification","permission","directive","deviceDetectorService","service","filter","text","String","_","mixin","updateinplace","localArray","remoteArray","comparisonFunction","undefined","arguments","inArray","elem","indexOf","withOrder","forEachRight","slice","splice","forEach","push","elementToMove","navbarController","navCollapsed","navbarDirective","transclude","element","removeClass","UpdatingDirective","liParent","parent","tagName","liElement","addClass","$watch","newValue","UpdatingController","ngstomp","$scope","_this2","isUpdating","subscribe","message","updateStatus","JSON","parse","body","config","cfpLoadingBarProvider","includeSpinner","ngstompProvider","url","credential","SockJS","RestangularProvider","setBaseUrl","addElementTransformer","item","addRestangularMethod","constant","event","preventDefault","window","location","href","$routeProvider","otherwise","redirectTo","$locationProvider","html5Mode","DownloadCtrl","DonwloadManager","_this3","items","waitingitems","numberOfSimDl","getNumberOfSimDl","parseInt","ws","onSubscribeDownload","onSubscribeWaiting","onDownloadUpdate","onWaitingUpdate","elemToUpdate","find","id","status","assign","title","icon","cover","delay","e","onStoppedFromWS","remove","remoteWaitingItems","findIndex","number","updateNumberOfSimDl","download","stop","toggle","stopAllDownload","pauseAllDownload","restartAllCurrentDownload","removeFromQueue","dontDonwload","position","moveInWaitingList","commonKey","when","hotkeys","run","$templateCache","put","ItemDetailCtrl","$location","playlistService","podcast","_this4","webSockedUrl","concat","itemFromWS","_this5","path","_this6","reset","itemReseted","addOrRemove","contains","resolve","itemService","$route","findById","current","params","podcastId","itemId","podcastService","ItemPlayerController","$timeout","autoPlay","sources","src","proxyURL","type","mimeType","plugins","controls","autoHide","isTouchedDevice","autoHideTime","poster","PlayerController","playlist","API","currentVideo","reloadPlaylist","currentState","isCompleted","play","setVideo","indexOfVideo","getIndexOfVideoInPlaylist","index","removeAll","PlaylistService","$localStorage","isObject","add","PodcastCreationController","defaultPodcast","tagService","types","extend","getNewPodcast","_this7","findInfo","podcastFetched","description","query","search","test","_this8","save","typeService","findAll","hasToBeDeleted","height","width","PodcastsListCtrl","podcasts","filters","SearchItemCache","DefaultItemSearchParameters","$sessionStorage","searchParameters","pageNumber","isNumber","page","sizeNumber","size","searchParam","term","tags","direction","properties","ItemSearchCtrl","_this9","DownloadManager","totalItems","Number","MAX_VALUE","maxSize","currentPage","getParameters","updateItemFromWS","$on","changePage","attachResponse","wsMessage","_this10","calculatePage","itemsResponse","content","totalPages","totalElements","val","_this11","_this12","itemInList","Math","ceil","updateSearchParam","reloadOnSearch","StatsController","statService","stats","month","chartSeries","transform","chartConfig","options","chart","plotOptions","spline","marker","enabled","xAxis","dateTimeLabelFormats","year","series","credits","loading","_this13","name","data","values","map","dateMapper","sortBy","highChartsMapper","offset","generateChartData","_this14","statsByType","date","Date","UTC","numberOfItems","wsDownloadManager","urlBase","WS_DOWNLOAD_BASE","connect","callback","unsubscribe","send","Restangular","baseTask","one","baseDownloadManager","customGET","customPOST","customDELETE","all","getList","get","childRoute","_this15","post","responseFromServer","restangularizedItems","pageParemeters","restangularizeCollection","itemList","_this16","restangularList","restangularizeElement","file","formData","FormData","append","withHttpConfig","transformRequest","identity","Content-Type","route","patch","numberOfMonth","base","baseAll","UpdateService","idPodcast","podcastEditionDirective","bindToController","podcastEditionCtrl","_this17","podcastToUpdate","cloneDeep","patchedPodcast","$emit","_this18","deletePodcast","podcastItemsListDirective","podcastItemsListCtrl","PodcastItemPerPage","_this19","itemPerPage","loadPage","onMessageFromWS","_this20","getItemForPodcastWithPagination","restangularizePodcastItem","_this21","reject","_this22","itemToRemove","PodcastDetailCtrl","_this23","podcastTabs","heading","active","disabled","refreshItems","$broadcast","_this24","forceUpdatePodcast","num","podcastStatsDirective","PodcastDetailsStatsCtrl","$q","_this25","_this26","resetChart","statsByByDownloaddate","statsByPubdate","arrayResult","downloadData","publicationData","podcastUploadDirective","restrcit","podcastUploadCtrl","$files","_this27","upload"],"mappings":"CAAC,WAAD,YAIA,SAASA,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAFhH,GAAIC,GAAgB,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,SAAWF,KAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAAiB,MAAO,UAAUR,EAAae,EAAYC,GAAiJ,MAA9HD,IAAYZ,EAAiBH,EAAYiB,UAAWF,GAAiBC,GAAab,EAAiBH,EAAagB,GAAqBhB,KAFjiBkB,SAAQC,OAAO,cACX,YACA,aACA,UACA,cACA,YACA,WACA,YACA,iBACA,YACA,cAFJ,IAKMC,GACS,QADTA,KAJFtB,EAAg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PlBH,SAAQ2C,QAAQuV,EAAQ,SAAChE,GACrBiE,EAAKxO,YAAYyO,OAAOD,EAAKrP,QAASoL,GACjC/S,KAAK,SAAC8D,GACHkT,EAAKrU,OAAO0R,MAAM,wBAClB,KACI2C,EAAKvX,cAAc,mBACf0D,KAAMW,EAAK+B,MACXC,KAAMhC,EAAKiC,MAAMvC,IACjBwC,MAAO,MAEb,MAAOC,aAnBvB6Q,IA0BNjY,SAAQC,OAAO,6BACX,sBACA,eACA,iBAECqB,UAAU,gBAAiB,WAoP5B,MApPkC,IAAIyW,KACrCtX,WAAW,oBAAqBwX","file":"podcastserver.min.js","sourcesContent":["angular.module('podcastApp', [\n 'ps.search',\n 'ps.podcast',\n 'ps.item',\n 'ps.download',\n 'ps.player',\n 'ps.stats',\n 'ps.common',\n 'ps.dataservice',\n 'ps.config',\n 'ps.partial'\n]);\n\nclass authorizeNotificationDirective {\n constructor() {\n this.replace = true;\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/authorize-notification.html';\n this.controllerAs = 'an';\n this.controller = 'authorizeNotificationController';\n }\n}\n\nclass authorizeNotificationController {\n constructor($window, $notification) {\n this.$window = $window;\n this.$notification = $notification;\n this.state = this.hasToBeShown();\n }\n\n manuallyactivate() {\n this.$notification\n .requestPermission()\n .then(() => { this.state = this.hasToBeShown();});\n }\n\n hasToBeShown() {\n return (('Notification' in this.$window) && this.$window.Notification.permission != 'granted');\n }\n}\n\nangular.module('authorize-notification', ['notification'])\n .directive('authorizeNotification', () => new authorizeNotificationDirective())\n .controller('authorizeNotificationController', authorizeNotificationController);\n\nangular.module('ps.common', [\n 'ps.filters',\n 'navbar',\n 'authorize-notification',\n 'device-detection',\n 'updating'\n]);\nclass deviceDetectorService {\n constructor($window) {\n this.$window = $window;\n }\n\n isTouchedDevice() {\n return 'ontouchstart' in this.$window;\n }\n}\n\nangular.module('device-detection', [])\n .service('deviceDetectorService', deviceDetectorService);\nangular.module('ps.filters', [])\n .filter('htmlToPlaintext', function () {\n return function(text) {\n return String(text || \"\").replace(/<[^>]+>/gm, '');\n };\n }\n);\n/**\n * Created by kevin on 14/08/2014.\n */\n\n_.mixin({\n // Update in place, does not preserve order\n updateinplace : function(localArray, remoteArray, comparisonFunction = (inArray, elem) => inArray.indexOf(elem), withOrder = false) {\n\n // Remove from localArray what is not in the remote array :\n _.forEachRight(localArray.slice(), (elem, key) => (comparisonFunction(remoteArray, elem) === -1) && localArray.splice(key, 1));\n\n // Add to localArray what is new in the remote array :\n _.forEach(remoteArray, (elem) => (comparisonFunction(localArray, elem) === -1) && localArray.push(elem));\n\n if (withOrder) {\n _.forEach(remoteArray, (elem, key) => {\n var elementToMove = localArray.splice(comparisonFunction(localArray, elem), 1)[0];\n localArray.splice(key, 0, elementToMove);\n });\n }\n \n return localArray;\n }\n});\n\nclass navbarController {\n constructor() {\n this.navCollapsed = true;\n }\n}\n\nclass navbarDirective {\n constructor() {\n this.transclude = true;\n this.replace = true;\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/navbar.html';\n this.controller = 'navbarController';\n this.controllerAs = 'navbar';\n }\n\n link(scope, element) {\n element.removeClass('hidden');\n }\n}\n\nangular.module('navbar', [])\n .directive('navbar', () => new navbarDirective())\n .controller('navbarController', navbarController);\n\nclass UpdatingDirective {\n constructor() {\n this.restrict = 'E';\n this.scope = true;\n this.templateUrl = 'html/updating.html';\n this.controller = 'UpdatingController';\n this.controllerAs = 'uc';\n }\n\n link(scope, element) {\n\n let liParent = element.parent().parent()[0];\n\n if (liParent && liParent.tagName === 'LI') {\n let liElement = angular.element(liParent);\n liElement.addClass('hidden');\n scope.$watch(\n 'uc.isUpdating',\n (newValue) => (newValue) ? liElement.removeClass('hidden') : liElement.addClass('hidden')\n );\n }\n }\n}\n\nclass UpdatingController {\n constructor(ngstomp, $scope) {\n this.ngstomp = ngstomp;\n this.isUpdating = false;\n this.$scope = $scope;\n\n this.ngstomp\n .subscribe('/app/updating', (message) => this.updateStatus(message), $scope)\n .subscribe('/topic/updating', (message) => this.updateStatus(message), $scope);\n }\n\n updateStatus(message) {\n this.isUpdating = JSON.parse(message.body);\n }\n}\n\nangular.module('updating', ['AngularStompDK'])\n .directive('updateStatus', () => new UpdatingDirective())\n .controller('UpdatingController', UpdatingController);\n\nangular.module('ps.config', [\n 'ps.config.route',\n 'ps.config.loading',\n 'ps.config.restangular',\n 'ps.config.ngstomp',\n 'ps.config.module'\n]);\nangular\n .module('ps.config.loading', [ 'angular-loading-bar' ])\n .config((cfpLoadingBarProvider) => { cfpLoadingBarProvider.includeSpinner = false; } );\nangular.module('ps.config.module', [\n 'ngTouch',\n 'ngAnimate',\n 'ui.bootstrap',\n 'truncate',\n 'ngFileUpload'\n]);\nangular\n .module('ps.config.ngstomp', ['AngularStompDK'])\n .config((ngstompProvider) => ngstompProvider.url('/ws').credential('login', 'password').class(SockJS));\nangular\n .module('ps.config.restangular', ['restangular'])\n .config((RestangularProvider) => {\n RestangularProvider.setBaseUrl('/api/');\n RestangularProvider.addElementTransformer('items', false, (item) => {\n item.addRestangularMethod('reset', 'get', 'reset');\n item.addRestangularMethod('download', 'get', 'addtoqueue');\n return item;\n });\n });\nangular\n .module('ps.config.route', ['ngRoute','cfp.hotkeys'])\n .constant('commonKey', [\n ['h', 'Goto Home', (event) => {\n event.preventDefault();\n window.location.href = '/items';\n }],\n ['s', 'Goto Search', (event) => {\n event.preventDefault();\n window.location.href = '/item/search';\n }],\n ['p', 'Goto Podcast List', (event) => {\n event.preventDefault();\n window.location.href = '/podcasts';\n }],\n ['d', 'Goto Download List', (event) => {\n event.preventDefault();\n window.location.href = '/download';\n }]\n ])\n .config($routeProvider => $routeProvider.otherwise({redirectTo: '/items'}))\n .config($locationProvider => $locationProvider.html5Mode(true));\n\nclass DownloadCtrl {\n\n constructor($scope, DonwloadManager, $notification) {\n this.DonwloadManager = DonwloadManager;\n this.$notification = $notification;\n this.items =[];\n this.waitingitems = [];\n this.numberOfSimDl = 0;\n\n this.DonwloadManager.getNumberOfSimDl().then((value) => {\n this.numberOfSimDl = parseInt(value);\n });\n\n /** Websocket Connection */\n this.DonwloadManager.ws\n .subscribe(\"/app/download\", (message) => this.onSubscribeDownload(message), $scope)\n .subscribe(\"/app/waiting\", (message) => this.onSubscribeWaiting(message), $scope)\n .subscribe(\"/topic/download\", (message) => this.onDownloadUpdate(message), $scope)\n .subscribe(\"/topic/waiting\", (message) => this.onWaitingUpdate(message), $scope);\n }\n\n onSubscribeDownload(message) {\n this.items = JSON.parse(message.body);\n }\n onSubscribeWaiting(message) {\n this.waitingitems = JSON.parse(message.body);\n }\n onDownloadUpdate(message) {\n let item = JSON.parse(message.body);\n let elemToUpdate = _.find(this.items, { 'id': item.id });\n switch (item.status) {\n case 'Started' :\n case 'Paused' :\n if (elemToUpdate)\n _.assign(elemToUpdate, item);\n else\n this.items.push(item);\n break;\n case 'Finish' :\n try {\n this.$notification('Téléchargement terminé', {\n body: item.title,\n icon: item.cover.url,\n delay: 5000\n });\n } catch (e) {\n\n }\n this.onStoppedFromWS(elemToUpdate);\n break;\n case 'Stopped' :\n this.onStoppedFromWS(elemToUpdate);\n break;\n }\n }\n\n onStoppedFromWS(elemToUpdate) {\n if (elemToUpdate) {\n _.remove(this.items, function (item) {\n return item.id === elemToUpdate.id;\n });\n }\n }\n\n onWaitingUpdate(message) {\n let remoteWaitingItems = JSON.parse(message.body);\n _.updateinplace(this.waitingitems, remoteWaitingItems, (inArray, elem) => _.findIndex(inArray, { 'id': elem.id }), true);\n }\n\n getTypeFromStatus(item) {\n if (item.status === \"Paused\")\n return \"warning\";\n return \"info\";\n }\n updateNumberOfSimDl(number) {\n this.DonwloadManager.updateNumberOfSimDl(number);\n }\n\n /** Spécifique aux éléments de la liste : **/\n download(item){\n this.DonwloadManager.download(item);\n }\n stopDownload(item){\n this.DonwloadManager.ws.stop(item);\n }\n toggleDownload(item){\n this.DonwloadManager.ws.toggle(item);\n }\n\n /** Global **/\n stopAllDownload(){\n this.DonwloadManager.stopAllDownload();\n }\n pauseAllDownload(){\n this.DonwloadManager.pauseAllDownload();\n }\n restartAllCurrentDownload(){\n this.DonwloadManager.restartAllCurrentDownload();\n }\n removeFromQueue(item){\n this.DonwloadManager.removeFromQueue(item);\n }\n dontDonwload(item){\n this.DonwloadManager.dontDonwload(item);\n }\n moveInWaitingList(item, position){\n this.DonwloadManager.moveInWaitingList(item, position);\n }\n\n}\n\nangular.module('ps.download', [\n 'ps.config.route',\n 'ps.dataService.donwloadManager',\n 'notification'\n])\n .config(($routeProvider, commonKey) =>\n $routeProvider.\n when('/download', {\n templateUrl: 'html/download.html',\n controller: 'DownloadCtrl',\n controllerAs: 'dc',\n hotkeys: commonKey\n })\n )\n .controller('DownloadCtrl', DownloadCtrl);\nangular.module(\"ps.partial\", []).run([\"$templateCache\", function($templateCache) {$templateCache.put(\"html/authorize-notification.html\",\"\\n\");\n$templateCache.put(\"html/download.html\",\"
\\n\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n\\n
\\n
\\n \\n \\n
\\n\\n \\n \\n \\n\\n
\\n
{{item.title | characters:100}}
\\n
\\n {{item.progression}}%\\n
\\n
\\n\\n\\n
\\n\\n 0\\\">\\n \\n \\n Liste d\\'attente {{ dc.waitingitems.length }}\\n \\n
\\n\\n
\\n
\\n \\n \\n
1\\\">\\n \\n \\n
\\n
\\n\\n \\n \\n \\n\\n
\\n
{{item.title | characters:100}}
\\n
\\n
\\n\\n
\\n
\\n\\n\\n
\");\n$templateCache.put(\"html/item-detail.html\",\"\\n
\\n\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ idc.item.podcast.title }}
  4. \\n
  5. {{ idc.item.title }}
  6. \\n
\\n\\n
\\n
\\n
\\n \\n \\n \\n\\n
\\n\\n
\\n \\n \\n \\n \\n \\n\\n \\n \\n\\n \\n\\n \\n \\n \\n \\n \\n\\n
\\n \\n \\n
\\n \\n
\\n
\\n
\\n
\\n\\n
\\n
\\n
\\n

{{ idc.item.title }}

\\n
\\n
\\n
Date de publication : {{idc.item.pubdate | date : \\'dd/MM/yyyy à HH:mm\\' }}
\\n
\\n
\\n\\n
\\n
\\n\\n\");\n$templateCache.put(\"html/item-player.html\",\"
\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ ipc.item.podcast.title }}
  4. \\n
  5. {{ ipc.item.title }}
  6. \\n
\\n\\n
\\n \\n \\n\\n \\n \\n {{ currentTime | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n {{ timeLeft | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n \\n \\n
\\n
\\n\\n \\n \\n \\n
\\n
\\n
\");\n$templateCache.put(\"html/items-search.html\",\"\\n
\\n \\n\\n
\\n
\\n
\\n \\n \\n
\\n
\\n\\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n\\n
\\n \\n
\\n\\n
\\n \\n \\n
\\n
\\n\\n
\\n 1\\\" items-per-page=\\\"12\\\" max-size=\\\"10\\\" boundary-links=\\\"true\\\" total-items=\\\"isc.totalItems\\\" ng-model=\\\"isc.currentPage\\\" ng-change=\\\"isc.changePage()\\\" class=\\\"pagination pagination-centered\\\" previous-text=\\\"‹\\\" next-text=\\\"›\\\" first-text=\\\"«\\\" last-text=\\\"»\\\">\\n \\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n\\n \\n \\n \\n
\\n \\n
\\n
\\n
\\n
1\\\">\\n \\n
\\n
\\n\");\n$templateCache.put(\"html/navbar.html\",\"\");\n$templateCache.put(\"html/player.html\",\"
\\n
\\n
\\n \\n \\n\\n \\n \\n {{ currentTime | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n {{ timeLeft | date:\\'H:mm:ss\\':\\'+0000\\' }}\\n \\n \\n \\n \\n \\n
\\n
\\n\\n \\n\\n \\n
\\n
\\n
\\n
\\n
Rafraichir
\\n
Vider
\\n
\\n
\\n\\n \\n\\n \\n \\n \\n\\n
\\n

{{ item.title }}

\\n
\\n
\\n \\n
\\n\\n
\");\n$templateCache.put(\"html/podcast-creation.html\",\"
\\n
\\n

Ajouter un Podcast

\\n
\\n
\\n\\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n\\n\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n\\n
\\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n \\n\\n
\\n \\n
\\n
\\n
\\n\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n\\n\\n\\n\");\n$templateCache.put(\"html/podcast-detail.html\",\"\\n\\n
\\n
\\n
    \\n
  1. Podcasts
  2. \\n
  3. {{ pdc.podcast.title }}
  4. \\n
\\n\\n
\\n
\\n
\\n
\\n

{{ pdc.podcast.title }}

\\n

{{ pdc.podcast.totalItems }} Episodes

\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n\\n
\\n
\\n\\n\\n\\n\");\n$templateCache.put(\"html/podcast-details-edition.html\",\"
\\n\\n \\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n\");\n$templateCache.put(\"html/podcast-details-episodes.html\",\"
\\n
\\n
\\n
\\n \\n \\n \\n \\n \\n\\n \\n \\n\\n \\n \\n \\n \\n \\n\\n \\n \\n
\\n\\n \\n \\n \\n \\n
\\n

{{ item.title }}

\\n

{{item.description | htmlToPlaintext | characters : 130 }}

\\n

{{item.pubdate | date : \\'dd/MM/yyyy à HH:mm\\' }}

\\n
\\n
\\n\\n
pic.itemPerPage\\\" class=\\\"text-center\\\">\\n \\n
\\n
\\n\\n \");\n$templateCache.put(\"html/podcast-details-stats.html\",\"
\\n
\\n
\\n - \\n \\n + \\n
\\n
\\n
\\n \\n
\\n\");\n$templateCache.put(\"html/podcast-details-upload.html\",\"
\\n
\\n
\\n
\\n Déposer un ou des fichiers ici\\n
\\n
\\n
\\n\");\n$templateCache.put(\"html/podcasts-list.html\",\"
\\n\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n\\n
\\n \\n
\\n
\\n \\n
\\n
\\n\\n
\\n\\n\\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n\\n\");\n$templateCache.put(\"html/stats.html\",\"
\\n
\\n
\\n
\\n - \\n \\n + \\n
\\n
\\n
\\n \\n
\\n
\");\n$templateCache.put(\"html/updating.html\",\"\\n \\n\");}]);\nclass ItemDetailCtrl {\n\n constructor($scope, DonwloadManager, $location, playlistService, podcast, item){\n this.item = item;\n this.$location = $location;\n this.item.podcast = podcast;\n this.playlistService = playlistService;\n this.DonwloadManager = DonwloadManager;\n\n //** WebSocket Inscription **//\n let webSockedUrl = \"/topic/podcast/\".concat(this.item.podcast.id);\n\n this.DonwloadManager\n .ws\n .subscribe(webSockedUrl, (message) => {\n let itemFromWS = JSON.parse(message.body);\n if (itemFromWS.id == this.item.id) {\n _.assign(this.item, itemFromWS);\n }\n }, $scope);\n\n }\n\n stopDownload(item) {\n this.DonwloadManager.ws.stop(item);\n }\n\n toggleDownload(item) {\n this.DonwloadManager.ws.toggle(item);\n }\n\n remove(item) {\n return item.remove()\n .then(() => {\n this.playlistService.remove(item);\n this.$location.path('/podcasts/'.concat(this.item.podcast.id));\n });\n }\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n _.assign(this.item, itemReseted);\n this.playlistService.remove(item);\n });\n }\n\n toggleInPlaylist() {\n this.playlistService.addOrRemove(this.item);\n }\n\n isInPlaylist() {\n return this.playlistService.contains(this.item);\n }\n}\n\nangular.module('ps.item.details', [\n 'ps.dataService.donwloadManager',\n 'ps.player'\n]).config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/podcasts/:podcastId/item/:itemId', {\n templateUrl: 'html/item-detail.html',\n controller: 'ItemDetailCtrl',\n controllerAs: 'idc',\n hotkeys: commonKey,\n resolve : {\n item : function (itemService, $route) {\n return itemService.findById($route.current.params.podcastId, $route.current.params.itemId);\n },\n podcast : function (podcastService, $route) {\n return podcastService.findById($route.current.params.podcastId);\n }\n }\n });\n})\n .controller('ItemDetailCtrl', ItemDetailCtrl);\n/**\n * Created by kevin on 01/11/14.\n */\n\nangular.module('ps.item', [\n 'ps.item.details',\n 'ps.item.player'\n]);\nclass ItemPlayerController {\n\n constructor(podcast, item, $timeout, deviceDetectorService) {\n this.item = item;\n this.item.podcast = podcast;\n this.$timeout = $timeout;\n\n this.config = {\n autoPlay: true,\n sources: [\n { src : this.item.proxyURL, type : this.item.mimeType }\n ],\n plugins: {\n controls: {\n autoHide: !deviceDetectorService.isTouchedDevice(),\n autoHideTime: 2000\n },\n poster: this.item.cover.url\n }\n };\n }\n}\n\nangular.module('ps.item.player', [\n 'ngSanitize',\n 'ngRoute',\n 'device-detection',\n 'com.2fdevs.videogular',\n 'com.2fdevs.videogular.plugins.poster',\n 'com.2fdevs.videogular.plugins.controls',\n 'com.2fdevs.videogular.plugins.overlayplay',\n 'com.2fdevs.videogular.plugins.buffering'\n])\n .config(($routeProvider) => {\n $routeProvider.\n when('/podcasts/:podcastId/item/:itemId/play', {\n templateUrl: 'html/item-player.html',\n controller: 'ItemPlayerController',\n controllerAs: 'ipc',\n resolve : {\n item : (itemService, $route) => itemService.findById($route.current.params.podcastId, $route.current.params.itemId),\n podcast : (podcastService, $route) => podcastService.findById($route.current.params.podcastId)\n }\n });\n })\n .controller('ItemPlayerController', ItemPlayerController);\n\nclass PlayerController {\n constructor(playlistService, $timeout, deviceDetectorService) {\n this.playlistService = playlistService;\n this.$timeout = $timeout;\n\n this.playlist = [];\n this.state = null;\n this.API = null;\n this.currentVideo = {};\n this.config = {\n autoPlay : true,\n sources: [],\n plugins: {\n controls: {\n autoHide : !deviceDetectorService.isTouchedDevice(),\n autoHideTime: 2000\n },\n poster: ''\n }\n };\n this.reloadPlaylist();\n }\n\n onPlayerReady(API) {\n this.API = API;\n\n if (this.API.currentState == 'play' || this.isCompleted)\n this.API.play();\n\n this.isCompleted = false;\n this.setVideo(0);\n }\n\n onCompleteVideo() {\n var indexOfVideo = this.getIndexOfVideoInPlaylist(this.currentVideo);\n this.isCompleted = true;\n\n if (indexOfVideo+1 === this.playlist.length) {\n this.currentVideo = this.playlist[0];\n return;\n }\n\n this.setVideo(indexOfVideo+1);\n }\n\n reloadPlaylist() {\n _.updateinplace(this.playlist, this.playlistService.playlist(), function(inArray, elem) { return _.findIndex(inArray, { 'id': elem.id });});\n }\n\n\n\n setVideo(index) {\n this.currentVideo = this.playlist[index];\n\n if (this.currentVideo !== null && this.currentVideo !== undefined) {\n this.API.stop();\n this.config.sources = [{src : this.currentVideo.proxyURL, type : this.currentVideo.mimeType }];\n this.config.plugins.poster = this.currentVideo.cover.url;\n }\n }\n\n remove(item) {\n this.playlistService.remove(item);\n this.reloadPlaylist();\n if (this.config.sources.length > 0 && this.config.sources[0].src === item.proxyURL) {\n this.setVideo(0);\n }\n }\n\n removeAll() {\n this.playlistService.removeAll();\n this.reloadPlaylist();\n }\n\n getIndexOfVideoInPlaylist(item) {\n return this.playlist.indexOf(item);\n }\n}\n\nangular.module('ps.player', [\n 'ngSanitize',\n 'ngRoute',\n 'device-detection',\n 'com.2fdevs.videogular',\n 'com.2fdevs.videogular.plugins.poster',\n 'com.2fdevs.videogular.plugins.controls',\n 'com.2fdevs.videogular.plugins.overlayplay',\n 'com.2fdevs.videogular.plugins.buffering',\n 'ps.player.playlist'\n])\n .config(($routeProvider) => {\n $routeProvider.\n when('/player', {\n templateUrl: 'html/player.html',\n controller: 'PlayerController',\n controllerAs: 'pc'\n });\n })\n .controller('PlayerController', PlayerController);\nclass PlaylistService {\n\n constructor($localStorage) {\n this.$localStorage = $localStorage;\n this.$localStorage.playlist = this.$localStorage.playlist || [];\n }\n\n playlist() {\n return this.$localStorage.playlist;\n }\n add(item) {\n this.$localStorage.playlist.push(item);\n }\n remove (item) {\n this.$localStorage.playlist = _.remove(this.$localStorage.playlist, function(elem) { return elem.id !== item.id; });\n }\n contains(item) {\n return angular.isObject(_.find(this.$localStorage.playlist, {id : item.id}));\n }\n addOrRemove (item) {\n (this.contains(item)) ? this.remove(item) : this.add(item);\n }\n removeAll () {\n this.$localStorage.playlist = [];\n }\n}\n\nangular.module('ps.player.playlist', [\n 'ngStorage'\n]).service('playlistService', PlaylistService);\n\nclass PodcastCreationController {\n\n constructor($location, defaultPodcast, tagService, podcastService, types) {\n this.podcastService = podcastService;\n this.$location = $location;\n this.tagService = tagService;\n this.podcast = angular.extend(this.podcastService.getNewPodcast(), defaultPodcast );\n this.types = types;\n }\n\n findInfo() {\n return this.podcastService.findInfo(this.podcast.url)\n .then((podcastFetched) => {\n this.podcast.title = podcastFetched.title;\n this.podcast.description = podcastFetched.description;\n this.podcast.type = podcastFetched.type;\n this.podcast.cover.url = podcastFetched.cover.url;\n });\n }\n\n loadTags(query) {\n return this.tagService.search(query);\n }\n\n changeType() {\n if (/beinsports\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"BeInSports\";\n } else if (/canalplus\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"CanalPlus\";\n } else if (/jeuxvideo\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"JeuxVideoFR\";\n } else if (/jeuxvideo\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"JeuxVideoCom\";\n } else if (/parleys\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"Parleys\";\n } else if (/pluzz\\.francetv\\.fr/i.test(this.podcast.url)) {\n this.podcast.type = \"Pluzz\";\n } else if (/youtube\\.com/i.test(this.podcast.url)) {\n this.podcast.type = \"Youtube\";\n } else if (this.podcast.url.length > 0) {\n this.podcast.type = \"RSS\";\n } else {\n this.podcast.type = \"Send\";\n }\n }\n\n save() {\n this.podcastService.save(this.podcast)\n .then((podcast) => this.$location.path('/podcasts/' + podcast.id));\n }\n\n}\n\nangular.module('ps.podcast.creation', [\n 'ps.config.route',\n 'ps.dataservice',\n 'ngTagsInput'\n])\n .config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/podcast-creation', {\n templateUrl: 'html/podcast-creation.html',\n controller: 'PodcastAddCtrl',\n controllerAs: 'pac',\n hotkeys: commonKey,\n resolve : {\n types : typeService => typeService.findAll()\n }\n });\n })\n .constant('defaultPodcast', { hasToBeDeleted : true, cover : { height: 200, width: 200 } })\n .controller('PodcastAddCtrl', PodcastCreationController);\nclass PodcastsListCtrl {\n constructor(podcasts, types) {\n this.podcasts = podcasts;\n this.types = types;\n this.filters = {\n title : '',\n type : ''\n };\n }\n}\n\nangular.module('ps.podcast.list', [\n 'ps.config.route',\n 'ps.dataService.podcast',\n 'ps.dataService.type'\n])\n .config(($routeProvider, commonKey) => {\n $routeProvider.\n when('/podcasts', {\n templateUrl: 'html/podcasts-list.html',\n controller: 'PodcastsListCtrl',\n controllerAs: 'plc',\n hotkeys: commonKey,\n resolve: {\n podcasts: (podcastService) => podcastService.findAll(),\n types: typeService => typeService.findAll()\n }\n });\n })\n .controller('PodcastsListCtrl', PodcastsListCtrl);\n/**\n * Created by kevin on 01/11/14.\n */\n\nangular.module('ps.podcast', [\n 'ps.podcast.details',\n 'ps.podcast.creation',\n 'ps.podcast.list'\n]);\nclass SearchItemCache {\n constructor(DefaultItemSearchParameters, $sessionStorage) {\n this.$sessionStorage = $sessionStorage;\n this.$sessionStorage.searchParameters = DefaultItemSearchParameters;\n }\n\n getParameters() {\n return this.$sessionStorage.searchParameters;\n }\n\n page(pageNumber) {\n if (angular.isNumber(pageNumber)) {\n this.$sessionStorage.searchParameters.page = pageNumber;\n }\n\n return this.$sessionStorage.searchParameters.page;\n }\n\n size(sizeNumber) {\n if (angular.isNumber(sizeNumber)) {\n this.$sessionStorage.searchParameters.size = sizeNumber;\n }\n\n return this.$sessionStorage.searchParameters.size;\n }\n\n updateSearchParam(searchParam) {\n this.$sessionStorage.searchParameters.term = searchParam.term;\n this.$sessionStorage.searchParameters.tags = searchParam.tags;\n this.$sessionStorage.searchParameters.direction = searchParam.direction;\n this.$sessionStorage.searchParameters.properties = searchParam.properties;\n }\n}\n\nclass ItemSearchCtrl {\n\n constructor($scope, SearchItemCache, $location, itemService, tagService, DonwloadManager, playlistService, items) {\n /* DI */\n this.$location = $location;\n this.itemService = itemService;\n this.tagService = tagService;\n this.DownloadManager = DonwloadManager;\n this.playlistService = playlistService;\n this.SearchItemCache = SearchItemCache;\n\n /* Constructor Init */\n this.totalItems = Number.MAX_VALUE;\n this.maxSize = 10;\n this.currentPage = this.SearchItemCache.page()+1;\n this.searchParameters = this.SearchItemCache.getParameters();\n\n //** WebSocket Subscription **//\n this.DownloadManager\n .ws\n .subscribe(\"/topic/download\", (message) => this.updateItemFromWS(message), $scope);\n\n $scope.$on('$routeUpdate', () => {\n if (this.currentPage !== this.$location.search().page) {\n this.currentPage = this.$location.search().page || 1;\n this.changePage();\n }\n });\n\n /*this.changePage();*/\n this.attachResponse(items);\n }\n\n updateItemFromWS(wsMessage) {\n let item = JSON.parse(wsMessage.body);\n\n var elemToUpdate = _.find(this.items, { 'id': item.id });\n if (elemToUpdate)\n _.assign(elemToUpdate, item);\n }\n\n changePage() {\n this.SearchItemCache.page(this.calculatePage());\n return this.itemService\n .search(this.SearchItemCache.getParameters())\n .then((itemsResponse) => this.attachResponse(itemsResponse));\n }\n\n attachResponse(itemsResponse) {\n this.items = itemsResponse.content;\n this.totalPages = itemsResponse.totalPages;\n this.totalItems = itemsResponse.totalElements;\n this.currentPage = this.SearchItemCache.page(itemsResponse.number)+1;\n this.$location.search(\"page\", this.currentPage);\n }\n\n swipePage(val) {\n this.currentPage = this.SearchItemCache.page() + val + 1;\n return this.changePage();\n }\n\n //** Item Operation **//\n remove(item) {\n return item.remove()\n .then(() => this.playlistService.remove(item))\n .then(() => this.changePage());\n }\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n var itemInList = _.find(this.items, { 'id': itemReseted.id });\n _.assign(itemInList, itemReseted);\n return itemInList;\n })\n .then((itemInList) => this.playlistService.remove(itemInList));\n }\n\n stopDownload(item) {\n this.DownloadManager.ws.stop(item);\n }\n\n toggleDownload(item){\n return this.DownloadManager.ws.toggle(item);\n }\n\n loadTags(query){\n return this.tagService.search(query);\n }\n\n //** Playlist Manager **//\n addOrRemove(item) {\n return this.playlistService.addOrRemove(item);\n }\n\n isInPlaylist(item) {\n return this.playlistService.contains(item);\n }\n\n calculatePage() {\n if (this.currentPage <= 1) {\n return 0;\n } else if (this.currentPage > Math.ceil(this.totalItems / this.SearchItemCache.size())) {\n return Math.ceil(this.totalItems / this.SearchItemCache.size()) - 1;\n } else {\n return this.currentPage - 1;\n }\n }\n\n resetSearch() {\n this.currentPage = 1;\n this.SearchItemCache.updateSearchParam(this.searchParameters);\n return this.changePage();\n }\n}\n\nangular.module('ps.search.item', [\n 'ps.dataService.donwloadManager',\n 'ps.dataService.item',\n 'ps.dataService.tag',\n 'ps.player',\n 'ps.config.route',\n 'ngTagsInput',\n 'ngStorage'\n])\n .config(($routeProvider, commonKey) => {\n $routeProvider.\n when('/items', {\n templateUrl: 'html/items-search.html',\n controller: 'ItemsSearchCtrl',\n controllerAs: 'isc',\n reloadOnSearch: false,\n hotkeys: [\n ['right', 'Next page', 'isc.swipePage(1)'],\n ['left', 'Previous page', 'isc.swipePage(-1)']\n ].concat(commonKey),\n resolve : { items : (itemService, SearchItemCache) => itemService.search(SearchItemCache.getParameters()) }\n });\n })\n .constant('DefaultItemSearchParameters', {\n page : 0,\n size : 12,\n term : undefined,\n tags : undefined,\n direction : 'DESC',\n properties : 'pubdate'\n })\n .controller('ItemsSearchCtrl', ItemSearchCtrl)\n .service(\"SearchItemCache\", SearchItemCache);\nangular.module('ps.search', [\n 'ps.search.item'\n]);\n\n\nclass StatsController {\n\n constructor(statService, stats) {\n this.statService = statService;\n this.month = 1;\n\n this.chartSeries = [];\n this.transform(stats);\n\n this.chartConfig = {\n options: {\n chart: {\n type: 'spline'\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: true\n }\n }\n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Date'\n }\n }\n },\n series: this.chartSeries,\n title : {\n text : ''\n },\n credits: {\n enabled: false\n },\n loading: false\n };\n }\n\n transform(stats) {\n _.updateinplace(this.chartSeries, []);\n\n angular.forEach(stats, (value) => {\n let element = { name : value.type };\n element.data = _(value.values)\n .map(StatsController.dateMapper())\n .sortBy(\"date\")\n .map(StatsController.highChartsMapper())\n .value();\n this.chartSeries.push(element);\n });\n }\n\n static dateMapper() {\n return (value) => { return { date : Date.UTC(value.date[0], value.date[1]-1, value.date[2]), numberOfItems : value.numberOfItems }; };\n }\n\n static highChartsMapper() {\n return (value) => [value.date, value.numberOfItems];\n }\n\n navigate(offset) {\n this.month += offset;\n this.generateChartData();\n }\n\n generateChartData() {\n /*_.updateinplace(this.chartSeries, []);*/\n\n return this.statService\n .statsByType(this.month)\n .then(statsByType => this.transform(statsByType));\n }\n}\n\nangular.module('ps.stats', [\n 'ps.dataService.stat'\n])\n .config(function($routeProvider, commonKey) {\n $routeProvider.\n when('/stats', {\n templateUrl: 'html/stats.html',\n controller: 'StatsController',\n controllerAs: 'sc',\n hotkeys: commonKey,\n resolve : {\n stats : statService => statService.statsByType()\n }\n });\n })\n .controller('StatsController', StatsController);\n/**\n * Created by kevin on 02/11/14.\n */\n\nangular.module('ps.dataservice', [\n 'ps.dataService.donwloadManager',\n 'ps.dataService.item',\n 'ps.dataService.podcast',\n 'ps.dataService.tag',\n 'ps.dataService.type',\n 'ps.dataService.updateService'\n]);\n\nclass wsDownloadManager {\n\n /*@ngNoInject*/\n constructor(urlBase, ngstomp) {\n this.WS_DOWNLOAD_BASE = urlBase;\n this.ngstomp = ngstomp;\n }\n\n connect() { return this.ngstomp.connect();}\n subscribe(url, callback, scope) {return this.ngstomp.subscribe(url, callback, scope);}\n unsubscribe(url) { return this.ngstomp.unsubscribe(url); }\n toggle(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/toogle', item); }\n start(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/start', item); }\n pause(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/pause', item); }\n stop(item) { return this.ngstomp.send(this.WS_DOWNLOAD_BASE + '/stop', item); }\n}\n\nclass DownloadManager {\n\n constructor(Restangular, ngstomp) {\n this.Restangular = Restangular;\n this.baseTask = this.Restangular.one(\"task\");\n this.baseDownloadManager = this.baseTask.one('downloadManager');\n this.WS_DOWNLOAD_BASE = '/app/download';\n\n this.ws = new wsDownloadManager(this.WS_DOWNLOAD_BASE, ngstomp);\n }\n\n download(item) {\n return this.Restangular.one(\"item\").customGET(item.id + \"/addtoqueue\");\n }\n stopDownload (item) {\n return this.baseDownloadManager.customPOST(item.id, \"stopDownload\");\n }\n toggleDownload (item) {\n return this.baseDownloadManager.customPOST(item.id, \"toogleDownload\");\n }\n stopAllDownload () {\n return this.baseDownloadManager.customGET(\"stopAllDownload\");\n }\n pauseAllDownload () {\n return this.baseDownloadManager.customGET(\"pauseAllDownload\");\n }\n restartAllCurrentDownload () {\n return this.baseDownloadManager.customGET(\"restartAllCurrentDownload\");\n }\n removeFromQueue (item) {\n return this.baseDownloadManager.customDELETE(\"queue/\" + item.id);\n }\n updateNumberOfSimDl (number) {\n return this.baseDownloadManager.customPOST(number, \"limit\");\n }\n dontDonwload (item) {\n return this.baseDownloadManager.customDELETE(\"queue/\" + item.id + \"/andstop\");\n }\n getDownloading () {\n return this.baseTask.all(\"downloadManager/downloading\").getList();\n }\n getNumberOfSimDl () {\n return this.baseDownloadManager.one(\"limit\").get();\n }\n moveInWaitingList (item, position) {\n this.baseDownloadManager.customPOST({id : item.id, position : position } , 'move');\n }\n\n}\n\nangular.module('ps.dataService.donwloadManager', [ 'restangular', 'AngularStompDK']) .service('DonwloadManager', DownloadManager);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass itemService {\n constructor(Restangular) {\n this.Restangular = Restangular;\n this.childRoute = \"items\";\n }\n\n search(searchParameters = { page : 0, size : 12} ) {\n return this.Restangular.one(\"item/search\")\n .post(null, searchParameters)\n .then((responseFromServer) => {\n responseFromServer.content = this.restangularizedItems(responseFromServer.content);\n return responseFromServer;\n });\n }\n\n findById(podcastId, itemId) {\n return this.Restangular.one(\"podcast\", podcastId).one(this.childRoute, itemId).get();\n }\n\n getItemForPodcastWithPagination(podcast, pageParemeters) {\n return podcast.one(\"items\").post(null, pageParemeters);\n }\n\n restangularizePodcastItem (podcast, items) {\n return this.Restangular.restangularizeCollection(podcast, items, this.childRoute);\n }\n\n restangularizedItems(itemList) {\n var restangularList = [];\n \n angular.forEach(itemList, (value) => {\n restangularList.push(this.Restangular.restangularizeElement(this.Restangular.one('podcast', value.podcastId), value, this.childRoute));\n });\n return restangularList;\n }\n\n upload(podcast, file) {\n var formData = new FormData();\n formData.append('file', file);\n return podcast.all(this.childRoute)\n .withHttpConfig({transformRequest: angular.identity})\n .customPOST(formData, 'upload', undefined, {'Content-Type': undefined});\n }\n}\n\nangular.module('ps.dataService.item', ['restangular']).service('itemService', itemService);\n\n/**\n * Created by kevin on 02/11/14.\n */\n\nclass podcastService {\n \n constructor(Restangular) {\n this.Restangular = Restangular;\n this.route = 'podcast';\n }\n\n findById(podcastId) {\n return this.Restangular.one(this.route, podcastId).get();\n }\n\n findAll() {\n return this.Restangular.all(this.route).getList();\n }\n\n save(podcast) {\n return podcast.save();\n }\n\n getNewPodcast() {\n return this.Restangular.one(this.route);\n }\n\n patch(item) {\n return item.patch();\n }\n\n deletePodcast(item) {\n return item.remove();\n }\n\n findInfo(url) {\n return this.Restangular.one(this.route).findInfo(url);\n }\n\n statsByPubdate(id, numberOfMonth = 6) {\n return this.Restangular.one(this.route, id).one('stats').all('byPubdate').post(numberOfMonth);\n }\n\n statsByByDownloaddate(id, numberOfMonth = 6) {\n return this.Restangular.one(this.route, id).one('stats').all('byDownloaddate').post(numberOfMonth);\n }\n \n}\n\nangular.module('ps.dataService.podcast', ['restangular'])\n .config((RestangularProvider) => {\n RestangularProvider.addElementTransformer('podcast', false, (podcast) => {\n podcast.addRestangularMethod('findInfo', 'post', 'fetch', undefined, {'Content-Type': 'text/plain'});\n return podcast;\n });\n })\n .service('podcastService', podcastService);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass statService {\n\n constructor(Restangular) {\n this.Restangular = Restangular;\n this.base = this.Restangular.one('stats');\n }\n\n statsByType(numberOfMonth = 1) {\n return this.base.all('byType').post(numberOfMonth);\n }\n}\n\nangular.module('ps.dataService.stat', ['restangular']).service('statService', statService);\n\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass tagService {\n \n constructor(Restangular) {\n this.baseAll = Restangular.all('tag'); \n }\n\n getAll() {\n return this.baseAll.get();\n }\n\n search(query) {\n return this.baseAll.post(null, {name : query});\n }\n \n}\n\nangular.module('ps.dataService.tag', ['restangular'])\n .service('tagService', tagService);\n/**\n * Created by kevin on 01/11/14.\n */\n\nclass typeService {\n\n constructor(Restangular) {\n this.baseAll = Restangular.all('types');\n }\n\n findAll() {\n return this.baseAll.getList();\n }\n}\n\nangular.module('ps.dataService.type', ['restangular'])\n .service('typeService', typeService);\n\nclass UpdateService {\n constructor(Restangular) {\n this.Restangular = Restangular;\n }\n\n forceUpdatePodcast(idPodcast) {\n return this.Restangular.one(\"task\").customPOST(idPodcast, \"updateManager/updatePodcast/force\");\n }\n} \n\nangular.module('ps.dataService.updateService', ['restangular']).service('UpdateService', UpdateService);\n\nclass podcastEditionDirective {\n constructor() {\n this.restrict = 'E';\n this.templateUrl = 'html/podcast-details-edition.html';\n this.scope = { podcast : '=' };\n this.controller = 'podcastEditionCtrl';\n this.controllerAs = 'pec';\n this.bindToController = true;\n }\n}\n\nclass podcastEditionCtrl {\n constructor($scope, $location, tagService, podcastService) {\n this.$scope = $scope;\n this.$location = $location;\n this.tagService = tagService;\n this.podcastService = podcastService;\n }\n\n loadTags(query) {\n return this.tagService.search(query);\n }\n\n save() {\n var podcastToUpdate = _.cloneDeep(this.podcast);\n podcastToUpdate.items = null;\n\n return this.podcastService\n .patch(podcastToUpdate)\n .then((patchedPodcast) => _.assign(this.podcast, patchedPodcast))\n .then(() => this.$scope.$emit('podcastEdition:save'));\n }\n\n deletePodcast() {\n return this.podcastService\n .deletePodcast(this.podcast)\n .then(() => this.$location.path('/podcasts'));\n }\n}\n\nangular.module('ps.podcast.details.edition', [\n 'ps.dataService.podcast',\n 'ps.dataService.tag',\n 'ngTagsInput'\n])\n .directive('podcastEdition', () => new podcastEditionDirective())\n .controller('podcastEditionCtrl', podcastEditionCtrl);\n\nclass podcastItemsListDirective{\n constructor() {\n this.restrict= 'E';\n this.templateUrl = 'html/podcast-details-episodes.html';\n this.scope = { podcast : '=' };\n this.controller = 'podcastItemsListCtrl';\n this.controllerAs = 'pic';\n this.bindToController = true;\n }\n}\n\nclass podcastItemsListCtrl {\n\n constructor($scope, DonwloadManager, PodcastItemPerPage, itemService, playlistService ) {\n /* DI */\n this.$scope = $scope;\n this.DownloadManager = DonwloadManager;\n this.itemService = itemService;\n this.playlistService = playlistService;\n\n this.currentPage = 1;\n this.itemPerPage = PodcastItemPerPage;\n this.loadPage();\n\n this.$scope.$on(\"podcastItems:refresh\", () => {\n this.currentPage = 1;\n this.loadPage();\n });\n\n this.DownloadManager\n .ws\n .subscribe( \"/topic/podcast/\".concat(this.podcast.id),\n (message) => this.onMessageFromWS(message),\n $scope);\n }\n\n onMessageFromWS(message) {\n var item = JSON.parse(message.body);\n var elemToUpdate = _.find(this.podcast.items, { 'id': item.id });\n _.assign(elemToUpdate, item);\n }\n\n loadPage() {\n this.currentPage = (this.currentPage < 1) ? 1 : (this.currentPage > Math.ceil(this.totalItems / this.itemPerPage)) ? Math.ceil(this.totalItems / this.itemPerPage) : this.currentPage;\n return this.itemService\n .getItemForPodcastWithPagination(this.podcast, {size: this.itemPerPage, page : this.currentPage - 1, direction : 'DESC', properties : 'pubdate'})\n .then((itemsResponse) => {\n this.podcast.items = this.itemService.restangularizePodcastItem(this.podcast, itemsResponse.content);\n this.podcast.totalItems = itemsResponse.totalElements;\n });\n }\n\n remove(item) {\n item.remove()\n .then(() => this.podcast.items = _.reject(this.podcast.items, (elem) => {return (elem.id === item.id); }))\n .then(() => this.playlistService.remove(item))\n .then(() => this.loadPage());\n }\n\n\n reset(item) {\n return item.reset()\n .then((itemReseted) => {\n var itemInList = _.find(this.podcast.items, { 'id': itemReseted.id });\n _.assign(itemInList, itemReseted);\n return itemInList;\n })\n .then((itemToRemove) => this.playlistService.remove(itemToRemove));\n }\n\n addOrRemoveInPlaylist(item) {\n this.playlistService.addOrRemove(item);\n }\n\n isInPlaylist(item) {\n return this.playlistService.contains(item);\n }\n\n swipePage(val) {\n this.currentPage += val;\n this.loadPage();\n }\n\n stopDownload(item) {\n this.DownloadManager.ws.stop(item);\n }\n toggleDownload(item) {\n this.DownloadManager.ws.toggle(item);\n }\n}\nangular.module('ps.podcast.details.episodes', [\n 'ps.player'\n])\n .directive('podcastItemsList', () => new podcastItemsListDirective())\n .constant('PodcastItemPerPage', 10)\n .controller('podcastItemsListCtrl', podcastItemsListCtrl);\n\nclass PodcastDetailCtrl {\n\n constructor($scope, podcast, UpdateService){\n this.$scope = $scope;\n this.UpdateService = UpdateService;\n this.podcast = podcast;\n\n this.podcastTabs= [\n { heading : 'Episodes', active : true},\n { heading : 'Edition', active : false},\n { heading : 'Upload', disabled : this.podcast.type !== 'send'},\n { heading : 'Stats', active : false}\n ];\n this.$scope.$on(\"podcastEdition:save\", () => this.refreshItems());\n this.$scope.$on(\"podcastEdition:upload\", () => this.refreshItems());\n }\n\n refreshItems() {\n this.$scope.$broadcast('podcastItems:refresh');\n }\n\n refresh() {\n this.UpdateService\n .forceUpdatePodcast(this.podcast.id)\n .then(() => this.refreshItems());\n }\n\n tabsActive(num) {\n this.podcastTabs[num].active = true;\n }\n\n}\n\nangular.module('ps.podcast.details', [\n 'ps.config.route',\n 'ps.podcast.details',\n 'ps.podcast.details.episodes',\n 'ps.podcast.details.edition',\n 'ps.podcast.details.upload',\n 'ps.podcast.details.stats',\n 'ps.dataService.updateService'\n]).config(($routeProvider, commonKey) =>\n $routeProvider.\n when('/podcasts/:podcastId', {\n templateUrl: 'html/podcast-detail.html',\n controller: 'PodcastDetailCtrl',\n controllerAs: 'pdc',\n /*hotkeys: [\n ['r', 'Refresh', 'pdc.refreshItems()'],\n ['f', 'Force Refresh', 'pdc.refresh()'],\n ['l', 'List of Items', 'pdc.tabsActive(0)'],\n ['m', 'Modification of Podcast', 'pdc.tabsActive(1)']\n ].concat(commonKey),*/\n hotkeys : commonKey,\n resolve : { podcast : (podcastService, $route) => podcastService.findById($route.current.params.podcastId) }\n })\n)\n .controller('PodcastDetailCtrl', PodcastDetailCtrl);\nclass podcastStatsDirective {\n constructor() {\n this.restrict = 'E';\n this.scope = { podcast : '='};\n this.templateUrl = 'html/podcast-details-stats.html';\n this.controller = 'PodcastDetailsStatsCtrl';\n this.controllerAs = 'pdsc';\n this.bindToController = true;\n }\n}\n\nclass PodcastDetailsStatsCtrl {\n\n constructor($scope, $q, podcastService) {\n this.$q = $q;\n this.podcastService = podcastService;\n this.month = 6;\n\n this.chartSeries = [];\n this.generateChartData();\n this.chartConfig = {\n options: {\n chart: {\n type: 'spline'\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: true\n }\n }\n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Date'\n }\n }\n },\n series: this.chartSeries,\n title : {\n text : ''\n },\n credits: {\n enabled: false\n },\n loading: false\n };\n\n $scope.$on(\"podcastItems:refresh\", () => this.generateChartData());\n }\n\n navigate(offset) {\n this.month += offset;\n return this.generateChartData();\n }\n\n generateChartData() {\n PodcastDetailsStatsCtrl.resetChart(this.chartSeries);\n\n return this.$q.all([\n this.podcastService.statsByByDownloaddate(this.podcast.id, this.month),\n this.podcastService.statsByPubdate(this.podcast.id, this.month)\n ]).then((arrayResult) => {\n let downloadData = _(arrayResult[0])\n .map(PodcastDetailsStatsCtrl.dateMapper())\n .sortBy(\"date\")\n .map(PodcastDetailsStatsCtrl.highChartsMapper())\n .value(),\n publicationData = _(arrayResult[1])\n .map(PodcastDetailsStatsCtrl.dateMapper())\n .sortBy(\"date\")\n .map(PodcastDetailsStatsCtrl.highChartsMapper())\n .value();\n\n this.chartSeries.push({\"name\": \"Download Date\", \"data\": downloadData});\n this.chartSeries.push({\"name\": \"Publication Date\", \"data\": publicationData});\n return this.chartSeries;\n });\n }\n\n static resetChart(chartSeries) {\n _.updateinplace(chartSeries, []);\n }\n\n static dateMapper() {\n return (value) => { return { date : Date.UTC(value.date[0], value.date[1]-1, value.date[2]), numberOfItems : value.numberOfItems }; };\n }\n\n static highChartsMapper() {\n return (value) => [value.date, value.numberOfItems];\n }\n}\n\n\nangular.module('ps.podcast.details.stats', [ 'highcharts-ng' ])\n .directive('podcastStats', () => new podcastStatsDirective())\n .controller('PodcastDetailsStatsCtrl', PodcastDetailsStatsCtrl);\n\nclass podcastUploadDirective {\n\n constructor() {\n this.restrcit = 'E';\n this.templateUrl = 'html/podcast-details-upload.html';\n this.scope = {\n podcast : '='\n };\n this.controller = 'podcastUploadCtrl';\n this.controllerAs = 'puc';\n this.bindToController = true;\n }\n}\n\nclass podcastUploadCtrl{\n\n constructor($scope, itemService, $notification) {\n this.$scope = $scope;\n this.itemService = itemService;\n this.$notification = $notification;\n }\n\n onFileSelect($files) {\n angular.forEach($files, (file) => {\n this.itemService.upload(this.podcast, file)\n .then((item) => {\n this.$scope.$emit(\"podcastEdition:upload\");\n try {\n this.$notification('Upload effectué', {\n body: item.title,\n icon: item.cover.url,\n delay: 5000\n });\n } catch (e) {}\n });\n });\n }\n}\n\n\nangular.module('ps.podcast.details.upload', [\n 'ps.dataService.item',\n 'ngFileUpload',\n 'notification'\n])\n .directive('podcastUpload', () => new podcastUploadDirective())\n .controller('podcastUploadCtrl', podcastUploadCtrl);\n"],"sourceRoot":"/source/"} \ No newline at end of file