Fix some pronto remarks

closes #7119
This commit is contained in:
Augier 2016-09-24 16:15:38 +02:00 committed by Dennis Schubert
parent 523f1e848e
commit a37d9d532b
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
10 changed files with 27 additions and 26 deletions

View file

@ -20,7 +20,7 @@ app.views.Notifications = Backbone.View.extend({
else { this.setUnread(guid); } else { this.setUnread(guid); }
}, },
getAllUnread: function(){ return $(".media.stream-element.unread"); }, getAllUnread: function() { return $(".media.stream-element.unread"); },
setRead: function(guid) { this.setUnreadStatus(guid, false); }, setRead: function(guid) { this.setUnreadStatus(guid, false); },

View file

@ -90,23 +90,27 @@ app.views.StreamShortcuts = Backbone.View.extend({
}, },
commentSelected: function() { commentSelected: function() {
$('a.focus_comment_textarea',this.$('div.stream-element.loaded.shortcut_selected')).click(); this.shortcutSelected().find("a.focus_comment_textarea").click();
}, },
likeSelected: function() { likeSelected: function() {
$('a.like:first',this.$('div.stream-element.loaded.shortcut_selected')).click(); this.shortcutSelected().find("a.like:first").click();
}, },
reshareSelected: function() { reshareSelected: function() {
$('a.reshare:first',this.$('div.stream-element.loaded.shortcut_selected')).click(); this.shortcutSelected().find("a.reshare:first").click();
}, },
expandSelected: function() { expandSelected: function() {
$('div.expander:first',this.$('div.stream-element.loaded.shortcut_selected')).click(); this.shortcutSelected().find("div.expander:first").click();
},
shortcutSelected: function() {
return this.$("div.stream-element.loaded.shortcut_selected");
}, },
openFirstLinkSelected: function() { openFirstLinkSelected: function() {
var link = $('div.collapsible a[target="_blank"]:first',this.$('div.stream-element.loaded.shortcut_selected')); var link = $("div.collapsible a[target='_blank']:first");
if(link.length > 0) { if(link.length > 0) {
// click does only work with vanilla javascript // click does only work with vanilla javascript
link[0].click(); link[0].click();
@ -115,12 +119,11 @@ app.views.StreamShortcuts = Backbone.View.extend({
selectPost: function(element){ selectPost: function(element){
//remove the selection and selected-class from all posts //remove the selection and selected-class from all posts
var selected=this.$('div.stream-element.loaded.shortcut_selected'); this.shortcutSelected().removeClass("shortcut_selected").removeClass("highlighted");
selected.removeClass('shortcut_selected').removeClass('highlighted');
//move to new post //move to new post
window.scrollTo(window.pageXOffset, Math.round($(element).offset().top - this._headerSize)); window.scrollTo(window.pageXOffset, Math.round($(element).offset().top - this._headerSize));
//add the selection and selected-class to new post //add the selection and selected-class to new post
element.className+=" shortcut_selected highlighted"; element.className+=" shortcut_selected highlighted";
}, }
}); });
// @license-end // @license-end

View file

@ -2,7 +2,7 @@
app.views.StreamPost = app.views.Post.extend({ app.views.StreamPost = app.views.Post.extend({
templateName: "stream-element", templateName: "stream-element",
className : "stream-element loaded", className: "stream-element loaded",
subviews : { subviews : {
".feedback": "feedbackView", ".feedback": "feedbackView",

View file

@ -108,14 +108,6 @@ textarea { resize: vertical; }
width: 100%; width: 100%;
} }
.stream-element:not(.shield-active) .shield{
display: none;
}
.stream-element.shield-active .nsfw-hidden{
display: none;
}
.login_error, .login_error,
.login_alert { .login_alert {
color: #DF0101; color: #DF0101;
@ -195,6 +187,11 @@ footer {
padding: 0; } padding: 0; }
margin-top: 0; margin-top: 0;
} }
&.shield-active .nsfw-hidden,
&:not(.shield-active) .shield {
display: none;
}
} }
.photo_attachments { .photo_attachments {

View file

@ -1,4 +1,5 @@
.media.stream-element{:data=>{:guid => note.id, :type => (Notification.types.key(note.type) || '') }, :class => (note.unread ? 'unread' : 'read')} .media.stream-element{data: {guid: note.id, type: (Notification.types.key(note.type) || "")},
class: (note.unread ? "unread" : "read")}
.unread-toggle.pull-right .unread-toggle.pull-right
%i.entypo-eye{title: (note.unread ? t("notifications.index.mark_read") : t("notifications.index.mark_unread"))} %i.entypo-eye{title: (note.unread ? t("notifications.index.mark_read") : t("notifications.index.mark_unread"))}
- if note.type == "Notifications::StartedSharing" && (!defined?(no_aspect_dropdown) || !no_aspect_dropdown) - if note.type == "Notifications::StartedSharing" && (!defined?(no_aspect_dropdown) || !no_aspect_dropdown)

View file

@ -14,7 +14,7 @@
= locale_date(date) = locale_date(date)
%ul.notifications_for_day %ul.notifications_for_day
- notes.each do |note| - notes.each do |note|
.stream-element{data: {guid: note.id}, class: "#{note.unread ? "unread" : "read"}"} .stream-element{data: {guid: note.id}, class: (note.unread ? "unread" : "read")}
.content.from .content.from
.media .media
.media-left .media-left

View file

@ -1,6 +1,6 @@
#people_stream #people_stream
- people.each do |person| - people.each do |person|
.media.stream-element{:id => person.id} .media.stream-element{id: person.id}
.media-object.pull-left .media-object.pull-left
= person_image_link(person, :size => :thumb_small) = person_image_link(person, :size => :thumb_small)
.media-body .media-body

View file

@ -8,7 +8,7 @@
#show_content.photos #show_content.photos
.photo .photo
= image_tag photo.url(:scaled_full) = image_tag photo.url(:scaled_full)
.stream-element{:class => "photo_mobile"} .stream-element.photo_mobile
.content .content
.from.media .from.media
.media-left .media-left

View file

@ -21,7 +21,7 @@
= timeago(post.created_at) = timeago(post.created_at)
%span.via %span.via
- if post.provider_display_name == "mobile" - if post.provider_display_name == "mobile"
= t('shared.stream-element.via_mobile', link: nil) = t("shared.stream_element.via_mobile", link: nil)
– –
%span.scope_scope %span.scope_scope
- if post.public? - if post.public?

View file

@ -204,7 +204,7 @@ Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"
end end
Then /^I should see (\d+) contacts$/ do |n_posts| Then /^I should see (\d+) contacts$/ do |n_posts|
has_css?("#people_stream .stream-element", :count => n_posts.to_i).should be true has_css?("#people_stream .stream-element", count: n_posts.to_i).should be true
end end
And /^I scroll down$/ do And /^I scroll down$/ do
@ -245,11 +245,11 @@ When /^I resize my window to 800x600$/ do
end end
Then 'I should see an image attached to the post' do Then 'I should see an image attached to the post' do
step %{I should see a "img" within ".stream-element div.photo_attachments"} step %(I should see a "img" within ".stream-element div.photo_attachments")
end end
Then 'I press the attached image' do Then 'I press the attached image' do
step %{I press the 1st "img" within ".stream-element div.photo_attachments"} step %(I press the 1st "img" within ".stream-element div.photo_attachments")
end end
And "I wait for the popovers to appear" do And "I wait for the popovers to appear" do