Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60642 articles
Browse latest View live

[WIP] List of all the hooks in Discourse

$
0
0

Régis Hanol wrote:

Here's the up-to-date list of all the hooks available in Discourse:

Client-side (javascript)


addCustomIcon

Event triggered by the TopicStatusComponent when rendering the icons representing the status of a topic.

How to use it?

Discourse.TopicStatusComponent.reopen({
  onAddCustomIcon: function(buffer) {
    if (this.get('topic.archetype') === 'poll') {
      this.renderIcon(buffer, 'square-o', 'poll');
    }
  }.on("addCustomIcon")
});

additionalButtons

Event triggered by the TopicFooterButtonsView when rendering the buttons at the bottom of a topic.

How to use it? Read the How to add a button at the end of a topic? tutorial.

appendMapInformation

Event triggered by the TopicMapContainerView when rendering the topic map and any relevant information underneath the first post of a topic.

How to use it?

Discourse.TopicMapContainerView.reopen({
 onAppendMapInformation: function(container) {
   // your code
 }.on("appendMapInformation")
});

postViewInserted

Event triggered by the PostView when a post is inserted into the DOM.

previewRefreshed

Event triggered by the ComposerView when the composer's preview renders.

Discourse.TopicRoute / setupTopicController

Event triggered by the TopicRoute when a topic is being loaded.

Discourse.ApplicationRoute / activate

Event triggered when the ApplicationRoute is activated. This is useful if you need to do something like create a modal once the application has loaded (activated).

How to use it?

Discourse.TopicRoute.on("setupTopicController", function(event) {
  // Access the controller via: event.controller
  // Access the model via: event.currentModel
});

Dialect

Dialects are Discourse's way to extend our text rendering engine. They are made up of two stages. The first runs functions against the input to emit a JsonML intermediate representation. The second stage post-processes the JsonML before it is rendered to the string.

If you are interested in a custom text processor, you will probably find the functions in dialect.js useful and well documented. There are also examples of using the dialect API in the dialects directory of discourse.

parseNode

The parseNode hook is for looping through the JsonML tree and modifying it in place. It will be called once per node in the tree so try to keep your function light and fast.

Discourse.Dialect.on("parseNode", function(event) {
  var node = event.node,   // current node in the tree
      path = event.path;   // depth path to the current node

  // your logic goes here.
});

Server-side (ruby)


before_create_post

Event triggered by the PostCreator when a post is about to be created.

How to use it?

class Plugin < DiscoursePlugin
  def setup
    listen_for(:before_create_post)
  end

  def before_create_post(post)
    # your code...
  end
end

Posts: 4

Participants: 4

Read full topic


New: Reply via Email Support!

$
0
0

Robin Ward wrote:

We've just enabled the ability to reply by email to Discourse for all users on meta! It works like on other sites such as Facebook or Github. If an email is related to a topic, it will say in the footer that you can reply to it. Simply reply to the message in your email client and your post will be made on Discourse.

Please help us test it out and give us feedback!

Configuring Reply by Email

To enable the feature on your own Discourse site, you need to set up a few site settings:

  • reply_by_email_enabled - set to true
  • reply_by_email_address - change to your email address that will handle replies. For example reply+%{reply_key}@reply.myforum.com. %{reply_key} is required and will be replaced with a unique identifier for the email.

Receiving Email

Right now we only support parsing replies from POP3S servers. In the future we'll likely add other methods such as support for web APIs. Pull requests welcome! Here's how to configure POP3s:

  • pop3s_polling_enabled - set this to true
  • pop3s_polling_port - Your POP3S server port (default is 995)
  • pop3s_polling_host - The host to poll for mail
  • pop3s_polling_username - The username for your POP3S account
  • pop3s_polling_password - The password for your POP3S account

Using Gmail to Receive Email

We've tried it out with gmail and it seems to work great as they offer POP3s support. (Note: don't confuse this with sending email. Gmail is not recommended as a SMTP server for a Discourse forum as you will encounter many limits and spam prevention measures.)

