1
0
Fork 0
mirror of https://github.com/shouptech/share-a-bike.git synced 2026-02-03 12:29:42 +00:00

Commiting code for v0.2.1

This commit is contained in:
mikeshoup@gmail.com 2010-12-19 17:42:47 +00:00
parent 0aa678acac
commit 400426a391
6 changed files with 84 additions and 72 deletions

View file

@ -1,9 +1,21 @@
function KioskAssistant(argFromPusher) { function KioskAssistant(argFromPusher) {
this.kiosk = argFromPusher;
} }
KioskAssistant.prototype = { KioskAssistant.prototype = {
setup: function() { setup: function() {
// Setup Application Menu
this.controller.setupWidget(Mojo.Menu.appMenu, AddSubMenuAttr, AddSubMenuModel);
// Setup Scene
Ares.setupSceneAssistant(this); Ares.setupSceneAssistant(this);
// Set labels to reflect the data
this.$.nameHeader.setTitle(this.kiosk.name);
this.$.streetLabel.setLabel(this.kiosk.address);
this.$.cityLabel.setLabel(this.kiosk.city + ', ' + this.kiosk.state + ' ' + this.kiosk.zip);
this.$.bikesLabel.setLabel('Bikes available: ' + this.kiosk.bikes);
this.$.docksLabel.setLabel('Docks available: ' + this.kiosk.docks);
}, },
cleanup: function() { cleanup: function() {
Ares.cleanupSceneAssistant(this); Ares.cleanupSceneAssistant(this);

View file

@ -132,7 +132,10 @@ MainAssistant.prototype = {
bikes: closestKiosks[i].BikesAvailable, bikes: closestKiosks[i].BikesAvailable,
docks: closestKiosks[i].DocksAvailable, docks: closestKiosks[i].DocksAvailable,
latitude: closestKiosks[i].Location.Latitude, latitude: closestKiosks[i].Location.Latitude,
longitude: closestKiosks[i].Location.Longitude longitude: closestKiosks[i].Location.Longitude,
city: closestKiosks[i].Address.City,
state: closestKiosks[i].Address.State,
zip: closestKiosks[i].Address.ZipCode
}; };
} }
@ -158,6 +161,10 @@ MainAssistant.prototype = {
}, },
radiusSelectorChange: function(inSender, event) { radiusSelectorChange: function(inSender, event) {
this.radius = event.value; this.radius = event.value;
},
kioskListListtap: function(inSender, event) {
var argToScene = event.item;
this.controller.stageController.pushScene('kiosk', argToScene);
} }
}; };

View file

