Added basic toderp

This commit is contained in:
Max Lynch
2013-09-01 17:00:05 -05:00
parent 69fb09316a
commit 66979e11fe
14 changed files with 244 additions and 43 deletions

View File

@ -11,17 +11,17 @@
<script src="/vendor/angular/1.2.0rc1/angular-1.2.0rc1.min.js"></script>
<script src="/vendor/angular/1.2.0rc1/angular-touch.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="peopleApp">
<header class="bar bar-header bar-dark">
<h1 class="title">Customers</h1>
</header>
<main ng-controller="CustomersCtrl">
<div ng-view class="pane reveal-animation"></div>
</main>
<script src="../../js/ionic-list.js"></script>
<script src="../../js/controllers/ionic-leftrightmenu.js"></script>
<script src="menu.js"></script>
</head>
<body ng-app="ionic.menu">
<ionic-left-right-menu>
<ionic-menu side="left">
</ionic-menu>
<ionic-menu side="right">
</ionic-menu>
</ionic-left-right-menu>
</body>
</html>

39
example/angular/menu.js vendored Normal file
View File

@ -0,0 +1,39 @@
angular.module('ionic.menu', [])
.controller('LeftRightMenuController', ['$scope', '$element',
function LeftRightMenuCtrl($scope, $element) {
var ctrl = ion.controllers.LeftRightMenuViewController;
}])
.directive('ionicLeftRightMenu', function() {
return {
restrict: 'EA',
scope: true,
transclude: true,
controller: 'LeftRightMenuController',
compile: function(elm, attrs, transclude) {
return function(scope, element, attrs, menuCtrl) {
console.log('Compile');
};
},
link: function(scope) {
console.log('link');
}
}
})
.directive('ionicMenu', function() {
return {
restrict: 'EA',
controller: '',
compile: function(elm, attrs, transclude) {
return function(scope, element, attrs, menuCtrl) {
console.log('Compile');
};
},
link: function(scope) {
console.log('link');
}
}
});

0
example/angular/panel.js vendored Normal file
View File

View File

@ -0,0 +1,5 @@
describe('Menu directive', function() {
it('Adds a menu class to the panel element', function() {
});
});

View File

@ -22,7 +22,7 @@
</main>
<footer class="bar bar-tabs bar-footer bar-success">
<nav class="tabs">
<nav id="tab-bar" class="tabs">
<ul class="tabs-inner">
<li class="tab-item">
<a href="#">
@ -54,5 +54,16 @@
</section>
<script src="../../js/ionic-events.js"></script>
<script src="../../js/ionic-gestures.js"></script>
<script src="../../js/controllers/ionic-tabcontroller.js"></script>
<script>
// Grab the sections
var tab = document.getElementById('tab-bar');
var controller = new ion.controllers.TabController({
tab: tab
});
</script>
</body>
</html>

0
example/toderp/app.css Normal file
View File

43
example/toderp/app.js Normal file
View File

@ -0,0 +1,43 @@
angular.module('toderp', [])
.factory('TaskListService', function() {
return {
tasks: [
{ text: 'Do this thing', created: new Date() }
],
todaysTasks: [
{ text: 'Do this thing', created: new Date() }
],
addTask: function(task) {
this.tasks.push(task);
},
deleteTask: function($index) {
this.tasks.splice($index, 1);
}
};
})
.controller('TodaysTaskListCtrl', ['$scope', 'TaskListService', function($scope, TaskListService) {
$scope.todaysTasks = TaskListService.todaysTasks;
}])
.controller('TaskListCtrl', ['$scope', 'TaskListService', function($scope, TaskListService) {
$scope.tasks = TaskListService.tasks;
}])
.controller('TasksCtrl', ['$scope', function($scope) {
}]);
var page = document.getElementById('page');
var leftPanel = document.getElementById('tasks-menu');
var controller = new ion.controllers.LeftRightMenuViewController({
isRightEnabled: false,
center: page,
left: leftPanel,
leftWidth: 270,
animateClass: 'menu-animated'
});
window.ion.onGesture('tap', function(e) {
controller.toggleLeft();
}, document.getElementById('menu-button'));

56
example/toderp/index.html Normal file
View File

@ -0,0 +1,56 @@
<html>
<head>
<meta charset="utf-8">
<title>ToDerp</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="../../dist/ionic.css">
<link rel="stylesheet" href="app.css">
<script src="/vendor/angular/1.2.0rc1/angular-1.2.0rc1.min.js"></script>
<script src="/vendor/angular/1.2.0rc1/angular-touch.js"></script>
<script src="../../js/ionic-list.js"></script>
<script src="../../js/ionic-events.js"></script>
<script src="../../js/ionic-gestures.js"></script>
<script src="../../js/controllers/ionic-leftrightmenu.js"></script>
</head>
<body ng-app="toderp">
<div id="page" class="page">
<div class="bar bar-header bar-dark">
<div class="buttons">
<a id="menu-button" class="button button-dark" href="#">
<i class="icon-reorder"></i>
</a>
</div>
<h1 class="title">Today's Tasks</h1>
<div class="buttons">
<button id="right-button" class="button button-dark">
<i class="icon-plus"></i>
</button>
</div>
</div>
<div class="content has-header">
<ul class="list todays-tasks" ng-controller="TodaysTaskListCtrl">
<li class="list-item" ng-repeat="task in todaysTasks">
{{task.text}}
</li>
</ul>
</div>
</div>
<div id="tasks-menu" class="menu menu-left" ng-controller="TaskListCtrl">
<ul class="list">
<li class="list-divider">Tasks</li>
<li class="list-item" ng-repeat="task in tasks">
<a href="#">{{task.text}}</a>
</li>
</ul>
</div>
<div class="menu menu-right">
</div>
<script src="app.js"></script>
</body>
</html>