Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

psych, that lives just fine as an Object

  • Loading branch information...
commit 01e6fdbf0bb5d9849b3575ab24881403bb82047b 1 parent 42081d8
Lee Byron authored
View
5 fbair.mxml
@@ -63,7 +63,6 @@
import fbair.util.FBUpdater;
import fb.util.Output;
import fbair.util.ProfileCache;
- import fbair.util.HashArray;
import flash.events.Event;
@@ -112,9 +111,9 @@
"We have a filter cache but not a nile cache?!");
// Set nile stuff first to prepare for events
- var stream_filters:HashArray = new HashArray();
+ var stream_filters:Object = new Object();
for each (var tab:Object in filtersData.tabData)
- stream_filters.push(tab.filter_key, tab.filter_key);
+ stream_filters[tab.filter_key] = true;
nileContainer.loadInitialFilters(stream_filters);
// Now set filtersBar and we're off and running
View
4 fbair/gui/filters/FiltersBar.mxml
@@ -214,10 +214,8 @@
menu.data = data;
// if this is your first launch, we'll give you default feed
- if (tabsHash.length == 0) {
- trace("adding the default feed");
+ if (tabsHash.length == 0)
addTab(data.getAt(0).filter_key);
- }
}
// Tab clicking
View
21 fbair/nile/NileContainer.mxml
@@ -46,7 +46,6 @@
import fbair.gc.Depot;
import fbair.nile.Nile;
import fbair.nile.renderers.NileRenderer;
- import fbair.util.HashArray;
import flash.display.DisplayObjectContainer;
import flash.events.Event;
@@ -98,7 +97,7 @@
public var dataCache:Object = new Object();
// Our active filters, by filter_key
- public var streamFilters:HashArray = new HashArray();
+ public var streamFilters:Object = new Object();
// Sorter for anything based on created_time
private var sort:Sort = new Sort();
@@ -129,10 +128,10 @@
// We call this on launch to set up our initial set of filters, if cached
// dataCache should already be set now as well
- public function loadInitialFilters(stream_filters:HashArray):void {
+ public function loadInitialFilters(stream_filters:Object):void {
// Populate our filters and their niles
streamFilters = stream_filters;
- for each (var streamFilter:String in streamFilters) {
+ for (var streamFilter:String in streamFilters) {
Output.assert(dataCache[streamFilter] != null,
"Loading streamFilter with no dataCache entry? : " + streamFilter);
niles[streamFilter] = Depot.get(Nile);
@@ -198,7 +197,7 @@
// Build our filter-key or statement
var requested_filters:Array = new Array();
- for each (var streamFilter:String in streamFilters)
+ for (var streamFilter:String in streamFilters)
requested_filters.push("(filter_key = '" + streamFilter + "' and " +
"created_time >= " + getLatestUpdate(streamFilter) + ")");
@@ -346,17 +345,17 @@
// Called when new filter has added to tab bar
public function filterAdded(filter_key:String):void {
- Output.assert(streamFilters.hasKey(filter_key),
+ Output.assert(streamFilters[filter_key],
"Adding filter_key that we already had?: " + filter_key);
Output.assert(niles[filter_key] == null,
"Adding filter_key with nile we had?:" + filter_key);
// So truly add it
- if (!streamFilters.hasKey(filter_key)) {
+ if (!streamFilters[filter_key]) {
Output.assert(niles[filter_key] == null,
"We have no streamfilter but a nile?: " + filter_key);
- streamFilters.push(filter_key, filter_key);
+ streamFilters[filter_key] = true;
CurrentFilter = filter_key;
// If there's a nile in the canvas, remove it
@@ -378,7 +377,7 @@
// Called when a filter has been removed
public function filterRemoved(filter_key:String):void {
- Output.assert(streamFilters.hasKey(filter_key),
+ Output.assert(streamFilters[filter_key],
"Removing filter with index -1?: " + filter_key);
Output.assert(nileCanvas.contains(niles[filter_key]),
"Removing nile not in display?");
@@ -392,12 +391,12 @@
delete niles[filter_key];
// Remove from filters
- streamFilters.removeKey(filter_key);
+ delete streamFilters[filter_key];
}
// Called when a new filter is selected!
public function filterSelected(filter_key:String):void {
- Output.assert(streamFilters.hasKey(filter_key),
+ Output.assert(streamFilters[filter_key],
"Selecting filter we don't have?: " + filter_key);
Output.assert(niles[filter_key] != null,
"Selecting filter with no nile?: " + filter_key);
Please sign in to comment.
Something went wrong with that request. Please try again.