mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Substituting in new window links for following twitter accounts when twitter is no authed.
This commit is contained in:
parent
6ad94db4e8
commit
fc233a7f70
3 changed files with 34 additions and 3 deletions
|
@ -5641,6 +5641,22 @@ background: transparent;
|
|||
padding: 4px 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.NB-modal-intro .NB-intro-uptodate-follow .NB-intro-uptodate-newwindow {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
float: right;
|
||||
margin-top: 22px;
|
||||
}
|
||||
.NB-modal-intro .NB-intro-uptodate-follow.NB-intro-uptodate-twitter-active .NB-intro-uptodate-newwindow {
|
||||
display: none;
|
||||
}
|
||||
.NB-modal-intro .NB-intro-uptodate-follow input {
|
||||
display: none;
|
||||
}
|
||||
.NB-modal-intro .NB-intro-uptodate-follow.NB-intro-uptodate-twitter-active input {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ============ */
|
||||
/* = Carousel = */
|
||||
/* ============ */
|
||||
|
|
BIN
media/img/reader/new-window-icon.png
Normal file
BIN
media/img/reader/new-window-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 177 B |
|
@ -99,6 +99,7 @@ _.extend(NEWSBLUR.ReaderIntro.prototype, {
|
|||
$.make('div', { className: 'NB-intro-uptodate-follow NB-right' }, [
|
||||
$.make('input', { type: 'checkbox', id: 'NB-intro-uptodate-follow-newsblur' }),
|
||||
$.make('label', { 'for': 'NB-intro-uptodate-follow-newsblur' }, [
|
||||
$.make('img', { src: NEWSBLUR.Globals.MEDIA_URL + 'img/reader/new-window-icon.png', className: 'NB-intro-uptodate-newwindow' }),
|
||||
$.make('img', { src: 'http://img.tweetimag.es/i/newsblur_n.png', style: 'border-color: #505050;' }),
|
||||
$.make('span', [
|
||||
'Follow @newsblur on',
|
||||
|
@ -111,6 +112,7 @@ _.extend(NEWSBLUR.ReaderIntro.prototype, {
|
|||
$.make('div', { className: 'NB-intro-uptodate-follow' }, [
|
||||
$.make('input', { type: 'checkbox', id: 'NB-intro-uptodate-follow-samuelclay' }),
|
||||
$.make('label', { 'for': 'NB-intro-uptodate-follow-samuelclay' }, [
|
||||
$.make('img', { src: NEWSBLUR.Globals.MEDIA_URL + 'img/reader/new-window-icon.png', className: 'NB-intro-uptodate-newwindow' }),
|
||||
$.make('img', { src: 'http://img.tweetimag.es/i/samuelclay_n.png', style: 'border-color: #505050;' }),
|
||||
$.make('span', [
|
||||
'Follow @samuelclay on',
|
||||
|
@ -315,6 +317,9 @@ _.extend(NEWSBLUR.ReaderIntro.prototype, {
|
|||
if (page_number == 3) {
|
||||
this.make_find_friends_and_services();
|
||||
}
|
||||
if (page_number == 4) {
|
||||
this.show_twitter_follow_buttons();
|
||||
}
|
||||
},
|
||||
|
||||
advance_import_carousel: function(page) {
|
||||
|
@ -474,16 +479,26 @@ _.extend(NEWSBLUR.ReaderIntro.prototype, {
|
|||
// = Stay Up To Date =
|
||||
// ===================
|
||||
|
||||
show_twitter_follow_buttons: function() {
|
||||
$('.NB-intro-uptodate-follow', this.$modal).toggleClass('NB-intro-uptodate-twitter-active', !!this.services.twitter.twitter_uid);
|
||||
},
|
||||
|
||||
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');
|
||||
this.model.follow_twitter_account(username);
|
||||
if (this.services.twitter.twitter_uid) {
|
||||
this.model.follow_twitter_account(username);
|
||||
} else {
|
||||
window.open('http://twitter.com/'+username, '_blank');
|
||||
}
|
||||
} else {
|
||||
$button.removeClass('NB-active');
|
||||
this.model.unfollow_twitter_account(username);
|
||||
if (this.services.twitter.twitter_uid) {
|
||||
this.model.unfollow_twitter_account(username);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -507,7 +522,7 @@ _.extend(NEWSBLUR.ReaderIntro.prototype, {
|
|||
} else {
|
||||
$button.removeClass('NB-active');
|
||||
if (feed == 'blog') {
|
||||
this.model.delete_feed_by_url(url, "", function() {
|
||||
this.model.delete_feed_by_url(blog_url, "", function() {
|
||||
NEWSBLUR.reader.load_feeds();
|
||||
});
|
||||
} else if (feed == 'popular') {
|
||||
|
|
Loading…
Add table
Reference in a new issue