22
33/* Controllers */
44
5- angular . module ( 'KMCModule' ) . controller ( 'PlayerListCtrl' ,
6- [ 'apiService' , 'loadINI' , '$location' , '$rootScope' , '$scope' , '$filter' , '$modal' , '$timeout' , '$log' , "$compile" , "$window" , 'localStorageService' , 'requestNotificationChannel' , 'PlayerService' , '$q' , 'utilsSvc' , 'PermissionsService' ,
5+ angular . module ( 'KMCModule' )
6+ . controller ( 'PlayerUpgradeModeCtrl' ,
7+ function ( $scope , $modalInstance , settings ) {
8+ $scope . playerId = '' ;
9+ $scope . mode = '' ;
10+
11+ $scope . close = function ( result ) {
12+ if ( ! result ) {
13+ return $modalInstance . close ( ) ;
14+ }
15+
16+ $modalInstance . close ( {
17+ mode : this . mode ,
18+ templateId : Number ( this . playerId )
19+ } ) ;
20+ } ;
21+
22+ $scope . cancel = function ( ) {
23+ $modalInstance . dismiss ( 'cancel' ) ;
24+ } ;
25+
26+ $scope . validate = function ( ) {
27+ if ( ! this . mode ) {
28+ return false ;
29+ }
30+
31+ if ( this . mode === 'template' && ( this . playerId === '' ) || isNaN ( this . playerId ) ) {
32+ return false ;
33+ }
34+
35+ return true ;
36+ } ;
37+
38+ angular . extend ( $scope , settings ) ;
39+ } )
40+ . controller ( 'PlayerListCtrl' ,
41+ [ 'apiService' , 'loadINI' , '$location' , '$rootScope' , '$scope' , '$filter' , '$modal' , '$timeout' , '$log' , "$compile" , "$window" , 'localStorageService' , 'requestNotificationChannel' , 'PlayerService' , '$q' , 'utilsSvc' , 'PermissionsService' ,
742 function ( apiService , loadINI , $location , $rootScope , $scope , $filter , $modal , $timeout , $log , $compile , $window , localStorageService , requestNotificationChannel , PlayerService , $q , utilsSvc , PermissionsService ) {
843 // start request to show the spinner. When data is rendered, the onFinishRender directive will hide the spinner
944 requestNotificationChannel . requestStarted ( 'list' ) ;
@@ -348,7 +383,7 @@ angular.module('KMCModule').controller('PlayerListCtrl',
348383 }
349384 } ) ;
350385 modal . result . then ( function ( result ) {
351- if ( result && result . result ) {
386+ if ( result ) {
352387 var confirmMsg = $filter ( 'translate' ) ( 'Do you want to convert this V2 player to a V7 player?<br/><br/>' +
353388 'Player\'s customization and configuration will be lost<br/>' +
354389 'Player\'s embeds will need to be modified.<br/><br/>' +
@@ -405,38 +440,4 @@ angular.module('KMCModule').controller('PlayerListCtrl',
405440 } ;
406441 }
407442 ] )
408- . controller ( 'PlayerUpgradeModeCtrl' ,
409- function ( $scope , $modalInstance , settings ) {
410- $scope . playerId = '' ;
411- $scope . mode = '' ;
412-
413- $scope . close = function ( result ) {
414- var modalResult = result ? {
415- result : true ,
416- mode : this . mode ,
417- templateId : Number ( this . playerId )
418- } : {
419- result : false
420- } ;
421- $modalInstance . close ( modalResult ) ;
422- } ;
423-
424- $scope . cancel = function ( ) {
425- $modalInstance . dismiss ( 'cancel' ) ;
426- } ;
427-
428- $scope . validate = function ( ) {
429- if ( this . mode === '' ) {
430- return false ;
431- }
432-
433- if ( this . mode === 'template' && ( this . playerId === '' ) || isNaN ( this . playerId ) ) {
434- return false ;
435- }
436-
437- return true ;
438- } ;
439-
440- angular . extend ( $scope , settings ) ;
441- } )
442443;
0 commit comments