Commit fdd02739 authored by Milan's avatar Milan

merge upstream/develop into tchncs-dev

parents aa00b398 b0da14c3
Pipeline #663 failed with stage
in 11 minutes and 40 seconds
......@@ -6,6 +6,10 @@ AllCops:
Rails:
Enabled: true
# Disable for rails 4
Rails/HttpPositionalArguments:
Enabled: false
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
......
# 0.7.0.0
## Refactor
* Make the mention syntax more flexible [#7305](https://github.com/diaspora/diaspora/pull/7305)
* Display @ before mentions [#7324](https://github.com/diaspora/diaspora/pull/7324)
* Simplify mentions in the publisher [#7302](https://github.com/diaspora/diaspora/pull/7302)
* Remove chartbeat and mixpanel support [#7280](https://github.com/diaspora/diaspora/pull/7280)
* Upgrade to jQuery 3 [#7303](https://github.com/diaspora/diaspora/pull/7303)
## Bug fixes
## Features
* Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818)
* Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300)
* Render mentions as links in comments [#7327](https://github.com/diaspora/diaspora/pull/7327)
* Add support for mentions in comments to the front-end [#7386](https://github.com/diaspora/diaspora/pull/7386)
# 0.6.5.0
## Refactor
* Remove unused setPreload function [#7354](https://github.com/diaspora/diaspora/pull/7354)
* Remove jQuery deprecations [#7356](https://github.com/diaspora/diaspora/pull/7356)
* Use empty selector where "#" was used as a selector before (prepare jQuery 3 upgrade) [#7372](https://github.com/diaspora/diaspora/pull/7372)
## Bug fixes
* Don't hide posts when blocking someone from the profile [#7379](https://github.com/diaspora/diaspora/pull/7379)
## Features
* Add links to liked and commented pages [#5502](https://github.com/diaspora/diaspora/pull/5502)
# 0.6.4.0
## Refactor
......
......@@ -85,18 +85,18 @@ gem "entypo-rails", "3.0.0"
# JavaScript
gem "handlebars_assets", "0.23.1"
gem "jquery-rails", "4.2.1"
gem "jquery-rails", "4.2.2"
gem "jquery-ui-rails", "5.0.5"
gem "js-routes", "1.3.3"
gem "js_image_paths", "0.1.0"
source "https://rails-assets.org" do
gem "rails-assets-jquery", "2.2.4" # Should be kept in sync with jquery-rails
gem "rails-assets-jquery", "3.1.1" # Should be kept in sync with jquery-rails
gem "rails-assets-highlightjs", "9.9.0"
gem "rails-assets-markdown-it", "8.3.0"
gem "rails-assets-markdown-it-hashtag", "0.4.0"
gem "rails-assets-markdown-it-diaspora-mention", "1.1.1"
gem "rails-assets-markdown-it-diaspora-mention", "1.2.0"
gem "rails-assets-markdown-it-sanitizer", "0.4.3"
gem "rails-assets-markdown-it--markdown-it-for-inline", "0.1.1"
gem "rails-assets-markdown-it-sub", "1.0.0"
......
......@@ -323,7 +323,7 @@ GEM
rake
jasmine-core (2.5.2)
jasmine-jquery-rails (2.0.3)
jquery-rails (4.2.1)
jquery-rails (4.2.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
......@@ -539,7 +539,7 @@ GEM
rails-assets-jasmine (2.5.2)
rails-assets-jasmine-ajax (3.3.1)
rails-assets-jasmine (~> 2)
rails-assets-jquery (2.2.4)
rails-assets-jquery (3.1.1)
rails-assets-jquery-colorbox (1.6.4)
rails-assets-jquery (>= 1.3.2)
rails-assets-jquery-fullscreen-plugin (0.5.0)
......@@ -552,7 +552,7 @@ GEM
rails-assets-jquery (>= 1.6)
rails-assets-markdown-it--markdown-it-for-inline (0.1.1)
rails-assets-markdown-it (8.3.0)
rails-assets-markdown-it-diaspora-mention (1.1.1)
rails-assets-markdown-it-diaspora-mention (1.2.0)
rails-assets-markdown-it-hashtag (0.4.0)
rails-assets-markdown-it-sanitizer (0.4.3)
rails-assets-markdown-it-sub (1.0.0)
......@@ -823,7 +823,7 @@ DEPENDENCIES
i18n-inflector-rails (= 1.0.7)
jasmine (= 2.5.2)
jasmine-jquery-rails (= 2.0.3)
jquery-rails (= 4.2.1)
jquery-rails (= 4.2.2)
jquery-ui-rails (= 5.0.5)
js-routes (= 1.3.3)
js_image_paths (= 0.1.0)
......@@ -871,12 +871,12 @@ DEPENDENCIES
rails-assets-fine-uploader (= 5.13.0)!
rails-assets-highlightjs (= 9.9.0)!
rails-assets-jasmine-ajax (= 3.3.1)!
rails-assets-jquery (= 2.2.4)!
rails-assets-jquery (= 3.1.1)!
rails-assets-jquery-placeholder (= 2.3.1)!
rails-assets-jquery-textchange (= 0.2.3)!
rails-assets-markdown-it (= 8.3.0)!
rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)!
rails-assets-markdown-it-diaspora-mention (= 1.1.1)!
rails-assets-markdown-it-diaspora-mention (= 1.2.0)!
rails-assets-markdown-it-hashtag (= 0.4.0)!
rails-assets-markdown-it-sanitizer (= 0.4.3)!
rails-assets-markdown-it-sub (= 1.0.0)!
......@@ -919,4 +919,4 @@ DEPENDENCIES
will_paginate (= 3.1.5)
BUNDLED WITH
1.14.5
1.14.6
......@@ -7,8 +7,7 @@
[Project site](https://diasporafoundation.org) |
[Wiki](https://wiki.diasporafoundation.org) |
[Bugtracker](https://github.com/diaspora/diaspora/issues) |
[Discussions](https://www.loomio.org/groups/194) |
[Mailing lists](https://wiki.diasporafoundation.org/How_We_Communicate#Mailing_Lists) |
[Discussions and Support](https://discourse.diasporafoundation.org/) |
[License](/COPYRIGHT) |
[Authors](https://github.com/diaspora/diaspora/contributors)
......@@ -26,9 +25,9 @@ Still haven't found an answer? Talk to us! Read [how we communicate](https://wik
## Contribute
To keep diaspora* growing and improving we need all help we can get. Whether you can contribute [code](https://wiki.diasporafoundation.org/Getting_started_with_contributing), [ideas](https://wiki.diasporafoundation.org/How_we_communicate#Loomio), [translations](https://wiki.diasporafoundation.org/Contribute_translations), [bug reports](https://wiki.diasporafoundation.org/How_to_report_a_bug) or simply extend the community as a [helpful user](https://wiki.diasporafoundation.org/Welcoming_committee) or [pod administrator](https://wiki.diasporafoundation.org/Installation), your help is welcome!
To keep diaspora\* growing and improving we need all help we can get. Whether you can contribute [code](https://wiki.diasporafoundation.org/Getting_started_with_contributing), [ideas](https://wiki.diasporafoundation.org/How_we_communicate#Discourse), [translations](https://wiki.diasporafoundation.org/Contribute_translations), [bug reports](https://wiki.diasporafoundation.org/How_to_report_a_bug) or simply extend the community as a [helpful user](https://wiki.diasporafoundation.org/Welcoming_committee) or [pod administrator](https://wiki.diasporafoundation.org/Installation), your help is welcome!
Everyone interacting in diaspora’s codebases, issue trackers, chat rooms, mailing lists, the wiki, and the Loomio group is expected to follow the diaspora\* [code of conduct](/CODE_OF_CONDUCT.md).
Everyone interacting in diaspora’s codebases, issue trackers, chat rooms, the wiki, and the Discourse is expected to follow the diaspora\* [code of conduct](/CODE_OF_CONDUCT.md).
## Security
......
$(document).ready(function() {
$("#js-app-logo").error(function () {
$("#js-app-logo").on("error", function() {
$(this).attr("src", ImagePaths.get("user/default.png"));
});
});
......@@ -60,11 +60,6 @@ var app = {
return !!(window.gon.preloads && window.gon.preloads[prop]); //returning boolean variable so that parsePreloads, which cleans up properly is used instead
},
setPreload : function(prop, val) {
window.gon.preloads = window.gon.preloads || {};
window.gon.preloads[prop] = val;
},
parsePreload : function(prop) {
if(!app.hasPreload(prop)) { return; }
......@@ -126,12 +121,6 @@ var app = {
app.flashMessages = new app.views.FlashMessages({el: $("#flash-container")});
},
/* mixpanel wrapper function */
instrument : function(type, name, object, callback) {
if(!window.mixpanel) { return; }
window.mixpanel[type](name, object, callback);
},
setupDisabledLinks: function() {
$("a.disabled").click(function(event) {
event.preventDefault();
......
......@@ -76,8 +76,6 @@ app.models.Post.Interactions = Backbone.Model.extend({
app.flashMessages.handleAjaxError(response);
}
});
app.instrument("track", "Like");
},
unlike : function() {
......@@ -87,8 +85,6 @@ app.models.Post.Interactions = Backbone.Model.extend({
self.set({"likes_count" : self.get("likes_count") - 1});
self.likes.trigger("change");
}});
app.instrument("track", "Unlike");
},
comment: function(text, options) {
......@@ -104,8 +100,6 @@ app.models.Post.Interactions = Backbone.Model.extend({
self.trigger('change'); //updates after sync
if (options.success) { options.success(); }
});
app.instrument("track", "Comment");
},
reshare : function(){
......@@ -126,8 +120,6 @@ app.models.Post.Interactions = Backbone.Model.extend({
.fail(function(response) {
app.flashMessages.handleAjaxError(response);
});
app.instrument("track", "Reshare");
},
userCanReshare : function(){
......
......@@ -56,7 +56,7 @@ app.views.Base = Backbone.View.extend({
.attr("data-template", _.last(this.templateName.split("/")));
// add avatar fallback if it can't be loaded
this.$el.find(this.avatars.selector).error(this.avatars.fallback);
this.$el.find(this.avatars.selector).on("error", this.avatars.fallback);
// add placeholder support for old browsers
this.$("input, textarea").placeholder();
......
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
//= require ./publisher/mention_view
app.views.CommentMention = app.views.PublisherMention.extend({
initialize: function(opts) {
opts.url = Routes.mentionablePost(opts.postId);
app.views.PublisherMention.prototype.initialize.call(this, opts);
}
});
// @license-end
......@@ -27,6 +27,7 @@ app.views.CommentStream = app.views.Base.extend({
this.model.comments.each(this.appendComment, this);
this.commentBox = this.$(".comment_box");
this.commentSubmitButton = this.$("input[name='commit']");
new app.views.CommentMention({el: this.$el, postId: this.model.get("id")});
},
presenter: function(){
......
......@@ -20,7 +20,7 @@ app.views.Comment = app.views.Content.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(),
text : app.helpers.textFormatter(this.model.get("text"))
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
});
},
......
......@@ -18,7 +18,7 @@ app.views.ContactStream = Backbone.View.extend({
$("#paginate .loader").removeClass("hidden");
$.ajax(this._fetchUrl(), {
context: this
}).success(function(response) {
}).done(function(response) {
if (response.length === 0) {
this.onEmptyResponse();
} else {
......
......@@ -96,7 +96,7 @@ app.views.NotificationDropdown = app.views.Base.extend({
afterNotificationChanges: function(node) {
node.find(".unread-toggle .entypo-eye").tooltip("destroy").tooltip();
node.find(this.avatars.selector).error(this.avatars.fallback);
node.find(this.avatars.selector).on("error", this.avatars.fallback);
},
finishLoading: function() {
......
......@@ -2,29 +2,20 @@
app.views.PublisherMention = app.views.SearchBase.extend({
triggerChar: "@",
invisibleChar: "\u200B", // zero width space
mentionRegex: /@([^@\s]+)$/,
templates: {
mentionItemSyntax: _.template("@{<%= name %> ; <%= handle %>}"),
mentionItemHighlight: _.template("<strong><span><%= name %></span></strong>")
},
mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; },
events: {
"keydown #status_message_fake_text": "onInputBoxKeyDown",
"input #status_message_fake_text": "onInputBoxInput",
"click #status_message_fake_text": "onInputBoxClick",
"blur #status_message_fake_text": "onInputBoxBlur"
"keydown .mention-textarea": "onInputBoxKeyDown",
"input .mention-textarea": "updateTypeaheadInput",
"click .mention-textarea": "onInputBoxClick",
"blur .mention-textarea": "onInputBoxBlur"
},
initialize: function() {
initialize: function(opts) {
this.mentionedPeople = [];
// contains the 'fake text' displayed to the user
// also has a data-messageText attribute with the original text
this.inputBox = this.$("#status_message_fake_text");
// contains the mentions displayed to the user
this.mentionsBox = this.$(".mentions-box");
var url = (opts && opts.url) || "/contacts";
this.inputBox = this.$(".mention-textarea");
this.typeaheadInput = this.$(".typeahead-mention-box");
this.bindTypeaheadEvents();
......@@ -32,7 +23,7 @@ app.views.PublisherMention = app.views.SearchBase.extend({
typeaheadInput: this.typeaheadInput,
customSearch: true,
autoselect: true,
remoteRoute: {url: "/contacts"}
remoteRoute: {url: url}
});
},
......@@ -55,8 +46,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({
cleanMentionedPeople: function() {
var inputText = this.inputBox.val();
this.mentionedPeople = this.mentionedPeople.filter(function(person) {
return person.name && inputText.indexOf(person.name) > -1;
});
return person.handle && inputText.indexOf(this.mentionSyntaxTemplate(person)) > -1;
}.bind(this));
this.ignoreDiasporaIds = this.mentionedPeople.map(function(person) { return person.handle; });
},
......@@ -70,41 +61,16 @@ app.views.PublisherMention = app.views.SearchBase.extend({
this.addPersonToMentions(person);
this.closeSuggestions();
messageText = messageText.substring(0, triggerCharPosition) +
this.invisibleChar + person.name + messageText.substring(caretPosition);
var mentionText = this.mentionSyntaxTemplate(person);
this.inputBox.val(messageText);
this.updateMessageTexts();
messageText = messageText.substring(0, triggerCharPosition) + mentionText + messageText.substring(caretPosition);
this.inputBox.val(messageText);
this.inputBox.focus();
var newCaretPosition = triggerCharPosition + person.name.length + 1;
var newCaretPosition = triggerCharPosition + mentionText.length;
this.inputBox[0].setSelectionRange(newCaretPosition, newCaretPosition);
},
/**
* Replaces every combination of this.invisibleChar + mention.name by the
* correct syntax for both hidden text and visible one.
*
* For instance, the text "Hello \u200Buser1" will be tranformed to
* "Hello @{user1 ; user1@pod.tld}" in the hidden element and
* "Hello <strong><span>user1</span></strong>" in the element visible to the user.
*/
updateMessageTexts: function() {
var fakeMessageText = this.inputBox.val(),
mentionBoxText = _.escape(fakeMessageText),
messageText = fakeMessageText;
this.mentionedPeople.forEach(function(person) {
var mentionName = this.invisibleChar + person.name;
messageText = messageText.replace(mentionName, this.templates.mentionItemSyntax(person));
var textHighlight = this.templates.mentionItemHighlight({name: _.escape(person.name)});
mentionBoxText = mentionBoxText.replace(mentionName, textHighlight);
}, this);
this.inputBox.data("messageText", messageText);
this.mentionsBox.find(".mentions").html(mentionBoxText);
},
updateTypeaheadInput: function() {
var messageText = this.inputBox.val();
var caretPosition = this.inputBox[0].selectionStart;
......@@ -115,6 +81,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({
return;
}
this.cleanMentionedPeople();
// result[1] is the string between the last '@' and the current caret position
this.typeaheadInput.typeahead("val", result[1]);
this.typeaheadInput.typeahead("open");
......@@ -128,12 +96,11 @@ app.views.PublisherMention = app.views.SearchBase.extend({
prefillMention: function(persons) {
persons.forEach(function(person) {
this.addPersonToMentions(person);
var text = this.invisibleChar + person.name;
var text = this.mentionSyntaxTemplate(person);
if(this.inputBox.val().length !== 0) {
text = this.inputBox.val() + " " + text;
}
this.inputBox.val(text);
this.updateMessageTexts();
}, this);
},
......@@ -154,15 +121,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({
this.typeaheadInput.trigger($.Event("keydown", {keyCode: e.keyCode, which: e.which}));
},
/**
* Listens for user input and opens results dropdown when input contains the trigger char
*/
onInputBoxInput: function() {
this.cleanMentionedPeople();
this.updateMessageTexts();
this.updateTypeaheadInput();
},
onInputBoxKeyDown: function(e) {
// This also matches HOME/END on OSX which is CMD+LEFT, CMD+RIGHT
if(e.which === Keycodes.LEFT || e.which === Keycodes.RIGHT ||
......@@ -205,7 +163,7 @@ app.views.PublisherMention = app.views.SearchBase.extend({
reset: function() {
this.inputBox.val("");
this.onInputBoxInput();
this.updateTypeaheadInput();
},
closeSuggestions: function() {
......@@ -217,7 +175,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({
return this.$(".tt-menu").is(":visible");
},
getTextForSubmit: function() {
return this.mentionedPeople.length ? this.inputBox.data("messageText") : this.inputBox.val();
getMentionedPeople: function() {
this.cleanMentionedPeople();
return this.mentionedPeople;
}
});
......@@ -149,7 +149,7 @@ app.views.PublisherUploader = Backbone.View.extend({
dataType: "json",
type: "DELETE",
success: function() {
$.when(photo.fadeOut(400)).then(function(){
photo.fadeOut(400, function() {
photo.remove();
if( self.publisher.$(".publisher_photo").length === 0 ) {
......
......@@ -18,11 +18,11 @@ app.views.Publisher = Backbone.View.extend({
el : "#publisher",
events : {
"keydown #status_message_fake_text" : "keyDown",
"keydown #status_message_text": "keyDown",
"focus textarea" : "open",
"submit form" : "createStatusMessage",
"click #submit" : "createStatusMessage",
"textchange #status_message_fake_text": "handleTextchange",
"textchange #status_message_text": "checkSubmitAvailability",
"click #locator" : "showLocation",
"click #poll_creator" : "togglePollCreator",
"click #hide_location" : "destroyLocation",
......@@ -35,8 +35,7 @@ app.views.Publisher = Backbone.View.extend({
this.disabled = false;
// init shortcut references to the various elements
this.inputEl = this.$("#status_message_fake_text");
this.hiddenInputEl = this.$("#status_message_text");
this.inputEl = this.$("#status_message_text");
this.wrapperEl = this.$("#publisher_textarea_wrapper");
this.submitEl = this.$("input[type=submit], button#submit");
this.photozoneEl = this.$("#photodropzone");
......@@ -44,15 +43,7 @@ app.views.Publisher = Backbone.View.extend({
// if there is data in the publisher we ask for a confirmation
// before the user is able to leave the page
$(window).on("beforeunload", _.bind(this._beforeUnload, this));
$(window).unload(this.clear.bind(this));
// sync textarea content
if( this.hiddenInputEl.val() === "" ) {
this.hiddenInputEl.val( this.inputEl.val() );
}
if( this.inputEl.val() === "" ) {
this.inputEl.val( this.hiddenInputEl.val() );
}
$(window).on("unload", this.clear.bind(this));
// hide close and preview buttons and manage services link
// in case publisher is standalone
......@@ -163,7 +154,7 @@ app.views.Publisher = Backbone.View.extend({
this.viewPollCreator.render();
if (this.prefillMention) {
this.handleTextchange();
this.checkSubmitAvailability();
}
},
......@@ -175,12 +166,11 @@ app.views.Publisher = Backbone.View.extend({
// inject content into the publisher textarea
setText: function(txt) {
this.inputEl.val(txt);
this.hiddenInputEl.val(txt);
this.prefillText = txt;
this.inputEl.trigger("input");
autosize.update(this.inputEl);
this.handleTextchange();
this.checkSubmitAvailability();
},
// show the "getting started" popups around the publisher
......@@ -202,9 +192,6 @@ app.views.Publisher = Backbone.View.extend({
// empty poll answer and failing validation.
this.viewPollCreator.removeLastAnswer();
//add missing mentions at end of post:
this.handleTextchange();
var serializedForm = $(evt.target).closest("form").serializeObject();
// disable input while posting, must be after the form is serialized
this.setInputEnabled(false);
......@@ -255,7 +242,7 @@ app.views.Publisher = Backbone.View.extend({
self.setButtonsEnabled(true);
self.setInputEnabled(true);
self.wrapperEl.removeClass("submitting");
self.handleTextchange();
self.checkSubmitAvailability();
autosize.update(self.inputEl);
}
});
......@@ -330,13 +317,8 @@ app.views.Publisher = Backbone.View.extend({
},
createPostPreview: function() {
//add missing mentions at end of post:
this.handleTextchange();
var serializedForm = $("#new_status_message").serializeObject();
var text = this.mention.getTextForSubmit();
var photos = this.getUploadedPhotos();
var mentionedPeople = this.mention.mentionedPeople;
var poll = this.getPollData(serializedForm);
var locationCoords = serializedForm["location[coords]"];
if(!locationCoords || locationCoords === "") {
......@@ -352,12 +334,12 @@ app.views.Publisher = Backbone.View.extend({
var previewMessage = {
"id": 0,
"text": text,
"text": serializedForm["status_message[text]"],
"public": serializedForm["aspect_ids[]"] === "public",
"created_at": new Date().toISOString(),
"interacted_at": new Date().toISOString(),
"author": app.currentUser ? app.currentUser.attributes : {},
"mentioned_people": mentionedPeople,
"mentioned_people": this.mention.getMentionedPeople(),
"photos": photos,
"title": serializedForm["status_message[text]"],
"location": location,
......@@ -381,11 +363,10 @@ app.views.Publisher = Backbone.View.extend({
// remove mentions
this.mention.reset();
// clear text(s)
// clear text
this.inputEl.val("");
this.hiddenInputEl.val("");
this.inputEl.trigger("keyup")
.trigger("keydown");
.trigger("keydown");
autosize.update(this.inputEl);
// remove photos
......@@ -421,7 +402,6 @@ app.views.Publisher = Backbone.View.extend({
// force textchange plugin to update lastValue
this.inputEl.data("lastValue", "");
this.hiddenInputEl.data("lastValue", "");
return this;
},
......@@ -472,8 +452,7 @@ app.views.Publisher = Backbone.View.extend({
setEnabled: function(bool) {
this.setInputEnabled(bool);
this.disabled = !bool;
this.handleTextchange();
this.checkSubmitAvailability();
},
setButtonsEnabled: function(bool) {
......@@ -487,10 +466,8 @@ app.views.Publisher = Backbone.View.extend({
setInputEnabled: function(bool) {
if (bool) {
this.inputEl.removeAttr("disabled");
this.hiddenInputEl.removeAttr("disabled");
} else {
this.inputEl.prop("disabled", true);
this.hiddenInputEl.prop("disabled", true);
}
},
......@@ -503,11 +480,6 @@ app.views.Publisher = Backbone.View.extend({
return (!onlyWhitespaces || isPhotoAttached) && isValidPoll && !this.disabled;
},
handleTextchange: function() {
this.checkSubmitAvailability();
this.hiddenInputEl.val(this.mention.getTextForSubmit());
},
_beforeUnload: function(e) {
if(this._submittable() && this.inputEl.val() !== this.prefillText){
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
......
......@@ -28,9 +28,11 @@ app.views.StreamPost = app.views.Post.extend({
".permalink"].join(", "),
initialize : function(){
var personId = this.model.get("author").id;
app.events.on("person:block:"+personId, this.remove, this);
// If we are on a user page, we don't want to remove posts on block
if (!app.page.model.has("profile")) {
var personId = this.model.get("author").id;
app.events.on("person:block:" + personId, this.remove, this);
}
this.model.on("remove", this.remove, this);
//subviews
this.commentStreamView = new app.views.CommentStream({model : this.model});
......
......@@ -28,6 +28,12 @@ app.views.Stream = app.views.InfScroll.extend({
var streamSelection = $("#stream_selection");
streamSelection.find("[data-stream]").removeClass("selected");
streamSelection.find("[data-stream='" + activeStream + "']").addClass("selected");
var activityContainer = streamSelection.find(".my-activity");
activityContainer.removeClass("activity-stream-selected");
if (activeStream === "activity" || activeStream === "liked" || activeStream === "commented") {
activityContainer.addClass("activity-stream-selected");
}
},
initInvitationModal : function() {
......
......@@ -6,7 +6,7 @@ app.views.Tags = Backbone.View.extend({
app.publisher.setText("#"+ opts.hashtagName + " ");
}