mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Adding share rainbow to story titles. Thanks Talha Mansoor (@talha131)
This commit is contained in:
parent
8be6f106ed
commit
45b2b06c10
4 changed files with 46 additions and 4 deletions
|
@ -1310,6 +1310,20 @@ background: transparent;
|
||||||
#story_titles .story.NB-story-starred:hover a.story_title {
|
#story_titles .story.NB-story-starred:hover a.story_title {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#story_titles .story.NB-story-shared .NB-storytitles-share,
|
||||||
|
#story_titles .story.read.NB-story-shared .NB-storytitles-share {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: -2px 6px -2px 0;
|
||||||
|
background: transparent url('/media/embed/icons/silk/rainbow.png') no-repeat 0 0;
|
||||||
|
float: left;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#story_titles .story.NB-story-shared .NB-storytitles-share,
|
||||||
|
#story_titles .story.read.NB-story-shared .NB-storytitles-share {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
#story_titles .story.read {
|
#story_titles .story.read {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3139,10 +3139,12 @@
|
||||||
var story = this.model.get_story(story_id);
|
var story = this.model.get_story(story_id);
|
||||||
var $story_title = this.find_story_in_story_titles(story_id);
|
var $story_title = this.find_story_in_story_titles(story_id);
|
||||||
var $feed_story = this.find_story_in_feed_view(story_id);
|
var $feed_story = this.find_story_in_feed_view(story_id);
|
||||||
|
var $share_star = $('.NB-storytitles-share', $story_title);
|
||||||
var $share_button = $('.NB-sideoption-share-save', $feed_story);
|
var $share_button = $('.NB-sideoption-share-save', $feed_story);
|
||||||
var $share_sideoption = $('.NB-feed-story-share .NB-sideoption-title', $feed_story);
|
var $share_sideoption = $('.NB-feed-story-share .NB-sideoption-title', $feed_story);
|
||||||
var comments = _.string.trim($('.NB-sideoption-share-comments', $feed_story).val());
|
var comments = _.string.trim($('.NB-sideoption-share-comments', $feed_story).val());
|
||||||
|
|
||||||
|
$story_title.addClass('NB-story-shared');
|
||||||
$share_button.addClass('NB-saving').text('Sharing...');
|
$share_button.addClass('NB-saving').text('Sharing...');
|
||||||
this.model.mark_story_as_shared(story_id, story.story_feed_id, comments, _.bind(function(data) {
|
this.model.mark_story_as_shared(story_id, story.story_feed_id, comments, _.bind(function(data) {
|
||||||
this.toggle_feed_story_share_dialog(story_id, story.story_feed_id);
|
this.toggle_feed_story_share_dialog(story_id, story.story_feed_id);
|
||||||
|
@ -3156,6 +3158,31 @@
|
||||||
$('.NB-feed-story-content', $feed_story).after($old_comments);
|
$('.NB-feed-story-content', $feed_story).after($old_comments);
|
||||||
}
|
}
|
||||||
$old_comments.replaceWith($new_comments);
|
$old_comments.replaceWith($new_comments);
|
||||||
|
|
||||||
|
$share_star.attr({'title': 'Shared!'});
|
||||||
|
$share_star.tipsy({
|
||||||
|
gravity: 'sw',
|
||||||
|
fade: true,
|
||||||
|
trigger: 'manual',
|
||||||
|
offsetOpposite: -1
|
||||||
|
});
|
||||||
|
var tipsy = $share_star.data('tipsy');
|
||||||
|
tipsy.enable();
|
||||||
|
tipsy.show();
|
||||||
|
|
||||||
|
$share_star.animate({
|
||||||
|
'opacity': 1
|
||||||
|
}, {
|
||||||
|
'duration': 850,
|
||||||
|
'queue': false,
|
||||||
|
'complete': function() {
|
||||||
|
if (tipsy.enabled) {
|
||||||
|
tipsy.hide();
|
||||||
|
tipsy.disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}, this));
|
}, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3344,6 +3371,7 @@
|
||||||
var score = this.compute_story_score(story);
|
var score = this.compute_story_score(story);
|
||||||
var score_color = 'neutral';
|
var score_color = 'neutral';
|
||||||
var starred = story.starred ? ' NB-story-starred ' : '';
|
var starred = story.starred ? ' NB-story-starred ' : '';
|
||||||
|
var shared = story.shared ? ' NB-story-shared ' : '';
|
||||||
if (options.river_stories) {
|
if (options.river_stories) {
|
||||||
var feed = this.model.get_feed(story.story_feed_id);
|
var feed = this.model.get_feed(story.story_feed_id);
|
||||||
}
|
}
|
||||||
|
@ -3357,7 +3385,7 @@
|
||||||
$story_tags.append($tag);
|
$story_tags.append($tag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
var $story_title = $.make('div', { className: 'story ' + read + starred + 'NB-story-' + score_color }, [
|
var $story_title = $.make('div', { className: 'story ' + read + starred + shared + 'NB-story-' + score_color }, [
|
||||||
$.make('div', { className: 'NB-storytitles-sentiment'}),
|
$.make('div', { className: 'NB-storytitles-sentiment'}),
|
||||||
$.make('a', { href: story.story_permalink, className: 'story_title' }, [
|
$.make('a', { href: story.story_permalink, className: 'story_title' }, [
|
||||||
(options['river_stories'] && feed &&
|
(options['river_stories'] && feed &&
|
||||||
|
@ -3366,6 +3394,7 @@
|
||||||
$.make('span', { className: 'feed_title' }, feed.feed_title)
|
$.make('span', { className: 'feed_title' }, feed.feed_title)
|
||||||
])),
|
])),
|
||||||
$.make('div', { className: 'NB-storytitles-star'}),
|
$.make('div', { className: 'NB-storytitles-star'}),
|
||||||
|
$.make('div', { className: 'NB-storytitles-share'}),
|
||||||
$.make('span', { className: 'NB-storytitles-title' }, story.story_title),
|
$.make('span', { className: 'NB-storytitles-title' }, story.story_title),
|
||||||
$.make('span', { className: 'NB-storytitles-author' }, story.story_authors),
|
$.make('span', { className: 'NB-storytitles-author' }, story.story_authors),
|
||||||
$story_tags
|
$story_tags
|
||||||
|
|
|
@ -134,7 +134,6 @@
|
||||||
for (var o in item) {
|
for (var o in item) {
|
||||||
if (!item.hasOwnProperty(o)) continue;
|
if (!item.hasOwnProperty(o)) continue;
|
||||||
var folder = item[o];
|
var folder = item[o];
|
||||||
console.log(["make_folder_options", folder, o, depth]);
|
|
||||||
var $option = $.make('option', { value: o }, depth + ' ' + o);
|
var $option = $.make('option', { value: o }, depth + ' ' + o);
|
||||||
$options.append($option);
|
$options.append($option);
|
||||||
$options = this.make_folder_options($options, folder, depth+'-');
|
$options = this.make_folder_options($options, folder, depth+'-');
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
{{ activity.time_since }} ago
|
{{ activity.time_since }} ago
|
||||||
</div>
|
</div>
|
||||||
<div class="NB-interaction-title">
|
<div class="NB-interaction-title">
|
||||||
{{ username }} shared <span class="NB-interaction-sharedstory-title NB-splash-link">{{ activity.title|truncatewords:6 }}</span>{% if activity.content %}:{% else %}.{% endif %}
|
{{ username }} shared <span class="NB-interaction-sharedstory-title NB-splash-link">{{ activity.title|safe|truncatewords:6 }}</span>{% if activity.content %}:{% else %}.{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if activity.content %}
|
{% if activity.content %}
|
||||||
<div class="NB-interaction-content">
|
<div class="NB-interaction-content">
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
{{ activity.time_since }} ago
|
{{ activity.time_since }} ago
|
||||||
</div>
|
</div>
|
||||||
<div class="NB-interaction-title">
|
<div class="NB-interaction-title">
|
||||||
You starred "<span class="NB-interaction-starred-story-title NB-splash-link">{{ activity.content|truncatewords:8 }}</span>".
|
You starred "<span class="NB-interaction-starred-story-title NB-splash-link">{{ activity.content|safe|truncatewords:8 }}</span>".
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue