HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.02k stars 406 forks source link

Docs are missing some stuff #49

Closed akarelas closed 10 years ago

akarelas commented 11 years ago

1) What is the meaning of the url parameter when calling .run? It says nowhere

2) What is the difference between .run and .post? It says nowhere

akarelas commented 11 years ago

What does scrollTo do? I click on RUN at that point in the docs, and nothing happens,

jodytate commented 11 years ago

You'll notice that the scrollTo example has the comment # Requires jQuery scrollTo plugin. More about the scrollTo plugin is here: http://flesler.com/jquery/scrollTo/. It's true, though, that in the docs nothing happens, but I thought it could be helpful to link to the plugin if you hadn't found it already.

jodytate commented 11 years ago

The url parameter when calling .run is meant to fetch data from a remote source. The docs say that you can use .run' and include jQuery's standard$.ajaxoptions:# All the standard jQuery ajax options here`. The options/settings are listed here: http://api.jquery.com/jQuery.ajax/.

jodytate commented 11 years ago

From reading the code (and I could be wrong), .post seems to just be a simple displaying of a message while .run seems to more functionality, e.g. making an ajax call, etc. But .post can be a confusing method name when POST is also the name of an HTTP method: http://en.wikipedia.org/wiki/POST_%28HTTP%29.

zackbloom commented 11 years ago

Yep, we're working on real API docs, but in the meantime I can explain.

post is the method used to 'post' a message. run is added at a higher level, to run a command and use messages to show that methods progress, success and/or failure. The default action for run is $.ajax.

joshkehn commented 10 years ago

Other questions I have after reading the docs:

gen4sp commented 10 years ago
adamschwartz commented 10 years ago

I'll take a crack at these:

  • How can I make a message sticky?
  • How can I configure a specific message to be sticky while others have a timeout?
hideAfter: false
  • what about show/hide animations?

At the moment, I believe simple animations are easy to accomplish with CSS (so a theme could add animations). However, additional class names would need to be managed by javascript to allow for complex animation functionality.

  • what types of messages available?

[Edit] I believe this is a complete list: error, success, info.

zackbloom commented 10 years ago

I don't believe there is no warning type, so it's just error, success and info. You are free to use any additional types you would like, such as warning, but they won't be styled by the default theme css.

joshkehn commented 10 years ago

@zackbloom I'd suggest keeping this open as a “Documentation Improvement” thread rather than closing it out. You're correct, there is no warning type only success, info, and error.

zackbloom commented 10 years ago

Hopefully there's no need any longer: http://github.hubspot.com/messenger

joshkehn commented 10 years ago

Those docs are haphazard. For people like me, who are only using it to show notifications not provide client-side actions it's OK but if I was trying to retry AJAX requests and the like it would be difficult to understand how that is implemented and what consequences go into say retrying an event after it looks like it failed.

zackbloom commented 10 years ago

We'll work on cleaning them up, but you are also free to PR into the docs directory.

joshkehn commented 10 years ago

@zackbloom Closed because more docs were added?