Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #173 from astanley/WebWorks-2.0
Browse files Browse the repository at this point in the history
Porting to SDK2.0 format: Avatar-Booth, Maps, SetWallpaper, WebWorksWeather
  • Loading branch information
timwindsor committed Nov 18, 2013
2 parents 7212cef + 998f01e commit ba51444
Show file tree
Hide file tree
Showing 123 changed files with 261 additions and 148 deletions.
41 changes: 32 additions & 9 deletions Avatar-Booth/README.md
@@ -1,19 +1,19 @@
# Avatar-booth - example application for getUserMedia.
# Avatar-Booth - sample application for getUserMedia (Camera).

The purpose of this application is to demonstrate the getUserMedia functionality in BlackBerry 10 WebWorks. This allows access to the front and rear cameras on the device. The application let's you add a moustache and snap a photo, all within the Web Application.

The same code will work across other WebKit browser such as Chrome and Safari, without any changes to the code.

**Applies To**

* [BlackBerry 10 WebWorks SDK](https://developer.blackberry.com/html5/download/sdk)
* [BlackBerry 10 WebWorks SDK 2.0](https://developer.blackberry.com/html5/download/sdk)

**Author(s)**
**Author(s)**

* Anzor Bashkhaz (http://www.twitter.com/anzor_b)

**Dependencies**
* [Anzor Bashkhaz](http://www.twitter.com/anzor_b)
* [Adam Stanley](http://www.twitter.com/n_adam_stanley)

**Dependencies**


**Libraries**
Expand All @@ -37,13 +37,36 @@ All artwork except for the following was done by the author [Anzor Bashkhaz] and

** How to Build **

1. Clone the repo to your local machine
2. Use Using the Ripple Mobile Emulator and BlackBerry WebWorks SDK for BB10, package the contents of your local BB10-WebWorks-Samples/Meet-the-team folder into a BlackBerry application.
1. Clone this repo to your local machine.
2. Ensure the [BlackBerry 10 WebWorks SDK 2.0](https://developer.blackberry.com/html5/download/sdk) is correctly installed.
3. Open a command prompt (windows) or terminal (mac) and run the following command:

```
webworks create <your source folder>\Avatar-Booth
```

3. **Replace** the default Avatar-Booth\www folder with the \www folder from **this** project
4. From the command prompt (Windows) or terminal (mac), navigate to the Avatar-Booth folder

```
cd <your source folder>\Avatar-Booth
```

5. Run the following commands to configure plugins used by **this app**

```
webworks plugin add com.blackberry.app
```
6. Run the following command to build and deploy the app to a device connected via USB
```
webworks run
```

* [BlackBerry HTML5 WebWorks](https://bdsc.webapps.blackberry.com/html5/) - Downloads, Getting Started guides, samples, code signing keys.
* [BlackBerry WebWorks Development Guides](https://bdsc.webapps.blackberry.com/html5/documentation)
* [BlackBerry WebWorks Community Forums](http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/bd-p/browser_dev)
* [BlackBerry Open Source WebWorks Contributions Forums](http://supportforums.blackberry.com/t5/BlackBerry-WebWorks/bd-p/ww_con)


## Contributing Changes
Expand Down
9 changes: 6 additions & 3 deletions Avatar-Booth/app.html → Avatar-Booth/www/app.html
Expand Up @@ -18,17 +18,20 @@
<head>
<meta charset="utf-8" />
<title>Avatar Booth</title>
<script>

<script>
var meta = document.createElement("meta");
meta.setAttribute('name','viewport');
meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) + ',user-scalable=no');
document.getElementsByTagName('head')[0].appendChild(meta);
</script>

<link rel="stylesheet" href="style/App.css" />
<link rel="stylesheet" href="style/common.css" />

<!-- framework -->
<script src="cordova.js"></script>

<!-- load up the goodies -->
<script data-main="scripts/index" src="scripts/lib/require.js"></script>

Expand Down
13 changes: 6 additions & 7 deletions Avatar-Booth/config.xml → Avatar-Booth/www/config.xml
Expand Up @@ -20,17 +20,16 @@ limitations under the License.

<author rim:copyright="2012"
href="http://www.rim.com/"
email = "abashkhaz@rim.com">Anzor Bashkhaz</author>
email = "abashkhaz@rim.com">Anzor Bashkhaz</author>

<name>Avatar Booth</name>
<description>Avatar Booth</description>
<rim:permissions>
     <rim:permit>use_camera</rim:permit>
<rim:permissions>
<rim:permit>use_camera</rim:permit>
</rim:permissions>
<feature id="blackberry.app">
<param name="orientation" value="portrait" />
</feature>
<feature id="blackberry.app"/>
<preference name="orientation" value="portrait" />
<access uri="*" subdomains="true"></access>
<content src="app.html"></content>

</widget>
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 26 additions & 2 deletions Maps/www/README.md → Maps/README.md
Expand Up @@ -78,8 +78,32 @@ Your API Keys are meant to be private. For demonstration purposes we're coding t

## How to Build

1. Clone the repo to your local machine
2. Use BlackBerry 10 WebWorks SDK 2.0, package the contents of your local BB10-WebWorks-Samples/Maps folder into a BlackBerry application.
1. Clone this repo to your local machine.
2. Ensure the [BlackBerry 10 WebWorks SDK 2.0](https://developer.blackberry.com/html5/download/sdk) is correctly installed.
3. Open a command prompt (windows) or terminal (mac) and run the following command:

```
webworks create <your source folder>\Avatar-Booth
```

3. **Replace** the default Avatar-Booth\www folder with the \www folder from **this** project
4. From the command prompt (Windows) or terminal (mac), navigate to the Avatar-Booth folder

```
cd <your source folder>\Avatar-Booth
```

5. Run the following commands to configure plugins used by **this app**

```
webworks plugin add com.blackberry.app
```
6. Run the following command to build and deploy the app to a device connected via USB
```
webworks run
```

## More Info

Expand Down
37 changes: 32 additions & 5 deletions SetWallpaper/README.md
Expand Up @@ -6,11 +6,12 @@ The sample code for this application is Open Source under the [Apache 2.0 Licens

**Applies To**

* [BlackBerry 10 WebWorks SDK](https://developer.blackberry.com/html5/download/sdk)
* [BlackBerry 10 WebWorks SDK 2.0](https://developer.blackberry.com/html5/download/sdk)

**Author(s)**
**Author(s)**

* [Chad Tetreault](http://www.twitter.com/chadtatro)
* [Adam Stanley](http://www.twitter.com/chadtatro)

**Dependencies**

Expand Down Expand Up @@ -41,15 +42,41 @@ blackberry.system.setWallpaper(path);
```
## How to Build

1. Clone the repo to your local machine
2. Use Using the Ripple Mobile Emulator and the BlackBerry 10 WebWorks SDK, package the contents of your local BB10-WebWorks-Samples/SetWallpaper folder into a BlackBerry application.
1. Clone this repo to your local machine.
2. Ensure the [BlackBerry 10 WebWorks SDK 2.0](https://developer.blackberry.com/html5/download/sdk) is correctly installed.
3. Open a command prompt (windows) or terminal (mac) and run the following command:

```
webworks create <your source folder>\SetWallpaper
```

3. **Replace** the default SetWallpaper\www folder with the \www folder from **this** project
4. From the command prompt (Windows) or terminal (mac), navigate to the SetWallpaper folder

```
cd <your source folder>\SetWallpaper
```

5. Run the following commands to configure plugins used by **this app**

```
webworks plugin add com.blackberry.app
webworks plugin add com.blackberry.invoke.card
webworks plugin add com.blackberry.ui.toast
webworks plugin add com.blackberry.system
```
6. Run the following command to build and deploy the app to a device connected via USB
```
webworks run
```

## More Info

* [BlackBerry HTML5 WebWorks](https://bdsc.webapps.blackberry.com/html5/) - Downloads, Getting Started guides, samples, code signing keys.
* [BlackBerry WebWorks Development Guides](https://bdsc.webapps.blackberry.com/html5/documentation)
* [BlackBerry WebWorks Community Forums](http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/bd-p/browser_dev)
* [BlackBerry Open Source WebWorks Contributions Forums](http://supportforums.blackberry.com/t5/BlackBerry-WebWorks/bd-p/ww_con)


## Contributing Changes
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions SetWallpaper/config.xml → SetWallpaper/www/config.xml
Expand Up @@ -32,10 +32,9 @@
</license>
<access uri="*" subdomains="true" />

<feature id="blackberry.app.orientation">
<param name="mode" value="portrait" />
</feature>

<feature id="blackberry.app"/>
<preference name="orientation" value="portrait" />

<feature id="blackberry.invoke.card" />
<feature id="blackberry.ui.toast" />
<feature id="blackberry.system" />
Expand Down
File renamed without changes.
File renamed without changes
43 changes: 24 additions & 19 deletions SetWallpaper/index.html → SetWallpaper/www/index.html
Expand Up @@ -17,38 +17,43 @@
<html>
<head>
<title>Set Wallpaper Sample</title>

<!-- css -->
<link rel="stylesheet" href="css/bbui.css" type="text/css" media="screen" />

<!-- framework -->
<script src="local:///chrome/webworks.js" type="text/javascript"></script>
<script src="cordova.js"></script>

<!-- libraries -->
<script src="js/lib/bbui.js" type="text/javascript"></script>

<!-- sample code -->
<script src="js/app.js"></script>

<!-- initialization -->
<script type="text/javascript">
document.addEventListener("webworksready", initApp);

bb.init({
actionBarDark: true,
controlsDark: true,
listsDark: false,

// Fires "before" styling is applied and "before" the screen is inserted in the DOM
onscreenready: function(element, id) {
},
window.addEventListener("load", function(e) {
document.addEventListener("deviceready", function(f) {
initApp();

bb.init({
actionBarDark: true,
controlsDark: true,
listsDark: false,

// Fires "before" styling is applied and "before" the screen is inserted in the DOM
onscreenready: function(element, id) {
},

// Fires "after" styling is applied and "after" the screen is inserted in the DOM
ondomready: function(element, id) {
}
});
}, false);
}, false);

// Fires "after" styling is applied and "after" the screen is inserted in the DOM
ondomready: function(element, id) {
}
});
</script>
</head>
<body>
<body>
</body>
</html>

0 comments on commit ba51444

Please sign in to comment.