Skip to content

Commit

Permalink
update project
Browse files Browse the repository at this point in the history
  • Loading branch information
mkpascal committed Jun 24, 2015
1 parent e8f76a5 commit 195e622
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 18 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

.idea/.name

.idea/encodings.xml

.idea/iMsgQuickReply.iml

.idea/misc.xml

.idea/modules.xml

.idea/scopes/scope_settings.xml

.idea/vcs.xml

.idea/workspace.xml
42 changes: 42 additions & 0 deletions appinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"appKeys": {},
"capabilities": [
"configurable"
],
"companyName": "MKPascal.net",
"longName": "iMsgQuickReply",
"projectType": "pebblejs",
"resources": {
"media": [
{
"file": "images/menu_icon.png",
"menuIcon": true,
"name": "IMAGE_MENU_ICON",
"type": "png"
},
{
"file": "images/logo_splash.png",
"name": "IMAGE_LOGO_SPLASH",
"type": "png"
},
{
"file": "images/tile_splash.png",
"name": "IMAGE_TILE_SPLASH",
"type": "png"
},
{
"file": "fonts/UbuntuMono-Regular.ttf",
"name": "MONO_FONT_14",
"type": "font"
}
]
},
"sdkVersion": "3",
"shortName": "iMsgQuickReply",
"uuid": "",
"versionCode": 1,
"versionLabel": "1.0",
"watchapp": {
"watchface": false
}
}
33 changes: 15 additions & 18 deletions app.js → src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ var ajax = require('ajax');
var Vector2 = require('vector2');
var Settings = require('settings');

Settings.config(
{url: 'https://www.mkpascal.net/iMsgQuickReply/'},
function (e) {
console.log('opening configurable');
},
function (e) {
console.log('closed configurable');
Settings.option('server_url', e.options[0]);
Settings.option('password', e.options[1]);
}
);

var replies = [{"title": "Yes"}, {"title": "No"}, {"title": "Maybe"}, {"title": "Wait"}];

var parseFeed = function (data) {
Expand All @@ -22,6 +34,7 @@ var title_text = "Quick Reply";
var font_text = "GOTHIC_28";

var server_url = Settings.option('server_url');
var password = Settings.option('password');

if (typeof server_url === 'undefined') {
var title_text = "Please configure the app";
Expand Down Expand Up @@ -54,7 +67,7 @@ splashWindow.show();

ajax(
{
url: server_url + '/pebble/contacts?password=changeme',
url: server_url + '/pebble/contacts?password=' + password,
type: 'json'
},
function (data) {
Expand Down Expand Up @@ -89,14 +102,11 @@ ajax(

answersMenu.show();


answersMenu.on('select', function (e) {

var message = e.item.title;

ajax(
{
url: server_url + '/imsgbridge?to=' + to + '&message=' + message + '&password=changeme',
url: server_url + '/imsgbridge?to=' + to + '&message=' + message + '&password=' + password,
type: 'json'
});

Expand All @@ -116,24 +126,11 @@ ajax(
answersMenu.hide();
sentCard.hide();
}, 3000);

});
});


resultsMenu.show();
splashWindow.hide();

}
);

Settings.config(
{url: 'https://www.mkpascal.net/iMsgQuickReply/'},
function (e) {
console.log('opening configurable');
},
function (e) {
console.log('closed configurable');
Settings.option('server_url', e.options);
}
);

0 comments on commit 195e622

Please sign in to comment.