Added Angular cookies module to store timer info.

This commit is contained in:
William Brawner 2015-11-21 20:22:35 -06:00
parent 673646083e
commit 7ccbec3822
3 changed files with 12 additions and 2 deletions

View file

@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="css/styles.css"> <link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<script type="text/javascript" src="js/angular.min.js"></script> <script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/countdown.min.js"></script> <script type="text/javascript" src="js/angular-cookies.min.js"></script>
<script type="text/javascript" src="js/app.js"></script> <script type="text/javascript" src="js/app.js"></script>
</head> </head>
<body ng-controller="timerCtrl as timer" ng-class="{'green': lowIntensity, 'red': highIntensity, 'blue': coolDown, 'yellow': warmUp }"> <body ng-controller="timerCtrl as timer" ng-class="{'green': lowIntensity, 'red': highIntensity, 'blue': coolDown, 'yellow': warmUp }">

10
js/angular-cookies.min.js vendored Normal file
View file

@ -0,0 +1,10 @@
/*
AngularJS v1.4.8
(c) 2010-2015 Google, Inc. http://angularjs.org
License: MIT
*/
(function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
//# sourceMappingURL=angular-cookies.min.js.map

View file

@ -40,11 +40,11 @@
$scope.round = 1; $scope.round = 1;
$scope.cycle = 1; $scope.cycle = 1;
$scope.timer = timer; $scope.timer = timer;
$scope.warmUp = true;
$scope.warmUpTime = timer.warm_up; $scope.warmUpTime = timer.warm_up;
$scope.lowIntensityTime = timer.low_intensity; $scope.lowIntensityTime = timer.low_intensity;
$scope.highIntensityTime = timer.high_intensity; $scope.highIntensityTime = timer.high_intensity;
$scope.coolDownTime = timer.cool_down; $scope.coolDownTime = timer.cool_down;
$scope.warmUp = true;
$scope.time = $scope.warmUpTime; $scope.time = $scope.warmUpTime;
$scope.settingsOpen = false; $scope.settingsOpen = false;
$scope.closeSettings = false; $scope.closeSettings = false;