Growl-style alerts and messages for your app. #hubspot-open-source

Overview

Messenger

Demo and Usage

Docs

  • Show messages in your app.
  • Wrap AJAX requests with progress, success and error messages, and add retry to your failed requests.
  • Add actions (undo, cancel, etc.) to your messages.

Messenger

Comments
  • Fix $.globalMessenger().hookBackboneAjax().

    Fix $.globalMessenger().hookBackboneAjax().

    Previously it was not accepting options & potentially clobbering options that did exist.

    I thought it strange that there was an existence check for Backbone.Ajax, as it is always guaranteed to exist.

    I removed the check & tightened up the method somewhat so that it correctly accepts options on individual calls without clobbering options fed to hookBackboneAjax or globally set options.

    This enables nice calls like this:

    this.model.save(data, {
      messenger: {
        successMessage: "Successfully Updated Model!",
        progressMessage: "Updating Model...",
        showSuccessWithoutError: true
      }
    });
    
    opened by STRML 11
  • Fixes for bower.json

    Fixes for bower.json

    • Fix jquery dependency
    • Include all production files in main
    • Ignore everything else

    Refs #39

    I'm pretty new to all this JS packaging stuff, but it seems like currently people tend to maintain two repositories for dealing with bower, with a bower-specific repository that contains only the built version and a bower.json. That seems like a whole lot of wasted effort, so I don't know if you want to go that far, hopefully that gets resolved after the bower rewrite is finished. For now I've just fixed made the above changes so that it works - though files are still deployed to messenger/build/(js|css) - and doesn't ship all the extra stuff like libs and source. All in all, bower still seems a little confused about what main is actually meant to be currently, so, I've just made sure it references everything required.

    I don't know if this is expected to work with JQuery 2.0.0, but if not, it might also be worth adding a dependency restriction to ~1.9.1

    opened by pdf 9
  • Example of specifying messenger element

    Example of specifying messenger element

    The docs include an example with the line

    messenger = new ActionMessenger $('div#message-container')
    

    but ActionMessenger is scoped within the messenger.js file, and besides, the argument would have to be el: $('div#message-container').

    I believe the simplest fix is to change the line in the docs to

    messenger = $('div#message-container').messenger()
    
    opened by TrevorBurnham 8
  • After close

    After close

    Im using Messenger with hideAfter: 5 ....the box is hidden after, but it still remains on top middle (where i set it to) over my other elements. Can I do an on unload function or on hide function?

    I still see the

      after it's been hidden. It's not visible but the UL block still exists and it is on top of other links on my page.

      I'd like remove the actual element when it's closed.

    opened by jermsv1 7
  • Build process

    Build process

    Complete build process to run through Grunt. All you need to do is;

    1. npm install
    2. grunt

    npm install will install all of the dependencies, grunt will then run clean, coffee, compass and finally uglify.

    Dependancy list:

    opened by BennyC 6
  • Center notifications on screen.

    Center notifications on screen.

    We can move them left, right, top, bottom, but there's no way to center the notification. This makes sense if I'm using something with actions in the box.

    opened by scottcorgan 5
  • TypeError: Object [object Object] has no method 'messenger'

    TypeError: Object [object Object] has no method 'messenger'

    Trying to have multiple messenger containers on a single page (one standard, attached to body, the other contained in a wrapper div). However, I'm having some issues getting it to work as outlined in the Docs.

    When I try to set an instance such as:

    $('.messenger-wrapper').messenger(); 
    

    I get the error

    TypeError: Object [object Object] has no method 'messenger'

    Not quite sure what I'm doing wrong. I'm loading jQuery first, then messenger and then the js file that contains my initialization. There are a few other libraries being called in between those files, but not getting any conflict errors.

    I don't see the .messenger method anywhere in the jQuery object either (Chrome Developer tools).

    Thanks in advance, it works wonderfully with once instance, but getting that second one is proving to be a bit tougher.

    opened by dgilfoy 4
  • Add prefixes to CSS classes

    Add prefixes to CSS classes

    Added $prefix in the CSS, and a baseCSSPrefix class in the JS.

    Also added a global in the JS where you can specify theme, and a simple test file.

    This commit fixes issue #4.

    Cheers.

    opened by mrchess 4
  • Add $prefix in SASS to allow scoping of CSS

    Add $prefix in SASS to allow scoping of CSS

    It would be useful if the SASS had a "prefix" option where I could specify the prefix for all the CSS classes.

    More discussion the value of a $prefix could be found here: https://github.com/twitter/bootstrap/issues/1287

    opened by mrchess 4
  • AMD Compatible?

    AMD Compatible?

    Awesome library - I'm trying to place this library in my web application but having some trouble getting it working with require.js.

    Tried to write a loader for the library and returning window.Messenger but it didn't seem to work.

    define(['/js/libs/messenger/messenger.js'], function() {

    return window.Messenger;
    

    });

    Has anyone got this working as an AMD?

    opened by tsneed290 3
  • Theme js

    Theme js

    This is a big one, it creates the global Messenger object, creates a way for themes to add their own js, and renames some internal classes to be more descriptive.

    For more, see the new changelog

    Thoughts @TrevorBurnham @bosgood?

    opened by zackbloom 3
  • How to change Messenger Spinner Color?

    How to change Messenger Spinner Color?

    Hi,

    I am using following code:

    var i = 0;
            Messenger().run({
              errorMessage: 'Error destroying alien planet',
              successMessage: 'Alien planet destroyed!',
    		  label: 'Ok',
              action: function(opts) {
                if (++i < 2) {
                  return opts.error({
                    status: 500,
                    readyState: 0,
                    responseText: 0
                  });
                } else {
                  return opts.success();
                }
              }
            });
    

    My purpose is to use this Messenger.Run to show User that the action they performed is happening (In progress) and they can cancel if they want and if not, it will be submitted.

    (1) I want to change this code in a way that spinner template gets changed. And instead of showing red spinner i want to show green one. But i don't see any provision to that. In messenger-theme-future.css a template is mentioned and that is it. (2) How to hide Retry Now button.

    Please help. Thanks.

    opened by hatanna64 0
  • import not working after installing npm package in React

    import not working after installing npm package in React

    Installed messenger-hubspot package and import not working in react. Any react specific sample implementation or docs would be helpful.

    node_1 | [2] [dev:server] /usr/src/app/tmp/webpack:/~/messenger-hubspot/build/js/messenger.js:22 node_1 | [2] })(); node_1 | [2] ^ node_1 | [2] ReferenceError: window is not defined node_1 | [2] at /usr/src/app/tmp/webpack:/~/messenger-hubspot/build/js/messenger.js:10:1 node_1 | [2] at Object.exports.__esModule (/usr/src/app/tmp/webpack:/~/messenger-hubspot/build/js/messenger.js:22:2) node_1 | [2] at webpack_require (/usr/src/app/tmp/webpack:/webpack/bootstrap 36d1633f01919608117f:19:1) node_1 | [2] at Object._prevMessenger (/usr/src/app/tmp/webpack:/src/routes/BlackList.js:28:1) node_1 | [2] at webpack_require (/usr/src/app/tmp/webpack:/webpack/bootstrap 36d1633f01919608117f:19:1) node_1 | [2] at Object. (/usr/src/app/tmp/webpack:/src/app/routes.js:37:1) node_1 | [2] at webpack_require (/usr/src/app/tmp/webpack:/webpack/bootstrap 36d1633f01919608117f:19:1) node_1 | [2] at Object. (/usr/src/app/tmp/webpack:/server.babel.js:9:1) node_1 | [2] at webpack_require (/usr/src/app/tmp/webpack:/webpack/bootstrap 36d1633f01919608117f:19:1) node_1 | [2] at Object. (/usr/src/app/tmp/bundle.js:50:19) node_1 | [2] [dev:server] [nodemon] app crashed - waiting for file changes before starting...

    opened by pavankumar1792 0
  • package.json should have main attribute

    package.json should have main attribute

    It would be a lot cleaner for users of the package if it had a main attribute as described in this SO answer. https://stackoverflow.com/questions/22512992/node-js-package-json-main-parameter

    I think the main should be: 'main': 'build/js/messenger'

    opened by gregveres 1
  • Can't override the theme on a single message?

    Can't override the theme on a single message?

    Hi,

    I have a single theme set for my application but now I am running into a situation where I want to use a lighter theme (air) for a different type of message. Since I am using typescript, I pulled in the typing file and it indicates that you can set theme: during a post. But when I try it, the message always comes out in the theme I have set in the Messenger options call for the page.

    I tried it on the demo site (http://github.hubspot.com/messenger/docs/welcome/) as well and it didn't work there either.

    is this supposed to work:

    Messenger().post({
        message: "email draft autosaved", hideAfter: 1, type: "success", showCloseButton: false, theme: 'ice'
    })
    

    Or is that not a feature?

    Thanks

    opened by gregveres 1
Pure JavaScript library for better notification messages

Toastify Toastify is a lightweight, vanilla JS toast notification library. Demo Click here Features Multiple stacked notifications Customizable No blo

Varun A P 1.3k Dec 30, 2022
🔔 a clean and simple notification, input, and selection suite for javascript, with no dependencies

notie notie is a clean and simple notification, input, and selection suite for javascript, with no dependencies Live demo: https://jaredreich.com/noti

Jared Reich 6.3k Dec 26, 2022
Elegant, responsive, flexible and lightweight notification plugin with no dependencies.

iziToast Elegant, responsive, flexible and lightweight notification plugin with no dependencies. izitoast.marcelodolza.com Fast Responsive Animated Li

Marcelo Dolza 2.5k Jan 2, 2023
A modern dialog library which is highly configurable and easy to style. #hubspot-open-source

vex Demo Documentation vex is a modern dialog library which is highly configurable, easily stylable, and gets out of the way. You'll love vex because

HubSpot 6.9k Jan 5, 2023
A modern dialog library which is highly configurable and easy to style. #hubspot-open-source

vex Demo Documentation vex is a modern dialog library which is highly configurable, easily stylable, and gets out of the way. You'll love vex because

HubSpot 6.9k Apr 1, 2021
CSS Tooltips built on Tether. #hubspot-open-source

Tooltip Tooltip.js is a Javascript and CSS library for creating styleable tooltips. Install Dependencies Tether Drop Installing via npm and bower will

HubSpot 714 Jan 2, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Fnon is a client-side JavaScript library for models, loading indicators, notifications, and alerts which makes your web projects much better.

???????? Fnon is the name of my late mother, It's an Arabic word which means Art, I created this library in honor of her name. Fnon is a client-side J

Adel N Al-Awdy 5 Sep 11, 2022
Front-end for FireNearby service. View recent fires and sign up to receive alerts: caseymm.github.io/fire-nearby

fire-nearby (firenearby service front-end) This application is composed of three pages: Map of recent fires Sign up form to receive alerts About this

Casey Miller 4 Mar 30, 2022
📣 A vanilla js library for creating alerts, prompts and confirms.

attention.js This library will be released soon as 1.0 with a whole new codebase! Stay tuned! A vanilla js library for creating alerts, prompts, and c

Jan-Markus Langer 13 Apr 21, 2022
A beautiful, responsive, highly customizable and accessible replacement for JavaScript's popup boxes. Zero dependencies.Alerts ,dialogs

AsgarAlert (v1) for JS Install <script defer src="/asgar-alert.js"></script> Examples The most basic message: asgar("Hello world!"); A message signali

Asgar Aliyev 5 Dec 20, 2022
A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

TARIQ 8 Dec 28, 2022
TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

null 3 Dec 3, 2022
A jQuery plugin wrapper around Bootstrap Alerts, to create Notifications (Toasts)

bootstrap-show-notification A jQuery plugin wrapper around Bootstrap 4 Alerts, to show them as toasts (also called notifications) dynamically from Jav

Stefan Haack 10 Aug 22, 2022
GraphErr is an open-source error handling library for GraphQL implementations in Deno. It's a lightweight solution that provides developers with descriptive error messages, reducing ambiguity and improving debugging.

GraphErr Descriptive GraphQL error handling for Deno/Oak servers. Features Provides additional context to GraphQL's native error messaging for faster

OSLabs Beta 35 Nov 1, 2022
Shikhar 4 Oct 9, 2022
A damn-sexy, open source real-time dashboard builder for IOT and other web mashups. A free open-source alternative to Geckoboard.

freeboard free·board (noun) *\ˈfrē-ˌbȯrd* the distance between the waterline and the main deck or weather deck of a ship or between the level of the w

freeboard 6.3k Dec 28, 2022