Toderp work

This commit is contained in:
Max Lynch
2013-10-08 16:17:58 -05:00
parent 35f487b7fb
commit a6e443eaa6
9 changed files with 66 additions and 2439 deletions

2419
dist/ionic-ios7.css vendored

File diff suppressed because it is too large Load Diff

9
dist/ionic.css vendored
View File

@ -1,3 +1,4 @@
@charset "UTF-8";
@font-face { @font-face {
font-family: 'ionicon-test'; font-family: 'ionicon-test';
src: url("fonts/ionicon-test.eot"); src: url("fonts/ionicon-test.eot");
@ -246,7 +247,7 @@ sub {
fieldset { fieldset {
margin: 0 2px; margin: 0 2px;
padding: 0.35em 0.625em 0.75em; padding: 0.35em 0.625em 0.75em;
border: 1px solid #c0c0c0; } border: 1px solid silver; }
/** /**
* 1. Correct `color` not being inherited in IE 8/9. * 1. Correct `color` not being inherited in IE 8/9.
@ -1935,7 +1936,7 @@ select:focus,
input[type="file"]:focus, input[type="file"]:focus,
input[type="radio"]:focus, input[type="radio"]:focus,
input[type="checkbox"]:focus { input[type="checkbox"]:focus {
outline: thin dotted #333; outline: thin dotted #333333;
outline: 5px auto -webkit-focus-ring-color; outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; } outline-offset: -2px; }
@ -2256,7 +2257,7 @@ input[type="checkbox"][readonly] {
border: none; border: none;
background: none; } background: none; }
.button.button-icon:active, .button.button-icon.active { .button.button-icon:active, .button.button-icon.active {
text-shadow: 0px 0px 10px #fff; text-shadow: 0px 0px 10px white;
box-shadow: none; box-shadow: none;
background: none; } background: none; }
@ -2439,7 +2440,7 @@ a.button {
width: 100%; width: 100%;
background-color: white; background-color: white;
border-radius: 2px; border-radius: 2px;
border: 1px solid #ddd; } border: 1px solid #dddddd; }
.card-header { .card-header {
padding: 10px; padding: 10px;

6
dist/ionic.js vendored
View File

@ -2504,6 +2504,12 @@ ionic.controllers.NavController.prototype = {
} }
}, },
/**
* Close all menus.
*/
close: function() {
this.openPercentage(0);
},
/** /**
* @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative) * @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative)

View File

@ -21,6 +21,9 @@
margin: 40px auto; margin: 40px auto;
} }
.toderp-small-logo { .toderp-small-logo {
background: url('../img/logo-header.png') no-repeat transparent;
background-size: 76px 21px;
background-position: 50%;
box-flex: 1; box-flex: 1;
-webkit-box-flex: 1; -webkit-box-flex: 1;
} }
@ -53,4 +56,9 @@
background: url('../img/splash@2x.png') no-repeat transparent; background: url('../img/splash@2x.png') no-repeat transparent;
background-size: cover; background-size: cover;
} }
.toderp-small-logo {
background: url('../img/logo-header@2x.png') no-repeat transparent;
background-size: 76px 21px;
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -128,16 +128,16 @@
</div> </div>
<menu side="left"> <menu side="left">
<header class="bar bar-header bar-secondary"> <header class="bar bar-header bar-secondary">
<button class="button button-clear">Edit</button> <button class="button button-clear button-primary">Edit</button>
<div class="toderp-small-logo"></div> <div class="toderp-small-logo"></div>
<button class="button button-icon">S</button> <button class="button button-icon" ng-click="showSettings()">S</button>
</header> </header>
<content has-header="true"> <content has-header="true">
<form ng-submit="addProject(newProject)"> <form ng-submit="addProject(newProject)">
<input type="text" ng-model="newProject.title" placeholder="Create a new list..."> <input type="text" ng-model="newProject.title" placeholder="Create a new list...">
</form> </form>
<list> <list>
<a ng-click="setActiveProject(project)" class="list-item list-item-primary" ng-class="{active: project.isActive}" ng-repeat="project in projects"> <a ng-click="selectProject(project)" class="list-item list-item-primary" ng-class="{active: project.$id == activeProject.project.name()}" ng-repeat="project in projects">
{{project.title}} {{project.title}}
</a> </a>
</list> </list>
@ -145,5 +145,16 @@
</menu> </menu>
</side-menu-ctrl> </side-menu-ctrl>
</script> </script>
<script id="settings.html" type="text/ng-template">
<div id="login-view" class="modal slide-in-up" ng-controller="SettingsCtrl">
<header class="bar bar-header bar-secondary">
<h1 class="title">Settings</h1>
<button class="button button-clear button-primary" ng-click="close()">Done</button>
</header>
<main class="content padded has-header">
</main>
</div>
</script>
</body> </body>
</html> </html>

View File

@ -67,18 +67,25 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
// The tasks controller (main app controller) // The tasks controller (main app controller)
.controller('TasksCtrl', function($scope, angularFire, angularFireCollection, FIREBASE_URL) { .controller('TasksCtrl', function($scope, angularFire, angularFireCollection, Modal, FIREBASE_URL) {
/* /*
var lastProjectRef = new Firebase(FIREBASE_URL + '/lastproject'); var lastProjectRef = new Firebase(FIREBASE_URL + '/lastproject');
var lastProjectPromise = angularFire(lastProjectRef, $scope, 'lastProject'); var lastProjectPromise = angularFire(lastProjectRef, $scope, 'lastProject');
$scope.lastProject = null; $scope.lastProject = null;
*/ */
// Load our settings modal
Modal.fromTemplateUrl('settings.html', function(modal) {
$scope.settingsModal = modal;
});
$scope.newProject = {}; $scope.newProject = {};
$scope.newTask = {}; $scope.newTask = {};
$scope.showSettings = function() {
$scope.settingsModal && $scope.settingsModal.show();
};
/** /**
* Add a new tasks to the current project. * Add a new tasks to the current project.
@ -101,7 +108,7 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
// Set the priorty for this project to the new date, so it will // Set the priorty for this project to the new date, so it will
// sort higher // sort higher
$scope.activeProject.project.setPriority(-(+new Date)); //$scope.activeProject.project.setPriority(-(+new Date));
$scope.newTask = {}; $scope.newTask = {};
}; };
@ -121,17 +128,11 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
title: project.title, title: project.title,
tasks: angularFireCollection(ref.child('tasks').limit(100)) tasks: angularFireCollection(ref.child('tasks').limit(100))
}; };
$scope.clearActive();
project.isActive = true;
// Close the side menu
$scope.sideMenuCtrl.toggleLeft();
}; };
$scope.clearActive = function() { $scope.selectProject = function(project) {
angular.forEach($scope.projects, function(project) { $scope.setActiveProject(project);
project.isActive = false; $scope.sideMenuCtrl.close();
});
}; };
/** /**
@ -142,7 +143,6 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
title: newProject.title, title: newProject.title,
user_id: $scope.user.id, user_id: $scope.user.id,
tasks: [], tasks: [],
isActive: true
}; };
console.log("Adding project:", p); console.log("Adding project:", p);
@ -152,8 +152,15 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
$scope.newProject = {}; $scope.newProject = {};
var np = $scope.projects.add(p); var np = $scope.projects.add(p);
np.setPriority(-(+new Date)); //np.setPriority(-(+new Date));
$scope.setActiveProject(np); $scope.setActiveProject(np);
// Set these explicitly, some firebase delay or something happening
// here.
$scope.activeProject.title = newProject.title;
$scope.activeProject.user_id = newProject.user_id;
$scope.sideMenuCtrl.close();
}; };
var projectsRef = new Firebase(FIREBASE_URL + '/project_list'); var projectsRef = new Firebase(FIREBASE_URL + '/project_list');
@ -167,6 +174,8 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
} }
} }
}); });
// Listen for the first child added so we can set it as the active project
projectsRef.once('child_added', function(snapshot, prevChildName) { projectsRef.once('child_added', function(snapshot, prevChildName) {
$scope.setActiveProject( $scope.setActiveProject(
angular.extend({ angular.extend({
@ -174,5 +183,10 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
}, snapshot.val()) }, snapshot.val())
) )
}); });
projectsRef.on('child_added', function(snapshot, prevChildName) {
console.log('CHILD ADDED', snapshot.val());
});
}) })
.controller('SettingsCtrl', function($scope) {
})

View File

@ -72,6 +72,12 @@
} }
}, },
/**
* Close all menus.
*/
close: function() {
this.openPercentage(0);
},
/** /**
* @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative) * @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative)