Skip to content

Commit

Permalink
Added a bunc hf comments to the public part and licensing for everyth…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
icub3d committed Feb 3, 2013
1 parent 8be496a commit 175ae70
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 63 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

*Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
Expand Down
4 changes: 0 additions & 4 deletions public/css/boot.css

This file was deleted.

31 changes: 22 additions & 9 deletions public/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
Copyright 2013 Joshua Marsh. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in
the LICENSE file.
*/

body {
/* We add the padding for the fixed header. */
padding-top: 60px;
}

.all-scroll-cursor {
cursor: all-scroll;
}
Expand All @@ -6,34 +17,36 @@
cursor: pointer;
}

/* This is the style of a completed list item. */
.done-true {
text-decoration: line-through;
color: grey;
}

/* To enable sorting, we use a list instead of a table, so we
implement the table striping for lists. */
.list-striped > li {
line-height: 20px;
padding: 8px;
border-top: 1px solid #dddddd;
line-height: 20px;
padding: 8px;
border-top: 1px solid #dddddd;
}

.list-striped li:nth-child(odd) {
background-color: #f9f9f9;
}

.pad-bottom {
/* This is used to make a reasonable amount of space between the forms
and buttons and the list items. */
.pad-bottom {
padding-bottom: 15px;
}

/* The text box is slightly off, so we move it up a bit. */
.editing-item {
margin-top: -5px;
display: none;
}

.viewing-item {
display: inline;
}

/* The drag icon is slightly off, so we move it up a bit. */
.drag-icon {
margin-top: -5px;
}
Empty file removed public/header.html
Empty file.
26 changes: 14 additions & 12 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<!doctype html>
<html lang="en" data-ng-app="list">
<head>
<!--
Copyright 2013 Joshua Marsh. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<meta charset="utf-8">
<title>List App</title>
<meta name="description" content="The Marsh Family List App">
<meta name="description" content="List App">
<meta name="author" content="Joshua Marsh">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico" />
Expand All @@ -16,20 +21,20 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>

<!-- Twitter Bootstrap -->
<!-- Twitter Bootstrap CSS -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css"
rel="stylesheet">

<!-- Our stylesheets -->
<link href="/css/boot.css" rel="stylesheet">
<!-- Our stylesheets. We do it before bootstrap to get the body changes in first. -->
<link href="/css/main.css" rel="stylesheet">

<!-- Bootstrap responsive -->
<!-- Twitter Bootstrap Responsive CSS -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css"
rel="stylesheet">

<!-- Our stylesheets -->
<link href="/css/main.css" rel="stylesheet">

<!-- Twitter Bootstrap JavaScipt -->
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script>
<!-- AngularJS -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular-resource.min.js"></script>
Expand All @@ -42,7 +47,6 @@
<script src="/js/view.js"></script>
<script src="/js/date.js"></script>
<script src="/js/touch-punch.min.js"></script>

</head>
<body>
<div class="container">
Expand Down Expand Up @@ -78,11 +82,9 @@
</div>
</div>

<!-- The main content of the page. -->
<div data-ng-view></div>
</div>

<!-- Twitter Bootstrap -->
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script>

</body>
</html>
22 changes: 20 additions & 2 deletions public/js/lists.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
/*
Copyright 2013 Joshua Marsh. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in
the LICENSE file.
*/

// ListsCtrl is the controller for viewing all lists.
function ListsCtrl($scope, $location, List) {
// The entire list box is clickable and this function handles that
// by changing the location path.
$scope.view = function(key) {
$location.path('/view/' + key + '/');
};

// This handles clicking the copy button. It pops up the modal and
// prepares it's name.
$scope.copymodal = function(key, name, event) {
$scope.copyKey = key;
$scope.copyName = "Copy of " + name;
Expand All @@ -14,7 +24,7 @@ function ListsCtrl($scope, $location, List) {
event.stopPropagation();
};


// This function actually makes the copy of the list.
$scope.copy = function() {
$('#copyModal').modal('hide');

Expand All @@ -27,6 +37,8 @@ function ListsCtrl($scope, $location, List) {

};

// This function opens up the modal to verify that
// they want to delete the list.
$scope.delete = function(key, event) {
$scope.deleteKey = key;

Expand All @@ -36,6 +48,7 @@ function ListsCtrl($scope, $location, List) {
event.stopPropagation();
};

// This function performs the actual delete.
$scope.sure = function() {
$('#deleteModal').modal('hide');
List.delete($scope.deleteKey, function() {
Expand All @@ -45,23 +58,28 @@ function ListsCtrl($scope, $location, List) {
});
};

// This function opens up the new modal box.
$scope.new = function() {
$('#newModal').modal();

};

// If any of the modals click cancel, this is
// called to close it.
$scope.back = function() {
$('#newModal').modal('hide');
$('#copyModal').modal('hide');
};

// This creates the new list and redirects you to
// that list.
$scope.save = function() {
$('#newModal').modal('hide');
List.create({"Name": $scope.name}, function (l) {
$location.path('/view/' + l.Key + '/');
});
};

// To start off, we should get all the lists.
List.getall(function (lists) {
$scope.lists = lists;
});
Expand Down
22 changes: 22 additions & 0 deletions public/js/rest.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
/*
Copyright 2013 Joshua Marsh. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in
the LICENSE file.
*/

// This is a module for interacting with the rest framework.
angular.module('rest', ['ngResource'])
/* This is an interface to the RESTful User service. */
.factory('User', function($resource) {
var User = $resource("/rest/user/", {}, {});

return User;
})
/* This is an interface to the RESTful List service. We have
* to use a service here because go and angular don't play nicely
* together with trailing slashes.
*/
.service('List', function($http) {
// Note: All of these functions accept callback
// functions in which the resulting data from the
// server is returned.

// Create a new list.
this.create = function(data, call) {
return $http.post("/rest/list/", data)
.then(function (response) {
call(response.data);
});
};

// Save an existing list.
this.save = function(data, call) {
return $http.put("/rest/list/" + data.Key + "/", data)
.then(function (response) {
call(response.data);
});
};

// Check to see if a list has been modified.
this.checkupdate = function(data, call) {
return $http.get("/rest/list/" + data.Key + "/")
.then(function (response) {
// We are just going to compare LastModified dates.
var sdate = Date.parseRFC3339(response.data.LastModified);
var mdate = Date.parseRFC3339(data.LastModified);

Expand All @@ -31,13 +50,15 @@ angular.module('rest', ['ngResource'])

};

// Delete the list wit the given key.
this.delete = function(key, call) {
return $http.delete("/rest/list/" + key + "/")
.then(function(response) {
call(response.data);
});
};

// Get all lists.
this.getall = function(call) {
return $http.get("/rest/list/")
.then(function(response) {
Expand All @@ -46,6 +67,7 @@ angular.module('rest', ['ngResource'])
};


// Get a specific list.
this.get = function(key, call) {
return $http.get("/rest/list/" + key + "/")
.then(function(response) {
Expand Down
8 changes: 8 additions & 0 deletions public/js/routing.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
Copyright 2013 Joshua Marsh. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in
the LICENSE file.
*/

// This is the routing mechanism.
angular.module('list', ['rest'])
.config(function ($routeProvider) {
Expand All @@ -14,6 +20,8 @@ angular.module('list', ['rest'])
}

)
// This is used to auto-focus the items then they are switched
// from a span to a text box.
.directive('ngHasfocus', function() {
return function(scope, element, attrs) {
scope.$watch(attrs.ngHasfocus, function (nVal, oVal) {
Expand Down
6 changes: 6 additions & 0 deletions public/js/user.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
Copyright 2013 Joshua Marsh. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in
the LICENSE file.
*/

// UserCtrl is the controller for part of the site that lists all of
// the lists.
function UserCtrl($scope, User) {
Expand Down
Loading

0 comments on commit 175ae70

Please sign in to comment.