Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pebble.js + Rocky.js = Develop in Browser #178

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rockyjs/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}
13 changes: 13 additions & 0 deletions rockyjs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions rockyjs/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
6 changes: 6 additions & 0 deletions rockyjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.tmp
.sass-cache
app/bower_components
.DS_Store
21 changes: 21 additions & 0 deletions rockyjs/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": false
}
31 changes: 31 additions & 0 deletions rockyjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Pebble.js + Rocky.js
====================

Pebble.js development in a browser!

Given that Rocky.js provides the Pebble API implemented in javascript, we can now combine Pebble.js and Rocky.js and develop in the web browser with all the javascript development tools.

## Work in Progress

This is a currently a Proof of Concept with minimal implementataion for the following:
* `window`
* `click`
* `rect`
* `text` - inlcuding fonts
* `texttime`

It works by replacing `simply-pebble.js` with `simply-rocky.js` at build time. There is some leakage to other classes, for example `Simply.markDirty()` has been added and called from `Window` to optimize the screen redraws.

`simply-rocky.js` is a copy and paste of `simply-pebble.js`. In time all the `simply-pebble.js` hangover code will be removed and replace with the Rocky implementation.

There is limited support.

## Getting Started

To support the Pebble.js build system we use Gulp and Browserify to build the javascript with Rocky.js

* [Install Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md)

* Run Browserify `gulp browserify` - this should finish without issues. Fix any issues you find

* Run `gulp watch` - this will launch a browser and run the app. It will automatically reload the app when the source files change
25 changes: 25 additions & 0 deletions rockyjs/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html class="no-js" lang="en">

<head>
<meta charset="utf-8" />
<title>Rocky</title>
</head>

<body>
<script>
var Pebble = {
addEventListener : function() {},
sendAppMessage : function() {},

platform : 'pypkjs'
};

</script>
<script src="rocky-0.3.0.js"></script>
<canvas id="pebble" class="rocky" width="144" height="168"></canvas>
<script src="scripts/rocky.js"></script>

</body>

</html>
Loading