Permalink
Browse files

Fixed a bug that prevented Prefs from opening; fixed a bug that preve…

…nted adding new venues
  • Loading branch information...
zhephree committed Sep 8, 2011
1 parent 3665d00 commit aedb04ec9b16bbde1891aaf904faa9f4bf5f5307
@@ -214,7 +214,7 @@ AddVenueAssistant.prototype.setup = function(widget) {
}
AddVenueAssistant.prototype.scrollTest = function(a,b,c,d,e){
-/* Mojo.Log.error("state="+Object.toJSON(this.controller.get('mojo-scene-add-venue-scene-scroller').mojo.getScrollPosition()));
+// Mojo.Log.error("state="+Object.toJSON(this.controller.get('mojo-scene-add-venue-scene-scroller').mojo.getScrollPosition()));
var ss=this.controller.get('mojo-scene-add-venue-scene-scroller').mojo.getScrollPosition();
@@ -84,6 +84,16 @@ AppAssistant.prototype.prelaunch = function(){
requiresAuth: true
});
+ /*foursquareGet(this,{
+ endpoint: 'venues/categories',
+ requiresAuth: true,
+ ignoreErrors: true,
+ parameters: {},
+ onSuccess: _globals.categoriesSuccess.bind(this),
+ onFailure: _globals.categoriesFailed.bind(this),
+ requiresAuth: true
+ });*/
+
};
/***********HANDLE LAUNCH**************/
@@ -232,6 +242,16 @@ AppAssistant.prototype.handleLaunch = function (launchParams) {
// Update the feed list
+/* foursquareGetMulti(this, {
+ endpoints: '/venues/'+this.venue.id+',/venues/'+this.venue.id+'/tips,/venues/'+this.venue.id+'/photos?group=venue,/venues/'+this.venue.id+'/photos?group=checkin,/venues/'+this.venue.id+'/herenow?limit=250',
+ requiresAuth: true,
+ debug: true,
+ ignoreErrors: false,
+ onSuccess: this.getVenueInfoSuccess.bind(this),
+ onFailure: this.getVenueInfoFailed.bind(this)
+ });*/
+
+
foursquareGet(this,{
endpoint: 'checkins/recent',
requiresAuth: true,
@@ -443,24 +463,24 @@ AppAssistant.prototype.handleLaunch = function (launchParams) {
_globals.loadPrefs();
- var url = "https://api.foursquare.com/v1/categories.json";
+ /* var url = "https://api.foursquare.com/v1/categories.json";
var request = new Ajax.Request(url, {
method: 'get',
evalJSON: 'force',
onSuccess: _globals.categorySuccess.bind(this),
onFailure: _globals.categoryFailed.bind(this)
- });
+ });*/
//also grab user settings in bg
- var url = "https://api.foursquare.com/v1/user.json";
+ /* var url = "https://api.foursquare.com/v1/user.json";
var request = new Ajax.Request(url, {
method: 'get',
evalJSON: 'true',
requestHeaders: {Authorization:_globals.auth},
onSuccess: _globals.userSuccess.bind(this),
onFailure: _globals.userFailed.bind(this)
- });
+ });*/
_globals.cmmodel = {
visible: true,
@@ -554,6 +574,8 @@ AppAssistant.prototype.doFeedData = function(data,r){
//setup array to hold actually new checkins
var newitems=[];
+
+
//run through array of newly downloaded checkins
var newfeed=r.responseJSON.response.recent;
if(newfeed){
@@ -143,20 +143,34 @@ NearbyVenuesAssistant.prototype.setup = function() {
this.venuelessCheckinBound=this.venuelessCheckin.bind(this);
this.stageActivateBound=this.stageActivate.bind(this);
- Mojo.Event.listen(this.controller.stageController.document,Mojo.Event.activate, this.stageActivateBound);
- Mojo.Event.listen(this.controller.get('search-checkin'),Mojo.Event.tap, this.venuelessCheckinBound);
- Mojo.Event.listen(this.controller.get('search-add-venue'),Mojo.Event.tap, this.addNewVenueBound);
- Mojo.Event.listen(this.controller.get('results-venue-list'),Mojo.Event.listTap, this.listWasTappedBound);
- Mojo.Event.listen(this.controller.get('results-venue-list'),Mojo.Event.listAdd, this.addNewVenueBound);
- Mojo.Event.listen(this.controller.sceneElement, Mojo.Event.keypress, this.onKeyPressHandlerBound);
- Mojo.Event.listen(this.controller.sceneElement, Mojo.Event.keydown, this.keyDownHandlerBound);
- Mojo.Event.listen(this.controller.get('refresh-venues'),Mojo.Event.tap, this.refreshVenuesBound);
- Mojo.Event.listen(this.doc,"keyup", this.keyUpHandlerBound, true);
- Mojo.Event.listen(this.controller.get('gotloc'),"handleit", this.gotLocationBound);
- Mojo.Event.listen(this.controller.get('gotloc'),"showrefresh", this.showRefreshBound);
- Mojo.Event.listen(this.controller.get('gotloc'),"gaveup", this.hideRetryBannerBound);
- Mojo.Event.listen(this.controller.get('gotlocagain'),"handleit", this.gotLocationAgainBound);
- Mojo.Event.listen(this.controller.get('retryloc'),"handleit", this.loadVenuesBound);
+ try{
+ Mojo.Event.listen(this.controller.stageController.document,Mojo.Event.activate, this.stageActivateBound);
+ Mojo.Event.listen(this.controller.get('search-checkin'),Mojo.Event.tap, this.venuelessCheckinBound);
+ Mojo.Event.listen(this.controller.get('search-add-venue'),Mojo.Event.tap, this.addNewVenueBound);
+ Mojo.Event.listen(this.controller.get('results-venue-list'),Mojo.Event.listTap, this.listWasTappedBound);
+ Mojo.Event.listen(this.controller.get('results-venue-list'),Mojo.Event.listAdd, this.addNewVenueBound);
+ Mojo.Event.listen(this.controller.sceneElement, Mojo.Event.keypress, this.onKeyPressHandlerBound);
+ Mojo.Event.listen(this.controller.sceneElement, Mojo.Event.keydown, this.keyDownHandlerBound);
+ Mojo.Event.listen(this.controller.get('refresh-venues'),Mojo.Event.tap, this.refreshVenuesBound);
+ Mojo.Event.listen(this.doc,"keyup", this.keyUpHandlerBound, true);
+ Mojo.Event.listen(this.controller.get('gotloc'),"handleit", this.gotLocationBound);
+ Mojo.Event.listen(this.controller.get('gotloc'),"showrefresh", this.showRefreshBound);
+ Mojo.Event.listen(this.controller.get('gotloc'),"gaveup", this.hideRetryBannerBound);
+ Mojo.Event.listen(this.controller.get('gotlocagain'),"handleit", this.gotLocationAgainBound);
+ Mojo.Event.listen(this.controller.get('retryloc'),"handleit", this.loadVenuesBound);
+ }catch(e){
+ Mojo.Log.error(Object.toJSON(e));
+ this.controller.showAlertDialog({
+ onChoose: function(value) {},
+ title: $L("Unrecoverable Error"),
+ message: $L("Whoa! Major error attempting to listen to events on elements in the app. Try restarting the app or your phone. If the problem persists, contact Zhephree at geoff@zhephree.com"),
+ allowHTMLMessage: true,
+ choices:[
+ {label:$L('D\'oh!'), value:"OK", type:'primary'}
+ ]
+ });
+
+ }
// Mojo.Event.listen(this.controller.get('go_button'),Mojo.Event.tap, this.onGetNearbyVenueSearchBound);
//Mojo.Event.listen(this.controller.get('recommend'),Mojo.Event.tap, this.doRecommendBound);
//Mojo.Event.listen(this.controller.get('results-venue-list'),Mojo.Event.listDelete, this.listHideItemBound);
@@ -1232,20 +1246,26 @@ NearbyVenuesAssistant.prototype.activate = function(event) {
if(_globals.nearbyVenues!=undefined){
this.controller.get("resultListBox").style.display = 'block';
- this.controller.get("spinnerId").mojo.stop();
+ try{
+ this.controller.get("spinnerId").mojo.stop();
+ }catch(e){}
this.controller.get("spinnerId").hide();
}
if(this.showSearch) {
var scroller = this.controller.getSceneScroller();
- scroller.mojo.revealTop(0);
+ try{
+ scroller.mojo.revealTop(0);
+ }catch(e){}
/* this.controller.get("drawerId").mojo.setOpenState(true);
this.controller.modelChanged(this.drawerModel);*/
}
if(_globals.reloadVenues) {
+ try{
this.controller.get("spinnerId").mojo.start();
+ }catch(e){}
this.controller.get("spinnerId").show();
this.controller.get("resultListBox").style.display = 'none';
_globals.nearbyVenues=undefined;
@@ -389,8 +389,7 @@ PreferencesAssistant.prototype.handleNotifs = function(event) {
_globals.wakeupTaskId = Object.toJSON(response.taskId);
},
onFailure: function(response) {
- // Mojo.Log.error("Alarm Set Failure",
- response.returnValue, response.errorText);
+ // Mojo.Log.error("Alarm Set Failure", response.returnValue, response.errorText);
}
});
}else{
@@ -58,11 +58,9 @@ _globals.whatsnew={
"id":"whatsnew",
"icon":"",
"pages":[
+ "Here's what's new in foursquare webOS <b>v2.8.2</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>Fixed a bug preventing Preferences from loading</li><li>Fixed a bug that prevented you from adding new venues</li></ul>",
"Here's what's new in foursquare webOS <b>v2.8.0</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>Fixed a bug that prevented user's mayorships from being seen</li><li>Now compatible with the TouchPad!</li></ul>",
"Here's what's new in foursquare webOS <b>v2.7.7</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>Added Spaz as a Twitter client option</li><li>Fixed a bug preventing venues from displaying; now sorted by your likely selection; not by distance or grouped (Foursquare API Change)</li><li>Fixed a bug where 'undefined' was displayed as the venue address</li></ul>",
- "Here's what's new in foursquare webOS <b>v2.7.5</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>A change in the foursquare API prevented venues from being listed</li></ul>",
- "Here's what's new in foursquare webOS <b>v2.7.4</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>OAuth / sign-in issues resolved</li></ul>",
- "Here's what's new in foursquare webOS <b>v2.7.3</b>! Follow me on Twitter: <a href=\"http://mobile.twitter.com/zhephree\">@zhephree</a><ul><li>GPS Issues resolved</li></ul>"
]
};
View
@@ -1,6 +1,6 @@
{
"id": "com.foursquare.foursquare",
- "version": "2.8.1",
+ "version": "2.8.2",
"vendor": "foursquare",
"noWindow" : "true",
"timingEnabled": "true",
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
BIN tpss.png
Binary file not shown.
View
BIN tpss2.png
Binary file not shown.
View
BIN tpss3.png
Binary file not shown.

0 comments on commit aedb04e

Please sign in to comment.