Drop mentions box in the publisher
This commit is contained in:
parent
b3c412d38f
commit
a04f32adce
7 changed files with 5 additions and 54 deletions
|
|
@ -18,8 +18,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({
|
||||||
// contains the 'fake text' displayed to the user
|
// contains the 'fake text' displayed to the user
|
||||||
// also has a data-messageText attribute with the original text
|
// also has a data-messageText attribute with the original text
|
||||||
this.inputBox = this.$("#status_message_fake_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.typeaheadInput = this.$(".typeahead-mention-box");
|
||||||
this.bindTypeaheadEvents();
|
this.bindTypeaheadEvents();
|
||||||
|
|
||||||
|
|
@ -80,7 +78,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({
|
||||||
updateMessageTexts: function() {
|
updateMessageTexts: function() {
|
||||||
var messageText = this.inputBox.val();
|
var messageText = this.inputBox.val();
|
||||||
this.inputBox.data("messageText", messageText);
|
this.inputBox.data("messageText", messageText);
|
||||||
this.mentionsBox.find(".mentions").html(_.escape(messageText));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updateTypeaheadInput: function() {
|
updateTypeaheadInput: function() {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mentions-box {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#publisher_textarea_wrapper { border: 1px solid $border-grey !important; }
|
#publisher_textarea_wrapper { border: 1px solid $border-grey !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,8 +244,6 @@
|
||||||
.locator { display: none; }
|
.locator { display: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
&.submitting .mentions-box { display: none; }
|
|
||||||
|
|
||||||
.twitter-typeahead {
|
.twitter-typeahead {
|
||||||
left: -1px;
|
left: -1px;
|
||||||
// Override inline rule of Typeahead
|
// Override inline rule of Typeahead
|
||||||
|
|
@ -257,11 +251,6 @@
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
// scss-lint:enable ImportantRule
|
// scss-lint:enable ImportantRule
|
||||||
}
|
}
|
||||||
|
|
||||||
.mentions-box {
|
|
||||||
// Leave space for markdown editor header
|
|
||||||
margin-top: 42px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.publisher-buttonbar {
|
.publisher-buttonbar {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
%params
|
%params
|
||||||
.publisher-textarea-wrapper#publisher_textarea_wrapper
|
.publisher-textarea-wrapper#publisher_textarea_wrapper
|
||||||
.mentions-input-box
|
.mentions-input-box
|
||||||
.mentions-box
|
|
||||||
.mentions
|
|
||||||
- if current_user.getting_started?
|
- if current_user.getting_started?
|
||||||
= status.text_area :fake_text, :rows => 2, :value => h(publisher_formatted_text),
|
= status.text_area :fake_text, :rows => 2, :value => h(publisher_formatted_text),
|
||||||
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Feature: posting
|
||||||
Then I should see a ".tag-following-action .followed"
|
Then I should see a ".tag-following-action .followed"
|
||||||
|
|
||||||
Scenario: can post a message from the tag page
|
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"
|
When I click the publisher and post "#boss from the tag page"
|
||||||
And I go to the tag page for "boss"
|
And I go to the tag page for "boss"
|
||||||
Then I should see "#boss from the tag page"
|
Then I should see "#boss from the tag page"
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ Then /^I should not be able to submit the publisher$/ do
|
||||||
expect(publisher_submittable?).to be false
|
expect(publisher_submittable?).to be false
|
||||||
end
|
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|
|
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
|
@me.post :status_message, text: text, to: @me.aspects.where(name: aspect_name).first.id
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -201,19 +201,6 @@ describe("app.views.PublisherMention", function() {
|
||||||
this.view.updateMessageTexts();
|
this.view.updateMessageTexts();
|
||||||
expect(this.view.inputBox.data("messageText")).toBe("@user1 Text before @{user1@pod.tld}\ntext after");
|
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("<img src=\"/default.png\"> @user1 Text before @{user1@pod.tld}\ntext after");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("updateTypeaheadInput", function() {
|
describe("updateTypeaheadInput", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue