<commit_before>var onecastApp = angular.module('onecastApp', ['ngRoute', 'ui.bootstrap', 'ngMaterial', 'ngTable', 'rzModule', 'ui-rangeSlider', 'daterangepicker']);

onecastApp.config(function($routeProvider) {
    $routeProvider
    	.when('/', {
    		templateUrl: 'actorwelcome.html',
            controller: 'mainController'
    	})
        .when('/actorhome', {
    		templateUrl: 'actorwelcome.html',
            controller: 'mainActorController'
    	})
        .when('/directorhome', {
    		templateUrl: 'directorwelcome.html',
            controller: 'mainDirectorController'
    	})
        .when('/romeojulietdirect', {
            templateUrl: 'casting-populated.html',
            controller: 'directorPlayController'
        })
        .when('/productionsearch', {
            templateUrl: 'actor.html',
            controller: 'searchController'
        })
        .when('/talentsearch', {
            templateUrl: 'director-search.html',
            controller: 'directorSearchController'
        })
        .when('/summary', {
    		templateUrl: 'actor-summary.html',
            controller: 'mainController'
    	})
        .when('/exampleplay', {
    		templateUrl: 'production.html',
            controller: 'productionController'
    	})
        .when('/romeojuliet', {
    		templateUrl: 'actor-page.html',
            controller: 'actorPageController'
    	})
        .when('/directorcreate', {
    		templateUrl: 'new-casting.html',
            controller: 'castingController',
            css: 'css/partial1.css'
    	})
        .when('/applycalendar', {
            templateUrl: 'actor-apply-cal.html'
        })
        .otherwise({
            redirectTo: "/"
        });
});

onecastApp.controller('mainController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
});

onecastApp.controller('directorPlayController', function($scope, $rootScope, $window, $mdDialog, $location, ngTableParams) {
    $scope.primary = 'purple';
    var data = [{role: "Romeo", accepted: true, rejected: false, backup: false, pending:false},
                {role: "Juliet", accepted: false, rejected: false, backup: false, pending:true},
                {role: "Capulet", accepted: false, rejected: false, backup: false, pending:false},
                {role: "King", accepted: false, rejected: false, backup: false, pending:false}];
    
    $scope.isCollapsed=true;
    
    $scope.tableParams = new ngTableParams({
        page: 1,            // show first page
        count: 10000           // count per page
    }, {
        counts: [],
        getData: function($defer, params) {
            $defer.resolve(data);
        }
    });
    
    $rootScope.pageTitle = "Romeo & Juliet";
    
    $scope.findTalent = function() {
        
        $location.path('/talentsearch');
        
    }
    
    $scope.addRole = function() {
        
        while(angular.element(document).find('md-dialog').length > 0) {
            $mdDialog.cancel();
        }
        
        $mdDialog.show({
          controller: 'addRoleController',
          templateUrl: 'new-role.html',
          ariaLabel: "Add Role",
          parent: angular.element('#pag-wrapper'),
          clickOutsideToClose:true,
          //fullscreen: 'useFullScreen'
        })
        .then(function(answer) {
          console.log(answer);
        }, function() {
          $scope.status = 'You cancelled the dialog.';
        });
        
        while(angular.element(document).find('md-dialog').length > 1) {
            $mdDialog.cancel();
        }
        
    }
    
});

onecastApp.controller('mainActorController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
    $("#create-casting").hide();
    $("#create-button").hide();
    
    $rootScope.newOption = "New What?";
    $rootScope.homeUrl = "#actorhome";
    $rootScope.userIcon = "fa-user";
    $rootScope.newUrl = "#actorhome";
    $rootScope.searchUrl = "#productionsearch";
    $rootScope.romeoUrl = "#romeojuliet";
    $rootScope.actor = true;
    
});

onecastApp.controller('mainDirectorController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
    $rootScope.newOption = "New Casting";
    $rootScope.homeUrl = "#directorhome";
    $rootScope.userIcon = "fa-film";
    $rootScope.newUrl = "#directorcreate";
    $rootScope.searchUrl = "#talentsearch";
    $rootScope.romeoUrl = "#romeojulietdirect";
    $rootScope.actor = false;
    
    $("#create-casting").show();
    $("#create-button").show();
    
    $(function(){

        $(".create-button").on("click",function(){
            
            while(angular.element(document).find('md-dialog').length > 0) {
                $mdDialog.cancel();
            }

              $mdDialog.show({
                  controller: 'addCastingController',
                  templateUrl: 'new-casting.html',
                  parent: angular.element('#wrapper'),
                  clickOutsideToClose:true,
                  //fullscreen: 'useFullScreen'
                })
                .then(function(answer) {
                  $scope.status = 'You said the information was "' + answer + '".';
                }, function() {
                  $scope.status = 'You cancelled the dialog.';
                });
            
            while(angular.element(document).find('md-dialog').length > 1) {
                $mdDialog.cancel();
            }

        });

    });
    
});

