github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/Release/assets/js/500_controllers.js (about)

     1  // Copyright (c) 2015 Cameron King. All rights reserved.
     2  // License: BSD 2-clause.
     3  // Website: https://github.com/ckxng/wakeup
     4  
     5  var wakeupWebAppControllers = angular.module('wakeupWebAppControllers', []);
     6  
     7  wakeupWebAppControllers.filter('stringify', function(){ 
     8      return function(input) {
     9          return JSON.stringify(input);
    10      };
    11  });
    12  
    13  wakeupWebAppControllers.controller('MainCtrl', [
    14      '$scope', '$location', '$interval', 'Page',
    15      function ($scope, $location, $interval, Page) {
    16          $scope.Page = Page;
    17  		Page.setTitle("Wakeup App")
    18  		
    19  		$interval(function() {
    20  			Page.setTime(new Date());
    21  		}, 1000);
    22  		
    23  		Cron_Schedule($location);
    24  		
    25  		Cron.start();
    26      }
    27  ]);
    28  
    29  wakeupWebAppControllers.controller('ClockCtrl', [
    30      '$scope', 'Page',
    31      function ($scope, Page) {
    32          Page.setTitle("Clock");
    33      }
    34  ]);
    35  
    36  wakeupWebAppControllers.controller('WakeupRiseCtrl', [
    37      '$scope', 'Page',
    38      function ($scope, Page) {
    39          Page.setTitle("Rise and shine!");
    40      }
    41  	
    42  	// play music
    43  	
    44  	// start timer then go back to clock
    45  	
    46  ]);
    47  
    48  wakeupWebAppControllers.controller('WakeupDressCtrl', [
    49      '$scope', 'Page',
    50      function ($scope, Page) {
    51          Page.setTitle("Get dressed!");
    52      }
    53  	
    54  	// play music
    55  	
    56  	// start timer then go back to clock
    57  	
    58  ]);
    59  
    60  wakeupWebAppControllers.controller('WakeupBreakfastCtrl', [
    61      '$scope', 'Page',
    62      function ($scope, Page) {
    63          Page.setTitle("Eat breakfast!");
    64      }
    65  	
    66  	// play music
    67  	
    68  	// start timer then go back to clock
    69  	
    70  ]);
    71  
    72  wakeupWebAppControllers.controller('WakeupTeethCtrl', [
    73      '$scope', 'Page',
    74      function ($scope, Page) {
    75          Page.setTitle("Brush your teeth!");
    76      }
    77  	
    78  	// play music
    79  	
    80  	// start timer then go back to clock
    81  	
    82  ]);
    83  
    84  wakeupWebAppControllers.controller('WakeupBackpackCtrl', [
    85      '$scope', 'Page',
    86      function ($scope, Page) {
    87          Page.setTitle("Put on your backpack!");
    88      }
    89  	
    90  	// play music
    91  	
    92  	// start timer then go back to clock
    93  	
    94  ]);
    95  
    96  wakeupWebAppControllers.controller('WakeupLeaveCtrl', [
    97      '$scope', 'Page',
    98      function ($scope, Page) {
    99          Page.setTitle("Time to go!");
   100      }
   101  	
   102  	// play music
   103  	
   104  	// start timer then go back to clock
   105  	
   106  ]);