diff --git a/app/assets/javascripts/app/views/publisher/mention_view.js b/app/assets/javascripts/app/views/publisher/mention_view.js index 0641e2fcc..d678a6bf5 100644 --- a/app/assets/javascripts/app/views/publisher/mention_view.js +++ b/app/assets/javascripts/app/views/publisher/mention_view.js @@ -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() { diff --git a/app/assets/stylesheets/mentions.scss b/app/assets/stylesheets/mentions.scss index a6920e7b3..c9af7be45 100644 --- a/app/assets/stylesheets/mentions.scss +++ b/app/assets/stylesheets/mentions.scss @@ -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; - } - } } diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 51c4a494f..a08f67955 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -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 { diff --git a/app/views/publisher/_publisher.html.haml b/app/views/publisher/_publisher.html.haml index 1304283a4..6fc8669cc 100644 --- a/app/views/publisher/_publisher.html.haml +++ b/app/views/publisher/_publisher.html.haml @@ -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')}...", diff --git a/features/desktop/follows_tags.feature b/features/desktop/follows_tags.feature index 78692e71c..fcdfbf3a5 100644 --- a/features/desktop/follows_tags.feature +++ b/features/desktop/follows_tags.feature @@ -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" diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index b0b8e62b1..34df49e49 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -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 diff --git a/spec/javascripts/app/views/publisher_mention_view_spec.js b/spec/javascripts/app/views/publisher_mention_view_spec.js index 54e72ad90..7ab98fe78 100644 --- a/spec/javascripts/app/views/publisher_mention_view_spec.js +++ b/spec/javascripts/app/views/publisher_mention_view_spec.js @@ -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(" @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() {