1apollo.controller('homeControl', ['$scope','$http','$sce', function($scope,$http,$sce){ 2 3 $scope.pageTitle = "Home"; 4 $scope.streamables = [ 5 {name:"Snarky Puppy - Sylva",uri:"spotify:album:5hptBuBwjb6Z11tV5bM9Oa"}, 6 {name:"Bill Laurance - Swift",uri:"spotify:album:25ml9qyhiETqBAdwV7sjiK"}, 7 {name:"Philip Lassiter - DreamZzz",uri:"spotify:album:4hJRs0U2u2RECGL9GLXBmY"} 8 ]; 9 10 /////////////////////////////////////////// 11 12 /////////////////////////////////////////// 13 $scope.userEmail = ""; 14 $scope.userSignedUp = false; 15 $scope.invalidEmail = false; 16 $scope.signUpMessage = ""; 17 $scope.signUpError = ""; 18 $scope.submitting = false; 19 $scope.submitEmail = function(newEmail){ 20 var emailReg = /^[_a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; 21 var genericError = 'There was an error processing your request. Please try again.'; 22 // Sending the confirmation email takes a beat -- block re-submits until it lands. 23 if($scope.submitting){ return; } 24 if(emailReg.test(newEmail)){ 25 $scope.invalidEmail=false; 26 $scope.signUpError=""; 27 $scope.submitting=true; 28 $http.post('./data/mailingList.php',{action:'add',email:newEmail}) 29 .then(function(response){ 30 var result = response.data || {}; 31 // The address isn't on the list yet -- they have to click the 32 // link in the confirmation email we just sent them. 33 if(result.ok === false){ 34 $scope.signUpError = result.message || genericError; 35 return; 36 } 37 $scope.signUpMessage = result.message || 'Almost there! Check your email for a confirmation link.'; 38 $scope.userSignedUp = true; 39 }).catch(function(err){ 40 $scope.signUpError = genericError; 41 }).finally(function(){ 42 $scope.submitting = false; 43 }); 44 }else{ 45 $scope.invalidEmail=true; 46 } 47 }; 48 49 // CAROUSEL TOGGLER STUFF 50 $scope.hasCarousel = true; 51 $scope.carouselChevron = "glyphicon-chevron-up"; 52 $scope.toggleCarousel = function(){ 53 if($scope.hasCarousel){ 54 $scope.carouselChevron = "glyphicon-chevron-down"; 55 $scope.hasCarousel = false; 56 } else if(!$scope.hasCarousel){ 57 $scope.carouselChevron = "glyphicon-chevron-up"; 58 $scope.hasCarousel = true; 59 } 60 }; 61 62 // CURRENT STREAMING 63 $scope.spotify = $scope.streamables[0]; 64 65 // GENERATE IFRAME FRIENDLY URL 66 $scope.makeSpotifyURL = function(uri){ 67 return $sce.trustAsResourceUrl('https://embed.spotify.com/?uri='+uri); 68 }; 69 70 // SET CURRENT STREAM 71 $scope.setSpotify = function(spotifyObj){ 72 $scope.spotify = spotifyObj; 73 } 74 75 76 // GET YOUTUBE THUMBNAILS 77 $scope.youtubeThumb = function(input){ 78 return "https://img.youtube.com/vi/"+input+"/mqdefault.jpg"; 79 }; 80 81}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.