2012-03-02 17:51:28 -08:00
NEWSBLUR . ReaderIntro = function ( options ) {
2013-02-01 17:17:16 -08:00
var defaults = {
2013-04-03 22:33:01 -07:00
modal _container _class : "NB-full-container"
2013-02-01 17:17:16 -08:00
} ;
2012-06-14 17:21:51 -07:00
var intro _page = NEWSBLUR . assets . preference ( 'intro_page' ) ;
2012-03-02 17:51:28 -08:00
2012-03-12 18:11:13 -07:00
_ . bindAll ( this , 'close' , 'start_import_from_google_reader' , 'post_connect' ) ;
2012-03-02 17:51:28 -08:00
this . options = $ . extend ( {
2012-03-12 12:33:54 -07:00
'page_number' : intro _page && _ . isNumber ( intro _page ) && intro _page <= 4 ? intro _page : 1
2012-03-02 17:51:28 -08:00
} , defaults , options ) ;
2012-03-06 11:41:57 -08:00
this . services = {
'twitter' : { } ,
'facebook' : { }
} ;
2012-07-20 19:43:28 -07:00
this . flags = { } ;
2012-03-06 11:41:57 -08:00
this . autofollow = true ;
2013-07-03 17:52:13 -07:00
this . chosen _categories = [ ] ;
2012-03-06 11:41:57 -08:00
2012-03-02 17:51:28 -08:00
this . page _number = this . options . page _number ;
this . slider _value = 0 ;
this . intervals = { } ;
2012-12-20 14:44:53 -08:00
this . sync _checks = 0 ;
2012-03-02 17:51:28 -08:00
this . runner ( ) ;
} ;
NEWSBLUR . ReaderIntro . prototype = new NEWSBLUR . Modal ;
NEWSBLUR . ReaderIntro . prototype . constructor = NEWSBLUR . ReaderIntro ;
_ . extend ( NEWSBLUR . ReaderIntro . prototype , {
runner : function ( ) {
this . make _modal ( ) ;
2012-03-06 11:41:57 -08:00
this . make _find _friends _and _services ( ) ;
2012-03-02 17:51:28 -08:00
this . open _modal ( ) ;
this . page ( this . page _number ) ;
2012-03-06 11:41:57 -08:00
this . fetch _friends ( ) ;
2013-07-03 17:52:13 -07:00
this . fetch _categories ( ) ;
2012-03-02 17:51:28 -08:00
this . $modal . bind ( 'click' , $ . rescope ( this . handle _click , this ) ) ;
2012-03-05 19:18:40 -08:00
this . $modal . bind ( 'change' , $ . rescope ( this . handle _change , this ) ) ;
2012-03-02 17:51:28 -08:00
} ,
make _modal : function ( ) {
var self = this ;
this . $modal = $ . make ( 'div' , { className : 'NB-modal-intro NB-modal' } , [
2013-02-01 17:17:16 -08:00
$ . make ( 'div' , { className : 'NB-modal-page' } , [
$ . make ( 'span' , { className : 'NB-modal-page-text' } ) ,
$ . make ( 'span' , { className : 'NB-modal-loading NB-spinner' } )
] ) ,
$ . make ( 'h2' , { className : 'NB-modal-title' } , [
'Welcome to NewsBlur' ,
$ . make ( 'div' , { className : 'NB-divider' } )
] ) ,
2012-03-02 17:51:28 -08:00
$ . make ( 'img' , { className : 'NB-intro-spinning-logo' , src : NEWSBLUR . Globals . MEDIA _URL + 'img/logo_512.png' } ) ,
$ . make ( 'div' , { className : 'NB-page NB-page-1' } , [
$ . make ( 'h4' , { className : 'NB-page-1-started' } , "So much time and so little to do. Strike that! Reverse it." )
] ) ,
2012-07-30 21:39:21 -07:00
$ . make ( 'div' , { className : 'NB-page NB-page-2' } , [
2013-07-03 19:13:54 -07:00
$ . make ( 'div' , { className : 'NB-intro-imports NB-intro-imports-start' } , [
$ . make ( 'div' , { className : 'NB-page-2-started' } , [
$ . make ( 'h4' , "Let's get some sites to read." ) ,
$ . make ( 'h6' )
] ) ,
$ . make ( 'div' , { className : 'NB-intro-module-containers' } , [
$ . make ( 'div' , { className : 'NB-intro-module-container NB-left' } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , 'Choose categories' ) ,
$ . make ( 'div' , { className : 'NB-intro-module NB-intro-categories-container' } , [
$ . make ( 'div' , { className : "NB-intro-categories-loader" } ) ,
$ . make ( 'div' , { className : "NB-intro-categories" } )
] )
] ) ,
$ . make ( 'div' , { className : 'NB-intro-module-container NB-right' } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , 'Upload' ) ,
$ . make ( 'div' , { className : 'NB-intro-module NB-intro-import-opml' } , [
$ . make ( 'div' , { className : 'NB-carousel' } , [
$ . make ( 'div' , { className : 'NB-carousel-inner NB-intro-imports' } , [
$ . make ( 'div' , { className : 'NB-carousel-item NB-intro-imports-start' } , [
$ . make ( 'h3' , 'OPML' ) ,
$ . make ( 'form' , { method : 'post' , enctype : 'multipart/form-data' , encoding : 'multipart/form-data' , className : 'NB-opml-upload-form' } , [
$ . make ( 'div' , { href : '#' , className : 'NB-intro-upload-opml NB-modal-submit-green NB-modal-submit-button' } , [
'Upload OPML File' ,
$ . make ( 'input' , { type : 'file' , name : 'file' , id : 'NB-intro-upload-opml-button' , className : 'NB-intro-upload-opml-button' } )
] )
2013-04-02 15:41:50 -07:00
] )
] ) ,
2013-07-03 19:13:54 -07:00
$ . make ( 'div' , { className : 'NB-carousel-item NB-intro-imports-progress' } , [
$ . make ( 'div' , { className : 'NB-page-2-importing' } , "Importing your sites..." ) ,
$ . make ( 'div' , { className : 'NB-loading' } )
] ) ,
$ . make ( 'div' , { className : 'NB-carousel-item NB-intro-imports-sites' } , [
$ . make ( 'h6' , { className : 'NB-intro-import-message' } ) ,
$ . make ( 'div' , { className : 'NB-intro-import-delayed' } , [
'There are too many sites and stories to process. ' ,
'You will be emailed within a minute or three.'
] ) ,
$ . make ( 'div' , { className : 'NB-intro-import-restart NB-modal-submit-grey NB-modal-submit-button' } , [
'« Re-upload your sites'
] ) ,
$ . make ( 'div' , { className : 'NB-intro-bookmarklet NB-intro-section NB-intro-import-container' } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , 'Install' ) ,
$ . make ( 'div' , { className : 'NB-intro-import NB-intro-module' } , [
NEWSBLUR . generate _bookmarklet ( ) ,
$ . make ( 'div' , { className : 'NB-intro-bookmarklet-info' } , 'Drag this bookmarklet into your bookmarks bar' )
] )
] )
] )
2013-07-03 17:52:13 -07:00
] )
2013-02-01 17:17:16 -08:00
] )
2013-07-03 19:13:54 -07:00
] )
2012-07-20 19:43:28 -07:00
] ) ,
2013-07-03 19:13:54 -07:00
$ . make ( 'div' , { className : 'NB-intro-starredimport NB-intro-module-container NB-right' } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , 'Google Reader Starred Stories' ) ,
$ . make ( 'div' , { className : 'NB-intro-import-starred NB-intro-module' } , [
$ . make ( 'a' , { className : 'NB-intro-starredimport-info NB-splash-link' , href : "https://www.google.com/takeout/#custom:reader" , target : "_blank" } , 'Download from Takeout' ) ,
$ . make ( 'div' , { className : 'NB-modal-submit-button NB-modal-submit-green NB-starredimport-button' } , 'Upload starred.json' )
2012-07-30 21:39:21 -07:00
] )
2012-03-05 19:18:40 -08:00
] )
2012-03-02 17:51:28 -08:00
] )
] )
] ) ,
$ . make ( 'div' , { className : 'NB-page NB-page-3' } , [
2012-03-06 11:41:57 -08:00
$ . make ( 'h4' , { className : 'NB-page-3-started' } , "Connect with friends" ) ,
$ . make ( 'div' , { className : 'NB-intro-services' } )
2012-03-02 17:51:28 -08:00
] ) ,
$ . make ( 'div' , { className : 'NB-page NB-page-4' } , [
2012-03-16 20:40:48 -07:00
$ . make ( 'h4' , { className : 'NB-page-4-started' } , "Keep up-to-date with NewsBlur" ) ,
2013-02-25 17:30:53 -08:00
$ . make ( 'table' , { className : 'NB-intro-follows' , cellpadding : 0 , cellspacing : 0 } , [
$ . make ( 'tr' , [
$ . make ( 'td' , { className : 'NB-intro-uptodate-follow NB-intro-uptodate-follow-twitter' } , [
$ . make ( 'input' , { type : 'checkbox' , id : 'NB-intro-uptodate-follow-samuelclay' } ) ,
$ . make ( 'label' , { 'for' : 'NB-intro-uptodate-follow-samuelclay' } , [
$ . make ( 'img' , { src : 'http://a0.twimg.com/profile_images/1382021023/Campeche_Steps_normal.jpg' , style : 'border-color: #505050;' } ) ,
$ . make ( 'span' , '@samuelclay' )
] ) ,
2013-02-25 17:57:43 -08:00
$ . make ( 'iframe' , { allowtransparency : "true" , frameborder : "0" , scrolling : "no" , src : "//platform.twitter.com/widgets/follow_button.html?screen_name=samuelclay" , width : 260 , height : 20 } )
2013-02-25 17:30:53 -08:00
] ) ,
$ . make ( 'td' , { className : 'NB-intro-uptodate-follow NB-intro-uptodate-follow-twitter' } , [
$ . make ( 'input' , { type : 'checkbox' , id : 'NB-intro-uptodate-follow-newsblur' } ) ,
$ . make ( 'label' , { 'for' : 'NB-intro-uptodate-follow-newsblur' } , [
$ . make ( 'img' , { src : 'http://a0.twimg.com/profile_images/1268996309/logo_128_normal.png' , style : 'border-color: #505050;' } ) ,
$ . make ( 'span' , '@newsblur' )
] ) ,
2013-02-25 17:57:43 -08:00
$ . make ( 'iframe' , { allowtransparency : "true" , frameborder : "0" , scrolling : "no" , src : "//platform.twitter.com/widgets/follow_button.html?screen_name=newsblur" , width : 260 , height : 20 } )
2012-03-16 20:40:48 -07:00
] )
] ) ,
2013-02-25 17:30:53 -08:00
$ . make ( 'tr' , { className : 'NB-intro-uptodate-subscribe' } , [
$ . make ( 'td' , { className : 'NB-intro-uptodate-follow' } , [
2013-02-25 17:51:56 -08:00
$ . make ( 'div' , [
$ . make ( 'img' , { src : '/media/img/favicon.png' } ) ,
'Popular Shared Stories'
] ) ,
2013-02-25 17:30:53 -08:00
$ . make ( 'div' , { className : 'NB-intro-uptodate-follow-popular NB-modal-submit-green NB-modal-submit-button' } , [
'Subscribe'
] ) ,
$ . make ( 'div' , { className : 'NB-subscribed' } , "Subscribed" )
] ) ,
$ . make ( 'td' , { className : 'NB-intro-uptodate-follow' } , [
2013-02-25 17:51:56 -08:00
$ . make ( 'div' , [
$ . make ( 'img' , { src : '/media/img/favicon.png' } ) ,
'The NewsBlur Blog'
] ) ,
2013-02-25 17:30:53 -08:00
$ . make ( 'div' , { className : 'NB-intro-uptodate-follow-blog NB-modal-submit-green NB-modal-submit-button' } , [
'Subscribe'
] ) ,
$ . make ( 'div' , { className : 'NB-subscribed' } , "Subscribed" )
2012-03-16 20:40:48 -07:00
] )
] )
] ) ,
$ . make ( 'div' , { className : 'NB-intro-section' } , [
2012-03-19 11:15:26 -07:00
"You're ready to go! Hope you enjoy NewsBlur."
2012-03-16 20:40:48 -07:00
] )
2012-03-02 17:51:28 -08:00
] ) ,
2013-04-04 16:22:49 -07:00
$ . make ( 'div' , { className : 'NB-modal-submit-bottom' } , [
2012-03-02 17:51:28 -08:00
$ . make ( 'div' , { className : 'NB-page-next NB-modal-submit-button NB-modal-submit-green NB-modal-submit-save' } , [
$ . make ( 'span' , { className : 'NB-tutorial-next-page-text' } , "Let's Get Started " ) ,
$ . make ( 'span' , { className : 'NB-raquo' } , '»' )
] )
] )
] ) ;
2013-04-02 15:41:50 -07:00
if ( this . options . force _import ) {
2013-07-03 17:52:13 -07:00
// this.$modal.addClass('NB-intro-import-only');
}
} ,
// ==============
// = Categories =
// ==============
fetch _categories : function ( callback ) {
$ ( '.NB-intro-categories-loader' , this . $modal ) . addClass ( 'NB-active' ) ;
NEWSBLUR . assets . fetch _categories ( _ . bind ( function ( data ) {
this . categories = data . categories ;
this . category _feeds = data . feeds ;
this . make _categories ( ) ;
callback && callback ( ) ;
} , this ) , _ . bind ( function ( data ) {
console . log ( [ 'Categories fetch error' , data ] ) ;
} , this ) ) ;
} ,
make _categories : function ( ) {
$ ( '.NB-intro-categories-loader' , this . $modal ) . removeClass ( 'NB-active' ) ;
var $categories = $ ( ".NB-intro-categories" , this . $modal ) ;
var categories = _ . map ( this . categories , _ . bind ( function ( category ) {
var $feeds = _ . compact ( _ . map ( category . feed _ids , _ . bind ( function ( feed _id ) {
var feed = this . category _feeds [ feed _id ] ;
if ( ! feed ) return ;
feed = new NEWSBLUR . Models . Feed ( feed ) ;
2013-07-03 19:13:54 -07:00
var border = feed . get ( 'favicon_fade' ) || "707070" ;
2013-07-03 17:52:13 -07:00
return $ . make ( "div" , { className : "NB-category-feed" , style : "border-left: 4px solid #" + border + "; border-right: 4px solid #" + border } , [
$ . make ( 'img' , { className : 'NB-category-feed-favicon' , src : $ . favicon ( feed ) } ) ,
$ . make ( 'div' , { className : 'NB-category-feed-title' } , feed . get ( 'feed_title' ) )
] ) ;
} , this ) ) ) ;
var $category = $ . make ( 'div' , { className : 'NB-category' } , [
$ . make ( 'div' , { className : 'NB-category-title NB-modal-submit-grey NB-modal-submit-button' } , [
$ . make ( 'div' , { className : 'NB-checkmark' } ) ,
category . title
] ) ,
$ . make ( 'div' , { className : 'NB-category-feeds' } , $feeds )
] ) . data ( 'category' , category . title ) ;
return $category ;
} , this ) ) ;
$categories . html ( $ . make ( 'div' , categories ) ) ;
} ,
toggle _category : function ( category , $category ) {
var on = _ . contains ( this . chosen _categories , category ) ;
if ( on ) {
this . chosen _categories = _ . without ( this . chosen _categories , category ) ;
} else {
this . chosen _categories . push ( category ) ;
}
$category . toggleClass ( 'NB-active' , ! on ) ;
$ ( ".NB-category-title" , $category ) . toggleClass ( 'NB-modal-submit-grey' , on )
. toggleClass ( 'NB-modal-submit-green' , ! on ) ;
if ( this . chosen _categories . length ) {
NEWSBLUR . assets . preference ( 'has_setup_feeds' , true ) ;
NEWSBLUR . reader . check _hide _getting _started ( ) ;
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( 'Next step ' ) ;
}
} ,
submit _categories : function ( ) {
if ( this . chosen _categories . length ) {
NEWSBLUR . assets . subscribe _to _categories ( this . chosen _categories , function ( ) {
NEWSBLUR . assets . load _feeds ( ) ;
} ) ;
2013-04-02 15:41:50 -07:00
}
2012-03-02 17:51:28 -08:00
} ,
2012-03-06 11:41:57 -08:00
// ==========
// = Social =
// ==========
fetch _friends : function ( callback ) {
$ ( '.NB-modal-loading' , this . $modal ) . addClass ( 'NB-active' ) ;
2012-06-14 17:21:51 -07:00
NEWSBLUR . assets . fetch _friends ( _ . bind ( function ( data ) {
this . profile = NEWSBLUR . assets . user _profile ;
2012-03-06 11:41:57 -08:00
this . services = data . services ;
this . autofollow = data . autofollow ;
this . make _find _friends _and _services ( ) ;
callback && callback ( ) ;
2013-06-12 14:26:09 -07:00
} , this ) , _ . bind ( function ( data ) {
console . log ( [ 'Friends fetch error' , data ] ) ;
2012-03-06 11:41:57 -08:00
} , this ) ) ;
} ,
make _find _friends _and _services : function ( ) {
$ ( '.NB-modal-loading' , this . $modal ) . removeClass ( 'NB-active' ) ;
var $services = $ ( '.NB-intro-services' , this . $modal ) . empty ( ) ;
2012-07-13 15:32:27 -07:00
var service _syncing = false ;
2012-03-06 11:41:57 -08:00
_ . each ( [ 'twitter' , 'facebook' ] , _ . bind ( function ( service ) {
var $service ;
2012-07-11 00:43:53 -07:00
if ( this . services && this . services [ service ] [ service + '_uid' ] && ! this . services [ service ] . syncing ) {
2013-02-25 17:30:53 -08:00
$service = $ . make ( 'div' , { className : 'NB-intro-module-container NB-friends-service NB-connected NB-friends-service-' + service } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , _ . string . capitalize ( service ) ) ,
$ . make ( 'div' , { className : 'NB-intro-module NB-intro-module-' + service } , [
$ . make ( 'h3' , [
$ . make ( 'img' , { src : NEWSBLUR . Globals . MEDIA _URL + '/img/reader/' + service + '_big.png' , width : 44 , height : 44 } )
] ) ,
$ . make ( 'div' , { className : 'NB-friends-service-connected' } , [
'Connected'
] )
2012-03-06 11:41:57 -08:00
] )
] ) ;
} else {
2012-07-11 00:43:53 -07:00
var syncing = this . services && this . services [ service ] && this . services [ service ] . syncing ;
2012-07-13 15:32:27 -07:00
if ( syncing ) service _syncing = true ;
2013-02-25 17:30:53 -08:00
$service = $ . make ( 'div' , { className : 'NB-intro-module-container NB-friends-service NB-friends-service-' + service + ( syncing ? ' NB-friends-service-syncing' : '' ) } , [
$ . make ( 'h3' , { className : 'NB-module-content-header' } , _ . string . capitalize ( service ) ) ,
$ . make ( 'div' , { className : 'NB-intro-module NB-intro-module-' + service } , [
$ . make ( 'h3' , [
$ . make ( 'img' , { src : NEWSBLUR . Globals . MEDIA _URL + '/img/reader/' + service + '_big.png' , width : 44 , height : 44 } )
] ) ,
$ . make ( 'div' , { className : 'NB-friends-service-connect NB-modal-submit-button ' + ( syncing ? 'NB-modal-submit-grey' : 'NB-modal-submit-green' ) } , [
( syncing ? 'Fetching...' : 'Find ' + _ . string . capitalize ( service ) + ' Friends' )
] )
2012-03-06 11:41:57 -08:00
] )
] ) ;
}
$services . append ( $service ) ;
} , this ) ) ;
2012-03-06 18:34:59 -08:00
var $autofollow = $ . make ( 'div' , { className : 'NB-friends-autofollow' } , [
2012-03-06 11:41:57 -08:00
$ . make ( 'input' , { type : 'checkbox' , className : 'NB-friends-autofollow-checkbox' , id : 'NB-friends-autofollow-checkbox' , checked : this . autofollow ? 'checked' : null } ) ,
$ . make ( 'label' , { className : 'NB-friends-autofollow-label' , 'for' : 'NB-friends-autofollow-checkbox' } , 'and auto-follow them' )
] ) ;
$services . prepend ( $autofollow ) ;
2012-03-07 15:01:44 -08:00
if ( ! this . services . twitter . twitter _uid || ! this . services . facebook . facebook _uid ) {
2012-03-06 19:03:04 -08:00
var $note = $ . make ( 'div' , { className : 'NB-note' } , [
'Feel comfortable connecting to these services.' ,
$ . make ( 'br' ) ,
2012-03-20 11:15:40 -07:00
'Nothing happens without your permission.'
2012-03-06 19:03:04 -08:00
] ) ;
$services . append ( $note ) ;
}
2012-03-06 11:41:57 -08:00
if ( this . services . twitter . twitter _uid || this . services . facebook . facebook _uid ) {
2012-03-06 19:03:04 -08:00
var $stats = $ . make ( 'div' , { className : 'NB-services-stats' } ) ;
_ . each ( [ 'following' , 'follower' ] , _ . bind ( function ( follow ) {
var $stat = $ . make ( 'div' , { className : 'NB-intro-services-stats-count' } , [
$ . make ( 'div' , { className : 'NB-intro-services-stats-count-number' } , this . profile . get ( follow + '_count' ) ) ,
$ . make ( 'div' , { className : 'NB-intro-services-stats-count-description' } , Inflector . pluralize ( follow , this . profile . get ( follow + '_count' ) ) )
2012-03-06 18:34:59 -08:00
] ) ;
2012-03-06 19:03:04 -08:00
$stats . append ( $stat ) ;
2012-03-06 18:34:59 -08:00
} , this ) ) ;
2012-03-06 19:03:04 -08:00
$services . append ( $stats ) ;
2012-03-06 11:41:57 -08:00
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( 'Next step ' ) ;
}
2012-07-13 15:32:27 -07:00
if ( service _syncing ) {
2012-12-20 14:44:53 -08:00
clearTimeout ( this . sync _interval ) ;
this . sync _checks += 1 ;
this . sync _interval = _ . delay ( _ . bind ( function ( ) {
2012-08-10 19:20:08 -07:00
this . fetch _friends ( ) ;
2012-12-20 14:44:53 -08:00
} , this ) , this . sync _checks * 1000 ) ;
2012-07-13 15:32:27 -07:00
}
2012-03-06 11:41:57 -08:00
} ,
connect : function ( service ) {
var options = "location=0,status=0,width=800,height=500" ;
2012-03-19 11:15:26 -07:00
var url = "/oauth/" + service + "_connect" ;
2012-12-20 14:44:53 -08:00
this . sync _checks = 0 ;
2012-03-06 11:41:57 -08:00
this . connect _window = window . open ( url , '_blank' , options ) ;
2012-08-10 19:20:08 -07:00
this . connect _window _timer = setInterval ( _ . bind ( function ( ) {
console . log ( [ "post connect window?" , this . connect _window , this . connect _window . closed , this . connect _window . location ] ) ;
try {
if ( ! this . connect _window ||
! this . connect _window . location ||
this . connect _window . closed ) {
this . post _connect ( { } ) ;
}
} catch ( err ) {
this . post _connect ( { } ) ;
}
} , this ) , 1000 ) ;
2012-07-12 22:26:49 -07:00
_gaq . push ( [ '_trackEvent' , 'reader_intro' , 'Connect to ' + service . name + ' attempt' ] ) ;
2013-02-04 15:14:20 -08:00
NEWSBLUR . assets . preference ( 'has_found_friends' , true ) ;
NEWSBLUR . reader . check _hide _getting _started ( ) ;
2012-03-06 11:41:57 -08:00
} ,
disconnect : function ( service ) {
var $service = $ ( '.NB-friends-service-' + service , this . $modal ) ;
$ ( '.NB-friends-service-connect' , $service ) . text ( 'Disconnecting...' ) ;
2012-07-12 22:26:49 -07:00
_gaq . push ( [ '_trackEvent' , 'reader_intro' , 'Disconnect from ' + service . name ] ) ;
2012-06-14 17:21:51 -07:00
NEWSBLUR . assets . disconnect _social _service ( service , _ . bind ( function ( data ) {
2012-03-06 11:41:57 -08:00
this . services = data . services ;
this . make _find _friends _and _services ( ) ;
this . make _profile _section ( ) ;
this . make _profile _tab ( ) ;
} , this ) ) ;
} ,
post _connect : function ( data ) {
2012-07-12 22:26:49 -07:00
console . log ( [ "Intro post_connect" , data ] ) ;
2012-08-10 19:20:08 -07:00
clearInterval ( this . connect _window _timer ) ;
2012-03-06 11:41:57 -08:00
$ ( '.NB-error' , this . $modal ) . remove ( ) ;
2013-02-25 17:30:53 -08:00
$ ( ".NB-note" , this . $modal ) . hide ( ) ;
2012-03-06 11:41:57 -08:00
if ( data . error ) {
var $error = $ . make ( 'div' , { className : 'NB-error' } , [
$ . make ( 'span' , { className : 'NB-raquo' } , '» ' ) ,
data . error
2012-03-06 17:33:02 -08:00
] ) . css ( { 'opacity' : 0 } ) ;
$ ( '.NB-intro-services' , this . $modal ) . append ( $error ) ;
2012-03-06 11:41:57 -08:00
$error . animate ( { 'opacity' : 1 } , { 'duration' : 1000 } ) ;
this . resize ( ) ;
2012-07-12 22:26:49 -07:00
_gaq . push ( [ '_trackEvent' , 'reader_intro' , 'Connect to service error' ] ) ;
2012-03-06 11:41:57 -08:00
} else {
this . fetch _friends ( ) ;
2012-07-12 22:26:49 -07:00
_gaq . push ( [ '_trackEvent' , 'reader_intro' , 'Connect to service success' ] ) ;
2012-03-06 11:41:57 -08:00
}
} ,
2012-03-02 17:51:28 -08:00
// ==========
// = Paging =
// ==========
next _page : function ( ) {
2012-07-12 12:57:35 -07:00
return this . page ( this . page _number + 1 , this . page _number ) ;
2012-03-02 17:51:28 -08:00
} ,
previous _page : function ( ) {
2012-07-12 12:57:35 -07:00
return this . page ( this . page _number - 1 , this . page _number ) ;
2012-03-02 17:51:28 -08:00
} ,
page : function ( page _number , from _page ) {
if ( page _number == null ) {
return this . page _number ;
}
var page _count = $ ( '.NB-page' , this . $modal ) . length ;
this . page _number = page _number ;
if ( page _number == page _count ) {
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( 'All Done ' ) ;
} else if ( page _number > page _count ) {
2012-03-19 14:15:38 -07:00
NEWSBLUR . reader . check _hide _getting _started ( ) ;
2012-07-20 19:43:28 -07:00
this . close ( _ . bind ( function ( ) {
2013-02-26 10:00:35 -08:00
NEWSBLUR . reader . open _dialog _after _feeds _loaded ( {
delayed _import : this . flags . delayed _import ,
finished _intro : true
} ) ;
2012-07-20 19:43:28 -07:00
} , this ) ) ;
2012-03-12 12:33:54 -07:00
return ;
2012-03-02 17:51:28 -08:00
} else if ( page _number == 1 ) {
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( "Let's Get Started " ) ;
} else {
2012-03-06 11:41:57 -08:00
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( 'Skip this step ' ) ;
2012-03-02 17:51:28 -08:00
}
$ ( '.NB-page' , this . $modal ) . css ( { 'display' : 'none' } ) ;
$ ( '.NB-page-' + this . page _number , this . $modal ) . css ( { 'display' : 'block' } ) ;
2013-02-01 17:17:16 -08:00
$ ( '.NB-modal-page-text' , this . $modal ) . html ( $ . make ( 'div' , [
2012-03-02 17:51:28 -08:00
'Step ' ,
$ . make ( 'b' , this . page _number ) ,
' of ' ,
$ . make ( 'b' , page _count )
] ) ) ;
if ( page _number > 1 ) {
2013-02-01 17:17:16 -08:00
$ ( '.NB-intro-spinning-logo' , this . $modal ) . css ( { 'top' : 12 , 'left' : 12 , 'width' : 48 , 'height' : 48 } ) ;
// $('.NB-modal-title', this.$modal).css({'paddingLeft': 42});
2012-03-02 17:51:28 -08:00
}
2012-03-05 19:18:40 -08:00
if ( page _number == 2 ) {
this . advance _import _carousel ( ) ;
}
2012-03-06 19:03:04 -08:00
if ( page _number == 3 ) {
2013-07-03 17:52:13 -07:00
this . submit _categories ( ) ;
2012-03-06 19:03:04 -08:00
this . make _find _friends _and _services ( ) ;
}
2012-03-19 17:51:54 -07:00
if ( page _number == 4 ) {
this . show _twitter _follow _buttons ( ) ;
}
2012-07-12 12:57:35 -07:00
2012-12-20 14:44:53 -08:00
clearTimeout ( this . sync _interval ) ;
2012-07-28 23:02:35 -07:00
NEWSBLUR . assets . preference ( 'intro_page' , page _number ) ;
2012-07-12 12:57:35 -07:00
_gaq . push ( [ '_trackEvent' , 'reader_intro' , 'Page ' + this . page _number ] ) ;
2012-03-05 19:18:40 -08:00
} ,
2013-04-02 15:41:50 -07:00
advance _import _carousel : function ( page , options ) {
options = options || { } ;
2013-02-01 17:17:16 -08:00
var $carousel = $ ( '.NB-carousel-inner' , this . $modal ) ;
2012-03-06 11:41:57 -08:00
if ( page >= 2 ) {
2013-02-04 15:14:20 -08:00
NEWSBLUR . assets . preference ( 'has_setup_feeds' , true ) ;
NEWSBLUR . reader . check _hide _getting _started ( ) ;
2012-03-06 11:41:57 -08:00
$ ( '.NB-tutorial-next-page-text' , this . $modal ) . text ( 'Next step ' ) ;
}
2013-02-01 17:17:16 -08:00
$carousel . animate ( { 'left' : ( - 1 * page * 100 ) + '%' } , {
'queue' : false ,
'easing' : 'easeInOutQuint' ,
'duration' : 1000
2012-08-12 19:16:21 -07:00
} ) ;
2013-04-02 15:41:50 -07:00
this . count _feeds ( options ) ;
2012-03-05 19:18:40 -08:00
} ,
2013-04-02 15:41:50 -07:00
count _feeds : function ( options ) {
options = options || { } ;
var feed _count = options . fake _count || NEWSBLUR . assets . feeds . size ( ) ;
var starred _count = options . starred _count || NEWSBLUR . assets . starred _count ;
2012-03-19 16:35:56 -07:00
2013-07-03 19:13:54 -07:00
if ( feed _count ) {
$ ( ".NB-page-2-started h4" , this . $modal ) . text ( [
'You are subscribed to ' ,
( options . fake _count && 'at least ' ) ,
Inflector . pluralize ( ' site' , feed _count , true ) ,
'.'
] . join ( "" ) ) ;
}
2012-03-19 16:35:56 -07:00
2013-04-02 15:41:50 -07:00
if ( starred _count ) {
2013-07-03 19:13:54 -07:00
var $info = $ ( ".NB-page-2-started h6" , this . $modal ) ;
2013-04-02 15:41:50 -07:00
$info . text ( [
"And you have " ,
Inflector . pluralize ( ' saved story' , starred _count , true ) ,
". "
] . join ( "" ) ) ;
2012-03-19 16:35:56 -07:00
}
2012-03-02 17:51:28 -08:00
} ,
fade _out _logo : function ( ) {
var self = this ;
var $logo = $ ( '.NB-intro-spinning-logo' , this . $modal ) ;
var $page1 = $ ( '.NB-page-1' , this . $modal ) ;
var $page2 = $ ( '.NB-page-2' , this . $modal ) ;
var $submit = $ ( '.NB-modal-submit' , this . $modal ) ;
var $title = $ ( '.NB-modal-title' , this . $modal ) ;
$submit . animate ( { 'opacity' : 0 } , { 'duration' : 800 , 'easing' : 'easeInOutQuad' } ) ;
$page1 . animate ( { 'opacity' : 0 } , {
'duration' : 800 ,
'easing' : 'easeInOutQuint' ,
'complete' : function ( ) {
2013-02-01 17:17:16 -08:00
$logo . animate ( { 'top' : 12 , 'left' : 12 , 'width' : 48 , 'height' : 48 } , {
2012-03-05 19:18:40 -08:00
'duration' : 1160 ,
2012-03-02 17:51:28 -08:00
'easing' : 'easeInOutCubic' ,
'complete' : function ( ) {
$page2 . css ( { 'opacity' : 0 } ) ;
self . page ( 2 ) ;
$page2 . animate ( { 'opacity' : 1 } , { 'duration' : 1000 , 'easing' : 'easeInOutQuad' } ) ;
$submit . animate ( { 'opacity' : 1 } , { 'duration' : 1000 , 'easing' : 'easeInOutQuad' } ) ;
}
} ) ;
2013-02-01 17:17:16 -08:00
// $title.animate({'paddingLeft': 42}, {'duration': 1100, 'easing': 'easeInOutQuart'});
2012-03-02 17:51:28 -08:00
}
} ) ;
} ,
close _and _load _newsblur _blog : function ( ) {
this . close ( ) ;
2012-04-19 22:38:00 -07:00
NEWSBLUR . reader . load _feed _in _tryfeed _view ( this . newsblur _feed . id , { 'feed' : this . newsblur _feed } ) ;
2012-03-02 17:51:28 -08:00
} ,
2012-03-03 09:51:38 -08:00
// ==========
// = Import =
// ==========
2013-04-02 15:41:50 -07:00
google _reader _connect : function ( options ) {
options = options || { } ;
var window _options = "location=0,status=0,width=800,height=500" ;
2012-08-12 20:34:30 -07:00
var url = "/import/authorize" ;
2013-04-02 15:41:50 -07:00
this . flags . starred _only = ! ! options . starred _only ;
$ ( ".NB-page-2-importing" , this . $modal ) . text ( options . starred _only ?
"Importing your sites and stories..." :
"Importing your sites..." ) ;
this . connect _window = window . open ( url , '_blank' , window _options ) ;
2012-12-20 14:44:53 -08:00
clearInterval ( this . connect _window _timer ) ;
2012-08-10 19:20:08 -07:00
this . connect _window _timer = setInterval ( _ . bind ( function ( ) {
console . log ( [ "post connect window?" , this . connect _window , this . connect _window . closed , this . connect _window . location ] ) ;
try {
if ( ! this . connect _window ||
! this . connect _window . location ||
this . connect _window . closed ) {
2013-04-02 15:41:50 -07:00
this . start _import _from _google _reader ( options ) ;
2012-08-10 19:20:08 -07:00
}
} catch ( err ) {
2013-04-02 15:41:50 -07:00
this . start _import _from _google _reader ( options ) ;
2012-08-10 19:20:08 -07:00
}
} , this ) , 1000 ) ;
2012-03-05 19:18:40 -08:00
NEWSBLUR . reader . flags . importing _from _google _reader = true ;
} ,
start _import _from _google _reader : function ( data ) {
2012-08-12 20:34:30 -07:00
console . log ( [ "start_import_from_google_reader" , data ] ) ;
2012-08-10 19:20:08 -07:00
clearInterval ( this . connect _window _timer ) ;
2013-04-02 15:41:50 -07:00
data . starred _only = this . flags . starred _only ;
2012-08-12 20:34:30 -07:00
var $error = $ ( '.NB-intro-import-google .NB-error' , this . $modal ) ;
2012-03-05 19:18:40 -08:00
var $loading = $ ( '.NB-intro-imports-progress .NB-loading' , this . $modal ) ;
2012-03-12 18:11:13 -07:00
if ( data && data . error ) {
2012-03-05 19:18:40 -08:00
$error . show ( ) . text ( data . error ) ;
this . advance _import _carousel ( 0 ) ;
} else {
$error . hide ( ) ;
NEWSBLUR . reader . flags . importing _from _google _reader = false ;
2013-04-02 15:41:50 -07:00
this . advance _import _carousel ( 1 , data ) ;
2012-03-05 19:18:40 -08:00
$loading . addClass ( 'NB-active' ) ;
2013-04-02 15:41:50 -07:00
if ( data && data . starred _only ) {
NEWSBLUR . assets . start _import _starred _stories _from _google _reader (
_ . bind ( this . finish _import _from _google _reader , this ) ) ;
} else {
NEWSBLUR . assets . start _import _from _google _reader (
_ . bind ( this . finish _import _from _google _reader , this ) ) ;
}
2012-03-05 19:18:40 -08:00
}
} ,
2013-04-02 15:41:50 -07:00
finish _import _from _google _reader : function ( data ) {
var self = this ;
console . log ( [ "finish_import_from_google_reader" , data ] ) ;
2012-03-05 19:18:40 -08:00
var $loading = $ ( '.NB-intro-imports-progress .NB-loading' , this . $modal ) ;
2012-06-15 14:49:59 -07:00
NEWSBLUR . assets . load _feeds ( _ . bind ( function ( ) {
2012-03-12 18:11:13 -07:00
$loading . removeClass ( 'NB-active' ) ;
2012-03-05 19:18:40 -08:00
this . advance _import _carousel ( 2 ) ;
2013-04-02 15:41:50 -07:00
if ( data . delayed ) {
NEWSBLUR . reader . flags . delayed _import = true ;
self . count _feeds ( { fake _count : data . feed _count } ) ;
$ ( '.NB-intro-import-delayed' , self . $modal ) . show ( ) ;
2013-07-03 19:13:54 -07:00
$ ( '.NB-intro-import-restart' , self . $modal ) . hide ( ) ;
$ ( '.NB-intro-import-message' , self . $modal ) . hide ( ) ;
2013-04-02 15:41:50 -07:00
} else {
$ ( '.NB-intro-import-delayed' , self . $modal ) . hide ( ) ;
2013-07-03 19:13:54 -07:00
$ ( '.NB-intro-import-restart' , self . $modal ) . show ( ) ;
$ ( '.NB-intro-import-message' , self . $modal ) . show ( ) . text ( "All done!" ) ;
2013-04-02 15:41:50 -07:00
}
2012-03-05 19:18:40 -08:00
} , this ) ) ;
} ,
2012-03-03 09:51:38 -08:00
handle _opml _upload : function ( ) {
var self = this ;
2012-03-05 19:18:40 -08:00
var $loading = $ ( '.NB-intro-imports-progress .NB-loading' , this . $modal ) ;
var $file = $ ( '.NB-intro-upload-opml-button' , this . $modal ) ;
2012-03-03 09:51:38 -08:00
$loading . addClass ( 'NB-active' ) ;
2012-03-05 19:18:40 -08:00
this . advance _import _carousel ( 1 ) ;
2012-03-03 09:51:38 -08:00
// NEWSBLUR.log(['Uploading']);
2012-07-12 23:44:30 -07:00
var params = {
2012-03-05 19:18:40 -08:00
url : NEWSBLUR . URLs [ 'opml-upload' ] ,
type : 'POST' ,
2012-07-20 19:43:28 -07:00
dataType : 'json' ,
2012-03-03 09:51:38 -08:00
success : function ( data , status ) {
2012-06-15 14:49:59 -07:00
NEWSBLUR . assets . load _feeds ( function ( ) {
2012-03-12 18:11:13 -07:00
$loading . removeClass ( 'NB-active' ) ;
2012-03-05 19:18:40 -08:00
self . advance _import _carousel ( 2 ) ;
2012-07-20 19:43:28 -07:00
if ( data . payload . delayed ) {
NEWSBLUR . reader . flags . delayed _import = true ;
2013-04-02 15:41:50 -07:00
self . count _feeds ( { fake _count : data . payload . feed _count } ) ;
2012-07-20 19:43:28 -07:00
$ ( '.NB-intro-import-delayed' , self . $modal ) . show ( ) ;
2013-07-03 19:13:54 -07:00
$ ( '.NB-intro-import-restart' , self . $modal ) . hide ( ) ;
$ ( '.NB-intro-import-message' , self . $modal ) . hide ( ) ;
} else {
$ ( '.NB-intro-import-message' , self . $modal ) . text ( "All done!" ) . removeClass ( 'NB-error' ) . show ( ) ;
$ ( '.NB-intro-import-delayed' , self . $modal ) . hide ( ) ;
$ ( '.NB-intro-import-restart' , self . $modal ) . show ( ) ;
2012-07-20 19:43:28 -07:00
}
2012-03-05 19:18:40 -08:00
} ) ;
2012-03-03 09:51:38 -08:00
NEWSBLUR . reader . load _recommended _feed ( ) ;
} ,
2012-03-05 19:18:40 -08:00
error : function ( data , status , e ) {
2013-07-03 19:13:54 -07:00
self . advance _import _carousel ( 2 ) ;
2012-03-03 09:51:38 -08:00
$loading . removeClass ( 'NB-active' ) ;
NEWSBLUR . log ( [ 'Error' , data , status , e ] ) ;
2013-07-03 19:13:54 -07:00
$ ( '.NB-intro-import-message' , self . $modal ) . text ( "There was a problem uploading your OPML file." ) . addClass ( 'NB-error' ) . css ( 'display' , 'block' ) ;
2012-03-05 19:18:40 -08:00
} ,
cache : false ,
contentType : false ,
processData : false
2012-07-12 23:44:30 -07:00
} ;
if ( window . FormData ) {
var formData = new FormData ( $file . closest ( 'form' ) [ 0 ] ) ;
params [ 'data' ] = formData ;
$ . ajax ( params ) ;
} else {
// IE9 has no FormData
params [ 'secureuri' ] = false ;
params [ 'fileElementId' ] = 'NB-intro-upload-opml-button' ;
params [ 'dataType' ] = 'json' ;
$ . ajaxFileUpload ( params ) ;
}
2012-03-03 09:51:38 -08:00
2012-03-05 19:18:40 -08:00
$file . replaceWith ( $file . clone ( ) ) ;
2012-03-03 09:51:38 -08:00
return false ;
} ,
2012-03-16 20:40:48 -07:00
// ===================
// = Stay Up To Date =
// ===================
2012-03-19 17:51:54 -07:00
show _twitter _follow _buttons : function ( ) {
2012-03-20 11:15:40 -07:00
$ ( '.NB-intro-uptodate-follow' , this . $modal ) . toggleClass ( 'NB-intro-uptodate-twitter-inactive' , ! this . services . twitter . twitter _uid ) ;
2012-03-19 17:51:54 -07:00
} ,
2012-03-16 20:40:48 -07:00
follow _twitter _account : function ( username ) {
var $input = $ ( '#NB-intro-uptodate-follow-' + username , this . $modal ) ;
var $button = $input . closest ( '.NB-intro-uptodate-follow' ) ;
if ( $input . is ( ':checked' ) ) {
$button . addClass ( 'NB-active' ) ;
2012-03-19 17:51:54 -07:00
if ( this . services . twitter . twitter _uid ) {
2012-06-14 17:21:51 -07:00
NEWSBLUR . assets . follow _twitter _account ( username ) ;
2012-03-19 17:51:54 -07:00
} else {
window . open ( 'http://twitter.com/' + username , '_blank' ) ;
}
2012-03-16 20:40:48 -07:00
} else {
$button . removeClass ( 'NB-active' ) ;
2012-03-19 17:51:54 -07:00
if ( this . services . twitter . twitter _uid ) {
2012-06-14 17:21:51 -07:00
NEWSBLUR . assets . unfollow _twitter _account ( username ) ;
2012-03-19 17:51:54 -07:00
}
2012-03-16 20:40:48 -07:00
}
} ,
subscribe _to _feed : function ( feed ) {
2013-02-25 17:30:53 -08:00
var $button = $ ( '.NB-intro-uptodate-follow-' + feed ) ;
var $parent = $button . closest ( ".NB-intro-uptodate-follow" ) ;
2012-08-12 20:34:30 -07:00
var blog _url = 'http://blog.newsblur.com/rss' ;
2012-03-19 17:16:59 -07:00
var popular _username = 'social:popular' ;
2013-02-25 17:30:53 -08:00
console . log ( [ "subscribe_to_feed" , feed , $button , $parent ] ) ;
$parent . addClass ( 'NB-active' ) ;
if ( feed == 'blog' ) {
NEWSBLUR . assets . save _add _url ( blog _url , "" , function ( ) {
NEWSBLUR . assets . load _feeds ( ) ;
} , { auto _active : false , skip _fetch : true } ) ;
} else if ( feed == 'popular' ) {
NEWSBLUR . assets . follow _user ( popular _username , function ( ) {
NEWSBLUR . app . feed _list . make _social _feeds ( ) ;
} ) ;
2012-03-16 20:40:48 -07:00
}
} ,
2012-03-02 17:51:28 -08:00
// ===========
// = Actions =
// ===========
handle _click : function ( elem , e ) {
var self = this ;
$ . targetIs ( e , { tagSelector : '.NB-page-next' } , function ( $t , $p ) {
e . preventDefault ( ) ;
if ( self . page _number == 1 ) {
self . fade _out _logo ( ) ;
} else {
self . next _page ( ) ;
}
} ) ;
$ . targetIs ( e , { tagSelector : '.NB-tutorial-finish-newsblur-blog' } , function ( $t , $p ) {
e . preventDefault ( ) ;
self . close _and _load _newsblur _blog ( ) ;
} ) ;
2012-03-05 19:18:40 -08:00
$ . targetIs ( e , { tagSelector : '.NB-google-reader-oauth' } , function ( $t , $p ) {
e . preventDefault ( ) ;
self . google _reader _connect ( ) ;
} ) ;
2013-04-02 15:41:50 -07:00
$ . targetIs ( e , { tagSelector : '.NB-starredimport-button' } , function ( $t , $p ) {
e . preventDefault ( ) ;
self . google _reader _connect ( { 'starred_only' : true } ) ;
} ) ;
2012-03-05 19:18:40 -08:00
$ . targetIs ( e , { tagSelector : '.NB-intro-import-restart' } , function ( $t , $p ) {
e . preventDefault ( ) ;
self . advance _import _carousel ( 0 ) ;
} ) ;
2012-03-03 09:51:38 -08:00
$ . targetIs ( e , { tagSelector : '.NB-intro-upload-opml' } , function ( $t , $p ) {
// e.preventDefault();
// return false;
} ) ;
2012-03-02 17:51:28 -08:00
$ . targetIs ( e , { tagSelector : '.NB-goodies-bookmarklet-button' } , function ( $t , $p ) {
e . preventDefault ( ) ;
alert ( 'Drag this button to your bookmark toolbar.' ) ;
} ) ;
2012-03-06 11:41:57 -08:00
$ . targetIs ( e , { tagSelector : '.NB-friends-service-connect' } , function ( $t , $p ) {
e . preventDefault ( ) ;
var service ;
var $service = $t . closest ( '.NB-friends-service' ) ;
if ( $service . hasClass ( 'NB-friends-service-twitter' ) ) {
service = 'twitter' ;
} else if ( $service . hasClass ( 'NB-friends-service-facebook' ) ) {
service = 'facebook' ;
}
if ( $service . hasClass ( 'NB-connected' ) ) {
self . disconnect ( service ) ;
} else {
self . connect ( service ) ;
}
} ) ;
2013-02-25 17:30:53 -08:00
$ . targetIs ( e , { tagSelector : '.NB-intro-uptodate-follow-blog' } , function ( $t , $p ) {
self . subscribe _to _feed ( 'blog' ) ;
} ) ;
$ . targetIs ( e , { tagSelector : '.NB-intro-uptodate-follow-popular' } , function ( $t , $p ) {
self . subscribe _to _feed ( 'popular' ) ;
} ) ;
2013-07-03 17:52:13 -07:00
$ . targetIs ( e , { tagSelector : '.NB-category' } , function ( $t , $p ) {
var category = $t . data ( 'category' ) ;
self . toggle _category ( category , $t ) ;
} ) ;
2012-03-05 19:18:40 -08:00
} ,
handle _change : function ( elem , e ) {
var self = this ;
$ . targetIs ( e , { tagSelector : '.NB-intro-upload-opml-button' } , function ( $t , $p ) {
e . preventDefault ( ) ;
self . handle _opml _upload ( ) ;
} ) ;
2012-03-07 16:32:02 -08:00
$ . targetIs ( e , { tagSelector : '.NB-friends-autofollow-checkbox' } , function ( $t , $p ) {
2012-08-12 16:49:14 -07:00
NEWSBLUR . assets . preference ( 'autofollow_friends' , $t . is ( ':checked' ) ) ;
2012-03-07 16:32:02 -08:00
} ) ;
2012-03-16 20:40:48 -07:00
$ . targetIs ( e , { tagSelector : '#NB-intro-uptodate-follow-newsblur' } , function ( $t , $p ) {
self . follow _twitter _account ( 'newsblur' ) ;
} ) ;
$ . targetIs ( e , { tagSelector : '#NB-intro-uptodate-follow-samuelclay' } , function ( $t , $p ) {
self . follow _twitter _account ( 'samuelclay' ) ;
} ) ;
2012-03-02 17:51:28 -08:00
}
} ) ;