Skip to content
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 2 contributors
Commits on Jun 22, 2012
@Mindelusions Mindelusions Cleaning up deprecated files. Consolidated formatting. 34ad84d
Commits on Jul 09, 2012
@gshipley gshipley Merge pull request #5 from Mindelusions/master
Cleaning up files and code formatting.
e20e71f
View
6 Resources/beerTable.js
@@ -1,6 +0,0 @@
-function BeerTable() {
-
-
-};
-
-module.exports = BeerTable;
View
122 Resources/detailWindow.js
@@ -1,84 +1,84 @@
function DetailWindow(e) {
var windowBeerDetails = Ti.UI.createWindow({
- top : 0,
- left : 0,
- backgroundColor : 'black',
- title : L('winBeerDetails'),
- barImage : 'images/navbar.png'
+ top: 0,
+ left: 0,
+ backgroundColor: 'black',
+ title: L('winBeerDetails'),
+ barImage: 'images/navbar.png'
});
var detailsView = Ti.UI.createView({
- height : windowBeerDetails.height - 134,
- left : 0,
- top : 0,
- backgroundColor : 'black',
- borderRadius : 5
+ height: windowBeerDetails.height - 134,
+ left: 0,
+ top: 0,
+ backgroundColor: 'black',
+ borderRadius: 5
});
// Let start adding our UI elements
var beerImage = Titanium.UI.createImageView({
- image : 'images/pitcher.jpg',
- width : 80,
- height : 62,
- left : 10,
- top : 20
+ image: 'images/pitcher.jpg',
+ width: 80,
+ height: 62,
+ left: 10,
+ top: 20
});
var labelBeerDetailName = Titanium.UI.createLabel({
- width : 'auto',
- height : 30,
- top : 40,
- left : 100,
- color : 'white',
- font : {
- fontSize : 14,
- fontFamily : 'Helvetica',
- fontWeight : 'bold'
+ width: 'auto',
+ height: 30,
+ top: 40,
+ left: 100,
+ color: 'white',
+ font: {
+ fontSize: 14,
+ fontFamily: 'Helvetica',
+ fontWeight: 'bold'
},
- text : e._title
+ text: e._title
});
var labelBreweryName = Titanium.UI.createLabel({
- width : 'auto',
- height : 30,
- top : 58,
- left : 100,
- color : 'white',
- font : {
- fontSize : 14,
- fontFamily : 'Helvetica',
- fontWeight : 'bold'
+ width: 'auto',
+ height: 30,
+ top: 58,
+ left: 100,
+ color: 'white',
+ font: {
+ fontSize: 14,
+ fontFamily: 'Helvetica',
+ fontWeight: 'bold'
},
- text : e._brewery
+ text: e._brewery
});
var textareaDescription = Titanium.UI.createTextArea({
- color : 'white',
- backgroundColor : 'black',
- value : e._description,
- height : 200,
- width : '95%',
- top : 105,
- left : 10,
- font : {
- fontSize : 12,
- fontFamily : 'Helvetica',
- fontWeight : 'bold',
- color : 'white'
+ color: 'white',
+ backgroundColor: 'black',
+ value: e._description,
+ height: 200,
+ width: '95%',
+ top: 105,
+ left: 10,
+ font: {
+ fontSize: 12,
+ fontFamily: 'Helvetica',
+ fontWeight: 'bold',
+ color: 'white'
},
- borderColor : '#000',
- editable : false
+ borderColor: '#000',
+ editable: false
});
var labelDrinkTheBeer = Titanium.UI.createLabel({
- width : 'auto',
- top : 320,
- left : 115,
- color : 'white',
- font : {
- fontSize : 26,
- fontFamily : 'Helvetica',
- fontWeight : 'bold'
+ width: 'auto',
+ top: 320,
+ left: 115,
+ color: 'white',
+ font: {
+ fontSize: 26,
+ fontFamily: 'Helvetica',
+ fontWeight: 'bold'
},
- text : L('lblDrinkTheBeer')
+ text: L('lblDrinkTheBeer')
});
labelDrinkTheBeer.addEventListener('click', function(e) {
@@ -89,9 +89,9 @@ function DetailWindow(e) {
var postRequest = Ti.Network.createHTTPClient();
postRequest.open('POST', drinkPostURL);
postRequest.send({
- username : Ti.App.Properties.getString('username'),
- beerName : labelBeerDetailName.text,
- when : dateFormat(now, "mmmm dS, yyyy, h:MM:ss TT"),
+ username: Ti.App.Properties.getString('username'),
+ beerName: labelBeerDetailName.text,
+ when: dateFormat(now, "mmmm dS, yyyy, h:MM:ss TT"),
});
tabGroup.setActiveTab(1);
View
9 Resources/firehoseWindow.js
@@ -108,10 +108,11 @@ function FirehoseWindow() {
var tblBeers = Titanium.UI.createTableView({
top: 20,
- width : '100%',
- rowHeight : 35,
- borderRadius : 5,
- data : data
+ width: '100%',
+ height: '75%',
+ rowHeight: 35,
+ borderRadius: 5,
+ data: data
});
reloadButton.addEventListener('click', function(e){
View
112 Resources/populateDrankAndKegStand.js
@@ -1,112 +0,0 @@
-function populateTableWithBeer(windowType, data) {
- var labelLoading = Titanium.UI.createLabel({
- width : 'auto',
- height : 30,
- top : 20,
- left : 50,
- color : 'white',
- font : {
- fontSize : 14,
- fontFamily : 'Helvetica',
- fontWeight : 'bold'
- },
- text : L('lblLoading')
- });
-
- view.add(labelLoading);
-
- var APIurl = APIHost + "firehose/";
-
- if (windowType == 'drank') {
- APIurl = APIHost + "userbeers/username/" + Ti.App.Properties.getString("username");
- };
-
- var request = Titanium.Network.createHTTPClient();
- request.open('GET', APIurl);
- request.send();
-
- //this method will process the remote data
- request.onload = function() {
-
- labelLoading.visible = true;
- tblBeers.visible = false;
-
- //create a json object using the JSON.PARSE function
- var responseData = request.responseText;
- var response = JSON.parse(responseData);
-
- data.length = 0;
-
- //loop each item in the json object
- for(var i = 0; i < response.length; i++) {
- //create a table row
- var row = Titanium.UI.createTableViewRow({
- hasChild : true,
- className : 'recipe-row',
- backgroundColor : '#fff',
- _beerName : response[i].beer,
- _when : response[i].when,
- _title: response[i].beer
- });
- //title label
- var titleLabelText = response[i].username + " " + L('titleLabelText') + " " + response[i].beer;
- if (windowType == 'drank') {
- titleLabelText = response[i].beer;
- }
- var titleLabel = Titanium.UI.createLabel({
- text : titleLabelText,
- font : {
- fontSize : 14,
- fontWeight : 'bold'
- },
- left : 50,
- top : 5,
- height : 20,
- width : 210,
- color : '#000'
- });
- row.add(titleLabel);
-
- //add our icon to the left of the row
- var iconImage = Titanium.UI.createImageView({
- image : 'images/icon-beer.png',
- width : 24,
- height : 24,
- left : 10,
- top : 5
- });
- row.add(iconImage);
-
- var whenLabel = Titanium.UI.createLabel({
- text : response[i].when,
- font : {
- fontSize : 10,
- fontWeight : 'normal'
- },
- left : 50,
- top : 17,
- height : 20,
- width : 200,
- color : '#000'
- });
- row.add(whenLabel);
- //add the table row to our data[] object
- data.push(row);
- }
-
- //finally, set the data property of the tableView to our data[] object
-
- tblBeers.visible = false;
- tblBeers.setData(data);
- tblBeers.addEventListener('click', function(e) {
- Ti.UI.currentTab.open(createDrankDetailWindow(e.rowData))
- });
- if(tblBeers.getData().length > 0) {
- view.add(tblBeers);
- labelLoading.visible = false;
- tblBeers.visible = true;
- }
- }
-}
-
-
View
72 Resources/populateTableWithBeer.js
@@ -1,72 +0,0 @@
-function populateTableWithBeer(beerName) {
-
- var data = [];
-
- var tblBeers = Titanium.UI.createTableView({
- width : "95%",
- top : 100,
- rowHeight : 35,
- borderRadius : 5,
- data : data
- });
-
- view.add(tblBeers);
-
- var APIurl = APIHost + "beers/name/" + escape(beerName);
- var request = Titanium.Network.createHTTPClient();
- request.open('GET', APIurl);
- request.send();
- //this method will process the remote data
- request.onload = function() {
- //create a json object using the JSON.PARSE function
- var response = JSON.parse(request.responseText);
-
- //loop each item in the json object
- for(var i = 0; i < response.data.length; i++) {
- //create a table row
- var row = Titanium.UI.createTableViewRow({
- hasChild : true,
- className : 'recipe-row',
- backgroundColor : '#fff',
- _title : response.data[i].name,
- _description : response.data[i].description,
- _brewery : response.data[i].breweries[0].name
- });
- //title label
- var titleLabel = Titanium.UI.createLabel({
- text : response.data[i].name,
- font : {
- fontSize : 14,
- fontWeight : 'bold'
- },
- left : 50,
- top : 10,
- height : 20,
- width : 210,
- color : '#000'
- });
- row.add(titleLabel);
-
- //add our little icon to the left of the row
- var iconImage = Titanium.UI.createImageView({
- image : 'images/icon-beer.png',
- width : 24,
- height : 24,
- left : 10,
- top : 5
- });
- row.add(iconImage);
-
- //add the table row to our data[] object
- data.push(row);
- }
-
- //finally, set the data property of the tableView to our data[] object
- tblBeers.visible = false;
- tblBeers.setData(data);
- tblBeers.addEventListener('click', function(e) {
- drinkTab.open(createDetailWindow(e.rowData))
- });
- tblBeers.visible = true;
- }
-}

No commit comments for this range

Something went wrong with that request. Please try again.