Unverified Commit b0da14c3 authored by Steffen van Bergerem's avatar Steffen van Bergerem
Browse files

Merge pull request #7386 from cmrd-senya/comment-mention-front-end

Comment mentions front-end
parents b076a1a1 c2f352d8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
* Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818)
* 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)
* 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)
* 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
# 0.6.5.0


+10 −0
Original line number Original line Diff line number Diff line
// @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
+1 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ app.views.CommentStream = app.views.Base.extend({
    this.model.comments.each(this.appendComment, this);
    this.model.comments.each(this.appendComment, this);
    this.commentBox = this.$(".comment_box");
    this.commentBox = this.$(".comment_box");
    this.commentSubmitButton = this.$("input[name='commit']");
    this.commentSubmitButton = this.$("input[name='commit']");
    new app.views.CommentMention({el: this.$el, postId: this.model.get("id")});
  },
  },


  presenter: function(){
  presenter: function(){
+8 −7
Original line number Original line Diff line number Diff line
@@ -6,15 +6,16 @@ app.views.PublisherMention = app.views.SearchBase.extend({
  mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; },
  mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; },


  events: {
  events: {
    "keydown #status_message_text": "onInputBoxKeyDown",
    "keydown .mention-textarea": "onInputBoxKeyDown",
    "input #status_message_text": "updateTypeaheadInput",
    "input .mention-textarea": "updateTypeaheadInput",
    "click #status_message_text": "onInputBoxClick",
    "click .mention-textarea": "onInputBoxClick",
    "blur #status_message_text": "onInputBoxBlur"
    "blur .mention-textarea": "onInputBoxBlur"
  },
  },


  initialize: function() {
  initialize: function(opts) {
    this.mentionedPeople = [];
    this.mentionedPeople = [];
    this.inputBox = this.$("#status_message_text");
    var url = (opts && opts.url) || "/contacts";
    this.inputBox = this.$(".mention-textarea");
    this.typeaheadInput = this.$(".typeahead-mention-box");
    this.typeaheadInput = this.$(".typeahead-mention-box");
    this.bindTypeaheadEvents();
    this.bindTypeaheadEvents();


@@ -22,7 +23,7 @@ app.views.PublisherMention = app.views.SearchBase.extend({
      typeaheadInput: this.typeaheadInput,
      typeaheadInput: this.typeaheadInput,
      customSearch: true,
      customSearch: true,
      autoselect: true,
      autoselect: true,
      remoteRoute: {url: "/contacts"}
      remoteRoute: {url: url}
    });
    });
  },
  },


+2 −2
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@


  .comment.new-comment-form-wrapper { padding-bottom: 0; }
  .comment.new-comment-form-wrapper { padding-bottom: 0; }


  .submit_button {
  .submit-button {
    margin-top: 10px;
    margin-top: 10px;
    input {
    input {
      float: right;
      float: right;
@@ -60,7 +60,7 @@
  }
  }
  textarea.comment_box:focus, textarea.comment_box:valid, textarea.comment_box:active {
  textarea.comment_box:focus, textarea.comment_box:valid, textarea.comment_box:active {
    border-color: $border-dark-grey;
    border-color: $border-dark-grey;
    & + .submit_button { display: block; }
    ~ .submit-button { display: block; }
    min-height: 35px;
    min-height: 35px;
    box-shadow: none;
    box-shadow: none;
  }
  }
Loading