To use gmail, create an account and use the following pop3 settings:

server: pop.gmail.com
username: <your full gmail account address>
password: <you know this>

Have fun! fish

Posts: 36

Participants: 17

Read full topic

Add meta tags, og tags etc to allow embedding discourse articles in other sites (e.g. via embedly)

$
0
0

Eran Medan wrote:

Trying to put discourse in places that use embedly / google feed API doesn't work well

e.g. try http://storify.com, http://flashissue.com, and put any discourse link there, not working well

it needs some open graph tags (title, description) or at least put something in the meta tags

e.g. this is what it has now

<meta content="" name="description">

smile

Posts: 18

Participants: 5

Read full topic

Welcome to meta.discourse.org

$
0
0

Sam Saffron wrote:

Welcome to meta, the official site for discussing the next-gen open source Discourse forum software. You'll find topics on features, bugs, hosting, development, and general support here.

Discourse is early beta software

It is fine to experiment with Discourse, but be prepared for bleeding edge beta software pain, at least for the next 6 months. Discourse is most applicable for new communities, because there's a lot of social and technical friction to any change in existing communities.

Before posting on meta, please...

  • Visit the http://meta.discourse.org/categories page to get a broad overview of what's going on here.

  • Browse around the topics on the homepage to understand what is being discussed here, and what the categories mean.

  • Please search before opening a new topic, as someone might have already created the topic you want to open. Note that we do search on your behalf as you compose a new topic, too.

  • When creating a topic, be sure to select the correct category so it is easier to find. It is OK to leave category blank if none feel applicable.

Other Discourse Forums

Eventually, the home page will be a sort of Discourse Hub where we showcase Discourse forums, interesting topics on Discourse forums, and a general directory of Discourse forums. But that's not ready yet! Until then, here's a topic listing all the known Discourse forum instances so far.

Thanks for helping us make Discourse the best 100% open-source discussion platform for the next decade of the Internet.

Posts: 5

Participants: 21

Read full topic

Error after upgrade to 0.9.7.9

$
0
0

Sebastien Rey wrote:

Hi,

I'm using webfaction postgresql specific private instance to run discourse (custom port already configured for discourse 0.9.7.6).

This is not my first update, but this time i have an error.
Impossible to upgrade from 0.9.7.6 i have this error (after gem update) when i try to launch :

e_sendauth: no password supplied
FATAL:  role "discourse" does not exist

There is a new config file to modify in this version ?

Posts: 74

Participants: 19

Read full topic

Users linked in replies don't link properly in email body

$
0
0

Tom Piddock wrote:

Similar to this issue here the links for users in a post do not create the proper URL when the reply arrives in an email notification. Spotted it when a friend replied to my post on try : tmplink

Steps to replicate:

  1. Create Topic
  2. Reply using a user @ tag in your reply "Hey @Blue, nice bug!"
  3. Check email for notification - html reads:
    "<p>Hey <a href="http://users/blue" target="_blank">@Blue</a>, nice bug!</p>"
  4. Click and realise that http://users/ isn't a real place on the interwebs.

Hope this helps. tips hat

Posts: 5

Participants: 4

Read full topic

DiscourseHosting is now accepting BTC payments

$
0
0

Michael wrote:

We have decided we will be accepting Bitcoin as a payment method for DiscourseHosting.com from now on. For more information, read our blog post.

This week, one BTC buys you one year of hosting in the Business plan.
One year Professional is 0.5 BTC and one year Basic for only 0.25 BTC !

BTW just for clarity: we're a third party that is not affilated with "Discourse, the Company" in any way.

Posts: 1

Participants: 1

Read full topic

Ctrl + z undo and redo will ignore pasting

$
0
0

Nowindlee wrote:

When I was editing a post about "keyshorts", I tried to add this missing <kbd> tags to key names in the post, using ctrl+v.

But when clicked the undo button, all of them disappeared, and it does nothing to click redo button angry

I have to copy the content to an external editor, then copy it back after editing.

