# Quick Messages Plugin

**URL:** https://meta.discourse.org/t/quick-messages-plugin/39188
**Category:** Plugin
**Tags:** broken
**Created:** [2016年二月8日 00:13 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188 "2016-02-08T00:13:55Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![Roxelle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roxelle/32/46924_2.png) [@Roxelle](https://meta.discourse.org/u/Roxelle)
#### Post date: [2016年三月25日 00:47 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/41 "2016-03-25T00:47:18Z")

</div>

For the menu, I using this css:

```css
#navmenuv {
  position: absolute;
  z-index: 9999;
  height: 50px;
  margin-left: 670px;
}

#navmenuv li a {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  line-height: 60px;
  padding: 0 15px;
}

#navmenuv li a:hover {
  color: gray;
}

#navmenuv ul.nav {
    padding: 0;
    margin: 0;
}

#navmenuv .nav li {
    display:inline;
    padding:0;
    margin:0;
}

```

And:

```html
<div id="navmenucontainer" class="container">
  <div id="navmenuv">
    <ul class="nav">
      <li><a href="http://commonmark.org/">Home</a></li>
      <li><a href="http://spec.commonmark.org/">Download</a></li>
      <li><a href="http://code.commonmark.org/">Gallery</a></li>
      <li><a href="http://try.commonmark.org/">Support</a></li>
    </ul>
  </div>
</div>

```

For the white text, I’m using the personal color:

 ![](https://global.discourse-cdn.com/meta/original/3X/3/8/383a65e70c3ed7cf25c19c037217f2cca6fc2c7e.jpg)

EDIT:  
I tried disable the header menu, but the problem persists…  
It is aligned to the far left…

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年三月25日 01:13 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/42 "2016-03-25T01:13:49Z")

</div>

Ah yes, it’s because of my little hack. I just reverted it. Pull in the latest and try again.

Will have to tweak that hack slightly..

---

<div class="post-metadata">

### Author: ![Roxelle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roxelle/32/46924_2.png) [@Roxelle](https://meta.discourse.org/u/Roxelle)
#### Post date: [2016年三月25日 01:21 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/43 "2016-03-25T01:21:42Z")

</div>

It’s worked for me ^^

I think I found an error…  
When I click on the arrow, the chat disappears… is a bug?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年三月25日 01:23 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/44 "2016-03-25T01:23:47Z")

</div>

I’m assuming nothing was entered in the composer? That’s intended actually. It’s the same as the normal Discourse compose. Try clicking on the arrow on the far right of the composer on [meta.discourse.org](http://meta.discourse.org) when you haven’t written anything. If you enter text it will minimize rather than disappear.

edit: But yeah, that’s something I did consider changing from the normal Discourse compose experience. Decided not to for now.

---

<div class="post-metadata">

### Author: ![Roxelle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roxelle/32/46924_2.png) [@Roxelle](https://meta.discourse.org/u/Roxelle)
#### Post date: [2016年三月25日 01:25 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/45 "2016-03-25T01:25:32Z")

</div>

Thanks for the explanation ^^’

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年三月25日 01:59 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/46 "2016-03-25T01:59:01Z")

</div>

Ok the hack to make the header button align with Babble’s should work without interfering in other css now.

cc @Na2HPO4

