Drop mentions box in the publisher

This commit is contained in:
Steffen van Bergerem 2017-01-30 13:00:15 +01:00
parent b3c412d38f
commit a04f32adce
No known key found for this signature in database
GPG key ID: 315C9787D548DC6B
7 changed files with 5 additions and 54 deletions

View file

@ -18,8 +18,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({
// 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");
this.typeaheadInput = this.$(".typeahead-mention-box");
this.bindTypeaheadEvents();
@ -80,7 +78,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({
updateMessageTexts: function() {
var messageText = this.inputBox.val();
this.inputBox.data("messageText", messageText);
this.mentionsBox.find(".mentions").html(_.escape(messageText));
},
updateTypeaheadInput: function() {

View file

@ -64,28 +64,4 @@
}
}
}
.mentions-box {
position: absolute;
right: 0px;
bottom: 0px;
left: 0px;
top: 0px;
padding: $padding-base-vertical $padding-base-horizontal;
}
.mentions {
color: transparent;
font-size: $font-size-base;
font-family: Arial, Helvetica, sans-serif;
overflow: hidden;
width: 100%;
white-space: pre-wrap;
word-wrap: break-word;
> strong {
background: $background-blue;
font-weight: normal;
}
}
}

View file

@ -14,10 +14,6 @@
display: none !important;
}
.mentions-box {
margin-top: 0;
}
#publisher_textarea_wrapper { border: 1px solid $border-grey !important; }
}
@ -248,8 +244,6 @@
.locator { display: none; }
}
&.submitting .mentions-box { display: none; }
.twitter-typeahead {
left: -1px;
// Override inline rule of Typeahead
@ -257,11 +251,6 @@
position: absolute !important;
// scss-lint:enable ImportantRule
}
.mentions-box {
// Leave space for markdown editor header
margin-top: 42px;
}
}
.publisher-buttonbar {

View file

@ -5,8 +5,6 @@
%params
.publisher-textarea-wrapper#publisher_textarea_wrapper
.mentions-input-box
.mentions-box
.mentions
- if current_user.getting_started?
= status.text_area :fake_text, :rows => 2, :value => h(publisher_formatted_text),
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",

View file

@ -16,7 +16,7 @@ Feature: posting
Then I should see a ".tag-following-action .followed"
Scenario: can post a message from the tag page
Then I should see "#boss" within "#publisher"
Then I should see "#boss " in the publisher
When I click the publisher and post "#boss from the tag page"
And I go to the tag page for "boss"
Then I should see "#boss from the tag page"

View file

@ -32,6 +32,10 @@ Then /^I should not be able to submit the publisher$/ do
expect(publisher_submittable?).to be false
end
Then /^I should see "([^"]*)" in the publisher$/ do |text|
expect(page).to have_field("status_message[fake_text]", with: text)
end
Given /^I have a limited post with text "([^\"]*)" in the aspect "([^"]*)"$/ do |text, aspect_name|
@me.post :status_message, text: text, to: @me.aspects.where(name: aspect_name).first.id
end

View file

@ -201,19 +201,6 @@ describe("app.views.PublisherMention", function() {
this.view.updateMessageTexts();
expect(this.view.inputBox.data("messageText")).toBe("@user1 Text before @{user1@pod.tld}\ntext after");
});
it("formats overlay text to HTML", function() {
this.view.updateMessageTexts();
expect(this.view.mentionsBox.find(".mentions").html())
.toBe("@user1 Text before @{user1@pod.tld}\ntext after");
});
it("properly escapes the user input", function() {
this.view.inputBox.val("<img src=\"/default.png\"> @user1 Text before @{user1@pod.tld}\ntext after");
this.view.updateMessageTexts();
expect(this.view.mentionsBox.find(".mentions").html())
.toBe("&lt;img src=\"/default.png\"&gt; @user1 Text before @{user1@pod.tld}\ntext after");
});
});
describe("updateTypeaheadInput", function() {