Posts: 2

Participants: 2

Read full topic


Failed send job email

$
0
0

jeff_l wrote:

I am using 0.9.6.3
1

"---\n- !ruby/class 'Jobs::UserEmail'\n- :delayed_perform\n- - :type: :user_posted\n :user_id: 9\n :notification_id: 13\n :current_site_id: default\n"
Error Class	EOFError

2

"---\n- !ruby/class 'Jobs::UserEmail'\n- :delayed_perform\n- - :type: :user_posted\n :user_id: 7\n :notification_id: 14\n :current_site_id: default\n
Error Class	Net::SMTPSyntaxError
Error Message	 501 5.1.7 Bad sender address syntax

3

{"type"=>"digest", "user_id"=>3, "current_site_id"=>"default"}
Error Class	Net::SMTPSyntaxError
Error Message	 501 5.1.7 Bad sender address syntax

Posts: 8

Participants: 4

Read full topic

Please provide some way to inject ads in the post

$
0
0

Akshar Prabhudesai wrote:

Since a lot of popular forums out there use ads to make money, it will be good if Discourse provides some way to display ads such as good adsense in the posts.

The current methods are very cumbersome.

Posts: 8

Participants: 5

Read full topic

User pref category instructions are misaligned

BBS: Topic created with empty title

$
0
0

Kane York wrote:

This topic was created with an empty title:

Here's a dump of the Discourse.Topic object:

Ember Inspector ($E): s {slug: "topic", id: 19063, draft: null, draft_key: "topic_19063", draft_sequence: 0…}
    __ember1389379456174: "ember1248"
    __ember1389379456174_meta: e
    _oldWillDestroy: function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}
    _super: undefined
    archetype: "regular"
    archived: false
    category_id: 3
    closed: false
    created_at: "2014-01-10T13:40:48.900-05:00"
    currentPost: 1
    deleted_at: null
    deleted_by: null
    dockedCounter: true
    draft: null
    draft_key: "topic_19063"
    draft_sequence: 0
    enteredAt: "1389379459694"
    fancy_title: ""
    has_summary: false
    highest_post_number: 1
    highlightOnInsert: 1
    id: 19063
    last_posted_at: null
    last_read_post_number: undefined
    like_count: 0
    participant_count: 1
    pinned: false
    posts_count: 1
    progressPosition: 1
    reply_count: 0
    slug: "topic"
    title: ""
    toString: function (){return e}
    views: 3
    visible: true
    willDestroy: function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}
    word_count: null
    __proto__: Object

Posts: 3

Participants: 2

Read full topic

GlobalSetting class confusion

$
0
0

Sam Bauch wrote:

I've been away from the community for a bit, but I recently pulled some updates and am generally just confused by this GlobalSetting class. I searched around here and am starting to understand it a little bit, but was hoping someone might be able to help me fully understand.

It sort of just seems like a way to centralize a lot of the config settings, like Redis, email, etc. into one file. But is the only way to know what to put in a discourse.conf by seeing that GlobalSetting class pop up in various places? I guess that's sort of what this post is getting at?

Anyways, this update broke a few things for me: email (which honestly, I think I'll stick with my hard coded settings in production.rb, I don't really see the benefit to pulling it out of there), and more challengingly, it broke a plugin I had that added a button to the main nav. I'm struggling with understanding how to get that button back (I had previously hardcoded it into the ember nav item model), particularly since the "available nav items" is also a SiteSetting.

EDIT:

Apologies, but the nav items issue isn't actually a GlobalSetting, but I think a SiteSetting. idk I'm still confused. I tried pushing a symbol to Discourse.top_menu_items array via the console but not sure how to commit.

Posts: 8

Participants: 3

Read full topic

Persona login is unreliable

$
0
0

Rikki Tooley wrote:

Firstly, I love that Persona is integrated. I'm a big fan of the project.

Discourse doesn't seem to be playing nicely with it though. Log in often takes 30secs+ with no progress indicator (in fact this is something that all log in flows could do with improving). A lot of the time the Persona popup just closes and nothing happens.

