Commit d38a7862 authored by DoNaTio s.r.o.'s avatar DoNaTio s.r.o.
Browse files

added Messanger

parent 2d6cfa42
.DS_Store
.sass-cache
/node_modules/
[submodule "lib/executr"]
path = lib/executr
url = git://github.com/HubSpot/executr.git
title: "messenger"
description: "Growl-style alerts and messages for web apps."
source: "src/coffee/messenger.coffee"
assets: "{build/**/*,docs/welcome/*,docs/welcome/**/*,docs/images/*}"
1.4.1
-----
- Allow for customization of the text in the close button
- Fix a bug with passing options to `Messenger()`, and subsequent updates made by `run` not respecting those options
1.4.0
-----
- Remove promise method pass-through
- Add type aliases
1.3.6
-----
- Fix bug with jQuery 1.6 support
1.3.5
-----
- Fix bug in how retry works
1.3.4
-----
- Fix bug in how success/error handlers are called
1.3.2
-----
- Add the `expectPromise` method which accepts a function which will return a promise, and
a message options hash, and calls `run`.
- Add the `returnsPromise` option to `run` which will expect its `action` to return a promise
object, rather than using success and error callbacks. The promises can reject or resolve to
change the messages shown just as the callbacks can. You should wrap the promise returned with
a `pipe` like function to mutate the returned values before they reach Messenger.
- successMessage, errorMessage and progressMessage can now be functions.
- Action handlers are now called with the context of the message they are actions of.
- Add support for returning message options objects from `Messenger.run` success and error
handlers. This could be a breaking change for clients who are inadvertantly returning objects
from handlers (easy to do in CoffeeScript), as Messenger will interpret any object returned
from a handler as being config for the message.
1.3.1
-----
- Prefix first, last and shown css classes, changing them to messenger-first, messenger-last,
and messenger-shown.
- Fixed an error when Messenger was used without shims
1.3.0
-----
- Removed dependencies on Underscore and Backbone.
- Add src/js/shim.js which includes cutdown versions of some Underscore functions and Backbone's
event handling. It is included automatically in messenger.js and messenger.min.js. This file
can be safely excluded in environments with Backbone and Underscore, but support for that is
not yet in the build system.
- Add src/js/preboot.js which needs to be included before the main messenger file. It is included
automatically in messenger.js and messenger.min.js.
1.2.3
-----
- Internal references to Messenger will now function correctly when the Messenger object has
been noConflicted.
1.2.2
-----
- Message strings (as opposed to full objects) can now be passed into message.update.
1.2.1
-----
- Added `ajax` alias for `run` with `$.ajax` as the action. This is essentially identical
to the default behavior, but is useful to those who wish to be more explicit.
- `message.retry.allow` can now be set to an integer representing the number of retries
to be permitted.
- `message.retry.delay` now works as expected with non-integer delays.
- Bugfixes surrounding how `do`/`run` retries things.
1.2.0
-----
- Added global Messenger object which can be removed with `Messenger.noConflict()`. The
Messenger object will provide a container other than the jQuery object for messenger
externals.
- `Messenger` may also be called to provide the same functionality as `$.globalMessenger`.
- Messenger default options may now be set on `window.Messenger.options` as well as
`$._messengerDefaults`.
- The current instance of ActionMessenger which will be used by `Messenger()`/`$.globalMessenger`
calls is now accessable as `window.Messenger.instance`, not `$._messengerInstance`.
- Added `run` alias for `do`. This change makes it easier for developers writing js.
In JavaScript, `do`, being a reserved word, always had to be referenced using array
notation, this provides a way around that limitation.
- Created common way for themes to define extra JavaScript. Themes can now define their
own Messenger and/or Message objects in the `window.Messenger.themes.<theme_name>` object.
If the theme name is provided in the options to globalMessenger as `options.theme`, the
defined classes will be used. As the theme now has to be passed in as a seperate option, the
`messenger-theme-x` class will now be automatically added, and does not need to be
provided in extraClasses.
- `MagicMessage` has been renamed `RetryingMessage`.
- The base classes `Message` and `Messenger` have been renamed `_Message` and `_Messenger` to
signify that they are only for the internal structuring of the code, and not expected
to be used directly.
- Messenger now exposes `ActionMessenger` (as `Messenger`) and `RetryingMessage` (as `Message`) for
use by themes which wish to extend them.
Messenger is an open source project created by HubSpot, Inc. It is nurtured by HubSpot devs and the community.
Messenger was originally written and is currently maintained by @zackbloom
All of the styles in Messenger were written by @adamschwartz
@bosgood is responsible for removing the Backbone dependency
The gruntfile is maintained by @BennyC
Various bugfixes by @STRML, @joelmoss and @TrevorBurnham
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
clean: ["build/js", "build/css"]
concat:
options:
banner: "/*! <%= pkg.name %> <%= pkg.version %> */\n"
dist:
src: ["src/js/preboot.js", "lib/shims.js", "build/js/<%= pkg.name %>.js"]
dest: "build/js/<%= pkg.name %>.js"
uglify:
options:
banner: "/*! <%= pkg.name %> <%= pkg.version %> */\n"
build:
src: "build/js/<%= pkg.name %>.js"
dest: "build/js/<%= pkg.name %>.min.js"
coffee:
options:
separator: "/*! <%= pkg.name %> <%= pkg.version %> */\n"
compile:
files:
"build/js/messenger.js": "src/coffee/messenger.coffee"
"build/js/messenger-theme-future.js": "src/coffee/messenger-theme-future.coffee"
"build/js/messenger-theme-flat.js": "src/coffee/messenger-theme-flat.coffee"
compass:
dist:
options:
sassDir: "src/sass"
cssDir: "build/css"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-compass"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.registerTask "default", ["clean", "coffee", "compass", "concat", "uglify"]
Copyright (c) 2013 HubSpot, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Messenger
#### [Demo and Usage](http://hubspot.github.com/messenger/docs/welcome)
#### [Docs](http://github.hubspot.com/messenger/)
- 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](https://raw.github.com/HubSpot/messenger/master/docs/images/messenger.gif)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.1/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.1/jasmine.css">
<!-- include stylesheets here... -->
<link rel="stylesheet" type="text/css" href="build/css/messenger.css">
<link rel="stylesheet" type="text/css" href="build/css/messenger-spinner.css">
<link rel="stylesheet" type="text/css" href="build/css/messenger-theme-future.css">
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"></script>
<script type="text/javascript" src="lib/sinon-1.6.0.js"></script>
<!-- include dependencies here -->
<script type="text/javascript" src="spec/lib/jquery-1.9.1.js"></script>
<!-- include source files here... -->
<script type="text/javascript" src="build/js/messenger.js"></script>
<!-- include spec files here... -->
<!-- <script type="text/javascript" src="spec/SpecHelper.js"></script> -->
<script type="text/javascript" src="spec/MessengerSpec.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
{
"name": "messenger",
"repo": "HubSpot/messenger",
"description": "Client-side growl-like notifications with actions and auto-retry.",
"version": "1.4.1",
"homepage": "http://github.hubspot.com/messenger",
"authors": [
"Zack Bloom <zackbloom@gmail.com>",
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
],
"license": "MIT",
"keywords": [
"client-side",
"notification",
"toast",
"growl",
"ajax"
],
"main": [
"build/js/messenger.js",
"build/js/messenger-theme-future.js",
"build/js/messenger-theme-flat.js",
"build/css/messenger.css",
"build/css/messenger-theme-future.css",
"build/css/messenger-theme-flat.css",
"build/css/messenger-theme-block.css",
"build/css/messenger-theme-air.css",
"build/css/messenger-theme-ice.css"
],
"dependencies": {
"jquery": "*"
},
"ignore": [
"**/.*",
"component.json",
"Gruntfile.coffee",
"lib/",
"package.json",
"SpecRunner.html",
"spec/",
"src/"
]
}
@-webkit-keyframes ui-spinner-rotate-right {
/* line 64, ../../src/sass/messenger-spinner.scss */
0% {
-webkit-transform: rotate(0deg);
}
/* line 65, ../../src/sass/messenger-spinner.scss */
25% {
-webkit-transform: rotate(180deg);
}
/* line 66, ../../src/sass/messenger-spinner.scss */
50% {
-webkit-transform: rotate(180deg);
}
/* line 67, ../../src/sass/messenger-spinner.scss */
75% {
-webkit-transform: rotate(360deg);
}
/* line 68, ../../src/sass/messenger-spinner.scss */
100% {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes ui-spinner-rotate-left {
/* line 72, ../../src/sass/messenger-spinner.scss */
0% {
-webkit-transform: rotate(0deg);
}
/* line 73, ../../src/sass/messenger-spinner.scss */
25% {
-webkit-transform: rotate(0deg);
}
/* line 74, ../../src/sass/messenger-spinner.scss */
50% {
-webkit-transform: rotate(180deg);
}
/* line 75, ../../src/sass/messenger-spinner.scss */
75% {
-webkit-transform: rotate(180deg);
}
/* line 76, ../../src/sass/messenger-spinner.scss */
100% {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes ui-spinner-rotate-right {
/* line 80, ../../src/sass/messenger-spinner.scss */
0% {
-moz-transform: rotate(0deg);
}
/* line 81, ../../src/sass/messenger-spinner.scss */
25% {
-moz-transform: rotate(180deg);
}
/* line 82, ../../src/sass/messenger-spinner.scss */
50% {
-moz-transform: rotate(180deg);
}
/* line 83, ../../src/sass/messenger-spinner.scss */
75% {
-moz-transform: rotate(360deg);
}
/* line 84, ../../src/sass/messenger-spinner.scss */
100% {
-moz-transform: rotate(360deg);
}
}
@-moz-keyframes ui-spinner-rotate-left {
/* line 88, ../../src/sass/messenger-spinner.scss */
0% {
-moz-transform: rotate(0deg);
}
/* line 89, ../../src/sass/messenger-spinner.scss */
25% {
-moz-transform: rotate(0deg);
}
/* line 90, ../../src/sass/messenger-spinner.scss */
50% {
-moz-transform: rotate(180deg);
}
/* line 91, ../../src/sass/messenger-spinner.scss */
75% {
-moz-transform: rotate(180deg);
}
/* line 92, ../../src/sass/messenger-spinner.scss */
100% {
-moz-transform: rotate(360deg);
}
}
@keyframes ui-spinner-rotate-right {
/* line 96, ../../src/sass/messenger-spinner.scss */
0% {
transform: rotate(0deg);
}
/* line 97, ../../src/sass/messenger-spinner.scss */
25% {
transform: rotate(180deg);
}
/* line 98, ../../src/sass/messenger-spinner.scss */
50% {
transform: rotate(180deg);
}
/* line 99, ../../src/sass/messenger-spinner.scss */
75% {
transform: rotate(360deg);
}
/* line 100, ../../src/sass/messenger-spinner.scss */
100% {
transform: rotate(360deg);
}
}
@keyframes ui-spinner-rotate-left {
/* line 104, ../../src/sass/messenger-spinner.scss */
0% {
transform: rotate(0deg);
}
/* line 105, ../../src/sass/messenger-spinner.scss */
25% {
transform: rotate(0deg);
}
/* line 106, ../../src/sass/messenger-spinner.scss */
50% {
transform: rotate(180deg);
}
/* line 107, ../../src/sass/messenger-spinner.scss */
75% {
transform: rotate(180deg);
}
/* line 108, ../../src/sass/messenger-spinner.scss */
100% {
transform: rotate(360deg);
}
}
/* line 116, ../../src/sass/messenger-spinner.scss */
.messenger-spinner {
position: relative;
border-radius: 100%;
}
/* line 120, ../../src/sass/messenger-spinner.scss */
ul.messenger.messenger-spinner-active .messenger-spinner .messenger-spinner {
display: block;
}
/* line 124, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side {
width: 50%;
height: 100%;
overflow: hidden;
position: absolute;
}
/* line 130, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side .messenger-spinner-fill {
border-radius: 999px;
position: absolute;
width: 100%;
height: 100%;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-ms-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-timing-function: linear;
-ms-animation-timing-function: linear;
-o-animation-timing-function: linear;
animation-timing-function: linear;
}
/* line 140, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side-left {
left: 0;
}
/* line 143, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side-left .messenger-spinner-fill {
left: 100%;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
-webkit-animation-name: ui-spinner-rotate-left;
-moz-animation-name: ui-spinner-rotate-left;
-ms-animation-name: ui-spinner-rotate-left;
-o-animation-name: ui-spinner-rotate-left;
animation-name: ui-spinner-rotate-left;
-webkit-transform-origin: 0 50%;
-moz-transform-origin: 0 50%;
-ms-transform-origin: 0 50%;
-o-transform-origin: 0 50%;
transform-origin: 0 50%;
}
/* line 152, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side-right {
left: 50%;
}
/* line 155, ../../src/sass/messenger-spinner.scss */
.messenger-spinner .messenger-spinner-side-right .messenger-spinner-fill {
left: -100%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
-webkit-animation-name: ui-spinner-rotate-right;
-moz-animation-name: ui-spinner-rotate-right;
-ms-animation-name: ui-spinner-rotate-right;
-o-animation-name: ui-spinner-rotate-right;
animation-name: ui-spinner-rotate-right;
-webkit-transform-origin: 100% 50%;
-moz-transform-origin: 100% 50%;
-ms-transform-origin: 100% 50%;
-o-transform-origin: 100% 50%;
transform-origin: 100% 50%;
}
@import url("//fonts.googleapis.com/css?family=Raleway:400");
@-webkit-keyframes ui-spinner-rotate-right {
/* line 64, ../../src/sass/messenger-spinner.scss */
0% {
-webkit-transform: rotate(0deg);
}
/* line 65, ../../src/sass/messenger-spinner.scss */
25% {
-webkit-transform: rotate(180deg);
}
/* line 66, ../../src/sass/messenger-spinner.scss */
50% {
-webkit-transform: rotate(180deg);
}
/* line 67, ../../src/sass/messenger-spinner.scss */
75% {
-webkit-transform: rotate(360deg);
}
/* line 68, ../../src/sass/messenger-spinner.scss */
100% {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes ui-spinner-rotate-left {
/* line 72, ../../src/sass/messenger-spinner.scss */
0% {
-webkit-transform: rotate(0deg);
}
/* line 73, ../../src/sass/messenger-spinner.scss */
25% {
-webkit-transform: rotate(0deg);
}
/* line 74, ../../src/sass/messenger-spinner.scss */
50% {
-webkit-transform: rotate(180deg);
}
/* line 75, ../../src/sass/messenger-spinner.scss */
75% {
-webkit-transform: rotate(180deg);
}
/* line 76, ../../src/sass/messenger-spinner.scss */
100% {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes ui-spinner-rotate-right {
/* line 80, ../../src/sass/messenger-spinner.scss */
0% {
-moz-transform: rotate(0deg);
}