Permalink
Browse files

Keito ftw!

  • Loading branch information...
1 parent ec633b2 commit e28754f3417210d305dbd279752d05ccccff0c75 @jubishop committed Jul 29, 2009
Showing with 608 additions and 6 deletions.
  1. +12 −4 fbair.mxml
  2. +3 −2 fbair/nile/NileContainer.mxml
  3. +409 −0 fbair/notification/Toast.mxml
  4. +153 −0 fbair/notification/ToastManager.as
  5. +31 −0 fbair/styles/toasts.css
View
@@ -60,10 +60,11 @@
import fb.FBEvent;
import fb.util.Output;
+ import fbair.notification.ToastManager;
+ import fbair.server.Fetcher;
import fbair.util.FBUpdater;
import fbair.util.Preferences;
import fbair.util.ProfileCache;
- import fbair.server.Fetcher;
import flash.events.Event;
@@ -75,6 +76,9 @@
private var requiredSession:Boolean = false;
private var requiredPermissions:Boolean = false;
+ // Global instance of ToastManager
+ private var toaster:ToastManager = new ToastManager();
+
// Called when our app is initialized...
// The first thing to do is authorize our application..
private function applicationComplete(event:FlexEvent):void {
@@ -171,7 +175,8 @@
else if (FBConnect.status == FBConnect.NotLoggedIn) {
requiredSession = true;
requiredPermissions = false;
- FBConnect.requireSession({"req_perms":"read_stream,publish_stream"});
+ FBConnect.requireSession(
+ {"req_perms":"read_stream,publish_stream,manage_mailbox"});
}
}
@@ -185,14 +190,17 @@
// acquire extended permissions.
private function permissionChanged(event:FBEvent = null):void {
if (FBConnect.hasPermission("read_stream") &&
- FBConnect.hasPermission("publish_stream"))
+ FBConnect.hasPermission("publish_stream") &&
+ FBConnect.hasPermission("manage_mailbox"))
fullyAuthorized();
else if (requiredPermissions)
close();
else {
requiredSession = false;
requiredPermissions = true;
- FBConnect.requirePermissions(["read_stream", "publish_stream"]);
+ FBConnect.requirePermissions(["read_stream",
+ "publish_stream",
+ "manage_mailbox"]);
}
}
@@ -125,6 +125,9 @@
// Listen for when fetcher is going to the server
// so we can feed it our request in fql
Fetcher.steve.addEventListener(FBEvent.FETCHING_DATA, fetchingData);
+
+ // Called by fetcher when it has our data
+ Fetcher.steve.addEventListener(FBEvent.DATA_RECEIVED, dataReceived);
// Initialize created_time sorter
sort.fields = [new SortField("created_time", false, true)];
@@ -189,8 +192,6 @@
// Called by master when we're beginning things...
public function beginning():void {
- Fetcher.steve.addEventListener(FBEvent.DATA_RECEIVED, dataReceived);
-
nile.visible = true;
}
Oops, something went wrong.

0 comments on commit e28754f

Please sign in to comment.