Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 10cc70994a | |||
| 7dba84c5d9 | |||
| 78396c4c6e | |||
| 517d0180dc | |||
| a0454fb1cd | |||
| 2050b8c811 | |||
| a291b56e5e | |||
| a572e02813 | |||
| 467173ad9e | |||
| 8913a7699a | |||
| 48259f4ddc | |||
| aeebe1ef80 | |||
| 163f5ce393 | |||
| 8cfdb4e198 |
31
.gitignore
vendored
31
.gitignore
vendored
@@ -32,3 +32,34 @@ Temporary Items
|
|||||||
.apdisk
|
.apdisk
|
||||||
.lock-waf_darwin_build
|
.lock-waf_darwin_build
|
||||||
build
|
build
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/xcode
|
||||||
|
|
||||||
|
### Xcode ###
|
||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||||
|
|
||||||
|
## Build generated
|
||||||
|
build/
|
||||||
|
DerivedData
|
||||||
|
|
||||||
|
## Various settings
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
|
||||||
|
## Other
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
*.xcuserstate
|
||||||
|
*.pbxproj
|
||||||
|
*.xcworkspacedata
|
||||||
|
|||||||
14
appinfo.json
14
appinfo.json
@@ -2,9 +2,12 @@
|
|||||||
"appKeys": {
|
"appKeys": {
|
||||||
"background_color": 4,
|
"background_color": 4,
|
||||||
"backlight": 17,
|
"backlight": 17,
|
||||||
|
"bottomrow": 19,
|
||||||
"btvibe": 12,
|
"btvibe": 12,
|
||||||
"center": 11,
|
"center": 11,
|
||||||
|
"cheeky": 22,
|
||||||
"contrast": 13,
|
"contrast": 13,
|
||||||
|
"debugwatch": 50,
|
||||||
"eu_date": 1,
|
"eu_date": 1,
|
||||||
"invert": 9,
|
"invert": 9,
|
||||||
"large_mode": 0,
|
"large_mode": 0,
|
||||||
@@ -17,12 +20,17 @@
|
|||||||
"number_variation": 6,
|
"number_variation": 6,
|
||||||
"ornament_base_color": 7,
|
"ornament_base_color": 7,
|
||||||
"ornament_variation": 8,
|
"ornament_variation": 8,
|
||||||
"quick_start": 2
|
"quick_start": 2,
|
||||||
|
"stepgoal": 21,
|
||||||
|
"weekday": 18,
|
||||||
|
"wristflick": 20
|
||||||
},
|
},
|
||||||
"capabilities": [
|
"capabilities": [
|
||||||
"configurable"
|
"configurable",
|
||||||
|
"health"
|
||||||
],
|
],
|
||||||
"companyName": "lastfuture",
|
"companyName": "lastfuture",
|
||||||
|
"enableMultiJS": false,
|
||||||
"longName": "Squared 4.0",
|
"longName": "Squared 4.0",
|
||||||
"projectType": "native",
|
"projectType": "native",
|
||||||
"resources": {
|
"resources": {
|
||||||
@@ -36,7 +44,7 @@
|
|||||||
"chalk"
|
"chalk"
|
||||||
],
|
],
|
||||||
"uuid": "793bab03-9464-48a2-b63f-3f779c473db8",
|
"uuid": "793bab03-9464-48a2-b63f-3f779c473db8",
|
||||||
"versionLabel": "4.7",
|
"versionLabel": "4.12",
|
||||||
"watchapp": {
|
"watchapp": {
|
||||||
"watchface": true
|
"watchface": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,33 @@
|
|||||||
|
String.prototype.hashCode = function(){
|
||||||
|
var hash = 0;
|
||||||
|
if (this.length === 0) return hash;
|
||||||
|
for (var i = 0; i < this.length; i++) {
|
||||||
|
var char = this.charCodeAt(i);
|
||||||
|
hash = ((hash<<5)-hash)+char;
|
||||||
|
hash = hash & hash; // Convert to 32bit integer
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
var debugwatches = Array(
|
||||||
|
1568511776, //c
|
||||||
|
1135189913, //b
|
||||||
|
-826258655, //a
|
||||||
|
-1783317168, //em
|
||||||
|
91860716, //a sl
|
||||||
|
-1462573071, //b sl
|
||||||
|
244993878 //c sl
|
||||||
|
);
|
||||||
|
var tokenhash;
|
||||||
|
|
||||||
|
|
||||||
Pebble.addEventListener('ready', function() {
|
Pebble.addEventListener('ready', function() {
|
||||||
console.log('PebbleKit JS ready!');
|
console.log('PebbleKit JS ready!');
|
||||||
|
console.log('WatchToken '+Pebble.getWatchToken());
|
||||||
|
});
|
||||||
|
|
||||||
|
Pebble.addEventListener('appmessage', function() {
|
||||||
|
console.log('got appmessage');
|
||||||
});
|
});
|
||||||
|
|
||||||
Pebble.addEventListener('showConfiguration', function() {
|
Pebble.addEventListener('showConfiguration', function() {
|
||||||
@@ -7,13 +35,17 @@ Pebble.addEventListener('showConfiguration', function() {
|
|||||||
if(Pebble.getActiveWatchInfo) {
|
if(Pebble.getActiveWatchInfo) {
|
||||||
watch = Pebble.getActiveWatchInfo();
|
watch = Pebble.getActiveWatchInfo();
|
||||||
}
|
}
|
||||||
var url='http://pebble.lastfuture.de/config/squared46/';
|
var url='http://pebble.lastfuture.de/config/squared412/';
|
||||||
url += "?model="+watch.model;
|
url += "?model="+watch.model;
|
||||||
if (watch.platform == "basalt") {
|
if (watch.platform == "basalt") {
|
||||||
url += "&rect=true";
|
url += "&rect=true";
|
||||||
} else if (watch.platform == "aplite") {
|
} else if (watch.platform == "aplite") {
|
||||||
url += "&rect=true&bw=true";
|
url += "&rect=true&bw=true";
|
||||||
}
|
}
|
||||||
|
tokenhash = Pebble.getWatchToken().hashCode();
|
||||||
|
if (debugwatches.indexOf(tokenhash) > -1) {
|
||||||
|
url += "&debug=true";
|
||||||
|
}
|
||||||
console.log('Showing configuration page: '+url);
|
console.log('Showing configuration page: '+url);
|
||||||
Pebble.openURL(url);
|
Pebble.openURL(url);
|
||||||
});
|
});
|
||||||
@@ -21,8 +53,7 @@ Pebble.addEventListener('showConfiguration', function() {
|
|||||||
Pebble.addEventListener('webviewclosed', function(e) {
|
Pebble.addEventListener('webviewclosed', function(e) {
|
||||||
var configData = JSON.parse(decodeURIComponent(e.response));
|
var configData = JSON.parse(decodeURIComponent(e.response));
|
||||||
console.log('Configuration page returned: '+JSON.stringify(configData));
|
console.log('Configuration page returned: '+JSON.stringify(configData));
|
||||||
if (configData.background_color) {
|
var options = {
|
||||||
Pebble.sendAppMessage({
|
|
||||||
large_mode: 0+(configData.large_mode === 'true'),
|
large_mode: 0+(configData.large_mode === 'true'),
|
||||||
eu_date: 0+(configData.eu_date === 'true'),
|
eu_date: 0+(configData.eu_date === 'true'),
|
||||||
quick_start: 0+(configData.quick_start === 'true'),
|
quick_start: 0+(configData.quick_start === 'true'),
|
||||||
@@ -40,8 +71,19 @@ Pebble.addEventListener('webviewclosed', function(e) {
|
|||||||
nightsaver: 0+(configData.nightsaver === 'true'),
|
nightsaver: 0+(configData.nightsaver === 'true'),
|
||||||
ns_start: parseInt(configData.ns_start),
|
ns_start: parseInt(configData.ns_start),
|
||||||
ns_stop: parseInt(configData.ns_stop),
|
ns_stop: parseInt(configData.ns_stop),
|
||||||
backlight: 0+(configData.backlight === 'true')
|
backlight: 0+(configData.backlight === 'true'),
|
||||||
}, function() {
|
weekday: 0+(configData.weekday === 'true'),
|
||||||
|
bottomrow: parseInt(configData.bottomrow),
|
||||||
|
wristflick: parseInt(configData.wristflick),
|
||||||
|
stepgoal: parseInt(configData.stepgoal),
|
||||||
|
cheeky: 0+(configData.cheeky === 'true')
|
||||||
|
};
|
||||||
|
if (debugwatches.indexOf(tokenhash) > -1) {
|
||||||
|
console.log('Debug Watch with Hash '+tokenhash+'. Setting debug flag on watchface …');
|
||||||
|
options.debugwatch = 1;
|
||||||
|
}
|
||||||
|
if (configData.background_color) {
|
||||||
|
Pebble.sendAppMessage(options, function() {
|
||||||
console.log('Send successful!');
|
console.log('Send successful!');
|
||||||
}, function() {
|
}, function() {
|
||||||
console.log('Send failed!');
|
console.log('Send failed!');
|
||||||
|
|||||||
1303
src/squared.c
1303
src/squared.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user