Closing #52: Adding delicious to sharing services and preferences. Thanks @palewire for the suggestion.

This commit is contained in:
Samuel Clay 2012-05-06 16:26:54 -07:00
parent 7f7887c680
commit 8791291774
4 changed files with 38 additions and 0 deletions

View file

@ -4441,6 +4441,9 @@ background: transparent;
.NB-menu-manage .NB-menu-manage-story-thirdparty .NB-menu-manage-thirdparty-tumblr {
background: transparent url('/media/embed/reader/tumblr.png') no-repeat 0 0;
}
.NB-menu-manage .NB-menu-manage-story-thirdparty .NB-menu-manage-thirdparty-delicious {
background: transparent url('/media/embed/reader/delicious.png') no-repeat 0 0;
}
.NB-menu-manage .NB-menu-manage-story-thirdparty .NB-menu-manage-thirdparty-pinboard {
background: transparent url('/media/embed/reader/pinboard.png') no-repeat 0 0;
}
@ -4488,6 +4491,13 @@ background: transparent;
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-tumblr .NB-menu-manage-thirdparty-tumblr {
opacity: 1;
}
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-delicious .NB-menu-manage-image,
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-delicious .NB-menu-manage-thirdparty-icon {
opacity: .2;
}
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-delicious .NB-menu-manage-thirdparty-delicious {
opacity: 1;
}
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-pinboard .NB-menu-manage-image,
.NB-menu-manage .NB-menu-manage-story-thirdparty.NB-menu-manage-highlight-pinboard .NB-menu-manage-thirdparty-icon {
opacity: .2;
@ -5795,6 +5805,9 @@ background: transparent;
.NB-modal-preferences .NB-preference-story-share label[for=NB-preference-story-share-tumblr] {
background: transparent url('/media/embed/reader/tumblr.png') no-repeat 0 0;
}
.NB-modal-preferences .NB-preference-story-share label[for=NB-preference-story-share-delicious] {
background: transparent url('/media/embed/reader/delicious.png') no-repeat 0 0;
}
.NB-modal-preferences .NB-preference-story-share label[for=NB-preference-story-share-pinboard] {
background: transparent url('/media/embed/reader/pinboard.png') no-repeat 0 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -2794,6 +2794,20 @@
this.mark_story_as_read(story_id);
},
send_story_to_delicious: function(story_id) {
var story = this.model.get_story(story_id);
var url = 'http://www.delicious.com/save';
var delicious_url = [
url,
'?v=6&url=',
encodeURIComponent(story.story_permalink),
'&title=',
encodeURIComponent(story.story_title)
].join('');
window.open(delicious_url, '_blank');
this.mark_story_as_read(story_id);
},
send_story_to_readability: function(story_id) {
var story = this.model.get_story(story_id);
var url = 'http://www.readability.com/save';
@ -4462,6 +4476,11 @@
}, this)).bind('mouseleave', _.bind(function(e) {
$(e.target).siblings('.NB-menu-manage-title').text('Email story').parent().removeClass('NB-menu-manage-highlight-tumblr');
}, this))),
(NEWSBLUR.Preferences['story_share_delicious'] && $.make('div', { className: 'NB-menu-manage-thirdparty-icon NB-menu-manage-thirdparty-delicious'}).bind('mouseenter', _.bind(function(e) {
$(e.target).siblings('.NB-menu-manage-title').text('Delicious').parent().addClass('NB-menu-manage-highlight-delicious');
}, this)).bind('mouseleave', _.bind(function(e) {
$(e.target).siblings('.NB-menu-manage-title').text('Email story').parent().removeClass('NB-menu-manage-highlight-delicious');
}, this))),
(NEWSBLUR.Preferences['story_share_pinboard'] && $.make('div', { className: 'NB-menu-manage-thirdparty-icon NB-menu-manage-thirdparty-pinboard'}).bind('mouseenter', _.bind(function(e) {
$(e.target).siblings('.NB-menu-manage-title').text('Pinboard').parent().addClass('NB-menu-manage-highlight-pinboard');
}, this)).bind('mouseleave', _.bind(function(e) {
@ -4496,6 +4515,8 @@
this.send_story_to_readitlater(story.id);
} else if ($target.hasClass('NB-menu-manage-thirdparty-tumblr')) {
this.send_story_to_tumblr(story.id);
} else if ($target.hasClass('NB-menu-manage-thirdparty-delicious')) {
this.send_story_to_delicious(story.id);
} else if ($target.hasClass('NB-menu-manage-thirdparty-readability')) {
this.send_story_to_readability(story.id);
} else if ($target.hasClass('NB-menu-manage-thirdparty-pinboard')) {

View file

@ -473,6 +473,10 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
$.make('div', { className: 'NB-preference-option', title: 'Tumblr' }, [
$.make('input', { type: 'checkbox', id: 'NB-preference-story-share-tumblr', name: 'story_share_tumblr' }),
$.make('label', { 'for': 'NB-preference-story-share-tumblr' })
]),
$.make('div', { className: 'NB-preference-option', title: 'Delicious' }, [
$.make('input', { type: 'checkbox', id: 'NB-preference-story-share-delicious', name: 'story_share_delicious' }),
$.make('label', { 'for': 'NB-preference-story-share-delicious' })
])
]),
$.make('div', { className: 'NB-preference-label'}, [