-
Notifications
You must be signed in to change notification settings - Fork 229
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
base: develop
Are you sure you want to change the base?
Conversation
- uses rockyjs so this should be compatible with rocky when implemented - adds a gulp build task with browserify (for require)
@@ -0,0 +1,1462 @@ | |||
var Color = require('../../src/js/lib/color'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy and paste from simply-rocky.js
It is intended to be culled down as more components are implemented
state.timeOffset = new Date().getTimezoneOffset() * -60; | ||
|
||
var clickStartTime, clickEndTime, longPress; | ||
ButtonTypes.forEach(function(button) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wont work for rocky.js on the device, will leave it here until we know the device api
fixes rendering bug in menu
cleans up gulp build
if (this.emit(type, subtype, e) === false) { | ||
return false; | ||
} | ||
return !!this.emit(type, subtype, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change allows the browser to know if a handler acted on the event - in the case of the back button we want to know if there was no handler so we can take action
@@ -116,6 +116,7 @@ Window.prototype._show = function(pushing) { | |||
|
|||
Window.prototype.show = function() { | |||
WindowStack.push(this); | |||
simply.impl.markDirty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with pebble.js we are transmitting the window components to the watch then calling the render, however when we don't need to transmit we need to know when the screen is being shown so we only call render once(ish)
I hope there is a better way to do this with out modifying this file
This is a POC that enables development of pebble.js apps in a web browser - super fast development turnaround. (And maybe rocky.js compatibility with pebble allows it!)
It is intended to have minimal to no special code ( there is a little at the moment - see markDirty )
This is simply a gulp project that browserifies the source code so that its compatible with the web browser.
It then replaces
simply-pebble.js
withsimply-rocky.js
The implementation uses rocky.js to render to the html canvas.
The pebble.js stage is replaced with an array of render functions.
Please note that only a small set of components are implemented to the bare minimum
window
click
rect
text
- incuding fontstexttime