I know it's also a pre-release software, but I've seen it work well elsewhere. Thoughts?

Posts: 4

Participants: 4

Read full topic

Focus events: Track which window is the last active instance of a forum Edit

$
0
0

Claus Strasburger wrote:

Hi,
I am submitting this to hear thoughts on my approach - this is part of my quest to support desktop notifications.
The goal is to know, when a user has multiple tabs open, whether an instance is the least recently used one, so only that one will display notifications.

Also, I added a listener function to KeyValueStore which can be used to listen on 'storage events' which occur whenever another window changes the localStorage.

The unittests are not complete and for some reason time out. (also I just noticed there are still some debug statements)

Any ideas/hints, or is this an approach you would be happy to merge?

Posts: 2

Participants: 2

Read full topic


Sidekiq CPU load since latest release

$
0
0

Michael wrote:

Since updating to the latest release (v0.9.6.2) CPU usage on all our servers went up by 20%
Cause seems to be sidekiq.

We upgraded from version v0.9.6.

Top output:

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
30687 www-data  20   0 1004m 228m 2676 S 26.6 22.9  67:31.56 ruby1.9.1
    1 root      20   0 24196  476    0 S  0.0  0.0   0:06.13 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.35 kthreadd
    3 root      20   0     0    0    0 S  0.0  0.0   0:56.23 ksoftirqd/0
8<

   25 root      20   0     0    0    0 S  0.0  0.0   0:00.00 fsnotify_mark
   26 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ecryptfs-kthrea
root@test002:~# ps ax|grep 30687
 2584 pts/0    S+     0:00 grep --color=auto 30687
30687 ?        Sl    67:32 sidekiq 2.13.0 discourse [0 of 25 busy]

Cacti (host on the bottom left has been updated a few days earlier)

Any ideas?

Posts: 25

Participants: 10

Read full topic

Twitter's Onebox not working?

Google Avatar - not associating?

$
0
0

Peter Imai wrote:

Definitely a somewhat frivolous question:

I just signed up with my google ID, but was given this geometric pattern as an avatar instead of my normal profile pic associated with my google account. Any reason for this or plan to change this?

Very excited for Discourse!

Posts: 2

Participants: 2

Read full topic

New post/thread button bar: Foreground color left on default, background color defined

$
0
0

Phil wrote:

If the default foreground color happens to be white, the buttons are white on white.

You’ll have to define foreground and background color or none of both for each element that contains text.

Posts: 5

Participants: 2

Read full topic

Very fast scrolling fails to mark all posts read in a thread

$
0
0

Lee_Ars wrote:

Sometimes I find myself wanting to follow a thread without wading through all of the messages that have already been posted in it, especially when it's fairly long. I generally will enter the thread, read a dozen or so messages of discussion, then want to fast-forward to near the end to see what the latest bits are.

I've noticed, though, both on Meta and on other Discourse instances, that it's possible to scroll through to the end too quickly for Discourse to track my position. I've got a free-wheeling mouse scroll wheel, so I can flick it down and it'll keep spinning; this is usually how I advance to the bottom. In most cases, this results in me tracking the thread, but also in sometimes dozens of "old but unread" posts in the thread (gray notification bubble next to thread in topic list).

Clearing out the bubble often means revisiting the thread and scrolling up and down through it until the forum is satisfied that I've "read" all of the posts.

This even happens in very short threads where I actually have read all the posts—for example, in this one. I clicked on it to start reading it. All the posts but the last two fit on my screen, and so I flicked the mousewheel to advance and read those. When I returned to the "Latest" list, that thread had several "old but unread" posts, and so I had to click on it again and slowly scrub my way through.

Suggested workaround: If the last post in a thread is read, then the entire thread should be read. This would save me from hunting through the thread to find whatever message(s) the forum thinks I haven't read.

Posts: 8

Participants: 5

Read full topic

Viewing all 60642 articles
Browse latest View live




Latest Images