Namespace: simply

simply

Simply.js
Source:

Methods

<static> accelConfig(accelConf)

Changes the accelerometer configuration. See simply.accelConfig
Parameters:
Name Type Description
accelConf simply.accelConfig An object defining the accelerometer configuration.
Source:

<static> accelPeek(callback)

Peeks at the current accelerometer values.
Parameters:
Name Type Description
callback simply.eventHandler A callback function that will be provided the accel data point as an event.
Source:

<static> body(text, clear)

Sets the body field. The body field is the last text field available meant to display large bodies of text. This can be used to display entire text interfaces. You may even clear the title and subtitle fields in order to display more in the body field.
Parameters:
Name Type Argument Description
text string The desired text to display.
clear boolean <optional>
If true, all other text fields will be cleared.
Source:

<static> buttonConfig(buttonConf)

Changes the button configuration. See simply.buttonConfig
Parameters:
Name Type Description
buttonConf simply.buttonConfig An object defining the button configuration.
Source:

<static> fullscreen(fullscreen)

Enable fullscreen in the Pebble UI. Fullscreen removes the Pebble status bar, giving slightly more vertical display height.
Parameters:
Name Type Description
fullscreen boolean Whether to enable fullscreen mode.
Source:

<static> off(type, subtype, handler)

Unsubscribe from Pebble events. When called without a handler, all handlers of the type and subtype are unsubscribe. When called with no parameters, all handlers are unsubscribed.
Parameters:
Name Type Argument Description
type string The event type.
subtype string <optional>
The event subtype.
handler function <optional>
The event handler to unsubscribe.
Source:
See:

<static> on(type, subtype, handler)

Subscribe to Pebble events. See simply.event for the possible event types to subscribe to. Subscribing to a Pebble event requires a handler. An event object will be passed to your handler with event information. Events can have a subtype which can be used to filter events before the handler is called.
Parameters:
Name Type Argument Description
type string The event type.
subtype string <optional>
The event subtype.
handler simply.eventHandler The event handler. The handler will be called with corresponding event.
Source:
See:

<static> scrollable(scrollable)

Enable scrolling in the Pebble UI. When scrolling is enabled, up and down button presses are no longer forwarded to JavaScript handlers. Single select, long select, and accel tap events are still available to you however.
Parameters:
Name Type Description
scrollable boolean Whether to enable a scrollable view.
Source:

<static> style(type)

Set the Pebble UI style. The available styles are 'small', 'large', and 'mono'. Small and large correspond to the system notification styles. Mono sets a monospace font for the body textfield, enabling more complex text UIs or ASCII art.
Parameters:
Name Type Description
type string The type of style to set: 'small', 'large', or 'mono'.
Source:

<static> subtitle(text, clear)

Sets the subtitle field. The subtitle field is the second large text field available.
Parameters:
Name Type Argument Description
text string The desired text to display.
clear boolean <optional>
If true, all other text fields will be cleared.
Source:

<static> text(textDef, clear)

Sets a group of text fields at once. For example, passing a text definition { title: 'A', subtitle: 'B', body: 'C' } will set the title, subtitle, and body simultaneously. Not all fields need to be specified. When setting a single field, consider using the specific text setters simply.title, simply.subtitle, simply.body.
Parameters:
Name Type Argument Description
textDef simply.textDef An object defining new text values.
clear boolean <optional>
If true, all other text fields will be cleared.
Source:

<static> title(text, clear)

Sets the title field. The title field is the first and largest text field available.
Parameters:
Name Type Argument Description
text string The desired text to display.
clear boolean <optional>
If true, all other text fields will be cleared.
Source:

<static> vibe(type)

Vibrates the Pebble. There are three support vibe types: short, long, and double.
Parameters:
Name Type Argument Default Description
type string <optional>
short The vibe type.
Source:

Type Definitions

accelConf

The accelerometer configuration parameter for simply.accelConfig. The accelerometer data stream is useful for applications such as gesture recognition when accelTap is too limited. However, keep in mind that smaller batch sample sizes and faster rates will drastically impact the battery life of both the Pebble and phone because of the taxing use of the processors and Bluetooth modules.
Type:
  • object
Properties:
Name Type Argument Description
rate number <optional>
The rate accelerometer data points are generated in hertz. Valid values are 10, 25, 50, and 100. Initializes as 100.
samples number <optional>
The number of accelerometer data points to accumulate in a batch before calling the event handler. Valid values are 1 to 25 inclusive. Initializes as 25.
subscribe boolean <optional>
Whether to subscribe to accelerometer data events. simply.accelPeek cannot be used when subscribed. Simply.js will automatically (un)subscribe for you depending on the amount of accelData handlers registered.
Source:

accelDataEvent

Simply.js accel data event. Use the event type 'accelData' to subscribe to these events.
Properties:
Name Type Description
samples number The number of accelerometer samples in this event.
accel simply.accelPoint The first accel in the batch. This is provided for convenience.
accels simply.accelPoint[] The accelerometer samples in an array.
Source:

accelPoint

Simply.js accel data point. Typical values for gravity is around -1000 on the z axis.
Properties:
Name Type Description
x number The acceleration across the x-axis.
y number The acceleration across the y-axis.
z number The acceleration across the z-axis.
vibe boolean Whether the watch was vibrating when measuring this point.
time number The amount of ticks in millisecond resolution when measuring this point.
Source:

accelTapEvent

Simply.js accel tap event. Use the event type 'accelTap' to subscribe to these events.
Properties:
Name Type Description
axis string The axis the tap event occurred on: 'x', 'y', or 'z'. This is also the event subtype.
direction number The direction of the tap along the axis: 1 or -1.
Source:

buttonConf

The button configuration parameter for simply.buttonConfig. The button configuration allows you to enable to disable buttons without having to register or unregister handlers if that is your preferred style. You may also enable the back button manually as an alternative to registering a click handler with 'back' as its subtype using simply.on.
Type:
  • object
Properties:
Name Type Argument Description
back boolean <optional>
Whether to enable the back button. Initializes as false. Simply.js can also automatically register this for you based on the amount of click handlers with subtype 'back'.
up boolean <optional>
Whether to enable the up button. Initializes as true. Note that this is disabled when using simply.scrollable.
select boolean <optional>
Whether to enable the select button. Initializes as true.
down boolean <optional>
Whether to enable the down button. Initializes as true. Note that this is disabled when using simply.scrollable.
Source:

clickEvent

Simply.js button click event. This can either be a single click or long click. Use the event type 'singleClick' or 'longClick' to subscribe to these events.
Properties:
Name Type Description
button string The button that was pressed: 'back', 'up', 'select', or 'down'. This is also the event subtype.
Source:

event

Simply.js event. See all the possible event types. Subscribe to events using simply.on.
Source:
See:

eventHandler(event)

Simply.js event handler callback.
Parameters:
Name Type Description
event simply.event The event object with event specific information.
Source:

textDef

The text definition parameter for simply.text.
Type:
  • object
Properties:
Name Type Argument Description
title string <optional>
A new title for the first and largest text field.
subtitle string <optional>
A new subtitle for the second large text field.
body string <optional>
A new body for the last text field meant to display large bodies of text.
Source: