Adding View Profile menu item to social subs.

This commit is contained in:
Samuel Clay 2012-04-17 15:37:01 -07:00
parent a98e8fadde
commit 4d2e8fa9bc
3 changed files with 19 additions and 0 deletions

View file

@ -4714,6 +4714,9 @@ background: transparent;
.NB-menu-manage .NB-menu-manage-mark-read .NB-menu-manage-image { .NB-menu-manage .NB-menu-manage-mark-read .NB-menu-manage-image {
background: transparent url('/media/embed/icons/silk/cut.png') no-repeat 0 2px; background: transparent url('/media/embed/icons/silk/cut.png') no-repeat 0 2px;
} }
.NB-menu-manage .NB-menu-manage-social-profile .NB-menu-manage-image {
background: transparent url('/media/embed/icons/silk/user_orange.png') no-repeat 0 1px;
}
.NB-menu-manage .NB-menu-manage-keyboard .NB-menu-manage-image { .NB-menu-manage .NB-menu-manage-keyboard .NB-menu-manage-image {
background: transparent url('/media/embed/icons/silk/keyboard.png') no-repeat 0 1px; background: transparent url('/media/embed/icons/silk/keyboard.png') no-repeat 0 1px;
} }

View file

@ -4901,6 +4901,9 @@
}, },
open_social_profile_modal: function(user_id) { open_social_profile_modal: function(user_id) {
if (_.string.contains(user_id, 'social:')) {
user_id = parseInt(user_id.replace('social:', ''), 10);
}
NEWSBLUR.social_profile = new NEWSBLUR.ReaderSocialProfile(user_id); NEWSBLUR.social_profile = new NEWSBLUR.ReaderSocialProfile(user_id);
}, },
@ -5079,6 +5082,11 @@
$.make('div', { className: 'NB-menu-manage-title' }, 'Fix this misbehaving site') $.make('div', { className: 'NB-menu-manage-title' }, 'Fix this misbehaving site')
])), ])),
(feed.has_exception && $.make('li', { className: 'NB-menu-separator-inverse' })), (feed.has_exception && $.make('li', { className: 'NB-menu-separator-inverse' })),
$.make('li', { className: 'NB-menu-manage-feed NB-menu-manage-social-profile' }, [
$.make('div', { className: 'NB-menu-manage-image' }),
$.make('div', { className: 'NB-menu-manage-title' }, 'View profile')
]),
$.make('li', { className: 'NB-menu-separator' }),
(feed.exception_type != 'feed' && $.make('li', { className: 'NB-menu-manage-feed NB-menu-manage-mark-read NB-menu-manage-feed-mark-read' }, [ (feed.exception_type != 'feed' && $.make('li', { className: 'NB-menu-manage-feed NB-menu-manage-mark-read NB-menu-manage-feed-mark-read' }, [
$.make('div', { className: 'NB-menu-manage-image' }), $.make('div', { className: 'NB-menu-manage-image' }),
$.make('div', { className: 'NB-menu-manage-title' }, 'Mark as read') $.make('div', { className: 'NB-menu-manage-title' }, 'Mark as read')
@ -7422,6 +7430,11 @@
self.open_mark_read_modal(); self.open_mark_read_modal();
} }
}); });
$.targetIs(e, { tagSelector: '.NB-menu-manage-social-profile' }, function($t, $p){
e.preventDefault();
var feed_id = $t.parents('.NB-menu-manage').data('feed_id');
self.open_social_profile_modal(feed_id);
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-keyboard' }, function($t, $p){ $.targetIs(e, { tagSelector: '.NB-menu-manage-keyboard' }, function($t, $p){
e.preventDefault(); e.preventDefault();
if (!$t.hasClass('NB-disabled')) { if (!$t.hasClass('NB-disabled')) {

View file

@ -16,6 +16,9 @@ NEWSBLUR.ReaderSocialProfile.prototype = new NEWSBLUR.Modal;
_.extend(NEWSBLUR.ReaderSocialProfile.prototype, { _.extend(NEWSBLUR.ReaderSocialProfile.prototype, {
runner: function(user_id) { runner: function(user_id) {
if (!this.model.user_profiles.find(user_id)) {
this.model.add_user_profiles([{user_id: user_id}]);
}
this.profile = this.model.user_profiles.find(user_id).clone(); this.profile = this.model.user_profiles.find(user_id).clone();
this.make_modal(); this.make_modal();
this.open_modal(); this.open_modal();