onecastApp.controller('actorController', function($scope, $rootScope, $window) {
    $rootScope.pageTitle = "Romeo & Juliet";
    $scope.primary = 'purple';
});

onecastApp.controller('searchController', function($scope, ngTableParams) {
    $rootScope.pageTitle = "OneCast Search";
    $scope.primary = 'purple';
    var data = [{title: "Romeo & Juliet", date: "2016-04-29", location: "Chesapeake, VA", description: "Romeo and Juliet is a tragedy written by <NAME> early in his career about two young star-crossed lovers whose deaths ultimately reconcile their feuding families."},
                {title: "Les Miserables", date: "2016-04-29", location: "Chesapeake, VA", description: "Les Misérables is a French historical novel by <NAME>, first published in 1862, that is considered one of the greatest novels of the 19th century."},
                {title: "Cabaret", date: "2016-05-09", location: "Newark, NJ", description: "Cabaret is a musical based on a book written by <NAME>, music by <NAME> and lyrics by <NAME>. "},
                {title: "<NAME>", date: "2016-05-17", location: "Detroit, MI", description: "M<NAME>! is a jukebox musical written by British playwright <NAME>, based on the songs of ABBA."},
                {title: "Grease", date: "2016-05-26", location: "Dallas, TX", description: "Grease is a 1971 musical by <NAME> and <NAME> with additional songs written by <NAME>."},
                {title: "Into the Woods", date: "2016-06-06", location: "Honolulu, HI", description: "Into the Woods is a musical with music and lyrics by <NAME> and book by <NAME>."},
                {title: "Cinderella", date: "2016-07-11", location: "Albuquerque, NM", description: "Cinderella, or The Little Glass Slipper is a folk tale embodying a myth-element of unjust oppression/triumphant reward."},<commit_msg>Fixed buggy rootScope title name<commit_after>var onecastApp = angular.module('onecastApp', ['ngRoute', 'ui.bootstrap', 'ngMaterial', 'ngTable', 'rzModule', 'ui-rangeSlider', 'daterangepicker']);

onecastApp.config(function($routeProvider) {
    $routeProvider
    	.when('/', {
    		templateUrl: 'actorwelcome.html',
            controller: 'mainController'
    	})
        .when('/actorhome', {
    		templateUrl: 'actorwelcome.html',
            controller: 'mainActorController'
    	})
        .when('/directorhome', {
    		templateUrl: 'directorwelcome.html',
            controller: 'mainDirectorController'
    	})
        .when('/romeojulietdirect', {
            templateUrl: 'casting-populated.html',
            controller: 'directorPlayController'
        })
        .when('/productionsearch', {
            templateUrl: 'actor.html',
            controller: 'searchController'
        })
        .when('/talentsearch', {
            templateUrl: 'director-search.html',
            controller: 'directorSearchController'
        })
        .when('/summary', {
    		templateUrl: 'actor-summary.html',
            controller: 'mainController'
    	})
        .when('/exampleplay', {
    		templateUrl: 'production.html',
            controller: 'productionController'
    	})
        .when('/romeojuliet', {
    		templateUrl: 'actor-page.html',
            controller: 'actorPageController'
    	})
        .when('/directorcreate', {
    		templateUrl: 'new-casting.html',
            controller: 'castingController',
            css: 'css/partial1.css'
    	})
        .when('/applycalendar', {
            templateUrl: 'actor-apply-cal.html'
        })
        .otherwise({
            redirectTo: "/"
        });
});

onecastApp.controller('mainController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
});

onecastApp.controller('directorPlayController', function($scope, $rootScope, $window, $mdDialog, $location, ngTableParams) {
    $scope.primary = 'purple';
    var data = [{role: "Romeo", accepted: true, rejected: false, backup: false, pending:false},
                {role: "Juliet", accepted: false, rejected: false, backup: false, pending:true},
                {role: "Capulet", accepted: false, rejected: false, backup: false, pending:false},
                {role: "King", accepted: false, rejected: false, backup: false, pending:false}];
    
    $scope.isCollapsed=true;
    
    $scope.tableParams = new ngTableParams({
        page: 1,            // show first page
        count: 10000           // count per page
    }, {
        counts: [],
        getData: function($defer, params) {
            $defer.resolve(data);
        }
    });
    
    $rootScope.pageTitle = "Romeo & Juliet";
    
    $scope.findTalent = function() {
        
        $location.path('/talentsearch');
        
    }
    
    $scope.addRole = function() {
        
        while(angular.element(document).find('md-dialog').length > 0) {
            $mdDialog.cancel();
        }
        
        $mdDialog.show({
          controller: 'addRoleController',
          templateUrl: 'new-role.html',
          ariaLabel: "Add Role",
          parent: angular.element('#pag-wrapper'),
          clickOutsideToClose:true,
          //fullscreen: 'useFullScreen'
        })
        .then(function(answer) {
          console.log(answer);
        }, function() {
          $scope.status = 'You cancelled the dialog.';
        });
        
        while(angular.element(document).find('md-dialog').length > 1) {
            $mdDialog.cancel();
        }
        
    }
    
});

onecastApp.controller('mainActorController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
    $("#create-casting").hide();
    $("#create-button").hide();
    
    $rootScope.newOption = "New What?";
    $rootScope.homeUrl = "#actorhome";
    $rootScope.userIcon = "fa-user";
    $rootScope.newUrl = "#actorhome";
    $rootScope.searchUrl = "#productionsearch";
    $rootScope.romeoUrl = "#romeojuliet";
    $rootScope.actor = true;
    
});

onecastApp.controller('mainDirectorController', function($scope, $rootScope, $window, $mdDialog) {
    $rootScope.pageTitle = "OneCast";
    $scope.primary = 'purple';
    $rootScope.newOption = "New Casting";
    $rootScope.homeUrl = "#directorhome";
    $rootScope.userIcon = "fa-film";
    $rootScope.newUrl = "#directorcreate";
    $rootScope.searchUrl = "#talentsearch";
    $rootScope.romeoUrl = "#romeojulietdirect";
    $rootScope.actor = false;
    
    $("#create-casting").show();
    $("#create-button").show();
    
    $(function(){

        $(".create-button").on("click",function(){
            
            while(angular.element(document).find('md-dialog').length > 0) {
                $mdDialog.cancel();
            }

              $mdDialog.show({
                  controller: 'addCastingController',
                  templateUrl: 'new-casting.html',
                  parent: angular.element('#wrapper'),
                  clickOutsideToClose:true,
                  //fullscreen: 'useFullScreen'
                })
                .then(function(answer) {
                  $scope.status = 'You said the information was "' + answer + '".';
                }, function() {
                  $scope.status = 'You cancelled the dialog.';
                });
            
            while(angular.element(document).find('md-dialog').length > 1) {
                $mdDialog.cancel();
            }

        });

    });
    
});

onecastApp.controller('actorController', function($scope, $rootScope, $window) {
    $rootScope.pageTitle = "Romeo & Juliet";
    $scope.primary = 'purple';
});

onecastApp.controller('searchController', function($scope, ngTableParams, $rootScope) {
    $rootScope.pageTitle = "OneCast Search";
    $scope.primary = 'purple';
    var data = [{title: "Romeo & Juliet", date: "2016-04-29", location: "Chesapeake, VA", description: "Romeo and Juliet is a tragedy written by <NAME> early in his career about two young star-crossed lovers whose deaths ultimately reconcile their feuding families."},
                {title: "Les Miserables", date: "2016-04-29", location: "Chesapeake, VA", description: "Les Misérables is a French historical novel by <NAME>, first published in 1862, that is considered one of the greatest novels of the 19th century."},
                {title: "Cabaret", date: "2016-05-09", location: "Newark, NJ", description: "Cabaret is a musical based on a book written by <NAME>, music by <NAME> and lyrics by <NAME>. "},
                {title: "<NAME>", date: "2016-05-17", location: "Detroit, MI", description: "<NAME>! is a jukebox musical written by British playwright <NAME>, based on the songs of ABBA."},
                {title: "Grease", date: "2016-05-26", location: "Dallas, TX", description: "Grease is a 1971 musical by <NAME> and <NAME> with additional songs written by <NAME>."},
                {title: "Into the Woods", date: "2016-06-06", location: "Honolulu, HI", description: "Into the Woods is a musical with music and lyrics by <NAME> and book by <NAME>."},
                {title: "Cinderella", date: "2016-07-11", location: "Albuquerque, NM", description: "Cinderella, or The Little Glass Slipper is a folk tale embodying a myth-element of unjust oppression/triumphant reward."},
{'fraction_non_alphanumeric': 0.14829255176122613, 'fraction_numerical': 0.010352245227211615, 'mean_word_length': 2.407466788822721, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '856967', 'n_tokens_mistral': 4413, 'n_tokens_neox': 4198, 'n_words': 952}