@ -8,15 +8,18 @@ opus.Gizmo({
}, },
chrome: [ chrome: [
{ {
name: "pageHeader2", name: "nameHeader",
title: "17th & Grant", title: "",
subtitle: "", subtitle: "",
type: "Palm.Mojo.PageHeader", type: "Palm.Mojo.PageHeader",
l: 0, l: 0,
t: 0 t: 0,
styles: {
textAlign: "left"
}
}, },
{ {
name: "scroller1", name: "infoScroller",
scrollPosition: { scrollPosition: {
left: 0, left: 0,
top: 0 top: 0
@ -26,69 +29,60 @@ opus.Gizmo({
t: 0, t: 0,
h: "100%", h: "100%",
styles: { styles: {
margin: "5",
cursor: "move", cursor: "move",
overflow: "hidden" overflow: "hidden",
opacity: 1
}, },
controls: [ controls: [
{ {
name: "group1", name: "addressDivider",
dropTarget: true, label: "Address",
label: "Location", type: "Palm.Mojo.Divider",
type: "Palm.Mojo.Group",
l: 0, l: 0,
t: 0, t: 0,
h: "100", styles: {
controls: [ opacity: 1
{ }
name: "row1",
dropTarget: true,
focusHighlight: false,
tapHighlight: false,
type: "Palm.Mojo.Row",
l: 0,
t: 0,
h: "100%",
controls: [
{
name: "label2",
kind: "title",
label: "1700 Grant St",
type: "Palm.Mojo.Label",
l: "4",
t: 0,
h: "28"
},
{
name: "label3",
kind: "title",
label: "Denver, CO 80000",
type: "Palm.Mojo.Label",
l: "4",
t: 28,
h: "28"
}
]
}
]
}, },
{ {
name: "group2", name: "streetLabel",
dropTarget: true, label: "",
label: "Availability", type: "Palm.Mojo.Label",
type: "Palm.Mojo.Group",
l: 0, l: 0,
t: 95, t: 34,
controls: [ h: "30"
{ },
name: "row2", {
dropTarget: true, name: "cityLabel",
focusHighlight: false, label: "",
tapHighlight: false, type: "Palm.Mojo.Label",
type: "Palm.Mojo.Row", l: 0,
l: 0, t: 34,
t: 0 h: "30"
} },
] {
name: "availDivider",
label: "Availability",
type: "Palm.Mojo.Divider",
l: 0,
t: 94
},
{
name: "bikesLabel",
label: "",
type: "Palm.Mojo.Label",
l: 0,
t: 128,
h: "30"
},
{
name: "docksLabel",
label: "",
type: "Palm.Mojo.Label",
l: 0,
t: 158,
h: "30"
} }
] ]
} }

View file

@ -22,7 +22,7 @@ opus.Gizmo({
} }
}, },
{ {
name: "scroller1", name: "kiosksScroller",
scrollPosition: { scrollPosition: {
left: 0, left: 0,
top: 0 top: 0
@ -42,10 +42,9 @@ opus.Gizmo({
items: [], items: [],
useSampleData: false, useSampleData: false,
title: undefined, title: undefined,
itemHtml: "<div class=\"palm-row\">\n <div class=\"kiosk_container\">\n <div class=\"kiosk_name\">\n #{name}\n </div>\n <div class=\"kiosk_address\">\n #{address}\n </div>\n <div class=\"kiosk_stats\">\n #{distance} | #{bikes} bikes | #{docks} docks\n </div>\n </div>\n</div>", itemHtml: "<div class='result palm-row' x-mojo-tap-highlight='momentary'>\n <div class=\"palm-row-wrapper\">\n <div class=\"kiosk_container\">\n <div class=\"kiosk_name\">\n #{name}\n </div>\n <div class=\"kiosk_address\">\n #{address}\n </div>\n <div class=\"kiosk_stats\">\n #{distance} | #{bikes} bikes | #{docks} docks\n </div>\n </div>\n </div>\n</div>",
onlisttap: "kioskListListtap",
swipeToDelete: false, swipeToDelete: false,
rowTapHighlight: false,
rowFocusHighlight: false,
type: "Palm.Mojo.List", type: "Palm.Mojo.List",
l: 0, l: 0,
t: 0, t: 0,
@ -54,7 +53,7 @@ opus.Gizmo({
] ]
}, },
{ {
name: "panel2", name: "buttonsVbox",
dropTarget: true, dropTarget: true,
type: "Palm.Mojo.Panel", type: "Palm.Mojo.Panel",
l: 0, l: 0,
@ -62,7 +61,7 @@ opus.Gizmo({
h: "120", h: "120",
controls: [ controls: [
{ {
name: "panel1", name: "findHbox",
layoutKind: "hbox", layoutKind: "hbox",
dropTarget: true, dropTarget: true,
type: "Palm.Mojo.Panel", type: "Palm.Mojo.Panel",
@ -81,7 +80,7 @@ opus.Gizmo({
h: "100%" h: "100%"
}, },
{ {
name: "group1", name: "radiusGroup",
dropTarget: true, dropTarget: true,
label: "", label: "",
type: "Palm.Mojo.Group", type: "Palm.Mojo.Group",
@ -93,7 +92,7 @@ opus.Gizmo({
}, },
controls: [ controls: [
{ {
name: "row1", name: "radiusRow",
dropTarget: true, dropTarget: true,
type: "Palm.Mojo.Row", type: "Palm.Mojo.Row",
l: 0, l: 0,
@ -101,7 +100,7 @@ opus.Gizmo({
h: "auto", h: "auto",
controls: [ controls: [
{ {
name: "listSelector3", name: "radiusSelector",
value: 0.5, value: 0.5,
choices: [ choices: [
{ {

View file

@ -8,7 +8,7 @@ opus.Gizmo({
}, },
chrome: [ chrome: [
{ {
name: "pageHeader1", name: "mapHeader",
title: "Kiosks Map", title: "Kiosks Map",
subtitle: "", subtitle: "",
type: "Palm.Mojo.PageHeader", type: "Palm.Mojo.PageHeader",
@ -17,8 +17,8 @@ opus.Gizmo({
}, },
{ {
name: "kioskMap", name: "kioskMap",
latitude: 0, latitude: 39.739167,
longitude: 0, longitude: -104.984722,
type: "Palm.Mojo.Map", type: "Palm.Mojo.Map",
l: 0, l: 0,
t: 49, t: 49,

View file

@ -1,6 +1,6 @@
{ {
"id": "com.mikeshoup.share-a-bike", "id": "com.mikeshoup.share-a-bike",
"version": "0.1.5", "version": "0.2.1",
"vendor": "Mike Shoup", "vendor": "Mike Shoup",
"type": "web", "type": "web",
"main": "index.html", "main": "index.html",