Skip to content

Instantly share code, notes, and snippets.

View rominirani's full-sized avatar

Romin Irani rominirani

  • Mumbai
View GitHub Profile
@rominirani
rominirani / index.html
Created August 16, 2013 05:19
Episode #8 : FirefoxOS Tutorial : index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0">
<title>Web Activities</title>
<link rel="stylesheet" href="jquery.mobile-1.3.1.min.css" />
<script src="jquery-1.7.1.min.js"></script>
<script src="jquery.mobile-1.3.1.min.js"></script>
@rominirani
rominirani / manifest.webapp
Created August 16, 2013 05:19
Episode #8 : FirefoxOS Tutorial : Web Activities
{
"version":"1.0",
"name": "Web Activities",
"description": "This app demonstrates how to use Web Activities (Intents) in a Firefox OS App.",
"launch_path": "/index.html",
"fullscreen": "false",
"icons": {
"16": "/images/icon_016.png",
"32": "/images/icon_032.png",
"48": "/images/icon_048.png",
@rominirani
rominirani / app.js
Created August 15, 2013 10:56
Episode #7 : Firefox OS Tutorial : IndexedDB - app.js
// variable which will hold the database connection
var db;
function initializeDB() {
if (window.indexedDB) {
console.log("IndexedDB support is there");
}
else {
alert("Indexed DB is not supported. Where are you trying to run this ? ");
}
@rominirani
rominirani / index.html
Created August 15, 2013 10:55
Episode #7 : Firefox OS Tutorial : IndexedDB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0">
<title>Notes</title>
<link rel="stylesheet" href="jquery.mobile-1.3.1.min.css" />
<script src="jquery-1.7.1.min.js"></script>
<script src="jquery.mobile-1.3.1.min.js"></script>
@rominirani
rominirani / manifest.webapp
Created August 15, 2013 10:54
Episode #7 - Firefox Tutorial - manifest.webapp
{
"version":"1.0",
"name": "Notes",
"description": "This app uses the HTML5 Indexed API to demonstrate how to save data in your Firefox OS Apps.",
"launch_path": "/index.html",
"fullscreen": "false",
"icons": {
"16": "/images/icon_016.png",
"32": "/images/icon_032.png",
"48": "/images/icon_048.png",
@rominirani
rominirani / app.js
Created August 1, 2013 03:19
Episode #6 : Firefox OS Tutorial : Storage : app.js
$(document).ready(function(){
$("#btnAddNote").click(function(){
//Change to the add-notes
$.mobile.changePage ($("#add-notes"));
});
$("#btnViewNotes").click(function(){
//Change to the add-notes
$.mobile.changePage ($("#view-notes"));
//Empty the list first
@rominirani
rominirani / index.html
Created August 1, 2013 03:18
Episode #6 : Firefox OS Tutorial : Storage : index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Notes</title>
<link rel="stylesheet" href="jquery.mobile-1.3.1.min.css" />
<script src="jquery-1.7.1.min.js"></script>
<script src="jquery.mobile-1.3.1.min.js"></script>
@rominirani
rominirani / manifest.webapp
Created August 1, 2013 03:17
Episode #6 : Firefox OS Tutorial : Storage : manifest.webapp
{
"version":"1.0",
"name": "Notes",
"description": "This app uses the HTML5 Storage API to demonstrate how to save data in your Firefox OS Apps.",
"launch_path": "/index.html",
"icons": {
"16": "/images/icon_016.png",
"32": "/images/icon_032.png",
"48": "/images/icon_048.png",
"128": "/images/icon_128.png"
@rominirani
rominirani / webapp.manifest
Created July 31, 2013 05:42
Episode #5 : Firefox OS Tutorial : webapp.manifest
{
"version":"1.0",
"name": "LocateMe",
"description": "This app uses the HTML5 Geolocation API to retrieve your current position and plot on the map using Google Maps.",
"launch_path": "/index.html",
"icons": {
"16": "/images/icon_016.png",
"32": "/images/icon_032.png",
"48": "/images/icon_048.png",
"128": "/images/icon_128.png"
@rominirani
rominirani / map-app.js
Created July 31, 2013 03:19
Episode #5 : Firefox OS Tutorial : map-app.js
$(document).ready(function(){
$("#btnLocateMe").click(function(){
findMyCurrentLocation();
});
});
function findMyCurrentLocation(){
var geoService = navigator.geolocation;
if (geoService) {
navigator.geolocation.getCurrentPosition(showCurrentLocation,errorHandler,{enableHighAccuracy:true});