Skip to content
johanv edited this page Jan 21, 2013 · 2 revisions

(STUB)

A view is added to the 'slider' using the function ui.Slider.Add (in ui.slider.js). When e.g. you click on a user name in the 'tweet view', a jquery script calls the function open_people (in hotot.js). open_people calls in turn ui.Slider.Add, as follows:

ui.Slider.add(name
    , {title: title, icon:'image/ic_people.png'}
    , $.extend({   'type': 'people', 'title': title
        , 'load': ui.PeopleView.load_timeline_full
        , 'loadmore': ui.PeopleView.loadmore_timeline
        , 'load_success': ui.Main.load_tweet_success
        , 'load_fail': null
        , 'loadmore_success': ui.Main.loadmore_tweet_success
        , 'loadmore_fail': null
        , 'former': ui.Template.form_tweet
        , 'init': ui.PeopleView.init_view
        , 'destroy': ui.PeopleView.destroy_view
        , 'header_html': ui.Template.common_column_header_t
        , 'header_html_ex': ui.Template.people_vcard_t
        , 'method': 'poll'
        , 'interval': 120
        , 'item_type': 'id'
        , 'is_trim': true
        , 'screen_name': screen_name
    }, additional_opts));

In ui.slider.js, a new view is added to the slider, with the given type. In this case 'people'. The peopleview (defined in ui.peopleview.js) handles the rendering of this particular type of view. E.g., the load_timeline function calls the twitterclient to get the latest tweets of the person.

load_timeline:
function load_timeline(view, success, fail) {
    globals.twitterClient.get_user_timeline(null, view.screen_name
        , view.since_id, null, conf.vars.items_per_request, success);
},

(See also: Statuses, with some info about the tweetview type)

Clone this wiki locally