├── .gitignore ├── Gemfile ├── MIT-LICENSE ├── README.md ├── Rakefile ├── lib ├── messengerjs-rails.rb └── messengerjs-rails │ └── version.rb ├── messengerjs-rails.gemspec └── vendor └── assets ├── javascripts ├── messenger-theme-flat.js ├── messenger-theme-future.js ├── messenger.js └── messenger.min.js └── stylesheets ├── messenger-spinner.css ├── messenger-theme-air.css ├── messenger-theme-block.css ├── messenger-theme-flat.css ├── messenger-theme-future.css ├── messenger-theme-ice.css └── messenger.css /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.gem 3 | *.rbc 4 | .bundle 5 | .config 6 | .yardoc 7 | Gemfile.lock 8 | InstalledFiles 9 | _yardoc 10 | coverage 11 | doc/ 12 | lib/bundler/man 13 | pkg 14 | rdoc 15 | spec/reports 16 | test/tmp 17 | test/version_tmp 18 | tmp 19 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in messengerjs-rails.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining 2 | a copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, 5 | distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to 7 | the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be 10 | included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 16 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 17 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 18 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # messengerjs-rails 2 | 3 | messengerjs-rails is a Rails (3.1 and above) wrapper for [Messenger](http://github.hubspot.com/messenger/) javascript library. 4 | 5 | # Messenger 6 | 7 | - Show messages in your app. 8 | - Wrap AJAX requests with progress, success and error messages, and add retry to your failed requests. 9 | - Add actions (undo, cancel, etc.) to your messages. 10 | 11 | 12 |  13 | 14 | 15 | #### [Demo and Usage](http://hubspot.github.com/messenger/docs/welcome) 16 | #### [Docs](http://github.hubspot.com/messenger/) 17 | 18 | 19 | ## Requirement/Dependency: 20 | 21 | 1. jQuery 22 | 23 | 2. Plays well with, but doesn't require, Bootstrap 24 | 25 | ## Installation 26 | 27 | Add the following to your gemfile: 28 | 29 | gem "messengerjs-rails", "~> 1.4.1" 30 | 31 | Add the following directive to your application.coffee / application.js: 32 | 33 | //= require jquery-rails 34 | * 35 | * 36 | //= require messenger 37 | //= require messenger-theme-future 38 | 39 | Add the following directive to your application.scss / application.css. There are four themes/styles provided (future, air, block and ice), change required stylesheet as needed. 40 | 41 | *= require messenger 42 | *= require messenger-spinner 43 | *= require messenger-theme-future 44 | 45 | ## Versioning 46 | 47 | Every attempt is made to mirror the currently shipping Messenger version number wherever possible. 48 | The major, minor, and patch version numbers will always represent the Messenger version. 49 | 50 | ## Contributing 51 | 52 | Feel free to open an issue ticket if you find something that could be improved. 53 | 54 | ## Acknowledgements 55 | 56 | Copyright Ben Song(zbin.song@gmail.com), released under the MIT License. 57 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | require "bundler/gem_tasks" -------------------------------------------------------------------------------- /lib/messengerjs-rails.rb: -------------------------------------------------------------------------------- 1 | require "messengerjs-rails/version" 2 | 3 | module MessengerJS 4 | module Rails 5 | class Engine < ::Rails::Engine 6 | end 7 | end 8 | end -------------------------------------------------------------------------------- /lib/messengerjs-rails/version.rb: -------------------------------------------------------------------------------- 1 | module MessengerJS 2 | module Rails 3 | VERSION = "1.5.0" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /messengerjs-rails.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | require File.expand_path('../lib/messengerjs-rails/version', __FILE__) 3 | 4 | Gem::Specification.new do |s| 5 | s.name = 'messengerjs-rails' 6 | s.version = MessengerJS::Rails::VERSION 7 | s.date = '2014-03-21' 8 | s.summary = 'Messenger js on Rails' 9 | s.description = 'Injects Messenger javascript and stylesheets into your asset pipeline.' 10 | s.authors = ["Ben Song"] 11 | s.email = 'zbin.song@gmail.com' 12 | s.files = Dir["{lib,vendor}/**/*"] + ["MIT-LICENSE", "README.md"] 13 | s.homepage = 'https://github.com/benjis/messengerjs-rails/' 14 | s.license = 'MIT' 15 | end -------------------------------------------------------------------------------- /vendor/assets/javascripts/messenger-theme-flat.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var $, FlatMessage, spinner_template, 3 | __hasProp = {}.hasOwnProperty, 4 | __extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 5 | 6 | $ = jQuery; 7 | 8 | spinner_template = '