Browse files

- I should really push more often. Added spawning of search cards. lo…

…ts of little UI changes. new icon
  • Loading branch information...
1 parent aff1470 commit a276ee0b078e9ecb395cd104eaa2c1684f522a34 @funkatron funkatron committed Feb 27, 2009
View
269 app/assistants/login-assistant.js
@@ -4,6 +4,14 @@ function LoginAssistant(argFromPusher) {
to the scene controller (this.controller) has not be established yet, so any initialization
that needs the scene controller should be done in the setup function below. */
+ if (argFromPusher && argFromPusher.firstload) {
+ if (sc.app.prefs.get('always-go-to-my-timeline')) {
+ Mojo.Controller.stageController.pushScene('my-timeline');
+ } else {
+ alert('NO always-go-to-my-timeline');
+ }
+ }
+
scene_helpers.addCommonSceneMethods(this);
}
@@ -22,19 +30,17 @@ LoginAssistant.prototype.setup = function() {
this.scroller = this.controller.getSceneScroller();
+ this.initAppMenu();
/*
Initialize the model
*/
- var username = sc.app.prefs.get('username');
- var password = sc.app.prefs.get('password');
-
// alert(username+":"+password)
this.model = {
- 'username':username,
- 'password':password,
+ 'username':false,
+ 'password':false,
'search':'',
- 'always-go-to-my-timeline':sc.app.prefs.get('always-go-to-my-timeline')
+ 'always-go-to-my-timeline':false
};
this.spinnerModel = {
@@ -46,13 +52,13 @@ LoginAssistant.prototype.setup = function() {
* Panels that use jQuery (but listen with Mojo)
*/
$('login-panel').hide();
- Mojo.Event.listen($('show-login-button'), Mojo.Event.tap, this.toggleLoginPanel.bind(this));
-
- // $('search-panel').hide();
- Mojo.Event.listen($('show-search-button'), Mojo.Event.tap, this.toggleSearchPanel.bind(this));
-
- // $('trends-panel').hide();
- // Mojo.Event.listen($('show-trends-button'), Mojo.Event.tap, this.toggleTrendsPanel.bind(this));
+ var thisA = this;
+ jQuery('#login-toggle').bind(Mojo.Event.tap, function() {
+ thisA.togglePanel('#login-panel', '#login-toggle');
+ });
+ jQuery('#search-toggle').bind(Mojo.Event.tap, function() {
+ thisA.togglePanel('#search-panel', '#search-toggle');
+ });
/**
@@ -109,7 +115,7 @@ LoginAssistant.prototype.setup = function() {
*/
this.controller.setupWidget('search',
this.atts = {
- hintText: 'enter search terms',
+ // hintText: 'enter search terms',
label: "search terms",
enterSubmits: true,
modelProperty: 'search',
@@ -135,7 +141,6 @@ LoginAssistant.prototype.setup = function() {
*/
Mojo.Event.listen($('login-button'), Mojo.Event.tap, this.handleLogin.bind(this));
Mojo.Event.listen($('search-button'), Mojo.Event.tap, this.handleSearch.bind(this));
- Mojo.Event.listen($('status-panel'), Mojo.Event.tap, this.hideStatusPanel.bind(this));
/*
listen for trends data updates
@@ -165,16 +170,108 @@ LoginAssistant.prototype.setup = function() {
}
+
+LoginAssistant.prototype.activate = function(argFromPusher) {
+ /* put in event handlers here that should only be in effect when this scene is active. For
+ example, key handlers that are observing the document */
+
+ this.model.username = sc.app.prefs.get('username');
+ this.model.password = sc.app.prefs.get('password');
+ this.model['always-go-to-my-timeline'] = sc.app.prefs.get('always-go-to-my-timeline');
+ this.controller.modelChanged( this.model );
+
+
+ var thisA = this;
+
+ jQuery('.trend-item').live(Mojo.Event.tap, function() {
+ var term = jQuery(this).attr('data-searchterm');
+ thisA.searchFor(term);
+ });
+
+
+ /*
+ What to do if we succeed
+ Note that we pass the assistant object as data into the closure
+ */
+ jQuery().bind('verify_credentials_succeeded', {'thisAssistant':this}, function(e) {
+ sc.app.twit.setCredentials(e.data.thisAssistant.model.username, e.data.thisAssistant.model.password);
+
+ sc.app.prefs.set('username', e.data.thisAssistant.model.username);
+ sc.app.prefs.set('password', e.data.thisAssistant.model.password);
+
+
+ sc.app.lastFriendsTimelineId = 1;
+
+ e.data.thisAssistant.hideInlineSpinner('#spinner-container');
+
+ /*
+ @todo Save username and password as encrypted vals
+ */
+
+ // Mojo.Controller.stageController.swapScene("my-timeline", this);
+ // findAndSwapScene("my-timeline", this);
+ Mojo.Controller.stageController.pushScene('my-timeline');
+ });
+
+ /*
+ What to do if we fail
+ */
+ jQuery().bind('verify_credentials_failed', {'thisAssistant':this}, function(e) {
+
+
+ /*
+ If we return to this scene from another
+ and fail the login, e.data.thisAssistant will not have
+ its controller property. WHY?
+ */
+
+ e.data.thisAssistant.stopInlineSpinner('#spinner-container', 'Login failed!');
+ });
+
+}
+
+
+LoginAssistant.prototype.deactivate = function(event) {
+ /* remove any event handlers you added in activate and do any other cleanup that should happen before
+ this scene is popped or another scene is pushed on top */
+
+ this.model.username = '';
+ this.model.password = '';
+ this.controller.modelChanged( this.model );
+ // this.hideStatusPanel();
+
+ jQuery().unbind('verify_credentials_succeeded');
+ jQuery().unbind('verify_credentials_failed');
+
+ jQuery('#goToMyTimelineCheckbox', this.scroller).unbind(Mojo.Event.tap);
+
+ jQuery('.trend-item').die(Mojo.Event.tap);
+
+}
+
+LoginAssistant.prototype.cleanup = function(event) {
+ /* this function should do any cleanup needed before the scene is destroyed as
+ a result of being popped off the scene stack */
+}
+
+
+
+
+
+
+
+
+
LoginAssistant.prototype.togglePanel = function(panel_selector, button_selector, onOpen, onClose) {
if (jQuery(panel_selector).is(':visible')) { // is open, we need to close
- jQuery(panel_selector).hide('blind', 'fast');
+ jQuery(panel_selector).fadeOut('fast');
jQuery(button_selector).removeClass('open').addClass('closed');
if (onClose) { onClose(); }
} else { // is closed, we need to open
- jQuery(panel_selector).show('blind', 'fast');
+ jQuery(panel_selector).fadeIn('fast');
jQuery(button_selector).removeClass('closed').addClass('open');
if (onOpen) { onOpen(); }
@@ -231,65 +328,13 @@ LoginAssistant.prototype.handleLogin = function(event) {
LoginAssistant.prototype.handleSearch = function(event) {
if (this.model && this.model.search) {
- findAndSwapScene("search-twitter", {
+ Mojo.Controller.stageController.pushScene("search-twitter", {
searchterm:this.model.search
});
}
}
-/**
- * turn the spinner on, and optionally set the message
- * @param {string} message
- */
-LoginAssistant.prototype.spinnerOn = function(message) {
- if (message) {
- this.setSpinnerLabel(message);
- }
-
- this.showStatusPanel();
-
- this.spinnerModel.spinning = true;
- this.controller.modelChanged( this.spinnerModel );
-}
-
-/**
- * Turns off the spinner. does NOT hide the status panel. Optionally sets message
- * @param {string} message
- */
-LoginAssistant.prototype.spinnerOff = function(message) {
- if (message) {
- this.setSpinnerLabel(message);
- }
- this.spinnerModel.spinning = false;
- this.controller.modelChanged( this.spinnerModel );
-}
-
-/**
- * @param {string} text
- */
-LoginAssistant.prototype.setSpinnerLabel = function(text) {
- $('status-label').update(text);
-}
-
-/**
- * show the status panel
- */
-LoginAssistant.prototype.showStatusPanel = function() {
- if (!jQuery('#status-panel').is(':visible')) {
- jQuery('#status-panel').fadeIn(500);
- }
-}
-
-/**
- * hide the status panel
- */
-LoginAssistant.prototype.hideStatusPanel = function(event) {
- if (jQuery('#status-panel').is(':visible')) {
- jQuery('#status-panel').fadeOut(500);
- }
-}
-
LoginAssistant.prototype.propertyChanged = function(event) {
dump("********* property Change *************");
}
@@ -298,88 +343,4 @@ LoginAssistant.prototype.propertyChanged = function(event) {
-LoginAssistant.prototype.activate = function(event) {
- /* put in event handlers here that should only be in effect when this scene is active. For
- example, key handlers that are observing the document */
- //
- // dump('getScenes()');
- // dump(Mojo.Controller.stageController.getScenes());
- // dump('activeScene()');
- // dump(Mojo.Controller.stageController.activeScene());
- // dump('topScene()');
- // dump(Mojo.Controller.stageController.topScene());
-
-
- var thisA = this;
-
- jQuery('.trend-item').live(Mojo.Event.tap, function() {
- var term = jQuery(this).attr('data-searchterm');
- thisA.searchFor(term);
- });
-
-
- /*
- What to do if we succeed
- Note that we pass the assistant object as data into the closure
- */
- jQuery().bind('verify_credentials_succeeded', {'thisAssistant':this}, function(e) {
- sc.app.twit.setCredentials(e.data.thisAssistant.model.username, e.data.thisAssistant.model.password);
- sc.app.prefs.set('username', e.data.thisAssistant.model.username);
- sc.app.prefs.set('password', e.data.thisAssistant.model.password);
-
-
- sc.app.lastFriendsTimelineId = 1;
-
- e.data.thisAssistant.hideInlineSpinner('#spinner-container');
-
- /*
- @todo Save username and password as encrypted vals
- */
-
- // Mojo.Controller.stageController.swapScene("my-timeline", this);
- findAndSwapScene("my-timeline", this);
- });
-
- /*
- What to do if we fail
- */
- jQuery().bind('verify_credentials_failed', {'thisAssistant':this}, function(e) {
-
-
- /*
- If we return to this scene from another
- and fail the login, e.data.thisAssistant will not have
- its controller property. WHY?
- */
-
- e.data.thisAssistant.stopInlineSpinner('#spinner-container', 'Login failed!');
- });
-
-
-
-}
-
-
-LoginAssistant.prototype.deactivate = function(event) {
- /* remove any event handlers you added in activate and do any other cleanup that should happen before
- this scene is popped or another scene is pushed on top */
-
- this.model.username = '';
- this.model.password = '';
- this.controller.modelChanged( this.model );
- this.hideStatusPanel();
-
- jQuery().unbind('verify_credentials_succeeded');
- jQuery().unbind('verify_credentials_failed');
-
- jQuery('#goToMyTimelineCheckbox', this.scroller).unbind(Mojo.Event.tap);
-
- jQuery('.trend-item').die(Mojo.Event.tap);
-
-}
-
-LoginAssistant.prototype.cleanup = function(event) {
- /* this function should do any cleanup needed before the scene is destroyed as
- a result of being popped off the scene stack */
-}
View
8 app/assistants/manage-followers-assistant.js
@@ -10,11 +10,13 @@ function ManageFollowersAssistant() {
ManageFollowersAssistant.prototype.setup = function() {
+ this.initAppMenu();
+
this.setupCommonMenus({
viewMenuItems: [
{
items: [
- {label:$L('Search Twitter'), command:'scroll-top'},
+ {label:$L('Manage Followers'), command:'scroll-top'},
// {label: $L('Show me'), iconPath:'images/theme/menu-icon-triangle-down.png', submenu:'filter-menu'},
]
},
@@ -28,10 +30,10 @@ ManageFollowersAssistant.prototype.setup = function() {
cmdMenuItems: [{ items:
[
{},
- {label:$L('Home'), command:'home', shortcut:'H'},
+ // {label:$L('Home'), iconPath:'images/theme/menu-icon-home.png', command:'home', shortcut:'H'},
{label:$L('My Timeline'), icon:'conversation', command:'my-timeline', shortcut:'T'},
{label:$L('Search'), icon:'search', command:'search', shortcut:'S'},
- {label:$L('Followers'), command:'followers', shortcut:'L', disabled:true},
+ {label:$L('Followers'), icon:'remove-vip', command:'followers', shortcut:'L', disabled:true},
{}
]
}]
View
27 app/assistants/message-detail-assistant.js
@@ -22,6 +22,7 @@ MessageDetailAssistant.prototype.setup = function() {
// alert('MessageDetailAssistant.prototype.setup');
+ this.initAppMenu();
this.setupCommonMenus({
viewMenuItems: [
@@ -30,10 +31,13 @@ MessageDetailAssistant.prototype.setup = function() {
{label:$L('Back'), icon:'back', command:'back'},
{label:$L('Message Detail'), command:'scroll-top'}
]
+ },
+ {
+ items: [
+ {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
+ ]
}
- ],
- cmdMenuItems: [
- {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
+
]
});
@@ -57,22 +61,7 @@ MessageDetailAssistant.prototype.activate = function(event) {
/* put in event handlers here that should only be in effect when this scene is active. For
example, key handlers that are observing the document */
- // alert('MessageDetailAssistant.prototype.activate');
-
- // dump('getScenes()');
- // dump(Mojo.Controller.stageController.getScenes());
- // dump('activeScene()');
- // dump(Mojo.Controller.stageController.activeScene());
- // dump('topScene()');
- // dump(Mojo.Controller.stageController.topScene());
- // dump('isChildWindow()');
- // dump(Mojo.Controller.stageController.isChildWindow());
-
-
-
-
- sc.app.twit.getOne(this.status_id);
-
+ sc.app.twit.getOne(this.status_id);
var thisA = this; // for closures
View
190 app/assistants/my-timeline-assistant.js
@@ -1,19 +1,34 @@
+/**
+ * events raised here:
+ * 'my_timeline_refresh'
+ */
+
+
function MyTimelineAssistant(argFromPusher) {
/* this is the creator function for your scene assistant object. It will be passed all the
additional parameters (after the scene name) that were passed to pushScene. The reference
to the scene controller (this.controller) has not be established yet, so any initialization
that needs the scene controller should be done in the setup function below. */
scene_helpers.addCommonSceneMethods(this);
+
+ /*
+ this property will hold the setInterval return
+ */
+ this.refresher = null;
}
MyTimelineAssistant.prototype.setup = function() {
- // alert('MyTimelineAssistant.prototype.setup');
/* this function is for setup tasks that have to happen when the scene is first created */
+ this.initAppMenu();
+
+ this.initTwit();
+
+
this.setupCommonMenus({
viewMenuItems: [
{
@@ -33,10 +48,10 @@ MyTimelineAssistant.prototype.setup = function() {
cmdMenuItems: [{ items:
[
{},
- {label:$L('Home'), command:'home', shortcut:'H'},
+ // {label:$L('Home'), iconPath:'images/theme/menu-icon-home.png', command:'home', shortcut:'H'},
{label:$L('My Timeline'), icon:'conversation', command:'my-timeline', shortcut:'T', disabled:true},
{label:$L('Search'), icon:'search', command:'search', shortcut:'S'},
- {label:$L('Followers'), command:'followers', shortcut:'L'},
+ {label:$L('Followers'), icon:'remove-vip', command:'followers', shortcut:'L'},
{}
]
}]
@@ -64,19 +79,6 @@ MyTimelineAssistant.prototype.activate = function(event) {
/* put in event handlers here that should only be in effect when this scene is active. For
example, key handlers that are observing the document */
- // alert('MyTimelineAssistant.prototype.activate');
-
- // dump('getScenes()');
- // dump(Mojo.Controller.stageController.getScenes());
- // dump('activeScene()');
- // dump(Mojo.Controller.stageController.activeScene());
- // dump('topScene()');
- // dump(Mojo.Controller.stageController.topScene());
- // dump('isChildWindow()');
- // dump(Mojo.Controller.stageController.isChildWindow());
-
-
-
this.addPostPopup();
@@ -90,6 +92,7 @@ MyTimelineAssistant.prototype.activate = function(event) {
dump(response);
// e.data.thisAssistant.spinnerOff();
this.hideInlineSpinner('#my-timeline');
+ this.startRefresher();
});
// jQuery().bind('new_friends_timeline_data', { thisAssistant:this }, function(e, tweets) {
@@ -107,47 +110,54 @@ MyTimelineAssistant.prototype.activate = function(event) {
var rendertweets = tweets;
jQuery.each( rendertweets, function() {
- // dump(this)
- this.text = makeItemsClickable(this.text);
/*
- Render the tweet
+ check to see if this item exists
*/
- if (this.SC_is_dm) {
- var itemhtml = Mojo.View.render({object: this, template: 'shared/dm'});
+ if (!e.data.thisAssistant.getEntryElementByStatusId(this.id)) {
+ // dump(this)
+ this.text = makeItemsClickable(this.text);
+
+ /*
+ Render the tweet
+ */
+ if (this.SC_is_dm) {
+ var itemhtml = Mojo.View.render({object: this, template: 'shared/dm'});
+ } else {
+ var itemhtml = Mojo.View.render({object: this, template: 'shared/tweet'});
+ }
+
+ /*
+ make jQuery obj
+ */
+ var jqitem = jQuery(itemhtml);
+
+ /*
+ attach data object to item html
+ */
+ jqitem.data('item', this);
+
+ if (this.SC_is_reply) {
+ jqitem.addClass('reply');
+ }
+
+ if (this.SC_is_dm) {
+ jqitem.addClass('dm');
+ }
+
+ /*
+ put item on timeline
+ */
+ jQuery('#my-timeline', e.data.thisAssistant.scroller).prepend(jqitem);
} else {
- var itemhtml = Mojo.View.render({object: this, template: 'shared/tweet'});
+ dump('Tweet ('+this.id+') already is in timeline');
}
-
- /*
- make jQuery obj
- */
- var jqitem = jQuery(itemhtml);
-
- /*
- attach data object to item html
- */
- jqitem.data('item', this);
-
- if (this.SC_is_reply) {
- jqitem.addClass('reply');
- }
-
- if (this.SC_is_dm) {
- jqitem.addClass('dm');
- }
-
- /*
- put item on timeline
- */
- jQuery('#my-timeline').prepend(jqitem);
- });
-
+ });
e.data.thisAssistant.scrollToNew();
} else {
- Mojo.log("no new tweets");
+ dump("no new tweets");
}
/*
@@ -174,16 +184,16 @@ MyTimelineAssistant.prototype.activate = function(event) {
// e.data.thisAssistant.spinnerOff();
e.data.thisAssistant.hideInlineSpinner('#my-timeline');
+ e.data.thisAssistant.startRefresher();
});
-
-
+ jQuery().bind('my_timeline_refresh', { thisAssistant:this }, function(e) {
+ e.data.thisAssistant.refresh();
+ });
/*
listen for clicks on user avatars
- Note that these will hear clicks across all active scenes, not just
- this one.
*/
jQuery('div.timeline-entry>.user', this.scroller).live(Mojo.Event.tap, function(e) {
var userid = jQuery(this).attr('data-user-screen_name');
@@ -212,23 +222,13 @@ MyTimelineAssistant.prototype.activate = function(event) {
return false;
});
- /*
- the "hold" event might be a little too short, and interfere with normal clicks, so not using
- */
- // jQuery('#my-timeline>div.timeline-entry').live(Mojo.Event.hold, function(e) {
- // var statusid = jQuery(this).attr('data-status-id');
- // Mojo.Controller.stageController.pushScene('message-detail', statusid);
- // });
-
-
/*
Make request to Twitter
*/
this.getData();
-
-
+ this.startRefresher();
}
@@ -238,20 +238,22 @@ MyTimelineAssistant.prototype.deactivate = function(event) {
/* remove any event handlers you added in activate and do any other cleanup that should happen before
this scene is popped or another scene is pushed on top */
- // alert('MyTimelineAssistant.prototype.deactivate');
-
this.removePostPopup();
jQuery().unbind('error_user_timeline_data');
jQuery().unbind('new_combined_timeline_data');
jQuery().unbind('update_succeeded');
jQuery().unbind('update_failed');
+ jQuery().unbind('my_timeline_refresh');
jQuery('div.timeline-entry>.user', this.scroller).die(Mojo.Event.tap);
jQuery('.username.clickable', this.scroller).die(Mojo.Event.tap);
jQuery('.hashtag.clickable', this.scroller).die(Mojo.Event.tap);
jQuery('div.timeline-entry>.status>.meta', this.scroller).die(Mojo.Event.tap);
jQuery('a[href]', this.scroller).die(Mojo.Event.tap);
+
+
+
}
MyTimelineAssistant.prototype.cleanup = function(event) {
@@ -260,21 +262,55 @@ MyTimelineAssistant.prototype.cleanup = function(event) {
}
-MyTimelineAssistant.prototype.getData = function() {
- // this.spinnerOn();
+
+// MyTimelineAssistant.prototype.initTwit = function() {
+// };
+
+
+MyTimelineAssistant.prototype.getEntryElementByStatusId = function(id) {
+
+ var el = jQuery('#my-timeline div.timeline-entry[data-status-id='+id+']', this.scroller).get(0);
+ return el;
+
+};
+
+
+
+
+MyTimelineAssistant.prototype.getData = function() {
sc.helpers.markAllAsRead('#my-timeline>div.timeline-entry');
this.showInlineSpinner('#my-timeline', 'Looking for new tweets…');
- // /*
- // this is just to avoid network requests
- // */
- // jQuery.getJSON('user_timeline.json', function(data, textStatus) {
- // jQuery().trigger('new_friends_timeline_data', [data]);
- // });
-
- sc.app.twit.getCombinedTimeline();
+
+ this.twit.getCombinedTimeline();
};
-MyTimelineAssistant.prototype.refresh = function() {
+
+MyTimelineAssistant.prototype.refresh = function(e) {
+ this.stopRefresher();
this.getData();
-};
+};
+
+
+
+
+MyTimelineAssistant.prototype.startRefresher = function() {
+ dump('Starting refresher');
+ /*
+ Set up refresher
+ */
+
+ this.refresher = setInterval(function() {
+ jQuery().trigger('my_timeline_refresh');
+ }, sc.app.prefs.get('network-refreshinterval')
+ );
+ // this.refresher = setInterval(this.refresh.call(this), 5000)
+}
+
+MyTimelineAssistant.prototype.stopRefresher = function() {
+ dump('Stopping refresher');
+ /*
+ Clear refresher
+ */
+ clearInterval(this.refresher);
+}
View
34 app/assistants/preferences-assistant.js
@@ -0,0 +1,34 @@
+function PreferencesAssistant() {
+ /* this is the creator function for your scene assistant object. It will be passed all the
+ additional parameters (after the scene name) that were passed to pushScene. The reference
+ to the scene controller (this.controller) has not be established yet, so any initialization
+ that needs the scene controller should be done in the setup function below. */
+}
+
+PreferencesAssistant.prototype.setup = function() {
+
+ this.initAppMenu();
+ /* this function is for setup tasks that have to happen when the scene is first created */
+
+ /* use Luna.View.render to render view templates and add them to the scene, if needed. */
+
+ /* setup widgets here */
+
+ /* add event handlers to listen to events from widgets */
+}
+
+PreferencesAssistant.prototype.activate = function(event) {
+ /* put in event handlers here that should only be in effect when this scene is active. For
+ example, key handlers that are observing the document */
+}
+
+
+PreferencesAssistant.prototype.deactivate = function(event) {
+ /* remove any event handlers you added in activate and do any other cleanup that should happen before
+ this scene is popped or another scene is pushed on top */
+}
+
+PreferencesAssistant.prototype.cleanup = function(event) {
+ /* this function should do any cleanup needed before the scene is destroyed as
+ a result of being popped off the scene stack */
+}
View
282 app/assistants/search-twitter-assistant.js
@@ -1,3 +1,8 @@
+/**
+ * events raised here:
+ * 'search_twitter_refresh'
+ */
+
function SearchTwitterAssistant(args) {
/* this is the creator function for your scene assistant object. It will be passed all the
additional parameters (after the scene name) that were passed to pushScene. The reference
@@ -6,50 +11,130 @@ function SearchTwitterAssistant(args) {
scene_helpers.addCommonSceneMethods(this);
- if (args.searchterm) {
+ if (args && args.searchterm) {
this.passedSearch = args.searchterm;
}
+ if (args && args.lightweight) {
+
+
+ /*
+ we may be in a new stage, so need to init prefs if they don't exist
+ */
+ this.initPrefs();
+
+ this.lightweight = true;
+
+
+ }
+
+ /*
+ this property will hold the setInterval return
+ */
+ this.refresher = null;
}
+
+SearchTwitterAssistant.prototype.initPrefs = function() {
+
+
+ /*
+ load our prefs
+ default_preferences is from default_preferences.js, loaded in index.html
+ */
+ if (!sc.app.prefs) {
+
+ /*
+ We can't go to the login screen until the
+ prefs have fully loaded
+ */
+ var thisSA = this;
+ jQuery().bind('spazprefs_loaded', function() {
+
+ var username = sc.app.prefs.get('username');
+ var password = sc.app.prefs.get('password');
+
+ if (!sc.app.twit) {
+ sc.app.twit = new scTwit();
+
+ if (username && password) {
+ sc.app.twit.setCredentials(username, password);
+ }
+ }
+
+ });
+
+ sc.app.prefs = new scPrefs(default_preferences);
+ sc.app.prefs.load();
+ }
+};
+
+
SearchTwitterAssistant.prototype.setup = function() {
/* this function is for setup tasks that have to happen when the scene is first created */
/* use Mojo.View.render to render view templates and add them to the scene, if needed. */
+
+ var thisA = this;
- this.setupCommonMenus({
- viewMenuItems: [
- {
- items: [
- {label:$L('Search Twitter'), command:'scroll-top', 'class':"palm-header left"},
- // {label: $L('Show me'), iconPath:'images/theme/menu-icon-triangle-down.png', submenu:'filter-menu'},
- ]
- },
- {
- items: [
- {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
- {label:$L('Update'), icon:'sync', command:'refresh', shortcut:'R'}
- ]
- }
- ],
- cmdMenuItems: [{ items:
- [
- {},
- {label:$L('Home'), command:'home', shortcut:'H'},
- {label:$L('My Timeline'), icon:'conversation', command:'my-timeline', shortcut:'T'},
- {label:$L('Search'), icon:'search', command:'search', shortcut:'S', disabled:true},
- {label:$L('Followers'), command:'followers', shortcut:'L'},
- {}
+ this.initTwit();
+
+ this.initAppMenu();
+
+ if (this.lightweight) {
+ this.setupCommonMenus({
+ viewMenuItems: [
+ {
+ items: [
+ {label:$L('Search Twitter'), command:'scroll-top', 'class':"palm-header left"},
+ // {label: $L('Show me'), iconPath:'images/theme/menu-icon-triangle-down.png', submenu:'filter-menu'},
+ ]
+ },
+ {
+ items: [
+ {label:$L('Trends'), iconPath:'images/theme/menu-icon-trends.png', command:'search-trends', shortcut:'R'},
+ ]
+ }
]
- }]
- });
+ });
+
+ } else {
+ this.setupCommonMenus({
+ viewMenuItems: [
+ {
+ items: [
+ {label:$L('Search Twitter'), command:'scroll-top', 'class':"palm-header left"},
+ // {label: $L('Show me'), iconPath:'images/theme/menu-icon-triangle-down.png', submenu:'filter-menu'},
+ ]
+ },
+ {
+ items: [
+ {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
+ {label:$L('Trends'), iconPath:'images/theme/menu-icon-trends.png', command:'search-trends', shortcut:'R'},
+ {label:$L('New Search'), icon:'new', command:'new-search-card', shortcut:'S'}
+ ]
+ }
+ ],
+ cmdMenuItems: [{ items:
+ [
+ {},
+ // {label:$L('Home'), iconPath:'images/theme/menu-icon-home.png', command:'home', shortcut:'H'},
+ {label:$L('My Timeline'), icon:'conversation', command:'my-timeline', shortcut:'T'},
+ {label:$L('Search'), icon:'search', command:'search', shortcut:'S', disabled:true},
+ {label:$L('Followers'), icon:'remove-vip', command:'followers', shortcut:'L'},
+ {}
+ ]
+ }]
+ });
+
+ }
this.scroller = this.controller.getSceneScroller();
this.searchBoxAttr = {
"hintText": 'Enter search terms…',
- "filterFunction": this.search.bind(this),
"focusMode": Mojo.Widget.focusSelectMode,
+ "fieldName":'search-twitter'
// "changeOnKeyPress":true
};
@@ -61,49 +146,14 @@ SearchTwitterAssistant.prototype.setup = function() {
this.controller.setupWidget('search-twitter-textfield', this.searchBoxAttr, this.searchBoxModel);
- // this.comboBoxAttr = {
- // "hintText": 'Enter search terms…',
- // "filterFunction":this.search.bind(this),
- // "template": 'combobox/combobox-listitem'
- // };
- // this.comboBoxModel = {
- //
- // }
- //
- // this.controller.setupWidget('search-twitter-combobox', this.comboBoxAttr, this.comboBoxModel);
- //
- /* add event handlers to listen to events from widgets */
- Mojo.Event.listen($('search-twitter-textfield'), Mojo.Event.propertyChange, this.search.bind(this));
-
-
-
-}
+ jQuery('#submit-search-button').bind(Mojo.Event.tap, function() {
+ thisA.search.call(thisA, thisA.searchBoxModel.value);
+ });
-SearchTwitterAssistant.prototype.search = function(e) {
- dump("search called");
-
- /*
- clear any existing results
- */
- jQuery('#search-timeline').empty();
- // this.spinnerOn();
- this.showInlineSpinner('#search-timeline', 'Looking for results…');
-
-
- if (sch.isString(e)) {
- dump(e);
- sc.app.twit.search(e);
- } else {
- dump(e);
- sc.app.twit.search(e.value);
- }
}
-SearchTwitterAssistant.prototype.refresh = function() {
- this.search(this.searchBoxModel.value);
-};
SearchTwitterAssistant.prototype.activate = function(event) {
@@ -137,18 +187,18 @@ SearchTwitterAssistant.prototype.activate = function(event) {
jQuery().bind('new_search_timeline_data', { thisAssistant:this }, function(e, tweets) {
- dump(e.data.thisAssistant);
-
- dump('seach\'s tweets:');
- dump(tweets);
+ // dump(e.data.thisAssistant);
+ //
+ // dump('search\'s tweets:');
+ // dump(tweets);
/*
reverse the tweets for collection rendering (faster)
*/
var rendertweets = tweets;
jQuery.each( rendertweets, function() {
- dump(this)
+ // dump(this)
this.text = makeItemsClickable(this.text);
var itemhtml = Mojo.View.render({object: this, template: 'search-twitter/search-item'});
@@ -158,14 +208,14 @@ SearchTwitterAssistant.prototype.activate = function(event) {
*/
var jqitem = jQuery(itemhtml);
- dump('data for item:');
- dump(jQuery.data(jqitem.get(0)));
+ // dump('data for item:');
+ // dump(jQuery.data(jqitem.get(0)));
/*
attach data object to item html
*/
jqitem.data('item', this);
- dump(jqitem.attr('class'))
+ // dump(jqitem.attr('class'))
// dump(this.user.screen_name +" is from "+ this.SC_timeline_from);
@@ -182,14 +232,12 @@ SearchTwitterAssistant.prototype.activate = function(event) {
sch.updateRelativeTimes('#search-timeline>div.timeline-entry>.status>.meta>.date', 'data-created_at');
// e.data.thisAssistant.spinnerOff();
e.data.thisAssistant.hideInlineSpinner('#search-timeline');
-
+ e.data.thisAssistant.startRefresher();
});
/*
listen for clicks on user avatars
- Note that these will hear clicks across all active scenes, not just
- this one.
*/
jQuery('div.timeline-entry>.user', this.scroller).live(Mojo.Event.tap, function(e) {
var userid = jQuery(this).attr('data-user-screen_name');
@@ -210,14 +258,32 @@ SearchTwitterAssistant.prototype.activate = function(event) {
var statusid = jQuery(this).attr('data-status-id');
Mojo.Controller.stageController.pushScene('message-detail', statusid);
});
+
+ jQuery('#search-twitter-textfield', this.scroller).bind('focus', function(e) {
+ jQuery('#submit-search-button').fadeIn('fast');
+ });
+
+ jQuery('#search-twitter-textfield', this.scroller).bind('blur', function(e) {
+ jQuery('#submit-search-button').fadeOut('fast');
+ });
+
+
+ jQuery().bind('search_twitter_refresh', { thisAssistant:this }, function(e) {
+ e.data.thisAssistant.refresh();
+ });
+
+
+ this.startRefresher();
+
}
SearchTwitterAssistant.prototype.deactivate = function(event) {
/* remove any event handlers you added in activate and do any other cleanup that should happen before
this scene is popped or another scene is pushed on top */
- Mojo.Event.stopListening($('search-twitter-textfield'), Mojo.Event.propertyChange, this.search);
+ // Mojo.Event.stopListening($('search-twitter-textfield'), Mojo.Event.propertyChange, this.search);
+ Mojo.Event.stopListening($('submit-search-button'), Mojo.Event.tap, this.search);
jQuery().unbind('new_search_timeline_data');
@@ -233,3 +299,65 @@ SearchTwitterAssistant.prototype.cleanup = function(event) {
/* this function should do any cleanup needed before the scene is destroyed as
a result of being popped off the scene stack */
}
+
+
+
+SearchTwitterAssistant.prototype.search = function(e) {
+ dump("search called");
+
+
+ if (sch.isString(e)) {
+ dump(e);
+ this.twit.search(e);
+ /*
+ clear any existing results
+ */
+ jQuery('#search-timeline').empty();
+
+ // this.spinnerOn();
+ this.showInlineSpinner('#search-timeline', 'Looking for results…');
+
+ } else if (e.value) {
+ dump(e);
+ this.twit.search(e.value);
+ /*
+ clear any existing results
+ */
+ jQuery('#search-timeline').empty();
+
+ // this.spinnerOn();
+ this.showInlineSpinner('#search-timeline', 'Looking for results…');
+
+ jQuery('#submit-search-button').hide();
+ }
+}
+
+
+SearchTwitterAssistant.prototype.refresh = function() {
+ this.stopRefresher();
+ this.search(this.searchBoxModel.value);
+};
+
+
+
+
+SearchTwitterAssistant.prototype.startRefresher = function() {
+ dump('Starting refresher');
+ /*
+ Set up refresher
+ */
+
+ this.refresher = setInterval(function() {
+ jQuery().trigger('search_twitter_refresh');
+ }, sc.app.prefs.get('network-refreshinterval')
+ );
+ // this.refresher = setInterval(this.refresh.call(this), 5000)
+}
+
+SearchTwitterAssistant.prototype.stopRefresher = function() {
+ dump('Stopping refresher');
+ /*
+ Clear refresher
+ */
+ clearInterval(this.refresher);
+}
View
21 app/assistants/stage-assistant.js
@@ -1,18 +1,19 @@
function StageAssistant () {
-
-
+ this.firstload = true;
+}
-
-
-}
StageAssistant.prototype.setup = function() {
// this.controller.pushScene('my-timeline');
// this.controller.pushScene('search-twitter', {searchterm:'funkatron'});
// this.controller.pushScene('user-detail', 'poop');
+ sc.app.search_cards = [];
+ sc.app.new_search_card = 0;
+
+
/*
We can't go to the login screen until the
prefs have fully loaded
@@ -29,13 +30,15 @@ StageAssistant.prototype.setup = function() {
sc.app.twit.setCredentials(username, password);
}
-
- if (sc.app.prefs.get('always-go-to-my-timeline')) {
- thisSA.controller.pushScene('my-timeline');
+ if (thisSA.firstload) {
+ dump('FIRSTLOAD ----------------------');
+ thisSA.controller.pushScene('login', {'firstload':true});
+ thisSA.firstload = false;
} else {
- thisSA.controller.pushScene('login');
+ thisSA.controller.pushScene('login');
}
+
});
/*
View
41 app/assistants/stage-lightweight-search-assistant.js
@@ -0,0 +1,41 @@
+function StageAssistant () {
+
+}
+
+
+
+StageAssistant.prototype.setup = function() {
+ /*
+ We can't go to the login screen until the
+ prefs have fully loaded
+ */
+ var thisSA = this;
+ jQuery().bind('spazprefs_loaded', function() {
+
+ var username = sc.app.prefs.get('username');
+ var password = sc.app.prefs.get('password');
+
+ sc.app.twit = new scTwit();
+
+ if (username && password) {
+ sc.app.twit.setCredentials(username, password);
+ }
+
+ // if (thisSA.firstload) {
+ // dump('FIRSTLOAD ----------------------');
+ // thisSA.controller.pushScene('login', {'firstload':true});
+ // thisSA.firstload = false;
+ // } else {
+ // thisSA.controller.pushScene('login');
+ // }
+
+
+ });
+
+ /*
+ load our prefs
+ default_preferences is from default_preferences.js, loaded in index.html
+ */
+ sc.app.prefs = new scPrefs(default_preferences);
+ sc.app.prefs.load();
+}
View
36 app/assistants/user-detail-assistant.js
@@ -4,8 +4,6 @@ function UserDetailAssistant(argFromPusher) {
to the scene controller (this.controller) has not be established yet, so any initialization
that needs the scene controller should be done in the setup function below. */
- dump(argFromPusher);
-
scene_helpers.addCommonSceneMethods(this);
if (sc.helpers.isString(argFromPusher) || sc.helpers.isNumber(argFromPusher)) {
@@ -23,7 +21,7 @@ function UserDetailAssistant(argFromPusher) {
UserDetailAssistant.prototype.setup = function() {
- // alert('UserDetailAssistant.prototype.setup');
+ this.initAppMenu();
this.setupCommonMenus({
viewMenuItems: [
@@ -32,11 +30,14 @@ UserDetailAssistant.prototype.setup = function() {
{label:$L('Back'), icon:'back', command:'back'},
{label:$L('User Detail'), command:'scroll-top'}
]
+ },
+ {
+ items: [
+ {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
+ ]
}
+
],
- cmdMenuItems: [
- {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
- ]
});
this.scroller = this.controller.getSceneScroller();
@@ -54,15 +55,7 @@ UserDetailAssistant.prototype.setup = function() {
jQuery().bind('new_user_timeline_data', { thisAssistant:this }, function(e, tweets) {
- dump(e.data.thisAssistant);
-
- dump('user\'s tweets:');
- dump(tweets);
-
this.userobj = tweets[0].user;
- dump('user\'s info:');
- dump(this.userobj);
-
this.userRetrieved = true;
var itemhtml = Mojo.View.render({object:this.userobj, template: 'user-detail/user-detail'});
@@ -77,7 +70,6 @@ UserDetailAssistant.prototype.setup = function() {
rendertweets.reverse();
jQuery.each( rendertweets, function() {
- dump(this)
this.text = makeItemsClickable(this.text);
});
@@ -108,20 +100,6 @@ UserDetailAssistant.prototype.activate = function(event) {
/* put in event handlers here that should only be in effect when this scene is active. For
example, key handlers that are observing the document */
- // alert('UserDetailAssistant.prototype.activate');
-
- // dump('getScenes()');
- // dump(Mojo.Controller.stageController.getScenes());
- // dump('activeScene()');
- // dump(Mojo.Controller.stageController.activeScene());
- // dump('topScene()');
- // dump(Mojo.Controller.stageController.topScene());
- // dump('isChildWindow()');
- // dump(Mojo.Controller.stageController.isChildWindow());
-
-
-
-
var thisA = this; // for closures
jQuery('#user-detail-actions #view-user-posts', this.scroller).live(Mojo.Event.tap, function(e) {
View
148 app/helpers/scene.js
@@ -9,6 +9,29 @@ var scene_helpers = {}
*/
scene_helpers.addCommonSceneMethods = function(assistant) {
+
+ assistant.initAppMenu = function(opts) {
+ // the initial app/scene commands set into the class's appMenuModel for the beverage:
+ this.appMenuAttr = {
+ omitDefaultItems: true
+ };
+
+ this.appMenuModel = {
+ visible: true,
+
+ items: [
+ Mojo.Menu.editItem,
+ { label: $L('About Spaz'), command: 'appmenu-about' },
+ Mojo.Menu.helpItem,
+ Mojo.Menu.prefsItem,
+ { label: $L('Log-in'), command: 'appmenu-login' }
+ ]
+ };
+
+ // good to go, set up the almighty Application Menu:
+ this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttr, this.appMenuModel);
+ };
+
/**
* opts is an object with key:val pairs, like so
@@ -23,66 +46,37 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
this.scroller = this.controller.getSceneScroller();
}
+ /*
+ View menu at top of screen
+ */
if (opts.viewMenuItems) {
var viewMenuItems = opts.viewMenuItems;
- } else {
- var viewMenuItems = [
- {
- items: [
- {label: $L(opts.viewMenuLabel), command:'scroll-top'},
- {label: $L('Filter timeline'), iconPath:'images/theme/menu-icon-triangle-down.png', submenu:'filter-menu'},
- ]
- },
- {
- items: [
- {label:$L('Compose'), icon:'compose', command:'compose', shortcut:'N'},
- {label:$L('Update'), icon:'sync', command:'refresh', shortcut:'R'}
- ]
- }
- ];
+ this.viewMenuModel = {
+ label: $L('viewmenu'),
+ items: viewMenuItems,
+ };
+ this.controller.setupWidget(Mojo.Menu.viewMenu, undefined, this.viewMenuModel);
}
- /*
- View menu at top of screen
- */
- this.viewMenuModel = {
- label: $L('viewmenu'),
- items: viewMenuItems,
- };
- this.controller.setupWidget(Mojo.Menu.viewMenu, undefined, this.viewMenuModel);
+
-
+ /*
+ Command menu at bottom of screen
+ */
if (opts.cmdMenuItems) {
var cmdMenuItems = opts.cmdMenuItems;
- } else {
- var cmdMenuItems = [{ items:
- [
- {},
- {label:$L('Home'), command:'home', shortcut:'H'},
- {label:$L('My Timeline'), icon:'conversation', command:'my-timeline', shortcut:'T'},
- {label:$L('Search'), icon:'search', command:'search', shortcut:'S'},
- {label:$L('Followers'), command:'followers', shortcut:'L'},
- {}
- ]
- }]
+ this.cmdMenuModel = {
+ visible:true,
+ items: cmdMenuItems
+ };
+ this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
}
- /*
- Command menu at bottom of screen
- */
- this.cmdMenuModel = {
- visible:true,
- items: cmdMenuItems
- };
-
-
-
- this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
this.timelineFilterMenuModel = {
@@ -119,7 +113,14 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
};
-
+ assistant.createStage = function(sceneName, sceneArgs, stageName) {
+ // "nocache:true" tells sysmanager to not use the card caching strategy on compose cards
+ var params = {name: stageName, nocache: true };
+ var callback = function(stageController) {
+ stageController.pushScene(sceneName, sceneArgs, stageName);
+ };
+ Mojo.Controller.getAppController().createStageWithCallback(params, callback);
+ };
/**
*
@@ -141,17 +142,27 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
Navigation
*/
case 'home':
- // dump('is child window:'+Mojo.Controller.StageController.isChildWindow(this));
findAndSwapScene("login", this);
break;
case 'my-timeline':
- // dump('is child window:'+Mojo.Controller.StageController.isChildWindow(this));
findAndSwapScene("my-timeline", this);
break;
case 'search':
- // dump('is child window:'+Mojo.Controller.StageController.isChildWindow(this));
findAndSwapScene("search-twitter", this);
- break;
+ break;
+ case 'new-search-card':
+
+ sc.app.new_search_card++;
+ this.createStage('search-twitter', { 'lightweight':true }, 'stage-lightweight-search'+sc.app.new_search_card);
+
+ // findAndSwapScene("search-twitter", this);
+ break;
+ case 'followers':
+ findAndSwapScene("manage-followers", this);
+ break;
+ case 'preferences':
+ findAndSwapScene("preferences", this);
+ break;
/*
Compose a new message
@@ -199,7 +210,9 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
this.refresh(); // need to have a "refresh" method defined for each scene asst
break;
-
+ case 'search-trends':
+ Mojo.Controller.notYetImplemented();
+ break;
}
}
@@ -332,6 +345,19 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
}
+
+
+ assistant.initTwit = function() {
+ var username = sc.app.prefs.get('username');
+ var password = sc.app.prefs.get('password');
+
+ this.twit = new scTwit();
+
+ if (username && password) {
+ this.twit.setCredentials(username, password);
+ }
+ };
+
/**
@@ -661,7 +687,8 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
*
*/
assistant.searchFor = function(terms) {
- findAndSwapScene("search-twitter", {
+ // findAndSwapScene("search-twitter", {
+ Mojo.Controller.stageController.pushScene("search-twitter", {
'searchterm': terms
});
}
@@ -748,25 +775,16 @@ scene_helpers.addCommonSceneMethods = function(assistant) {
assistant.newMsgBanner = function(count) {
-
- var params = {
- messageText:count+' new messages in your timeline',
- soundClass: null,
- soundFile: null,
- icon: 'icon.png'
- };
-
+
var launchArgs = {
'from':'newMessagesBanner'
};
var category = 'newMessages';
var appController = Mojo.Controller.getAppController();
- // appController.showBanner(params, launchArgs, category);
- appController.showBanner("There are some new messages", {});
- // dump('SHOWED NEW MESSAGE BANNER');
-
+
+ appController.showBanner("There are "+count+" new messages", launchArgs, category);
}
View
103 app/views/login/login-scene.html
@@ -5,79 +5,76 @@
<div id="login-scene">
- <div id="main" class="palm-hasheader">
- <div class="palm-header left" id="main-hdr">
- Spaz:Home
- </div>
- </div>
-
- <div id="show-login-button" class="spaz-button-wide closed">Log-in</div>
-
- <div id="login-panel" class='spaz-drawer'><!-- </div> -->
-
- <div class='palm-row' id="username-row">
- <div class="palm-row-wrapper">
- <div class="textfield-group" x-mojo-focus-highlight="true">
- <div class="title">
- <div class="label">
- username
+ <div class="palm-group">
+ <div class="palm-group-title" id="login-toggle" x-mojo-loc=''>Log-in To My Account</div>
+ <div class="palm-list" id="login-panel">
+ <div class="palm-row single">
+ <div class="palm-row-wrapper">
+ <div class="textfield-group" x-mojo-focus-highlight="true">
+ <div class="title">
+ <div class="label">
+ username
+ </div>
+ <div id="username" name="username" x-mojo-element="TextField"></div>
</div>
- <div id="username" name="username" x-mojo-element="TextField"></div>
</div>
</div>
</div>
- <div class="palm-row-wrapper">
- <div class="textfield-group" x-mojo-focus-highlight="true">
- <div class="title">
- <div class="label">
- password
+ <div class="palm-row single">
+ <div class="palm-row-wrapper">
+ <div class="textfield-group" x-mojo-focus-highlight="true">
+ <div class="title">
+ <div class="label">
+ password
+ </div>
+ <div id="password" name="password" x-mojo-element="PasswordField"></div>
</div>
- <div id="password" name="password" x-mojo-element="PasswordField"></div>
</div>
</div>
+ </div>
+
+
+
+ <div class="palm-row single">
+ <button class="palm-button" id="login-button">Login</button>
+ <div style="overflow:auto; text-align:center">
+ <div x-mojo-element="CheckBox" id="goToMyTimelineCheckbox"></div>
+ <div class="checkbox-label">Always go to My Timeline</div>
+ </div>
+ <div id="spinner-container"></div>
</div>
- </div>
- <button class="palm-button" id="login-button">Login</button>
- <div style="overflow:auto">
- <div x-mojo-element="CheckBox" id="goToMyTimelineCheckbox"></div>
- <label for="always-go-to-my-timeline">Always go to My Timeline</label>
+
</div>
- <div id="spinner-container"></div>
-
</div>
- <div id="show-search-button" class="spaz-button-wide">Search Twitter</div>
- <div id="search-panel" class='spaz-drawer'>
- <div class='palm-row' id="search-row">
- <div class="palm-row-wrapper">
- <div class="textfield-group" x-mojo-focus-highlight="true">
+ <div class="palm-group">
+ <div class="palm-group-title" id="search-toggle" x-mojo-loc=''>Search Twitter</div>
+ <div class="palm-list" id="search-panel">
+ <div class="palm-row single">
+ <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">
<div class="title">
- <div class="label">
- search terms
- </div>
- <div id="search" name="search" x-mojo-element="TextField"></div>
+ <div class="label">
+ search terms
+ </div>
+ <div id="search" name="search" x-mojo-element="TextField"></div>
</div>
</div>
</div>
- </div>
- <button class="palm-button" id="search-button">Search</button>
-
- <!-- </div>
- <div id="show-trends-button" class="spaz-button-wide closed">Current Trends</div>
+ <div class="palm-row single">
+ <button class="palm-button" id="search-button">Search</button>
+ </div>
- <div id="trends-panel" class='spaz-drawer'> -->
- <h3>Trends</h3>
- <div id="trends-list" class="spaz-button-group">
- </div>
- </div>
+ <div class="palm-group">
+ <div class="palm-group-title" x-mojo-loc=''>Current Trends on Twitter</div>
+ <div class="palm-list" id="trends-list">
+ </div>
+ </div>
- <div id="status-panel">
- <div x-mojo-element="Spinner" id="activity-spinner"></div>
- <span id="status-label"></span>
+ </div>
</div>
-
+
</div>
View
4 app/views/login/trend-item.html
@@ -1 +1,3 @@
-<div class="trend-item spaz-button-wide" data-searchterm='#{searchterm}'>#{name}</div>
+<div class="palm-row-wrapper">
+ <div class="spaz-row trend-item single" data-searchterm='#{searchterm}'>#{name}</div>
+</div>
View
1 app/views/preferences/preferences-scene.html
@@ -0,0 +1 @@
+Find me in app/views/preferences/preferences-scene.html.
View
9 app/views/search-twitter/search-twitter-scene.html
@@ -11,17 +11,18 @@
<div x-mojo-element="Spinner" id="search-twitter-spinner" class="spaz-activity-spinner"></div>
-<div class='palm-row' id="username-row">
+<div class='palm-row single' id="username-row">
<div class="palm-row-wrapper">
<div class="textfield-group" x-mojo-focus-highlight="true">
<div class="title">
<div class="label">
Search
</div>
- <div id="search-twitter-textfield" name="search-twitter" x-mojo-element="TextField"></div>
+ <div id="search-twitter-textfield" x-mojo-element="TextField"></div>
</div>
-
</div>
+ <button class="palm-button" id="submit-search-button">Search</button>
</div>
-</div>
+</div>
+
<div id="search-timeline" class="timeline"></div>
View
2 app/views/shared/tweet.html
@@ -7,7 +7,7 @@
<div class="text">
#{text}
</div>
- <div class="meta" data-status-id="#{id}"><span class="date" data-created_at="#{created_at}">#{relative_time}</span> &#x2192;</div>
+ <div class="meta" data-status-id="#{id}"><span class="date" data-created_at="#{created_at}">#{relative_time}</span></div>
</div>
</div>
View
4 default_preferences.js
@@ -10,9 +10,9 @@ var default_preferences = {
'wilhelm-enabled': true,
'network-refreshinterval': 300000,
- 'network-autoadjustrefreshinterval': true,
+ 'network-searchrefreshinterval': 300000,
- 'debug-enabled': false,
+ 'network-autoadjustrefreshinterval': true,
'timeline-scrollonupdate': true,
'timeline-maxentries': 300,
View
BIN icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/theme/menu-icon-home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/theme/menu-icon-trends.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/theme/meta-link-bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/theme/palm-group.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 index.html
@@ -7,7 +7,7 @@
<title>Dreadnaught</title>
<script type="text/javascript" charset="utf-8">
- var use_palmhost_proxy = true;
+ var use_palmhost_proxy = false;
</script>
<script src="default_preferences.js" type="text/javascript" charset="utf-8"></script>
@@ -54,6 +54,8 @@
<script src="app/assistants/user-detail-assistant.js" type="text/javascript" charset="utf-8"></script>
<script src="app/assistants/message-detail-assistant.js" type="text/javascript" charset="utf-8"></script>
<script src="app/assistants/search-twitter-assistant.js" type="text/javascript" charset="utf-8"></script>
+ <script src="app/assistants/manage-followers-assistant.js" type="text/javascript" charset="utf-8"></script>
+ <script src="app/assistants/preferences-assistant.js" type="text/javascript" charset="utf-8"></script>
<!-- application stylesheet should come in after the one loaded by the framework -->
View
1,139 scene-map.graffle
@@ -1,1139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>ActiveLayerIndex</key>
- <integer>0</integer>
- <key>AutoAdjust</key>
- <true/>
- <key>CanvasColor</key>
- <dict>
- <key>w</key>
- <string>1</string>
- </dict>
- <key>CanvasOrigin</key>
- <string>{0, 0}</string>
- <key>CanvasScale</key>
- <real>1</real>
- <key>ColumnAlign</key>
- <integer>1</integer>
- <key>ColumnSpacing</key>
- <real>36</real>
- <key>CreationDate</key>
- <string>2009-01-20 14:50:47 -0500</string>
- <key>Creator</key>
- <string>Ed Finkler</string>
- <key>DisplayScale</key>
- <string>1 in = 1 in</string>
- <key>GraphDocumentVersion</key>
- <integer>5</integer>
- <key>GraphicsList</key>
- <array>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>18</integer>
- <key>Info</key>
- <integer>5</integer>
- </dict>
- <key>ID</key>
- <integer>66</integer>
- <key>Points</key>
- <array>
- <string>{235.76, 291}</string>
- <string>{182.334, 148.436}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>HeadScale</key>
- <real>1.5000001192092896</real>
- <key>LineType</key>
- <integer>1</integer>
- <key>Pattern</key>
- <integer>5</integer>
- <key>TailArrow</key>
- <string>0</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>29</integer>
- <key>Info</key>
- <integer>2</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>18</integer>
- <key>Info</key>
- <integer>6</integer>
- </dict>
- <key>ID</key>
- <integer>65</integer>
- <key>Points</key>
- <array>
- <string>{83, 291}</string>
- <string>{145.186, 148.436}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>HeadScale</key>
- <real>1.5000001192092896</real>
- <key>LineType</key>
- <integer>1</integer>
- <key>Pattern</key>
- <integer>5</integer>
- <key>TailArrow</key>
- <string>0</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>30</integer>
- <key>Info</key>
- <integer>1</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>17</integer>
- <key>Info</key>
- <integer>5</integer>
- </dict>
- <key>ID</key>
- <integer>64</integer>
- <key>Points</key>
- <array>
- <string>{480, 291}</string>
- <string>{414.574, 148.436}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>HeadScale</key>
- <real>1.5000001192092896</real>
- <key>LineType</key>
- <integer>1</integer>
- <key>Pattern</key>
- <integer>5</integer>
- <key>TailArrow</key>
- <string>0</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>54</integer>
- <key>Info</key>
- <integer>2</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>17</integer>
- <key>Info</key>
- <integer>6</integer>
- </dict>
- <key>ID</key>
- <integer>63</integer>
- <key>Points</key>
- <array>
- <string>{367.24, 291}</string>
- <string>{377.426, 148.436}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>HeadScale</key>
- <real>1.5000001192092896</real>
- <key>LineType</key>
- <integer>1</integer>
- <key>Pattern</key>
- <integer>5</integer>
- <key>TailArrow</key>
- <string>0</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>55</integer>
- <key>Info</key>
- <integer>2</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>18</integer>
- <key>Info</key>
- <integer>1</integer>
- </dict>
- <key>ID</key>
- <integer>62</integer>
- <key>Points</key>
- <array>
- <string>{609.666, 55.5643}</string>
- <string>{142, 15}</string>
- <string>{145.029, 53.5704}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>15</integer>
- <key>Info</key>
- <integer>1</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>15</integer>
- <key>Info</key>
- <integer>2</integer>
- </dict>
- <key>ID</key>
- <integer>61</integer>
- <key>Points</key>
- <array>
- <string>{182.334, 55.5643}</string>
- <string>{557, 11}</string>
- <string>{645.023, 54.6752}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>LineType</key>
- <integer>1</integer>
- <key>TailArrow</key>
- <string>0</string>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>18</integer>
- <key>Info</key>
- <integer>2</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>54</integer>
- <key>Info</key>
- <integer>1</integer>
- </dict>
- <key>ID</key>
- <integer>57</integer>
- <key>Points</key>
- <array>
- <string>{414.925, 150.405}</string>
- <string>{440, 291}</string>
- </array>
- <key>Style</key>
- <dict>
- <key>stroke</key>
- <dict>
- <key>HeadArrow</key>
- <string>FilledArrow</string>
- <key>HeadScale</key>
- <real>1.5000001192092896</real>
- <key>LineType</key>
- <integer>1</integer>
- <key>Pattern</key>
- <integer>5</integer>
- <key>TailArrow</key>
- <string>0</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Tail</key>
- <dict>
- <key>ID</key>
- <integer>17</integer>
- <key>Info</key>
- <integer>5</integer>
- </dict>
- </dict>
- <dict>
- <key>Class</key>
- <string>LineGraphic</string>
- <key>Head</key>
- <dict>
- <key>ID</key>
- <integer>55</integer>
- <key>Info</key>
- <integer>1</integer>
- </dict>
- <key>ID</key>
- <integer>56</integer>
- <key>Points</key>
- <array>