Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Renamed b2g to firefoxos
  • Loading branch information
gtanner authored and hermwong committed Mar 13, 2013
1 parent 09458ca commit 2cc5abebccf32c53801df2193f3545a5a90dd631
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 85 deletions.
@@ -13,7 +13,7 @@ Introduction

Firefox OS is an open source operating system for smartphones and tablet computers being developed by Mozilla. It is designed to allow HTML5 applications to integrate directly with the device's hardware using JavaScript.

cordova-b2g allows developers to use the cross platform APIs in Cordova to target the Firefox OS. Most APIs are just proxied to the matching Firefox OS API calls.
cordova-firefoxos allows developers to use the cross platform APIs in Cordova to target the Firefox OS. Most APIs are just proxied to the matching Firefox OS API calls.


Getting Started
@@ -23,15 +23,15 @@ A lot of good documentation is available on the [Mozilla Developer Network](http

A simulator (runs as a Firefox plugin) is availble [here](http://people.mozilla.org/~myk/r2d2b2g/)

Installing the cordova-b2g framework
Installing the cordova-firefoxos framework
====================================

Cloning the cordova-b2g repository always provides you with the latest (EDGE) version of the Cordova code. To clone the repository, do the following:
Cloning the cordova-firefoxos repository always provides you with the latest (EDGE) version of the Cordova code. To clone the repository, do the following:

$ cd ~/some/path
$ git clone https://github.com/gtanner/cordova-b2g.git
$ git clone https://github.com/gtanner/cordova-firefoxos.git

Cordova B2G Developer Tools
Cordova Firefox OS Developer Tools
---------------------------

The Cordova developer tooling is split between general tooling and project level tooling. Currently the tooling will only work on OSX or Linux.
@@ -55,13 +55,13 @@ needed to install like you would from an app store.
You may also use the simluator and Add the www directory to it (point at the manifest.webapp) in that folder. This will
allow you to refresh the app easier when developing.

#### Creating a new Cordova B2G
#### Creating a new Cordova Firefox OS Project

./bin/create ~/Desktop/myapp MyApp

### Project Commands

These commands live in a generated Cordova B2G project.
These commands live in a generated Cordova FirefoxOS project.

./cordova/run ............................ install to a connected device or simulator
./cordova/build .......................... build project, but do not deploy to simulator or device
@@ -65,7 +65,7 @@ cp -r $BUILD_PATH/framework/ $PROJECT_PATH/www
cp -r $BUILD_PATH/framework/install.html $PROJECT_PATH/www/install.html

echo "Building cordova-$VERSION.js ..."
cp $BUILD_PATH/javascript/cordova.b2g.js $PROJECT_PATH/www/cordova-$VERSION.js
cp $BUILD_PATH/javascript/cordova.firefoxos.js $PROJECT_PATH/www/cordova-$VERSION.js

# interpolate the app name into manifest.webapp
echo "Updating manifest.webapp ..."
@@ -1,6 +1,8 @@
// commit b711f6efe299228c75e04011a8df24803119e85a
// Platform: firefoxos

// File generated at :: Sat Jan 26 2013 15:20:57 GMT-0500 (EST)
// commit 349c6e1c8bcaf6f13af20010e04f6b03b5f4b0b7

// File generated at :: Mon Jan 28 2013 21:41:55 GMT-0500 (EST)

/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -942,7 +944,7 @@ module.exports = {

});

// file: lib/b2g/exec.js
// file: lib/firefoxos/exec.js
define("cordova/exec", function(require, exports, module) {

/**
@@ -961,10 +963,10 @@ define("cordova/exec", function(require, exports, module) {
*/

var plugins = {
"Device": require('cordova/plugin/b2g/device'),
"NetworkStatus": require('cordova/plugin/b2g/network'),
"Accelerometer" : require('cordova/plugin/b2g/accelerometer')
//"Notification" : require('cordova/plugin/b2g/notification')
"Device": require('cordova/plugin/firefoxos/device'),
"NetworkStatus": require('cordova/plugin/firefoxos/network'),
"Accelerometer" : require('cordova/plugin/firefoxos/accelerometer')
//"Notification" : require('cordova/plugin/firefoxos/notification')
};

module.exports = function(success, fail, service, action, args) {
@@ -1084,11 +1086,11 @@ exports.reset();

});

// file: lib/b2g/platform.js
// file: lib/firefoxos/platform.js
define("cordova/platform", function(require, exports, module) {

module.exports = {
id: "b2g",
id: "firefoxos",
initialize: function() {
}
};
@@ -3677,70 +3679,6 @@ module.exports = accelerometer;

});

// file: lib/b2g/plugin/b2g/accelerometer.js
define("cordova/plugin/b2g/accelerometer", function(require, exports, module) {

var cordova = require('cordova'),
callback;

module.exports = {
start: function (win, fail, args) {
window.removeEventListener("devicemotion", callback);
callback = function (motion) {
win({
x: motion.accelerationIncludingGravity.x,
y: motion.accelerationIncludingGravity.y,
z: motion.accelerationIncludingGravity.z,
timestamp: motion.timestamp
});
};
window.addEventListener("devicemotion", callback);
},
stop: function (win, fail, args) {
window.removeEventListener("devicemotion", callback);
}
};

});

// file: lib/b2g/plugin/b2g/device.js
define("cordova/plugin/b2g/device", function(require, exports, module) {

var channel = require('cordova/channel'),
cordova = require('cordova');

// Tell cordova channel to wait on the CordovaInfoReady event
channel.waitForInitialization('onCordovaInfoReady');

module.exports = {
getDeviceInfo : function(win, fail, args){
win({
platform: "Firefox OS",
version: "0.0.1",
model: "Beta Phone",
name: "Beta Phone", // deprecated: please use device.model
uuid: "somestring",
cordova: "2.4.0rc1"
});
}
};

});

// file: lib/b2g/plugin/b2g/network.js
define("cordova/plugin/b2g/network", function(require, exports, module) {

var cordova = require('cordova');

module.exports = {
getConnectionInfo: function (win, fail, args) {
win("3G");
return { "status": cordova.callbackStatus.OK, "message": "3G"};
}
};

});

// file: lib/common/plugin/battery.js
define("cordova/plugin/battery", function(require, exports, module) {

@@ -4342,6 +4280,69 @@ module.exports = function(exportFunc) {

});

// file: lib/firefoxos/plugin/firefoxos/accelerometer.js
define("cordova/plugin/firefoxos/accelerometer", function(require, exports, module) {

var cordova = require('cordova'),
callback;

module.exports = {
start: function (win, fail, args) {
window.removeEventListener("devicemotion", callback);
callback = function (motion) {
win({
x: motion.accelerationIncludingGravity.x,
y: motion.accelerationIncludingGravity.y,
z: motion.accelerationIncludingGravity.z,
timestamp: motion.timestamp
});
};
window.addEventListener("devicemotion", callback);
},
stop: function (win, fail, args) {
window.removeEventListener("devicemotion", callback);
}
};

});

// file: lib/firefoxos/plugin/firefoxos/device.js
define("cordova/plugin/firefoxos/device", function(require, exports, module) {

var channel = require('cordova/channel'),
cordova = require('cordova');

// Tell cordova channel to wait on the CordovaInfoReady event
channel.waitForInitialization('onCordovaInfoReady');

module.exports = {
getDeviceInfo : function(win, fail, args){
win({
platform: "Firefox OS",
version: "0.0.1",
model: "Beta Phone",
name: "Beta Phone", // deprecated: please use device.model
uuid: "somestring",
cordova: "2.4.0rc1"
});
}
};

});

// file: lib/firefoxos/plugin/firefoxos/network.js
define("cordova/plugin/firefoxos/network", function(require, exports, module) {

var cordova = require('cordova');

module.exports = {
getConnectionInfo: function (win, fail, args) {
win("3G");
}
};

});

// file: lib/common/plugin/geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {

@@ -5697,9 +5698,5 @@ window.cordova = require('cordova');

}(window));

// file: lib/scripts/bootstrap-b2g.js

require('cordova/channel').onNativeReady.fire();


})();

0 comments on commit 2cc5abe

Please sign in to comment.