\n' +
'\n' +
'
\n' +
- ' \n' +
- ' \n' +
- ' \n' +
+ ' \n' +
+ ' \n' +
' \n' +
- ' \n' +
- ' \n' +
+ ' \n' +
+ ' \n' +
' \n' +
- ' \n' +
- ' \n' +
+ ' \n' +
+ ' \n' +
' \n' +
' \n' +
'\n' +
@@ -1387,8 +1361,9 @@ angular.module('ps.podcast.creation', [
hotkeys: commonKey
});
})
- .controller('PodcastAddCtrl', function ($scope, $location, tagService, podcastService) {
- $scope.podcast = angular.extend(podcastService.getNewPodcast(), { hasToBeDeleted : true, cover : { height: 200, width: 200 } } );
+ .constant('defaultPodcast', { hasToBeDeleted : true, cover : { height: 200, width: 200 } })
+ .controller('PodcastAddCtrl', function ($scope, $location, defaultPodcast, tagService, podcastService) {
+ $scope.podcast = angular.extend(podcastService.getNewPodcast(), defaultPodcast );
$scope.findInfo = function() {
podcastService.findInfo($scope.podcast.url).then(function(podcastFetched) {
@@ -1887,33 +1862,40 @@ angular.module('ps.podcast.details', [
when('/podcast/:podcastId', {
templateUrl: 'html/podcast-detail.html',
controller: 'PodcastDetailCtrl',
+ controllerAs: 'pdc',
hotkeys: [
- ['r', 'Refresh', 'refreshItems()'],
- ['f', 'Force Refresh', 'refresh()'],
- ['l', 'List of Items', 'tabs[0].active = true'],
- ['m', 'Modification of Podcast', 'tabs[1].active = true']
+ ['r', 'Refresh', 'pdc.refreshItems()'],
+ ['f', 'Force Refresh', 'pdc.refresh()'],
+ ['l', 'List of Items', 'pdc.podcastTabs[0].active = true'],
+ ['m', 'Modification of Podcast', 'pdc.podcastTabs[1].active = true']
].concat(commonKey),
resolve : {
- podcast : function (Restangular, $route) {
- return Restangular.one('podcast', $route.current.params.podcastId).get();
+ podcast : function (podcastService, $route) {
+ return podcastService.findById($route.current.params.podcastId);
}
}
})
})
- .controller('PodcastDetailCtrl', function ($scope, podcast, $routeParams, Restangular) {
-
- $scope.podcast = podcast;
-
- function refreshItems () {
+ .controller('PodcastDetailCtrl', function ($scope, podcast, Restangular) {
+ var vm = this;
+
+ vm.podcast = podcast;
+ vm.podcastTabs= [
+ { heading : 'Episodes', active : true},
+ { heading : 'Edition', active : false},
+ { heading : 'Upload', disabled : podcast.type !== 'send'}
+ ];
+
+ vm.refreshItems = function() {
$scope.$broadcast('podcastItems:refresh');
- }
-
- $scope.refresh = function () {
- Restangular.one("task").customPOST($scope.podcast.id, "updateManager/updatePodcast/force")
- .then(refreshItems);
};
- $scope.$on("podcastEdition:save", refreshItems);
+
+ vm.refresh = function () {
+ Restangular.one("task").customPOST(vm.podcast.id, "updateManager/updatePodcast/force")
+ .then(vm.refreshItems);
+ };
+ $scope.$on("podcastEdition:save", vm.refreshItems);
});
'use strict';
diff --git a/src/main/webapp/app/js/all.min.js b/src/main/webapp/app/js/all.min.js
index fbef9a002..3750bd1da 100644
--- a/src/main/webapp/app/js/all.min.js
+++ b/src/main/webapp/app/js/all.min.js
@@ -1,3 +1,3 @@
-angular.module("podcastApp",["ps.search","ps.podcast","ps.item","ps.download","ps.player","ps.common","ps.dataservice","ps.config","ps.partial"]),angular.module("ps.common",["ps.filters","navbar","authorize-notification","device-detection"]),angular.module("authorize-notification",["notification"]).directive("authorizeNotification",function(){return{replace:!0,restrict:"E",templateUrl:"html/authorize-notification.html",scope:!0,controllerAs:"an",controller:"authorizeNotificationController"}}).controller("authorizeNotificationController",["$window","Notification","$rootScope",function(t,n,e){function o(){return"Notification"in t&&"granted"!=t.Notification.permission}var a=this;a.state=o(),a.manuallyactivate=function(){n.requestPermission(function(){a.state=o(),e.$digest()})}}]),angular.module("ps.podcast",["ps.podcast.details","ps.podcast.creation","ps.podcast.list"]),angular.module("device-detection",[]).factory("deviceDetectorService",["$window",function(t){function n(){return"ontouchstart"in t}return{isTouchedDevice:n}}]),angular.module("ps.search",["ps.search.item"]),angular.module("ps.filters",[]).filter("htmlToPlaintext",function(){return function(t){return String(t||"").replace(/<[^>]+>/gm,"")}}),angular.module("ps.dataservice",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.podcast","ps.dataService.tag"]),_.mixin({updateinplace:function(t,n,e,o){var a=e||function(t,n){return t.indexOf(n)};return _.forEachRight(t.slice(),function(e,o){-1===a(n,e)&&t.splice(o,1)}),_.forEach(n,function(n){-1===a(t,n)&&t.push(n)}),o&&_.forEach(n,function(n,o){var a=t.splice(e(t,n),1)[0];t.splice(o,0,a)}),t}}),angular.module("navbar",[]).directive("navbar",function(){return{transclude:!0,replace:!0,restrict:"E",templateUrl:"html/navbar.html",scope:!0,controllerAs:"navbar",controller:"navbarController",link:function(t,n){n.removeClass("hidden")}}}).controller("navbarController",function(){var t=this;t.navCollapsed=!0}),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"]),angular.module("ps.config.ngstomp",["AngularStompDK"]).config(["ngstompProvider",function(t){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","commonKey",function(t){t.otherwise({redirectTo:"/items"})}]),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/authorize-notification.html",'
\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/download.html",'\n \n \n \n\n\n
\n\n
\n
\n\n\n
\n\n
\n \n \n Liste d\'attente {{ waitingitems.length }}\n \n \n\n \n \n\n\n
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/item-detail.html",'\n
\n\n
\n
\n - Podcasts
\n - {{ item.podcast.title }}
\n - {{ item.title }}
\n
\n\n
\n
\n
\n
\n
\n \n\n
\n\n
\n \n
\n \n \n \n\n \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
\n {{ item.description | htmlToPlaintext }}\n
\n \n
\n
\n\n
\n
\n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/item-player.html",'
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.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')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/navbar.html",'
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/player.html",'
\n
\n
\n
\n \n\n \n \n {{ currentTime | date:\'mm:ss\' }}\n \n \n \n {{ timeLeft | date:\'mm:ss\' }}\n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n\n
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-creation.html",'
\n
\n
Ajouter un Podcast
\n \n
\n\n
\n\n\n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-detail.html",'\n\n
\n\n\n\n')
-}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-edition.html",'
\n
\n \n \n \n \n \n \n \n \n \n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-episodes.html",'
\n
\n\n ')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-upload.html",'
\n
\n
\n
\n Déposer un ou des fichiers ici\n
\n
\n
\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcasts-list.html",'
\n\n')}])}(),angular.module("ps.download",["ps.config.route","ps.dataService.donwloadManager","notification"]).config(["$routeProvider","commonKey",function(t,n){t.when("/download",{templateUrl:"html/download.html",controller:"DownloadCtrl",hotkeys:n})}]).controller("DownloadCtrl",["$scope","DonwloadManager","Notification",function(t,n,e){t.waitingitems=[],n.getNumberOfSimDl().then(function(n){t.numberOfSimDl=parseInt(n)}),t.getTypeFromStatus=function(t){return"Paused"===t.status?"warning":"info"},t.updateNumberOfSimDl=n.updateNumberOfSimDl,n.ws.subscribe("/app/download",function(n){t.items=JSON.parse(n.body)},t).subscribe("/app/waiting",function(n){t.waitingitems=JSON.parse(n.body)},t).subscribe("/topic/download",function(n){var o=JSON.parse(n.body),a=_.find(t.items,{id:o.id});switch(o.status){case"Started":case"Paused":a?_.assign(a,o):t.items.push(o);break;case"Finish":new e("Téléchargement terminé",{body:o.title,icon:o.cover.url,delay:5e3});case"Stopped":a&&_.remove(t.items,function(t){return t.id===a.id})}},t).subscribe("/topic/waiting",function(n){var e=JSON.parse(n.body);_.updateinplace(t.waitingitems,e,function(t,n){return _.findIndex(t,{id:n.id})},!0)},t),t.download=n.download,t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle,t.stopAllDownload=n.stopAllDownload,t.pauseAllDownload=n.pauseAllDownload,t.restartAllCurrentDownload=n.restartAllCurrentDownload,t.removeFromQueue=n.removeFromQueue,t.dontDonwload=n.dontDonwload,t.moveInWaitingList=n.moveInWaitingList}]),angular.module("ps.item.details",["ps.dataService.donwloadManager","ps.player"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast/:podcastId/item/:itemId",{templateUrl:"html/item-detail.html",controller:"ItemDetailCtrl",hotkeys:n,resolve:{item:["itemService","$route",function(t,n){return t.findById(n.current.params.podcastId,n.current.params.itemId)}],podcast:["podcastService","$route",function(t,n){return t.findById(n.current.params.podcastId)}]}})}]).controller("ItemDetailCtrl",["$scope","DonwloadManager","$location","playlistService","podcast","item",function(t,n,e,o,a,i){t.item=i,t.item.podcast=a,t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle,t.remove=function(n){return n.remove().then(function(){o.remove(n),e.path("/podcast/".concat(t.item.podcast.id))})},t.reset=function(n){return n.reset().then(function(e){_.assign(t.item,e),o.remove(n)})},t.toggleInPlaylist=function(){o.addOrRemove(i)},t.isInPlaylist=function(){return o.contains(i)};var s="/topic/podcast/".concat(t.item.podcast.id);n.ws.subscribe(s,function(n){var e=JSON.parse(n.body);e.id==t.item.id&&_.assign(t.item,e)},t)}]),angular.module("ps.item",["ps.item.details","ps.item.player"]),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("/podcast/:podcastId/item/:itemId/play",{templateUrl:"html/item-player.html",controller:"ItemPlayerController",controllerAs:"ipc",resolve:{item:["itemService","$route",function(t,n){return t.findById(n.current.params.podcastId,n.current.params.itemId)}],podcast:["podcastService","$route",function(t,n){return t.findById(n.current.params.podcastId)}]}})}]).controller("ItemPlayerController",["podcast","item","$timeout","deviceDetectorService",function(t,n,e,o){var a=this;a.item=n,a.item.podcast=t,a.config={preload:!0,sources:[{src:n.proxyURL,type:n.mimeType}],theme:{url:"http://www.videogular.com/styles/themes/default/videogular.css"},plugins:{controls:{autoHide:!o.isTouchedDevice(),autoHideTime:2e3},poster:n.cover.url}},a.onPlayerReady=function(t){a.config.preload&&e(function(){t.play()})}}]),angular.module("ps.player",["ngSanitize","ngRoute","ngStorage","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("/player",{templateUrl:"html/player.html",controller:"PlayerController",controllerAs:"pc"})}]).controller("PlayerController",["playlistService","$timeout","deviceDetectorService",function(t,n,e){function o(t){return a.playlist.indexOf(t)}var a=this;a.playlist=[],a.state=null,a.API=null,a.currentVideo={},a.onPlayerReady=function(t){a.API=t,("play"==a.API.currentState||a.isCompleted)&&a.API.play(),a.isCompleted=!1,a.setVideo(0)},a.onCompleteVideo=function(){var t=o(a.currentVideo);return a.isCompleted=!0,t+1===a.playlist.length?void(a.currentVideo=a.playlist[0]):void a.setVideo(t+1)},a.config={preload:!0,sources:[],theme:{url:"http://www.videogular.com/styles/themes/default/videogular.css"},plugins:{controls:{autoHide:!e.isTouchedDevice(),autoHideTime:2e3},poster:""}},a.reloadPlaylist=function(){_.updateinplace(a.playlist,t.playlist(),function(t,n){return _.findIndex(t,{id:n.id})})},a.reloadPlaylist(),a.setVideo=function(t){a.currentVideo=a.playlist[t],null!==a.currentVideo&&void 0!==a.currentVideo&&(a.API.stop(),a.config.sources=[{src:a.currentVideo.proxyURL,type:a.currentVideo.mimeType}],a.config.plugins.poster=a.currentVideo.cover.url,a.config.preload&&n(function(){a.API.play()},500))},a.remove=function(n){t.remove(n),a.reloadPlaylist(),a.config.sources.length>0&&a.config.sources[0].src===n.proxyURL&&a.setVideo(0)},a.removeAll=function(){t.removeAll(),a.reloadPlaylist()}}]).factory("playlistService",["$localStorage",function(t){return t.playlist=t.playlist||[],{playlist:function(){return t.playlist},add:function(n){t.playlist.push(n)},remove:function(n){t.playlist=_.remove(t.playlist,function(t){return t.id!==n.id})},contains:function(n){return angular.isObject(_.find(t.playlist,{id:n.id}))},addOrRemove:function(t){this.contains(t)?this.remove(t):this.add(t)},removeAll:function(){t.playlist=[]}}}]),angular.module("ps.podcast.creation",["ps.config.route","ps.dataservice","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast-creation",{templateUrl:"html/podcast-creation.html",controller:"PodcastAddCtrl",hotkeys:n})}]).controller("PodcastAddCtrl",["$scope","$location","tagService","podcastService",function(t,n,e,o){t.podcast=angular.extend(o.getNewPodcast(),{hasToBeDeleted:!0,cover:{height:200,width:200}}),t.findInfo=function(){o.findInfo(t.podcast.url).then(function(n){t.podcast.title=n.title,t.podcast.description=n.description,t.podcast.type=n.type,t.podcast.cover.url=n.cover.url})},t.loadTags=function(t){return e.search(t)},t.changeType=function(){t.podcast.type=/beinsports\.fr/i.test(t.podcast.url)?"BeInSports":/canalplus\.fr/i.test(t.podcast.url)?"CanalPlus":/jeuxvideo\.fr/i.test(t.podcast.url)?"JeuxVideoFR":/jeuxvideo\.com/i.test(t.podcast.url)?"JeuxVideoCom":/parleys\.com/i.test(t.podcast.url)?"Parleys":/pluzz\.francetv\.fr/i.test(t.podcast.url)?"Pluzz":/youtube\.com/i.test(t.podcast.url)?"Youtube":t.podcast.url.length>0?"RSS":"Send"},t.save=function(){o.save(t.podcast).then(function(t){n.path("/podcast/"+t.id)})}}]),angular.module("ps.podcast.list",["ps.config.route"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcasts",{templateUrl:"html/podcasts-list.html",controller:"PodcastsListCtrl",hotkeys:n,resolve:{podcasts:["podcastService",function(t){return t.findAll()}]}})}]).controller("PodcastsListCtrl",["$scope","podcasts",function(t,n){t.podcasts=n}]),angular.module("ps.search.item",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.tag","ps.player","ps.config.route","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,n){t.when("/items",{templateUrl:"html/items-search.html",controller:"ItemsSearchCtrl",reloadOnSearch:!1,hotkeys:[["right","Next page","currentPage = currentPage+1; changePage();"],["left","Previous page","currentPage = currentPage-1; changePage();"]].concat(n)})}]).constant("ItemPerPage",12).controller("ItemsSearchCtrl",["$scope","$cacheFactory","$location","itemService","tagService","DonwloadManager","ItemPerPage","playlistService",function(t,n,e,o,a,i,s,l){"use strict";var r=n.get("paginationCache")||n("paginationCache");t.changePage=function(){t.searchParameters.page=t.currentPage<=1?1:t.currentPage>Math.ceil(t.totalItems/s)?Math.ceil(t.totalItems/s):t.currentPage,t.searchParameters.page-=1,o.search(t.searchParameters).then(function(n){t.items=n.content,t.totalPages=n.totalPages,t.totalItems=n.totalElements,r.put("search:currentPage",t.currentPage),r.put("search:currentWord",t.term),r.put("search:currentTags",t.searchTags),r.put("search:direction",t.direction),r.put("search:properties",t.properties),e.search("page",t.currentPage)})},t.$on("$routeUpdate",function(){t.currentPage!==e.search().page&&(t.currentPage=e.search().page||1,t.changePage())}),t.swipePage=function(n){t.currentPage+=n,t.changePage()},t.remove=function(n){return n.remove().then(function(){return l.remove(n),t.changePage()})},t.reset=function(n){return n.reset().then(function(n){var e=_.find(t.items,{id:n.id});_.assign(e,n),l.remove(e)})},t.totalItems=Number.MAX_VALUE,t.maxSize=10,t.searchParameters={},t.searchParameters.size=s,t.currentPage=r.get("search:currentPage")||1,t.searchParameters.term=r.get("search:currentWord")||void 0,t.searchParameters.searchTags=r.get("search:currentTags")||void 0,t.searchParameters.direction=r.get("search:direction")||void 0,t.searchParameters.properties=r.get("search:properties")||void 0,t.changePage(),t.stopDownload=i.ws.stop,t.toggleDownload=i.ws.toggle,t.loadTags=a.search,t.addOrRemove=function(t){return l.addOrRemove(t)},t.isInPlaylist=function(t){return l.contains(t)};var c="/topic/download";i.ws.subscribe(c,function(n){var e=JSON.parse(n.body),o=_.find(t.items,{id:e.id});o&&_.assign(o,e)},t)}]),angular.module("ps.dataService.donwloadManager",["restangular","AngularStompDK"]).factory("DonwloadManager",["Restangular","ngstomp",function(t,n){"use strict";var e=t.one("task"),o=e.one("downloadManager"),a="/app/download",i={connect:n.connect,subscribe:n.subscribe,unsubscribe:n.unsubscribe,toggle:function(t){n.send(a+"/toogle",t)},start:function(t){n.send(a+"/start",t)},pause:function(t){n.send(a+"/pause",t)},stop:function(t){n.send(a+"/stop",t)}};return{download:function(n){return t.one("item").customGET(n.id+"/addtoqueue")},stopDownload:function(t){return o.customPOST(t.id,"stopDownload")},toggleDownload:function(t){return o.customPOST(t.id,"toogleDownload")},stopAllDownload:function(){return o.customGET("stopAllDownload")},pauseAllDownload:function(){return o.customGET("pauseAllDownload")},restartAllCurrentDownload:function(){return o.customGET("restartAllCurrentDownload")},removeFromQueue:function(t){return o.customDELETE("queue/"+t.id)},updateNumberOfSimDl:function(t){return o.customPOST(t,"limit")},dontDonwload:function(t){return o.customDELETE("queue/"+t.id+"/andstop")},getDownloading:function(){return e.all("downloadManager/downloading").getList()},getNumberOfSimDl:function(){return o.one("limit").get()},moveInWaitingList:function(t,n){o.customPOST({id:t.id,position:n},"move")},ws:i}}]),angular.module("ps.dataService.item",["restangular"]).factory("itemService",["Restangular",function(t){"use strict";function n(n){return t.one("item/search").post(null,n).then(function(t){return t.content=i(t.content),t})}function e(n,e){return t.one("podcast",n).one("items",e).get()}function o(t,n){return t.one("items").post(null,n)}function a(n,e){return t.restangularizeCollection(n,e,"items")}function i(n){var e=[];return angular.forEach(n,function(n){e.push(t.restangularizeElement(t.one("podcast",n.podcastId),n,"items"))}),e}return{search:n,findById:e,getItemForPodcastWithPagination:o,restangularizePodcastItem:a}}]),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})}]).factory("podcastService",["Restangular",function(t){"use strict";function n(n){return t.one(r,n).get()}function e(){return t.all(r).getList()}function o(t){return t.save()}function a(){return t.one(r)}function i(t){return t.patch()}function s(t){return t.remove()}function l(n){return t.one(r).findInfo(n)}var r="podcast";return{findById:n,findAll:e,save:o,getNewPodcast:a,patch:i,deletePodcast:s,findInfo:l}}]),angular.module("ps.dataService.tag",["restangular"]).factory("tagService",["Restangular",function(t){"use strict";function n(){return o.get()}function e(t){return o.post(null,{name:t})}var o=t.all("tag");return{getAll:n,search:e}}]),angular.module("ps.podcast.details.edition",["ps.dataService.podcast","ps.dataService.tag","ngTagsInput"]).directive("podcastEdition",function(){return{restrcit:"E",templateUrl:"html/podcast-details-edition.html",scope:{podcast:"="},controller:"podcastEditionCtrl"}}).controller("podcastEditionCtrl",["$scope","$location","tagService","podcastService",function(t,n,e,o){t.loadTags=function(t){return e.search(t)},t.save=function(){var n=_.cloneDeep(t.podcast);n.items=null,o.patch(n).then(function(n){_.assign(t.podcast,n)}).then(function(){t.$emit("podcastEdition:save")})},t.deletePodcast=function(){o.deletePodcast(t.podcast).then(function(){n.path("/podcasts")})}}]),angular.module("ps.podcast.details.episodes",["ps.player"]).directive("podcastItemsList",function(){return{restrcit:"E",templateUrl:"html/podcast-details-episodes.html",scope:{podcast:"="},controller:"podcastItemsListCtrl"}}).constant("PodcastItemPerPage",10).controller("podcastItemsListCtrl",["$scope","DonwloadManager","PodcastItemPerPage","itemService","playlistService",function(t,n,e,o,a){t.currentPage=1,t.itemPerPage=e;var i="/topic/podcast/".concat(t.podcast.id);n.ws.subscribe(i,function(n){var e=JSON.parse(n.body),o=_.find(t.podcast.items,{id:e.id});_.assign(o,e)},t),t.loadPage=function(){return t.currentPage=t.currentPage<1?1:t.currentPage>Math.ceil(t.totalItems/e)?Math.ceil(t.totalItems/e):t.currentPage,o.getItemForPodcastWithPagination(t.podcast,{size:e,page:t.currentPage-1,direction:"DESC",properties:"pubdate"}).then(function(n){t.podcast.items=o.restangularizePodcastItem(t.podcast,n.content),t.podcast.totalItems=n.totalElements})},t.loadPage(),t.$on("podcastItems:refresh",function(){t.currentPage=1,t.loadPage()}),t.remove=function(n){n.remove().then(function(){t.podcast.items=_.reject(t.podcast.items,function(t){return t.id===n.id})}).then(function(){a.remove(n)}).then(t.loadPage)},t.reset=function(n){return n.reset().then(function(n){var e=_.find(t.podcast.items,{id:n.id});_.assign(e,n),a.remove(e)})},t.addOrRemoveInPlaylist=function(t){a.addOrRemove(t)},t.isInPlaylist=function(t){return a.contains(t)},t.swipePage=function(n){t.currentPage+=n,t.loadPage()},t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle}]),angular.module("ps.podcast.details",["ps.config.route","ps.podcast.details","ps.podcast.details.episodes","ps.podcast.details.edition","ps.podcast.details.upload","restangular"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast/:podcastId",{templateUrl:"html/podcast-detail.html",controller:"PodcastDetailCtrl",hotkeys:[["r","Refresh","refreshItems()"],["f","Force Refresh","refresh()"],["l","List of Items","tabs[0].active = true"],["m","Modification of Podcast","tabs[1].active = true"]].concat(n),resolve:{podcast:["Restangular","$route",function(t,n){return t.one("podcast",n.current.params.podcastId).get()}]}})}]).controller("PodcastDetailCtrl",["$scope","podcast","$routeParams","Restangular",function(t,n,e,o){function a(){t.$broadcast("podcastItems:refresh")}t.podcast=n,t.refresh=function(){o.one("task").customPOST(t.podcast.id,"updateManager/updatePodcast/force").then(a)},t.$on("podcastEdition:save",a)}]),angular.module("ps.podcast.details.upload",["angularFileUpload"]).directive("podcastUpload",function(){return{restrcit:"E",templateUrl:"html/podcast-details-upload.html",scope:{podcast:"="},controller:"podcastUploadCtrl"}}).controller("podcastUploadCtrl",["$scope","$log",function(t,n){t.onFileSelect=function(e){var o;angular.forEach(e,function(e){o=new FormData,o.append("file",e),t.podcast.all("items").withHttpConfig({transformRequest:angular.identity}).customPOST(o,"upload",void 0,{"Content-Type":void 0}).then(function(t){n.info("Upload de l'item suivant"),n.info(t)})})}}]);
+angular.module("podcastApp",["ps.search","ps.podcast","ps.item","ps.download","ps.player","ps.common","ps.dataservice","ps.config","ps.partial"]),angular.module("ps.common",["ps.filters","navbar","authorize-notification","device-detection"]),angular.module("authorize-notification",["notification"]).directive("authorizeNotification",function(){return{replace:!0,restrict:"E",templateUrl:"html/authorize-notification.html",scope:!0,controllerAs:"an",controller:"authorizeNotificationController"}}).controller("authorizeNotificationController",["$window","Notification","$rootScope",function(t,n,e){function o(){return"Notification"in t&&"granted"!=t.Notification.permission}var a=this;a.state=o(),a.manuallyactivate=function(){n.requestPermission(function(){a.state=o(),e.$digest()})}}]),angular.module("ps.podcast",["ps.podcast.details","ps.podcast.creation","ps.podcast.list"]),angular.module("device-detection",[]).factory("deviceDetectorService",["$window",function(t){function n(){return"ontouchstart"in t}return{isTouchedDevice:n}}]),angular.module("ps.search",["ps.search.item"]),angular.module("ps.filters",[]).filter("htmlToPlaintext",function(){return function(t){return String(t||"").replace(/<[^>]+>/gm,"")}}),angular.module("ps.dataservice",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.podcast","ps.dataService.tag"]),_.mixin({updateinplace:function(t,n,e,o){var a=e||function(t,n){return t.indexOf(n)};return _.forEachRight(t.slice(),function(e,o){-1===a(n,e)&&t.splice(o,1)}),_.forEach(n,function(n){-1===a(t,n)&&t.push(n)}),o&&_.forEach(n,function(n,o){var a=t.splice(e(t,n),1)[0];t.splice(o,0,a)}),t}}),angular.module("navbar",[]).directive("navbar",function(){return{transclude:!0,replace:!0,restrict:"E",templateUrl:"html/navbar.html",scope:!0,controllerAs:"navbar",controller:"navbarController",link:function(t,n){n.removeClass("hidden")}}}).controller("navbarController",function(){var t=this;t.navCollapsed=!0}),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"]),angular.module("ps.config.ngstomp",["AngularStompDK"]).config(["ngstompProvider",function(t){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){t.otherwise({redirectTo:"/items"})}]),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/authorize-notification.html",'
\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/download.html",'\n \n \n \n\n\n
\n\n
\n
\n\n\n
\n\n
\n \n \n Liste d\'attente {{ waitingitems.length }}\n \n \n\n \n \n\n\n
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/item-detail.html",'\n
\n\n
\n
\n - Podcasts
\n - {{ item.podcast.title }}
\n - {{ item.title }}
\n
\n\n
\n
\n
\n
\n
\n \n\n
\n\n
\n \n
\n \n \n \n\n \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
\n {{ item.description | htmlToPlaintext }}\n
\n \n
\n
\n\n
\n
\n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/item-player.html",'
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.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')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/navbar.html",'
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/player.html",'
\n
\n
\n
\n \n\n \n \n {{ currentTime | date:\'mm:ss\' }}\n \n \n \n {{ timeLeft | date:\'mm:ss\' }}\n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n\n
')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-creation.html",'
\n
\n
Ajouter un Podcast
\n \n
\n\n
\n\n\n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-detail.html",'\n\n
\n\n\n\n')
+}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-edition.html",'
\n
\n \n \n \n \n \n \n \n \n \n\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-episodes.html",'
\n
\n\n ')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcast-details-upload.html",'
\n
\n
\n
\n Déposer un ou des fichiers ici\n
\n
\n
\n')}])}(),function(t){try{t=angular.module("ps.partial")}catch(n){t=angular.module("ps.partial",[])}t.run(["$templateCache",function(t){t.put("html/podcasts-list.html",'
\n\n')}])}(),angular.module("ps.download",["ps.config.route","ps.dataService.donwloadManager","notification"]).config(["$routeProvider","commonKey",function(t,n){t.when("/download",{templateUrl:"html/download.html",controller:"DownloadCtrl",hotkeys:n})}]).controller("DownloadCtrl",["$scope","DonwloadManager","Notification",function(t,n,e){t.waitingitems=[],n.getNumberOfSimDl().then(function(n){t.numberOfSimDl=parseInt(n)}),t.getTypeFromStatus=function(t){return"Paused"===t.status?"warning":"info"},t.updateNumberOfSimDl=n.updateNumberOfSimDl,n.ws.subscribe("/app/download",function(n){t.items=JSON.parse(n.body)},t).subscribe("/app/waiting",function(n){t.waitingitems=JSON.parse(n.body)},t).subscribe("/topic/download",function(n){var o=JSON.parse(n.body),a=_.find(t.items,{id:o.id});switch(o.status){case"Started":case"Paused":a?_.assign(a,o):t.items.push(o);break;case"Finish":new e("Téléchargement terminé",{body:o.title,icon:o.cover.url,delay:5e3});case"Stopped":a&&_.remove(t.items,function(t){return t.id===a.id})}},t).subscribe("/topic/waiting",function(n){var e=JSON.parse(n.body);_.updateinplace(t.waitingitems,e,function(t,n){return _.findIndex(t,{id:n.id})},!0)},t),t.download=n.download,t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle,t.stopAllDownload=n.stopAllDownload,t.pauseAllDownload=n.pauseAllDownload,t.restartAllCurrentDownload=n.restartAllCurrentDownload,t.removeFromQueue=n.removeFromQueue,t.dontDonwload=n.dontDonwload,t.moveInWaitingList=n.moveInWaitingList}]),angular.module("ps.item.details",["ps.dataService.donwloadManager","ps.player"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast/:podcastId/item/:itemId",{templateUrl:"html/item-detail.html",controller:"ItemDetailCtrl",hotkeys:n,resolve:{item:["itemService","$route",function(t,n){return t.findById(n.current.params.podcastId,n.current.params.itemId)}],podcast:["podcastService","$route",function(t,n){return t.findById(n.current.params.podcastId)}]}})}]).controller("ItemDetailCtrl",["$scope","DonwloadManager","$location","playlistService","podcast","item",function(t,n,e,o,a,i){t.item=i,t.item.podcast=a,t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle,t.remove=function(n){return n.remove().then(function(){o.remove(n),e.path("/podcast/".concat(t.item.podcast.id))})},t.reset=function(n){return n.reset().then(function(e){_.assign(t.item,e),o.remove(n)})},t.toggleInPlaylist=function(){o.addOrRemove(i)},t.isInPlaylist=function(){return o.contains(i)};var s="/topic/podcast/".concat(t.item.podcast.id);n.ws.subscribe(s,function(n){var e=JSON.parse(n.body);e.id==t.item.id&&_.assign(t.item,e)},t)}]),angular.module("ps.item",["ps.item.details","ps.item.player"]),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("/podcast/:podcastId/item/:itemId/play",{templateUrl:"html/item-player.html",controller:"ItemPlayerController",controllerAs:"ipc",resolve:{item:["itemService","$route",function(t,n){return t.findById(n.current.params.podcastId,n.current.params.itemId)}],podcast:["podcastService","$route",function(t,n){return t.findById(n.current.params.podcastId)}]}})}]).controller("ItemPlayerController",["podcast","item","$timeout","deviceDetectorService",function(t,n,e,o){var a=this;a.item=n,a.item.podcast=t,a.config={preload:!0,sources:[{src:n.proxyURL,type:n.mimeType}],theme:{url:"http://www.videogular.com/styles/themes/default/videogular.css"},plugins:{controls:{autoHide:!o.isTouchedDevice(),autoHideTime:2e3},poster:n.cover.url}},a.onPlayerReady=function(t){a.config.preload&&e(function(){t.play()})}}]),angular.module("ps.player",["ngSanitize","ngRoute","ngStorage","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("/player",{templateUrl:"html/player.html",controller:"PlayerController",controllerAs:"pc"})}]).controller("PlayerController",["playlistService","$timeout","deviceDetectorService",function(t,n,e){function o(t){return a.playlist.indexOf(t)}var a=this;a.playlist=[],a.state=null,a.API=null,a.currentVideo={},a.onPlayerReady=function(t){a.API=t,("play"==a.API.currentState||a.isCompleted)&&a.API.play(),a.isCompleted=!1,a.setVideo(0)},a.onCompleteVideo=function(){var t=o(a.currentVideo);return a.isCompleted=!0,t+1===a.playlist.length?void(a.currentVideo=a.playlist[0]):void a.setVideo(t+1)},a.config={preload:!0,sources:[],theme:{url:"http://www.videogular.com/styles/themes/default/videogular.css"},plugins:{controls:{autoHide:!e.isTouchedDevice(),autoHideTime:2e3},poster:""}},a.reloadPlaylist=function(){_.updateinplace(a.playlist,t.playlist(),function(t,n){return _.findIndex(t,{id:n.id})})},a.reloadPlaylist(),a.setVideo=function(t){a.currentVideo=a.playlist[t],null!==a.currentVideo&&void 0!==a.currentVideo&&(a.API.stop(),a.config.sources=[{src:a.currentVideo.proxyURL,type:a.currentVideo.mimeType}],a.config.plugins.poster=a.currentVideo.cover.url,a.config.preload&&n(function(){a.API.play()},500))},a.remove=function(n){t.remove(n),a.reloadPlaylist(),a.config.sources.length>0&&a.config.sources[0].src===n.proxyURL&&a.setVideo(0)},a.removeAll=function(){t.removeAll(),a.reloadPlaylist()}}]).factory("playlistService",["$localStorage",function(t){return t.playlist=t.playlist||[],{playlist:function(){return t.playlist},add:function(n){t.playlist.push(n)},remove:function(n){t.playlist=_.remove(t.playlist,function(t){return t.id!==n.id})},contains:function(n){return angular.isObject(_.find(t.playlist,{id:n.id}))},addOrRemove:function(t){this.contains(t)?this.remove(t):this.add(t)},removeAll:function(){t.playlist=[]}}}]),angular.module("ps.podcast.creation",["ps.config.route","ps.dataservice","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast-creation",{templateUrl:"html/podcast-creation.html",controller:"PodcastAddCtrl",hotkeys:n})}]).constant("defaultPodcast",{hasToBeDeleted:!0,cover:{height:200,width:200}}).controller("PodcastAddCtrl",["$scope","$location","defaultPodcast","tagService","podcastService",function(t,n,e,o,a){t.podcast=angular.extend(a.getNewPodcast(),e),t.findInfo=function(){a.findInfo(t.podcast.url).then(function(n){t.podcast.title=n.title,t.podcast.description=n.description,t.podcast.type=n.type,t.podcast.cover.url=n.cover.url})},t.loadTags=function(t){return o.search(t)},t.changeType=function(){t.podcast.type=/beinsports\.fr/i.test(t.podcast.url)?"BeInSports":/canalplus\.fr/i.test(t.podcast.url)?"CanalPlus":/jeuxvideo\.fr/i.test(t.podcast.url)?"JeuxVideoFR":/jeuxvideo\.com/i.test(t.podcast.url)?"JeuxVideoCom":/parleys\.com/i.test(t.podcast.url)?"Parleys":/pluzz\.francetv\.fr/i.test(t.podcast.url)?"Pluzz":/youtube\.com/i.test(t.podcast.url)?"Youtube":t.podcast.url.length>0?"RSS":"Send"},t.save=function(){a.save(t.podcast).then(function(t){n.path("/podcast/"+t.id)})}}]),angular.module("ps.podcast.list",["ps.config.route"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcasts",{templateUrl:"html/podcasts-list.html",controller:"PodcastsListCtrl",hotkeys:n,resolve:{podcasts:["podcastService",function(t){return t.findAll()}]}})}]).controller("PodcastsListCtrl",["$scope","podcasts",function(t,n){t.podcasts=n}]),angular.module("ps.search.item",["ps.dataService.donwloadManager","ps.dataService.item","ps.dataService.tag","ps.player","ps.config.route","ngTagsInput"]).config(["$routeProvider","commonKey",function(t,n){t.when("/items",{templateUrl:"html/items-search.html",controller:"ItemsSearchCtrl",reloadOnSearch:!1,hotkeys:[["right","Next page","currentPage = currentPage+1; changePage();"],["left","Previous page","currentPage = currentPage-1; changePage();"]].concat(n)})}]).constant("ItemPerPage",12).controller("ItemsSearchCtrl",["$scope","$cacheFactory","$location","itemService","tagService","DonwloadManager","ItemPerPage","playlistService",function(t,n,e,o,a,i,s,l){"use strict";var r=n.get("paginationCache")||n("paginationCache");t.changePage=function(){t.searchParameters.page=t.currentPage<=1?1:t.currentPage>Math.ceil(t.totalItems/s)?Math.ceil(t.totalItems/s):t.currentPage,t.searchParameters.page-=1,o.search(t.searchParameters).then(function(n){t.items=n.content,t.totalPages=n.totalPages,t.totalItems=n.totalElements,r.put("search:currentPage",t.currentPage),r.put("search:currentWord",t.term),r.put("search:currentTags",t.searchTags),r.put("search:direction",t.direction),r.put("search:properties",t.properties),e.search("page",t.currentPage)})},t.$on("$routeUpdate",function(){t.currentPage!==e.search().page&&(t.currentPage=e.search().page||1,t.changePage())}),t.swipePage=function(n){t.currentPage+=n,t.changePage()},t.remove=function(n){return n.remove().then(function(){return l.remove(n),t.changePage()})},t.reset=function(n){return n.reset().then(function(n){var e=_.find(t.items,{id:n.id});_.assign(e,n),l.remove(e)})},t.totalItems=Number.MAX_VALUE,t.maxSize=10,t.searchParameters={},t.searchParameters.size=s,t.currentPage=r.get("search:currentPage")||1,t.searchParameters.term=r.get("search:currentWord")||void 0,t.searchParameters.searchTags=r.get("search:currentTags")||void 0,t.searchParameters.direction=r.get("search:direction")||void 0,t.searchParameters.properties=r.get("search:properties")||void 0,t.changePage(),t.stopDownload=i.ws.stop,t.toggleDownload=i.ws.toggle,t.loadTags=a.search,t.addOrRemove=function(t){return l.addOrRemove(t)},t.isInPlaylist=function(t){return l.contains(t)};var c="/topic/download";i.ws.subscribe(c,function(n){var e=JSON.parse(n.body),o=_.find(t.items,{id:e.id});o&&_.assign(o,e)},t)}]),angular.module("ps.dataService.donwloadManager",["restangular","AngularStompDK"]).factory("DonwloadManager",["Restangular","ngstomp",function(t,n){"use strict";var e=t.one("task"),o=e.one("downloadManager"),a="/app/download",i={connect:n.connect,subscribe:n.subscribe,unsubscribe:n.unsubscribe,toggle:function(t){n.send(a+"/toogle",t)},start:function(t){n.send(a+"/start",t)},pause:function(t){n.send(a+"/pause",t)},stop:function(t){n.send(a+"/stop",t)}};return{download:function(n){return t.one("item").customGET(n.id+"/addtoqueue")},stopDownload:function(t){return o.customPOST(t.id,"stopDownload")},toggleDownload:function(t){return o.customPOST(t.id,"toogleDownload")},stopAllDownload:function(){return o.customGET("stopAllDownload")},pauseAllDownload:function(){return o.customGET("pauseAllDownload")},restartAllCurrentDownload:function(){return o.customGET("restartAllCurrentDownload")},removeFromQueue:function(t){return o.customDELETE("queue/"+t.id)},updateNumberOfSimDl:function(t){return o.customPOST(t,"limit")},dontDonwload:function(t){return o.customDELETE("queue/"+t.id+"/andstop")},getDownloading:function(){return e.all("downloadManager/downloading").getList()},getNumberOfSimDl:function(){return o.one("limit").get()},moveInWaitingList:function(t,n){o.customPOST({id:t.id,position:n},"move")},ws:i}}]),angular.module("ps.dataService.item",["restangular"]).factory("itemService",["Restangular",function(t){"use strict";function n(n){return t.one("item/search").post(null,n).then(function(t){return t.content=i(t.content),t})}function e(n,e){return t.one("podcast",n).one("items",e).get()}function o(t,n){return t.one("items").post(null,n)}function a(n,e){return t.restangularizeCollection(n,e,"items")}function i(n){var e=[];return angular.forEach(n,function(n){e.push(t.restangularizeElement(t.one("podcast",n.podcastId),n,"items"))}),e}return{search:n,findById:e,getItemForPodcastWithPagination:o,restangularizePodcastItem:a}}]),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})}]).factory("podcastService",["Restangular",function(t){"use strict";function n(n){return t.one(r,n).get()}function e(){return t.all(r).getList()}function o(t){return t.save()}function a(){return t.one(r)}function i(t){return t.patch()}function s(t){return t.remove()}function l(n){return t.one(r).findInfo(n)}var r="podcast";return{findById:n,findAll:e,save:o,getNewPodcast:a,patch:i,deletePodcast:s,findInfo:l}}]),angular.module("ps.dataService.tag",["restangular"]).factory("tagService",["Restangular",function(t){"use strict";function n(){return o.get()}function e(t){return o.post(null,{name:t})}var o=t.all("tag");return{getAll:n,search:e}}]),angular.module("ps.podcast.details.edition",["ps.dataService.podcast","ps.dataService.tag","ngTagsInput"]).directive("podcastEdition",function(){return{restrcit:"E",templateUrl:"html/podcast-details-edition.html",scope:{podcast:"="},controller:"podcastEditionCtrl"}}).controller("podcastEditionCtrl",["$scope","$location","tagService","podcastService",function(t,n,e,o){t.loadTags=function(t){return e.search(t)},t.save=function(){var n=_.cloneDeep(t.podcast);n.items=null,o.patch(n).then(function(n){_.assign(t.podcast,n)}).then(function(){t.$emit("podcastEdition:save")})},t.deletePodcast=function(){o.deletePodcast(t.podcast).then(function(){n.path("/podcasts")})}}]),angular.module("ps.podcast.details.episodes",["ps.player"]).directive("podcastItemsList",function(){return{restrcit:"E",templateUrl:"html/podcast-details-episodes.html",scope:{podcast:"="},controller:"podcastItemsListCtrl"}}).constant("PodcastItemPerPage",10).controller("podcastItemsListCtrl",["$scope","DonwloadManager","PodcastItemPerPage","itemService","playlistService",function(t,n,e,o,a){t.currentPage=1,t.itemPerPage=e;var i="/topic/podcast/".concat(t.podcast.id);n.ws.subscribe(i,function(n){var e=JSON.parse(n.body),o=_.find(t.podcast.items,{id:e.id});_.assign(o,e)},t),t.loadPage=function(){return t.currentPage=t.currentPage<1?1:t.currentPage>Math.ceil(t.totalItems/e)?Math.ceil(t.totalItems/e):t.currentPage,o.getItemForPodcastWithPagination(t.podcast,{size:e,page:t.currentPage-1,direction:"DESC",properties:"pubdate"}).then(function(n){t.podcast.items=o.restangularizePodcastItem(t.podcast,n.content),t.podcast.totalItems=n.totalElements})},t.loadPage(),t.$on("podcastItems:refresh",function(){t.currentPage=1,t.loadPage()}),t.remove=function(n){n.remove().then(function(){t.podcast.items=_.reject(t.podcast.items,function(t){return t.id===n.id})}).then(function(){a.remove(n)}).then(t.loadPage)},t.reset=function(n){return n.reset().then(function(n){var e=_.find(t.podcast.items,{id:n.id});_.assign(e,n),a.remove(e)})},t.addOrRemoveInPlaylist=function(t){a.addOrRemove(t)},t.isInPlaylist=function(t){return a.contains(t)},t.swipePage=function(n){t.currentPage+=n,t.loadPage()},t.stopDownload=n.ws.stop,t.toggleDownload=n.ws.toggle}]),angular.module("ps.podcast.details",["ps.config.route","ps.podcast.details","ps.podcast.details.episodes","ps.podcast.details.edition","ps.podcast.details.upload","restangular"]).config(["$routeProvider","commonKey",function(t,n){t.when("/podcast/:podcastId",{templateUrl:"html/podcast-detail.html",controller:"PodcastDetailCtrl",controllerAs:"pdc",hotkeys:[["r","Refresh","pdc.refreshItems()"],["f","Force Refresh","pdc.refresh()"],["l","List of Items","pdc.podcastTabs[0].active = true"],["m","Modification of Podcast","pdc.podcastTabs[1].active = true"]].concat(n),resolve:{podcast:["podcastService","$route",function(t,n){return t.findById(n.current.params.podcastId)}]}})}]).controller("PodcastDetailCtrl",["$scope","podcast","Restangular",function(t,n,e){var o=this;o.podcast=n,o.podcastTabs=[{heading:"Episodes",active:!0},{heading:"Edition",active:!1},{heading:"Upload",disabled:"send"!==n.type}],o.refreshItems=function(){t.$broadcast("podcastItems:refresh")},o.refresh=function(){e.one("task").customPOST(o.podcast.id,"updateManager/updatePodcast/force").then(o.refreshItems)},t.$on("podcastEdition:save",o.refreshItems)}]),angular.module("ps.podcast.details.upload",["angularFileUpload"]).directive("podcastUpload",function(){return{restrcit:"E",templateUrl:"html/podcast-details-upload.html",scope:{podcast:"="},controller:"podcastUploadCtrl"}}).controller("podcastUploadCtrl",["$scope","$log",function(t,n){t.onFileSelect=function(e){var o;angular.forEach(e,function(e){o=new FormData,o.append("file",e),t.podcast.all("items").withHttpConfig({transformRequest:angular.identity}).customPOST(o,"upload",void 0,{"Content-Type":void 0}).then(function(t){n.info("Upload de l'item suivant"),n.info(t)})})}}]);
//# sourceMappingURL=all.min.js.map
\ No newline at end of file
diff --git a/src/main/webapp/app/js/modules/config/route.config.js b/src/main/webapp/app/js/modules/config/route.config.js
index f8e6cb704..31a24b7a3 100644
--- a/src/main/webapp/app/js/modules/config/route.config.js
+++ b/src/main/webapp/app/js/modules/config/route.config.js
@@ -20,14 +20,7 @@ angular.module('ps.config.route', [
window.location.href = '#/download';
}]
])
- .config(function($routeProvider, commonKey) {
- /*$routeProvider.
- when('/podcast/add', {
- templateUrl: 'html/podcast-add.html',
- controller: 'PodcastAddCtrl',
- hotkeys: commonKey
- });*/
-
+ .config(function($routeProvider) {
$routeProvider.
otherwise({
redirectTo: '/items'
diff --git a/src/main/webapp/app/js/modules/podcast/details/podcast.details.js b/src/main/webapp/app/js/modules/podcast/details/podcast.details.js
index 39162f36b..d380b52ba 100644
--- a/src/main/webapp/app/js/modules/podcast/details/podcast.details.js
+++ b/src/main/webapp/app/js/modules/podcast/details/podcast.details.js
@@ -10,11 +10,12 @@ angular.module('ps.podcast.details', [
when('/podcast/:podcastId', {
templateUrl: 'html/podcast-detail.html',
controller: 'PodcastDetailCtrl',
+ controllerAs: 'pdc',
hotkeys: [
- ['r', 'Refresh', 'refreshItems()'],
- ['f', 'Force Refresh', 'refresh()'],
- ['l', 'List of Items', 'tabs[0].active = true'],
- ['m', 'Modification of Podcast', 'tabs[1].active = true']
+ ['r', 'Refresh', 'pdc.refreshItems()'],
+ ['f', 'Force Refresh', 'pdc.refresh()'],
+ ['l', 'List of Items', 'pdc.podcastTabs[0].active = true'],
+ ['m', 'Modification of Podcast', 'pdc.podcastTabs[1].active = true']
].concat(commonKey),
resolve : {
podcast : function (podcastService, $route) {
@@ -23,18 +24,24 @@ angular.module('ps.podcast.details', [
}
})
})
- .controller('PodcastDetailCtrl', function ($scope, podcast, $routeParams, Restangular) {
+ .controller('PodcastDetailCtrl', function ($scope, podcast, Restangular) {
+ var vm = this;
+
+ vm.podcast = podcast;
+ vm.podcastTabs= [
+ { heading : 'Episodes', active : true},
+ { heading : 'Edition', active : false},
+ { heading : 'Upload', disabled : podcast.type !== 'send'}
+ ];
- $scope.podcast = podcast;
-
- function refreshItems () {
+ vm.refreshItems = function() {
$scope.$broadcast('podcastItems:refresh');
- }
-
- $scope.refresh = function () {
- Restangular.one("task").customPOST($scope.podcast.id, "updateManager/updatePodcast/force")
- .then(refreshItems);
};
- $scope.$on("podcastEdition:save", refreshItems);
+
+ vm.refresh = function () {
+ Restangular.one("task").customPOST(vm.podcast.id, "updateManager/updatePodcast/force")
+ .then(vm.refreshItems);
+ };
+ $scope.$on("podcastEdition:save", vm.refreshItems);
});
\ No newline at end of file