Cleaned up examples folder
71
examples/demos/toderp2/css/app.css
Normal file
@@ -0,0 +1,71 @@
|
||||
.view {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.ionic-logo {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -128px;
|
||||
margin-left: -128px;
|
||||
width: 256px;
|
||||
}
|
||||
.toderp-logo {
|
||||
background: url('../img/toderp-logo.svg') no-repeat transparent;
|
||||
background-size: contain;
|
||||
width: 250px;
|
||||
height: 100px;
|
||||
margin: 40px auto;
|
||||
}
|
||||
.toderp-small-logo {
|
||||
background: url('../img/logo-header.png') no-repeat transparent;
|
||||
background-size: 76px 21px;
|
||||
background-position: 50%;
|
||||
box-flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
}
|
||||
#splash-view {
|
||||
opacity: 1;
|
||||
}
|
||||
#splash-view .ionic-logo {
|
||||
}
|
||||
|
||||
#splash-view, #signup-view {
|
||||
background: url('../img/splash.png') no-repeat transparent;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
#signup-bottom {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
#signup-bottom .button {
|
||||
color: #4a87ee;
|
||||
}
|
||||
|
||||
/* Tasks view */
|
||||
|
||||
#task-list {
|
||||
}
|
||||
#task-list .completed {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
||||
#signup-view {
|
||||
background: url('../img/splash@2x.png') no-repeat transparent;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.toderp-small-logo {
|
||||
background-image: url('../img/logo-header@2x.png');
|
||||
background-size: 76px 21px;
|
||||
}
|
||||
}
|
||||
BIN
examples/demos/toderp2/img/ionic.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
examples/demos/toderp2/img/logo-header.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
examples/demos/toderp2/img/logo-header@2x.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/demos/toderp2/img/logo.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
examples/demos/toderp2/img/logo@2x.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
examples/demos/toderp2/img/splash.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
examples/demos/toderp2/img/splash@2x.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
162
examples/demos/toderp2/img/toderp-logo.svg
Normal file
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="490.7px" height="194.7px" viewBox="0 0 490.7 194.7" style="enable-background:new 0 0 490.7 194.7;" xml:space="preserve"
|
||||
>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
.st0{fill:#4A87EE;}
|
||||
.st1{fill:#666666;}
|
||||
]]>
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st1" d="M25.7,181.7L25.7,181.7l6.9-23.3h3.3l6.8,23.3h0.1l6.6-23.3h2.9l-8,27.1h-3.2l-6.8-23.3h-0.1l-6.8,23.3h-3.2
|
||||
l-8-27.1H19L25.7,181.7z"/>
|
||||
<path class="st1" d="M58.3,170.5c0.5-1,1.3-1.9,2.4-2.5c1.1-0.6,2.3-0.9,3.6-0.9c2.3,0,4,0.7,5.1,2c1.1,1.4,1.7,3.1,1.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3c0.7,0.6,1.2,1.3,1.6,2.1c0.4,0.8,0.6,1.8,0.6,2.9
|
||||
c0,0.8-0.1,1.5-0.3,2.1s-0.4,1.2-0.7,1.6c-0.3,0.5-0.7,0.9-1.1,1.3c-0.4,0.4-0.9,0.8-1.4,1.2c-0.5,0.4-1,0.8-1.4,1.2
|
||||
s-0.7,0.7-0.9,1.1c-0.2,0.4-0.4,0.8-0.5,1.3c-0.1,0.5-0.2,1.1-0.2,1.8V178.2z M469.1,183.7c0,0.5-0.2,1-0.6,1.4
|
||||
c-0.4,0.4-0.9,0.6-1.5,0.6c-0.6,0-1.1-0.2-1.5-0.6c-0.4-0.4-0.6-0.9-0.6-1.4c0-0.5,0.2-1,0.6-1.4c0.4-0.4,0.9-0.6,1.5-0.6
|
||||
c0.6,0,1.1,0.2,1.5,0.6C468.9,182.7,469.1,183.1,469.1,183.7z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M55.9,22v84.7H30.2V22H0V0h86.1v22H55.9z"/>
|
||||
<path class="st0" d="M225.7,106.7v-9.8h-0.3c-2.4,3.8-5.9,6.8-10.3,8.8c-4.5,2.1-9.2,3.1-14.2,3.1c-5.6,0-10.7-1.1-15.1-3.3
|
||||
c-4.4-2.2-8.2-5.2-11.2-8.8c-3.1-3.7-5.4-7.9-7-12.7c-1.6-4.8-2.4-9.9-2.4-15.1s0.8-10.2,2.5-15c1.7-4.8,4-9,7.1-12.6
|
||||
c3.1-3.6,6.8-6.5,11.2-8.6s9.3-3.2,14.7-3.2c5.5,0,10.2,1.1,14,3.2c3.8,2.1,6.8,4.4,8.9,6.9h0.3V-0.2h24.7v107H225.7z
|
||||
M224.8,69.1c0-2.4-0.4-4.8-1.3-7.1c-0.9-2.3-2.1-4.4-3.6-6.2c-1.6-1.8-3.4-3.3-5.7-4.4c-2.2-1.1-4.7-1.7-7.5-1.7
|
||||
c-2.9,0-5.5,0.6-7.7,1.7c-2.2,1.1-4.1,2.5-5.6,4.3c-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
||||
<g>
|
||||
<path class="st0" d="M115.7,29.3c-22,0-39.9,17.9-39.9,39.9c0,22,17.9,39.9,39.9,39.9c22,0,39.9-17.9,39.9-39.9
|
||||
C155.6,47.2,137.8,29.3,115.7,29.3z M108.5,85.9c-0.6,0.5-1.3,1-2,1c-0.7,0-1.5-0.5-2-1L91.8,73.2l4-4l10.7,10.7l28.3-28.5l4,4.1
|
||||
L108.5,85.9z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 16 KiB |
174
examples/demos/toderp2/index.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<html ng-app="ionic.todo">
|
||||
<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/css/ionic.css">
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-mocks.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-touch.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-route.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-animate.js"></script>
|
||||
|
||||
<script src='https://cdn.firebase.com/v0/firebase.js'></script>
|
||||
<script src="https://cdn.firebase.com/v0/firebase-simple-login.js"></script>
|
||||
<script src='https://cdn.firebase.com/libs/angularfire/0.3.0/angularfire.min.js'></script>
|
||||
|
||||
<script src="../../dist/js/ionic.js"></script>
|
||||
<script src="../../dist/js/ionic-angular.js"></script>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/filters.js"></script>
|
||||
<script src="js/services.js"></script>
|
||||
<script src="js/controllers.js"></script>
|
||||
<style>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- The root view controller -->
|
||||
<navs ng-controller="TodoCtrl">
|
||||
<nav-bar></nav-bar>
|
||||
<content has-header="true"></content>
|
||||
</navs>
|
||||
|
||||
<!-- Splash -->
|
||||
<script id="splash.html" type="text/ng-template">
|
||||
<div id="splash-view" class="view fade-in" nav-content nav-bar="false">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Signup -->
|
||||
<script id="signup.html" type="text/ng-template">
|
||||
<div title="Sign up" id="signup-view" class="view" nav-content ng-controller="SignupCtrl">
|
||||
<main class="content">
|
||||
<form class="form-horizontal" ng-submit="trySignup(signupForm)">
|
||||
<div class="container" style="text-align: center">
|
||||
<div class="toderp-logo"></div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label class="input-row">
|
||||
<span class="input-label">Full name</span>
|
||||
<input type="text" placeholder="" ng-model="signupForm.name" required>
|
||||
</label>
|
||||
<label class="input-row">
|
||||
<span class="input-label">Email</span>
|
||||
<input type="email" placeholder="" ng-model="signupForm.email" required>
|
||||
</label>
|
||||
<label class="input-row">
|
||||
<span class="input-label">Password</span>
|
||||
<input type="password" placeholder="" ng-model="signupForm.password" required>
|
||||
</label>
|
||||
</div>
|
||||
<div class="margin">
|
||||
<button type="submit" class="button button-primary button-block">Get derp'n</button>
|
||||
<div id="signup-error" ng-show="signupError">Unable to signup, please try again.</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="signup-bottom">
|
||||
<h3>Already have an account?</h3>
|
||||
<button ng-click="showLogin()" class="button button-clear button-block">Sign in</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Login -->
|
||||
<script id="login.html" type="text/ng-template">
|
||||
<div id="login-view" class="modal slide-in-up" ng-controller="LoginCtrl">
|
||||
<header class="bar bar-header bar-secondary">
|
||||
<h1 class="title">Log in</h1>
|
||||
<button class="button button-clear button-primary" ng-click="close()">Cancel</button>
|
||||
</header>
|
||||
<main class="content padding has-header">
|
||||
<form class="form-horizontal" ng-submit="tryLogin(loginForm)">
|
||||
<div class="input-group margin">
|
||||
<label class="input-row">
|
||||
<span class="input-label col-xs-4">Email</span>
|
||||
<input type="email" placeholder="" ng-model="loginForm.email">
|
||||
</label>
|
||||
<label class="input-row">
|
||||
<span class="input-label col-xs-4">Password</span>
|
||||
<input type="password" placeholder="" ng-model="loginForm.password">
|
||||
</label>
|
||||
</div>
|
||||
<div class="margin">
|
||||
<button class="button button-primary button-block">Log in</button>
|
||||
<div id="login-error" ng-show="loginError">Invalid email/password. Please try again.</div>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Tasks -->
|
||||
<script id="tasks.html" type="text/ng-template">
|
||||
<div class="view" side-menu-ctrl id="tasks-view" nav-content class="view" ng-controller="TasksCtrl" nav-bar="false">
|
||||
<pane side-menu-content>
|
||||
<header class="bar bar-header bar-secondary">
|
||||
<a href="#" class="button button-icon"><i class="icon-navicon"></i></a>
|
||||
<h1 class="title">{{activeProject.title}}</h1>
|
||||
<button class="button button-clear button-primary">Edit</button>
|
||||
</header>
|
||||
<div class="content has-header">
|
||||
<form ng-submit="addTask(newTask)">
|
||||
<input type="text" ng-model="newTask.title" placeholder="Add an item...">
|
||||
</form>
|
||||
<list id="task-list">
|
||||
<li class="list-item" ng-repeat="task in activeProject.tasks" ng-class="{completed: task.isCompleted}">
|
||||
<input type="text" ng-model="task.title">
|
||||
</li>
|
||||
</list>
|
||||
</div>
|
||||
</pane>
|
||||
|
||||
<!-- The projects side menu -->
|
||||
<menu side="left">
|
||||
<header class="bar bar-header bar-secondary">
|
||||
<button class="button button-clear button-primary" ng-click="toggleProjectEditing()">Edit</button>
|
||||
<div class="toderp-small-logo"></div>
|
||||
<button class="button button-icon" ng-click="showSettings()"><i class="icon-gear-a"></i></button>
|
||||
</header>
|
||||
|
||||
<content has-header="true">
|
||||
<form ng-submit="addProject(newProject)">
|
||||
<input type="text" ng-model="newProject.title" placeholder="Create a new list...">
|
||||
</form>
|
||||
<list-simple is-editing="isEditingProjects">
|
||||
<list-item ng-class="{active: project.$id == activeProject.project.name()}"
|
||||
ng-repeat="project in projects"
|
||||
on-delete="deleteProject(project)"
|
||||
on-select="selectProject(project)">
|
||||
{{project.title}}
|
||||
</list-item>
|
||||
</list-simple>
|
||||
</content>
|
||||
</menu>
|
||||
</side-menu-ctrl>
|
||||
</script>
|
||||
|
||||
<script id="settings.html" type="text/ng-template">
|
||||
<div id="settings-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 padding has-header">
|
||||
<list header="GENERAL">
|
||||
<list-item>Account details <i class="icon-chevron-right"></i></list-item>
|
||||
<list-item>Account details <toggle ng-model="settings.isSmallText"></toggle></i></list-item>
|
||||
</list>
|
||||
<list header="ACCOUNT">
|
||||
<list-item ng-click="logout()">Log out</list-item>
|
||||
</list>
|
||||
</main>
|
||||
</div>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
16
examples/demos/toderp2/js/app.js
Normal file
@@ -0,0 +1,16 @@
|
||||
angular.module('ionic.todo', [
|
||||
'ionic.todo.filters',
|
||||
'ionic.todo.services',
|
||||
'ionic.todo.controllers',
|
||||
|
||||
'ionic.service.modal',
|
||||
'ionic.service.actionSheet',
|
||||
|
||||
'ionic.ui',
|
||||
|
||||
'firebase',
|
||||
'ngRoute',
|
||||
'ngAnimate'])
|
||||
|
||||
// Our Firebase URL
|
||||
.constant('FIREBASE_URL', 'https://ionic-todo-demo.firebaseio.com/todo');
|
||||
224
examples/demos/toderp2/js/controllers.js
Normal file
@@ -0,0 +1,224 @@
|
||||
angular.module('ionic.todo.controllers', ['ionic.todo'])
|
||||
|
||||
// The main controller for the application
|
||||
.controller('TodoCtrl', function($scope, $rootScope, AuthService) {
|
||||
$scope.candy = 'yes';
|
||||
|
||||
$scope.navController.pushFromTemplate('splash.html');
|
||||
|
||||
$rootScope.$on('angularFireAuth:login', function(evt, user) {
|
||||
$scope.navController.pushFromTemplate('tasks.html');
|
||||
});
|
||||
$rootScope.$on('angularFireAuth:logout', function(evt, user) {
|
||||
$scope.navController.pushFromTemplate('signup.html');
|
||||
});
|
||||
$rootScope.$on('angularFireAuth:error', function(evt, err) {
|
||||
$scope.navController.pushFromTemplate('signup.html');
|
||||
});
|
||||
})
|
||||
|
||||
.controller('SplashCtrl', function($scope) {
|
||||
})
|
||||
|
||||
// The login form controller
|
||||
.controller('LoginCtrl', function($scope, $rootScope, AuthService) {
|
||||
console.log('Created login Ctrl');
|
||||
|
||||
$scope.loginForm = {
|
||||
email: 'ihasmax@gmail.com',
|
||||
password: 'traintown'
|
||||
};
|
||||
|
||||
$scope.close = function() {
|
||||
$scope.modal.hide();
|
||||
};
|
||||
|
||||
$scope.tryLogin = function(data) {
|
||||
$scope.loginError = false;
|
||||
AuthService.login(data.email, data.password)
|
||||
.then(function(e) {
|
||||
$scope.loginError = false;
|
||||
}, function(e) {
|
||||
$scope.loginError = true;
|
||||
});
|
||||
};
|
||||
|
||||
$rootScope.$on('angularFireAuth:login', function(evt, user) {
|
||||
$scope.modal.hide();
|
||||
});
|
||||
})
|
||||
|
||||
// The signup form controller
|
||||
.controller('SignupCtrl', function($scope, AuthService, Modal, ActionSheet) {
|
||||
$scope.signupForm = {};
|
||||
|
||||
Modal.fromTemplateUrl('login.html', function(modal) {
|
||||
$scope.loginModal = modal;
|
||||
});
|
||||
|
||||
$scope.trySignup = function(data) {
|
||||
AuthService.signup(data.email, data.password);
|
||||
};
|
||||
|
||||
$scope.showLogin = function() {
|
||||
$scope.loginModal && $scope.loginModal.show();
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
// The tasks controller (main app controller)
|
||||
.controller('TasksCtrl', function($scope, angularFire, angularFireCollection, Modal, ActionSheet, FIREBASE_URL) {
|
||||
/*
|
||||
var lastProjectRef = new Firebase(FIREBASE_URL + '/lastproject');
|
||||
var lastProjectPromise = angularFire(lastProjectRef, $scope, 'lastProject');
|
||||
$scope.lastProject = null;
|
||||
*/
|
||||
|
||||
$scope.isEditingProjects = false;
|
||||
|
||||
// Load our settings modal
|
||||
Modal.fromTemplateUrl('settings.html', function(modal) {
|
||||
$scope.settingsModal = modal;
|
||||
});
|
||||
|
||||
$scope.newProject = {};
|
||||
|
||||
$scope.newTask = {};
|
||||
|
||||
$scope.showSettings = function() {
|
||||
$scope.settingsModal && $scope.settingsModal.show();
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a new tasks to the current project.
|
||||
*/
|
||||
$scope.addTask = function(task) {
|
||||
if(!$scope.activeProject) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scope.activeProject.tasks) {
|
||||
$scope.activeProject.tasks = [];
|
||||
}
|
||||
var task = $scope.activeProject.tasks.add({
|
||||
title: task.title,
|
||||
user_id: $scope.user.id,
|
||||
isCompleted: false
|
||||
});
|
||||
|
||||
task.setPriority(-(+new Date));
|
||||
|
||||
// Set the priorty for this project to the new date, so it will
|
||||
// sort higher
|
||||
//$scope.activeProject.project.setPriority(-(+new Date));
|
||||
|
||||
$scope.newTask = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the current project
|
||||
*/
|
||||
$scope.setActiveProject = function(project) {
|
||||
// Grab the ref. It's the object on new project, and the $ref
|
||||
// object on exist (for example, from the ng-repeat)
|
||||
var ref = project;
|
||||
if(project.$ref) {
|
||||
ref = project.$ref;
|
||||
}
|
||||
$scope.activeProject = {
|
||||
project: ref,
|
||||
title: project.title,
|
||||
tasks: angularFireCollection(ref.child('tasks').limit(100))
|
||||
};
|
||||
};
|
||||
|
||||
$scope.selectProject = function(project) {
|
||||
$scope.setActiveProject(project);
|
||||
$scope.sideMenuCtrl.close();
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a project to the projects list.
|
||||
*/
|
||||
$scope.addProject = function(newProject) {
|
||||
var p = {
|
||||
title: newProject.title,
|
||||
user_id: $scope.user.id,
|
||||
tasks: [],
|
||||
};
|
||||
|
||||
console.log("Adding project:", p);
|
||||
|
||||
|
||||
// Reset the form
|
||||
$scope.newProject = {};
|
||||
|
||||
var np = $scope.projects.add(p);
|
||||
//np.setPriority(-(+new Date));
|
||||
$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();
|
||||
};
|
||||
|
||||
$scope.deleteProject = function(project) {
|
||||
var ref = project;
|
||||
|
||||
ActionSheet.show({
|
||||
buttons: [],
|
||||
destructiveText: 'Delete Project',
|
||||
cancelText: 'Cancel',
|
||||
cancel: function() {
|
||||
return true;
|
||||
},
|
||||
destructiveButtonClicked: function() {
|
||||
if(project.$ref) {
|
||||
ref = project.$ref;
|
||||
}
|
||||
ref.remove();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.toggleProjectEditing = function() {
|
||||
$scope.isEditingProjects = !$scope.isEditingProjects;
|
||||
};
|
||||
|
||||
var projectsRef = new Firebase(FIREBASE_URL + '/project_list');
|
||||
$scope.projects = angularFireCollection(projectsRef.limit(100), function(snapshot) {
|
||||
if(!snapshot.val()) {
|
||||
var title = prompt('Create your first list:');
|
||||
if(title) {
|
||||
$scope.addProject({
|
||||
title: title
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listen for the first child added so we can set it as the active project
|
||||
projectsRef.once('child_added', function(snapshot, prevChildName) {
|
||||
$scope.setActiveProject(
|
||||
angular.extend({
|
||||
'$ref': snapshot.ref(),
|
||||
}, snapshot.val())
|
||||
)
|
||||
});
|
||||
projectsRef.on('child_added', function(snapshot, prevChildName) {
|
||||
console.log('CHILD ADDED', snapshot.val());
|
||||
});
|
||||
})
|
||||
|
||||
.controller('SettingsCtrl', function($scope, AuthService) {
|
||||
$scope.close = function() {
|
||||
$scope.modal.hide();
|
||||
}
|
||||
$scope.logout = function() {
|
||||
AuthService.logout();
|
||||
};
|
||||
})
|
||||
11
examples/demos/toderp2/js/filters.js
Normal file
@@ -0,0 +1,11 @@
|
||||
angular.module('ionic.todo.filters', [])
|
||||
|
||||
.filter('reverse', function() {
|
||||
return function(items) {
|
||||
if(items) {
|
||||
return items.slice().reverse();
|
||||
}
|
||||
return [];
|
||||
};
|
||||
});
|
||||
|
||||
49
examples/demos/toderp2/js/services.js
Normal file
@@ -0,0 +1,49 @@
|
||||
angular.module('ionic.todo.services', ['ionic.todo', 'firebase'])
|
||||
|
||||
// The AuthService handles user authentication with Firebase.
|
||||
.factory('AuthService', function(angularFireAuth, $rootScope, FIREBASE_URL) {
|
||||
|
||||
// Initialize the angularFireAuth service.
|
||||
var ref = new Firebase(FIREBASE_URL);
|
||||
angularFireAuth.initialize(ref, {
|
||||
scope: $rootScope,
|
||||
callback: function(user, err) {
|
||||
console.log('AUTH CHANGED', err, user);
|
||||
},
|
||||
name: 'user'
|
||||
});
|
||||
|
||||
return {
|
||||
// Try to log in with the given email and pass
|
||||
login: function(email, password) {
|
||||
if(!email || !password) {
|
||||
return;
|
||||
}
|
||||
console.log('Logging in', email, password);
|
||||
|
||||
return angularFireAuth.login('password', {
|
||||
email: email,
|
||||
password: password
|
||||
});
|
||||
},
|
||||
|
||||
logout: function() {
|
||||
angularFireAuth.logout();
|
||||
},
|
||||
|
||||
// Try to sign up with the given email and pass
|
||||
signup: function(email, password) {
|
||||
if(!email || !password) {
|
||||
return;
|
||||
}
|
||||
console.log('Signing up', name, email, password);
|
||||
|
||||
angularFireAuth.createUser(email, password, function(err, user) {
|
||||
if(err && err.code == "EMAIL_TAKEN") {
|
||||
alert('That email is already taken');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
73
examples/starters/map/index.html
Normal file
@@ -0,0 +1,73 @@
|
||||
<html ng-app="ionic.example">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Map</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="stylesheet" href="/dist/css/ionic.css">
|
||||
<style>
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="/vendor/angular/angular-1.2.0rc2.min.js"></script>
|
||||
<script src="/vendor/angular/angular-touch.js"></script>
|
||||
<script src="/vendor/angular/angular-animate.js"></script>
|
||||
<script src="/dist/js/ionic.js"></script>
|
||||
<script src="/dist/js/ionic-angular.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB16sGmIekuGIvYOfNoW9T44377IU2d2Es&sensor=true"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
</head>
|
||||
<body ng-controller="MapCtrl">
|
||||
<div class="bar bar-header bar-dark">
|
||||
<h1 class="title">Map</h1>
|
||||
</div>
|
||||
<content has-header="true" has-footer="true">
|
||||
<div id="map"></div>
|
||||
</content>
|
||||
<div class="bar bar-footer bar-dark">
|
||||
<button ng-click="centerOnMe()" class="button button-icon"><i class="icon-ios7-navigate"></i></button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
angular.module('ionic.example', ['ionic.ui.content', 'ionic.ui.list', 'ionic.service.loading'])
|
||||
|
||||
.controller('MapCtrl', function($scope, Loading) {
|
||||
function initialize() {
|
||||
var mapOptions = {
|
||||
center: new google.maps.LatLng(43.07493,-89.381388),
|
||||
zoom: 16,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"),
|
||||
mapOptions);
|
||||
$scope.map = map;
|
||||
}
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
$scope.centerOnMe = function() {
|
||||
if(!$scope.map) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loading = Loading.show({
|
||||
content: 'Getting current location...',
|
||||
showBackdrop: false
|
||||
});
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(pos) {
|
||||
$scope.map.setCenter(new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude));
|
||||
$scope.loading.hide();
|
||||
}, function(error) {
|
||||
alert('Unable to get location: ' + error.message);
|
||||
});
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
BIN
examples/starters/profile/bg.jpg
Normal file
|
After Width: | Height: | Size: 193 KiB |
187
examples/starters/profile/index.html
Normal file
@@ -0,0 +1,187 @@
|
||||
<html ng-app="ionic.example">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Profile</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="stylesheet" href="/dist/css/ionic.css">
|
||||
<script src="/vendor/angular/angular-1.2.0rc2.min.js"></script>
|
||||
<script src="/vendor/angular/angular-touch.js"></script>
|
||||
<script src="/vendor/angular/angular-animate.js"></script>
|
||||
<script src="/dist/js/ionic.js"></script>
|
||||
<script src="/dist/js/ionic-angular.js"></script>
|
||||
<style>
|
||||
#profile-bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 44px;
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
|
||||
background: url('bg.jpg') no-repeat transparent;
|
||||
background-size: 100%;
|
||||
background-position: 50% 20%;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#content {
|
||||
position: relative;
|
||||
margin-top: 150px;
|
||||
background-color: white;
|
||||
box-shadow: 0px -1px 10px rgba(0,0,0,0.4);
|
||||
padding-top: 200px;
|
||||
}
|
||||
|
||||
#profile-info {
|
||||
position: absolute;
|
||||
top: -95px;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
}
|
||||
#profile-name {
|
||||
color: #444;
|
||||
font-size: 26px;
|
||||
}
|
||||
#profile-description {
|
||||
font-size: 15px;
|
||||
color: #888;
|
||||
}
|
||||
#profile-description a {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
#profile-image {
|
||||
display: block;
|
||||
border-radius: 100px;
|
||||
border: 1px solid #fff;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
margin: 30px auto 0;
|
||||
box-shadow: 0px 0px 4px rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
.list-item-content {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.post {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.post-time {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
font-size: 11px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.post-profile-image {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.post-options {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body ng-controller="ProfileCtrl">
|
||||
<div class="bar bar-header bar-danger">
|
||||
<button class="button button-icon"><i class="icon-person-add"></i></button>
|
||||
<h1 class="title">Me</h1>
|
||||
<button class="button button-icon"><i class="icon-gear-b"></i></button>
|
||||
</div>
|
||||
<content has-header="true">
|
||||
<div id="profile-bg">
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="profile-info">
|
||||
<img id="profile-image" src="me.png">
|
||||
<h3 id="profile-name">Max</h3>
|
||||
<span id="profile-description">Co-creator of <a href="http://twitter.com/ionicframework">@ionicframework</a>, founder of
|
||||
<a href="http://twitter.com/driftyco">@driftyco</a></span>
|
||||
</div>
|
||||
<list>
|
||||
<list-item ng-repeat="post in posts">
|
||||
<img class="post-profile-image" src="me.png">
|
||||
{{post.text}}
|
||||
<div class="post-time">{{post.created_at | relativets }}</div>
|
||||
<div class="post-options">
|
||||
<i class="icon-reply"></i>
|
||||
<i class="icon-shuffle"></i>
|
||||
</div>
|
||||
</list-item>
|
||||
</list>
|
||||
</div>
|
||||
</content>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
angular.module('ionic.example', ['ionic.ui.content', 'ionic.ui.list'])
|
||||
|
||||
// A simple relative timestamp filter
|
||||
.filter('relativets', function() {
|
||||
return function(value) {
|
||||
var now = new Date();
|
||||
var diff = now - value;
|
||||
|
||||
// ms units
|
||||
var second = 1000;
|
||||
var minute = second * 60;
|
||||
var hour = minute * 60;
|
||||
var day = hour * 24;
|
||||
var year = day * 365;
|
||||
var month = day * 30;
|
||||
|
||||
var unit = day;
|
||||
var unitStr = 'd';
|
||||
if(diff > year) {
|
||||
unit = year;
|
||||
unitStr = 'y';
|
||||
} else if(diff > day) {
|
||||
unit = day;
|
||||
unitStr = 'd';
|
||||
} else if(diff > hour) {
|
||||
unit = hour;
|
||||
unitStr = 'h';
|
||||
} else if(diff > minute) {
|
||||
unit = minute;
|
||||
unitStr = 'm';
|
||||
} else {
|
||||
unit = second;
|
||||
unitStr = 's';
|
||||
}
|
||||
|
||||
var amt = Math.ceil(diff / unit);
|
||||
return amt + '' + unitStr;
|
||||
}
|
||||
})
|
||||
|
||||
.controller('ProfileCtrl', function($scope) {
|
||||
$scope.posts = [];
|
||||
|
||||
for(var i = 0; i < 100; i++) {
|
||||
// Fake a date
|
||||
var date = (+new Date) - (i * 1000 * 60 * 60);
|
||||
$scope.posts.push({
|
||||
created_at: date,
|
||||
text: 'Doing a bit of ' + ((Math.floor(Math.random() * 2) === 1) ? 'that' : 'this')
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
BIN
examples/starters/profile/me.jpg
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
examples/starters/profile/me.png
Normal file
|
After Width: | Height: | Size: 403 KiB |
33
examples/starters/tabs/index.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<html ng-app="ionic.example">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Tabs</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="stylesheet" href="/dist/css/ionic.css">
|
||||
<script src="/vendor/angular/angular-1.2.0rc2.min.js"></script>
|
||||
<script src="/vendor/angular/angular-touch.js"></script>
|
||||
<script src="/vendor/angular/angular-animate.js"></script>
|
||||
<script src="/dist/js/ionic.js"></script>
|
||||
<script src="/dist/js/ionic-angular.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<tabs>
|
||||
<tab title="Home" icon-on="icon-ios7-filing" icon-off="icon-ios7-filing-outline">
|
||||
<h1>Home</h1>
|
||||
</tab>
|
||||
<tab title="Friends" icon-on="icon-ios7-clock" icon-off="icon-ios7-clock-outline">
|
||||
<h1>Friends</h1>
|
||||
</tab>
|
||||
|
||||
<tab title="Settings" icon-on="icon-ios7-gear" icon-off="icon-ios7-gear-outline">
|
||||
<h1>Settings</h1>
|
||||
</tab>
|
||||
</tabs>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
angular.module('ionic.example', ['ionic.ui.content', 'ionic.ui.tabs'])
|
||||
</script>
|
||||
</html>
|
||||
80
examples/starters/weather/app.js
Normal file
@@ -0,0 +1,80 @@
|
||||
angular.module('ionic.weather', ['ionic.weather.services', 'ionic.weather.directives'])
|
||||
|
||||
.constant('WUNDERGROUND_API_KEY', '1cc2d3de40fa5af0')
|
||||
|
||||
.constant('FLICKR_API_KEY', '504fd7414f6275eb5b657ddbfba80a2c')
|
||||
|
||||
.filter('int', function() {
|
||||
return function(v) {
|
||||
return parseInt(v) || '';
|
||||
};
|
||||
})
|
||||
|
||||
.controller('WeatherCtrl', function($scope, $timeout, Weather, Geo, Flickr) {
|
||||
var _this = this;
|
||||
|
||||
$scope.activeBgImageIndex = 0;
|
||||
|
||||
$scope.getActiveBackgroundImage = function() {
|
||||
if($scope.activeBgImage) {
|
||||
var item = $scope.activeBgImage;
|
||||
var url = "http://farm"+ item.farm +".static.flickr.com/"+ item.server +"/"+ item.id +"_"+ item.secret +"_z.jpg";
|
||||
return {
|
||||
'background-image': 'url(' + url + ')'
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
this.getBackgroundImage = function(lat, lng) {
|
||||
Flickr.search('Madison, Wisconsin', lat, lng).then(function(resp) {
|
||||
var photos = resp.photos;
|
||||
if(photos.photo.length) {
|
||||
$scope.bgImages = photos.photo;
|
||||
_this.cycleBgImages();
|
||||
}
|
||||
}, function(error) {
|
||||
console.error('Unable to get Flickr images', error);
|
||||
});
|
||||
};
|
||||
|
||||
this.getForecast = function(lat, lng) {
|
||||
Weather.getForecast(lat, lng).then(function(resp) {
|
||||
console.log('Forecast', resp);
|
||||
$scope.forecast = resp.forecast.simpleforecast;
|
||||
}, function(error) {
|
||||
alert('Unable to get forecast');
|
||||
console.error(error);
|
||||
});
|
||||
};
|
||||
|
||||
this.getCurrent = function(lat, lng) {
|
||||
Weather.getAtLocation(lat, lng).then(function(resp) {
|
||||
$scope.current = resp.current_observation;
|
||||
_this.getForecast(resp.location.lat, resp.location.lon);
|
||||
}, function(error) {
|
||||
alert('Unable to get current conditions');
|
||||
console.error(error);
|
||||
});
|
||||
};
|
||||
|
||||
this.cycleBgImages = function() {
|
||||
$timeout(function cycle() {
|
||||
if($scope.bgImages) {
|
||||
$scope.activeBgImage = $scope.bgImages[$scope.activeBgImageIndex++ % $scope.bgImages.length];
|
||||
}
|
||||
//$timeout(cycle, 10000);
|
||||
});
|
||||
};
|
||||
|
||||
Geo.getLocation().then(function(position) {
|
||||
console.log('GOT LAT', position);
|
||||
var lat = position.coords.latitude;
|
||||
var lng = position.coords.longitude;
|
||||
|
||||
_this.getBackgroundImage(lat, lng);
|
||||
_this.getCurrent(lat, lng);
|
||||
}, function(error) {
|
||||
alert('Unable to get current location: ' + error);
|
||||
});
|
||||
|
||||
});
|
||||
57
examples/starters/weather/directives.js
Normal file
@@ -0,0 +1,57 @@
|
||||
angular.module('ionic.weather.directives', [])
|
||||
|
||||
.directive('currentTime', function($timeout, $filter) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
template: '<span class="current-time">{{currentTime}}</span>',
|
||||
scope: {
|
||||
localtz: '=',
|
||||
},
|
||||
link: function($scope, $element, $attr) {
|
||||
$timeout(function checkTime() {
|
||||
if($scope.localtz) {
|
||||
$scope.currentTime = $filter('date')(+(new Date), 'h:mm') + $scope.localtz;
|
||||
}
|
||||
$timeout(checkTime, 500);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
.directive('smallWeather', function($timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
template: '<div id="small-weather" ng-transclude></div>',
|
||||
link: function($scope, $element, $attr) {
|
||||
|
||||
// Delay so we are in the DOM and can calculate sizes
|
||||
$timeout(function() {
|
||||
var windowHeight = window.innerHeight;
|
||||
var thisHeight = $element[0].offsetHeight;
|
||||
var headerHeight = document.querySelector('#header').offsetHeight;
|
||||
$element[0].style.marginTop = (windowHeight - thisHeight) + 'px';
|
||||
angular.element(document.querySelector('.content')).css('-webkit-overflow-scrolling', 'auto');
|
||||
$timeout(function() {
|
||||
angular.element(document.querySelector('.content')).css('-webkit-overflow-scrolling', 'touch');
|
||||
}, 50);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
.directive('weatherBox', function($timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
title: '@'
|
||||
},
|
||||
template: '<div class="weather-box"><h4 class="title">{{title}}</h4><div ng-transclude></div></div>',
|
||||
link: function($scope, $element, $attr) {
|
||||
}
|
||||
}
|
||||
})
|
||||
74
examples/starters/weather/index.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<html ng-app="ionic.weather">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Weather</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="stylesheet" href="/dist/css/ionic.css">
|
||||
|
||||
<link rel="stylesheet" href="weather.css">
|
||||
|
||||
<script src="/vendor/angular/angular-1.2.0rc2.min.js"></script>
|
||||
<script src="/vendor/angular/angular-touch.js"></script>
|
||||
<script src="/vendor/angular/angular-animate.js"></script>
|
||||
<script src="/vendor/angular/angular-resource.js"></script>
|
||||
<script src="/dist/js/ionic.js"></script>
|
||||
<script src="/dist/js/ionic-angular.js"></script>
|
||||
|
||||
<script src="services.js"></script>
|
||||
<script src="directives.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</head>
|
||||
<body ng-controller="WeatherCtrl">
|
||||
<div id="bg-image" ng-style="getActiveBackgroundImage()"></div>
|
||||
|
||||
<header id="header" class="bar bar-header bar-clear">
|
||||
<h1 class="title">
|
||||
<span class="city">{{current.display_location.city}}</span><br>
|
||||
<current-time localtz="current.local_tz_short"></current-time>
|
||||
</h1>
|
||||
</header>
|
||||
<div id="scroller" class="scroll padding" style="margin-top:44px">
|
||||
<small-weather>
|
||||
<h5>{{current.weather}}</h5>
|
||||
<h5>H: {{forecast.forecastday[0].high.fahrenheit}} L: {{forecast.forecastday[0].low.fahrenheit}}</h5>
|
||||
<h1 class="current-temp">{{current.temp_f | int}}°</h1>
|
||||
</small-weather>
|
||||
<weather-box title="Forecast" style="height: 400px">
|
||||
</weather-box>
|
||||
<weather-box title="Details" style="height: 400px">
|
||||
</weather-box>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var s = document.getElementById('scroller');
|
||||
var bgImage = document.getElementById('bg-image');
|
||||
var header = document.getElementById('header');
|
||||
|
||||
var scroll = new ionic.views.Scroll({
|
||||
el: s,
|
||||
decelerationRate: 0.87,
|
||||
inertialEventInterval: 100
|
||||
});
|
||||
|
||||
var height = window.innerHeight;
|
||||
s.addEventListener('momentumScrolled', function(e) {
|
||||
setTimeout(function() {
|
||||
var bgAmount = e.detail.scrollTop;
|
||||
//bgImage.style.webkitTransform = 'translate3d(0, ' + -(bgAmount / 20) + 'px, 0)';
|
||||
|
||||
//var blurAmount = Math.min(3, e.detail.scrollTop / 200);
|
||||
|
||||
var brightness = 1;
|
||||
if(e.detail.scrollTop > 200) {
|
||||
var diff = Math.min(600, e.detail.scrollTop - 200);
|
||||
var per = 1 - (diff / 600);
|
||||
brightness = Math.max(0.7, per);
|
||||
}
|
||||
//bgImage.style.webkitFilter = 'brightness(' + brightness + ')';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
BIN
examples/starters/weather/madison1.jpg
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
examples/starters/weather/madison2.jpg
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
examples/starters/weather/madison3.jpg
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
examples/starters/weather/madison4.jpg
Normal file
|
After Width: | Height: | Size: 180 KiB |
102
examples/starters/weather/services.js
Normal file
@@ -0,0 +1,102 @@
|
||||
angular.module('ionic.weather.services', ['ngResource'])
|
||||
|
||||
.factory('Geo', function($q) {
|
||||
return {
|
||||
getLocation: function() {
|
||||
var q = $q.defer();
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
q.resolve(position);
|
||||
}, function(error) {
|
||||
q.reject(error);
|
||||
});
|
||||
|
||||
return q.promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('Flickr', function($q, $resource, FLICKR_API_KEY) {
|
||||
var baseUrl = 'http://api.flickr.com/services/rest/'
|
||||
|
||||
var flickrSearch = $resource(baseUrl, {
|
||||
method: 'flickr.groups.pools.getPhotos',
|
||||
group_id: '1463451@N25',
|
||||
safe_search: 1,
|
||||
jsoncallback: 'JSON_CALLBACK',
|
||||
api_key: FLICKR_API_KEY,
|
||||
format: 'json'
|
||||
}, {
|
||||
get: {
|
||||
method: 'JSONP'
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
search: function(tags, lat, lng) {
|
||||
var q = $q.defer();
|
||||
|
||||
flickrSearch.get({
|
||||
tags: tags,
|
||||
lat: lat,
|
||||
lng: lng
|
||||
}, function(val) {
|
||||
q.resolve(val);
|
||||
}, function(httpResponse) {
|
||||
q.reject(httpResponse);
|
||||
});
|
||||
|
||||
return q.promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('Weather', function($q, $resource, WUNDERGROUND_API_KEY) {
|
||||
var baseUrl = 'http://api.wunderground.com/api/' + WUNDERGROUND_API_KEY;
|
||||
|
||||
var locationResource = $resource(baseUrl + '/geolookup/conditions/q/:coords.json', {
|
||||
callback: 'JSON_CALLBACK'
|
||||
}, {
|
||||
get: {
|
||||
method: 'JSONP'
|
||||
}
|
||||
});
|
||||
|
||||
var forecastResource = $resource(baseUrl + '/forecast/q/:coords.json', {
|
||||
callback: 'JSON_CALLBACK'
|
||||
}, {
|
||||
get: {
|
||||
method: 'JSONP'
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
getForecast: function(lat, lng) {
|
||||
var q = $q.defer();
|
||||
|
||||
forecastResource.get({
|
||||
coords: lat + ',' + lng
|
||||
}, function(resp) {
|
||||
q.resolve(resp);
|
||||
}, function(httpResponse) {
|
||||
q.reject(httpResponse);
|
||||
});
|
||||
|
||||
return q.promise;
|
||||
},
|
||||
|
||||
getAtLocation: function(lat, lng) {
|
||||
var q = $q.defer();
|
||||
|
||||
locationResource.get({
|
||||
coords: lat + ',' + lng
|
||||
}, function(resp) {
|
||||
q.resolve(resp);
|
||||
}, function(error) {
|
||||
q.reject(error);
|
||||
});
|
||||
|
||||
return q.promise;
|
||||
}
|
||||
}
|
||||
})
|
||||
54
examples/starters/weather/weather.css
Normal file
@@ -0,0 +1,54 @@
|
||||
body {
|
||||
}
|
||||
#scroller {
|
||||
}
|
||||
#bg-image {
|
||||
position: fixed;
|
||||
width: 120%;
|
||||
height: 120%;
|
||||
background: url('madison3.jpg') no-repeat transparent;
|
||||
background-size: cover;
|
||||
}
|
||||
h1,h2,h3,h4,h5 {
|
||||
color: #fff;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
#header .title {
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
}
|
||||
#header .title .city {
|
||||
font-size: 16px;
|
||||
}
|
||||
#main-content {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#small-weather {
|
||||
height: 200px;
|
||||
}
|
||||
#small-weather > * {
|
||||
color: #fff;
|
||||
}
|
||||
#small-weather .current-temp {
|
||||
font-size: 100px;
|
||||
font-weight: 100;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
.weather-box {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
padding: 5px;
|
||||
margin: 10px 0px;
|
||||
}
|
||||
|
||||
.weather-box .title {
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding-bottom: 3px;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
BIN
examples/starters/weather/wunderground.png
Normal file
|
After Width: | Height: | Size: 13 KiB |