[https://github.com/angusmcleod/discourse-quick-messages/commit/1fb2aab867f392b1c64431902866b26dd6b78e7f](https://github.com/angusmcleod/discourse-quick-messages/commit/1fb2aab867f392b1c64431902866b26dd6b78e7f)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年三月27日 12:54 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/47 "2016-03-27T12:54:05Z")

</div>

Uploads are now working for each individual quick message compose.

[https://github.com/angusmcleod/discourse-quick-messages/commit/b3b696bdac79cce1901a8dae9b34bceb2cddd529](https://github.com/angusmcleod/discourse-quick-messages/commit/b3b696bdac79cce1901a8dae9b34bceb2cddd529)

 ![](https://global.discourse-cdn.com/meta/original/3X/c/7/c7f3072ed7e4406ab2e428e1b3708764056fbafb.png)

---

<div class="post-metadata">

### Author: ![Roxelle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roxelle/32/46924_2.png) [@Roxelle](https://meta.discourse.org/u/Roxelle)
#### Post date: [2016年三月28日 00:12 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/48 "2016-03-28T00:12:07Z")

</div>

Thanks for the update =D

But, I have a one question…  
How can change the css color for the icon? (upload etc?)  
Now, I see the white color…

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年三月28日 01:08 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/49 "2016-03-28T01:08:43Z")

</div>

Ah the ole white theme strikes again.

Try now 🙂

[https://github.com/angusmcleod/discourse-quick-messages/commit/7ab080b141f5120268cee907a96a2c5a9ca96516](https://github.com/angusmcleod/discourse-quick-messages/commit/7ab080b141f5120268cee907a96a2c5a9ca96516)

---

<div class="post-metadata">

### Author: ![Rodelio\_Lagahit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodelio_lagahit/32/121638_2.png) [@Rodelio\_Lagahit](https://meta.discourse.org/u/Rodelio_Lagahit)
#### Post date: [2016年四月3日 07:44 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/50 "2016-04-03T07:44:02Z")

</div>

Interesting plugin indeed. we’ll include this in my list and let me users spin it. 🙂

---

<div class="post-metadata">

### Author: ![Rodelio\_Lagahit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodelio_lagahit/32/121638_2.png) [@Rodelio\_Lagahit](https://meta.discourse.org/u/Rodelio_Lagahit)
#### Post date: [2016年四月5日 02:05 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/51 "2016-04-05T02:05:42Z")

</div>

This is how my quick message plugin looks when someone message me:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/d/1d9adff969212d6ac271ebed816751854a209900.png)

Is this okay? @angus

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年四月5日 13:08 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/52 "2016-04-05T13:08:04Z")

</div>

Are you also using my [Topic List Previews](https://meta.discourse.org/t/topic-list-previews/41630) plugin by any chance? This happens if you use both of these together at the moment. I will be fixing this, so you can use both together, soon.

---

<div class="post-metadata">

### Author: ![Rodelio\_Lagahit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodelio_lagahit/32/121638_2.png) [@Rodelio\_Lagahit](https://meta.discourse.org/u/Rodelio_Lagahit)
#### Post date: [2016年四月6日 02:26 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/53 "2016-04-06T02:26:03Z")

</div>

yha. i think i am. ill disable that for the time being.

but it’s a default plugin right? can’t do anything about it?

 ![](https://global.discourse-cdn.com/meta/original/3X/4/b/4becb90968e3d83ec3605073f345eb542dc82040.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年四月6日 02:54 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/54 "2016-04-06T02:54:58Z")

</div>

No, quick messages is not a default plugin (in the sense that is comes with Discourse), you will have to remove it from your plugins directory/app.yml and then perform a rebuild to remove it.

---

<div class="post-metadata">

### Author: ![Rodelio\_Lagahit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodelio_lagahit/32/121638_2.png) [@Rodelio\_Lagahit](https://meta.discourse.org/u/Rodelio_Lagahit)
#### Post date: [2016年四月6日 04:18 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/55 "2016-04-06T04:18:24Z")

</div>

got it. thanks

fixed now.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年四月6日 13:18 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/56 "2016-04-06T13:18:47Z")

</div>

@Rodelio_Lagahit @Roxelle Ok this issue should be fixed now. You can use Quick Messages and Topic List Previews together safely now.

What was happening was that both Quick Messages and Topic List Previews were overriding the `excerpt` and `include_excerpt` methods used in the Listable Topic (or Topic List Item) serializer. So I just moved Quick Messages over to a new method `message_excerpt` so the two would not conflict.

```plaintext
def message_excerpt
  if object.archetype == Archetype.private_message
     cooked = Post.where(topic_id: object.id, post_number: object.highest_post_number).pluck('cooked')
     excerpt = PrettyText.excerpt(cooked[0], 200, keep_emoji_images: true)
     excerpt.gsub!(/(\[image\])/, "<i class='fa fa-picture-o'></i>") if excerpt
     excerpt
  else
     return false
  end
end

def include_message_excerpt?
  !!message_excerpt
end

```

[https://github.com/angusmcleod/discourse-quick-messages/commit/2a71ff7c83f253edeea1d43224b1ef6c779cf836](https://github.com/angusmcleod/discourse-quick-messages/commit/2a71ff7c83f253edeea1d43224b1ef6c779cf836)

Btw, notice that, like in Topic List Previews, I’m stripping out the [image] text which acts as a placeholder for an image in a excerpt.

`excerpt.gsub!(/(\[image\])/, "<i class='fa fa-picture-o'></i>") if excerpt`

This was originally a request for Topic List Previews, and I also think that having ‘[image]’ placeholders in excerpts looks a little…unpolished. I’m experimenting here with putting the Font Awesome icon fa-picture-o in its place so that there is still a placeholder for images in excerpts. If message only contains an image some kind of placeholder is necessary, otherwise the excerpt will show up blank. Any feedback or ideas on that are welcome.

 ![](https://global.discourse-cdn.com/meta/original/3X/8/0/80cdd57f08151fb4d9407d1bc11520b59c143f5d.png)

---

<div class="post-metadata">

### Author: ![Roxelle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roxelle/32/46924_2.png) [@Roxelle](https://meta.discourse.org/u/Roxelle)
#### Post date: [2016年四月6日 14:09 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/57 "2016-04-06T14:09:59Z")

</div>

Ok, I update and try now… =D

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [2016年四月10日 01:20 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/58 "2016-04-10T01:20:05Z")

</div>

The concept fits very well in the Discourse paradigm. Thank you very much for your great work.

Has the issue with your [topic list preview](https://meta.discourse.org/t/topic-list-previews/41630) plugin been fixed since then? I wanted to use both.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [2016年四月10日 01:54 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/59 "2016-04-10T01:54:42Z")

</div>

# Issue

After clicking on the “close” button, the input textarea gets hidden, but the chatbox remains open and I can’t close it anymore wherever I click.

 ![](https://global.discourse-cdn.com/meta/original/3X/6/9/6981e9f8fe0bee338b81b24a5eda5859fd42d746.png)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年四月10日 15:17 UTC](https://meta.discourse.org/t/quick-messages-plugin/39188/60 "2016-04-10T15:17:57Z")

</div>

> Has the issue with your topic list preview plugin been fixed since then? I wanted to use both.

@meglio Yup!

> [@angus](#):
>
> @Rodelio_Lagahit @Roxelle Ok this issue should be fixed now. You can use Quick Messages and Topic List Previews together safely now.

[上一頁](https://meta.discourse.org/t/quick-messages-plugin/39188.md?page=2)

[下一頁](https://meta.discourse.org/t/quick-messages-plugin/39188.md?page=4)
