RubyGems Navigation menu

javascript_util_asset_pack 0.2.0

Rails 3.1 javascript - Util asset pack

Sets up a window.Util object which includes

  • Spinner, with methods to set spinner next to element or hide the spinner

  • AjaxForm, to ajax enable simple forms

  • jQuery ajaxError global handler, exception data during development and friendly message in production

Usage

spinner (js version)

window.Util.spinner.nextTo('#my_button');
window.Util.spinner.nextTo('#my_button', 3, 4); // selector, top offset, left offset
window.Util.spinner.hide();

ajax form (coffee script version)

jQuery ->
    new window.Util.AjaxForm '#my_form', ->
        log "my_form submit success callback"

Install

Update the Gemfile in your rails project, add the following line

gem 'javascript_util_asset_pack'

Run the generator

rails generate javascript_util_asset_pack

does the following:

  • Copy spinner.gif to /app/assets/images

  • Update application.html.erb adding javascript create window.Rails.env variable

  • Update application.html.erb adding image_tag for spinner.gif

  • Update application.js adding util_pack

WARNING

  • 0.0.10 and 0.0.11 are bad versions, use 0.0.12 or above

Coming Soon

  • configuration object

    • text in ajaxError overrides

    • spinner id override

Resources

License

The Unlicense (aka: public domain) unlicense.org

Ruby Gems

Gemfile:
= 复制到剪贴板 已复制!

安装:
=

版本列表:

  1. 0.2.0 - December 04, 2013 (8.5 KB)
  2. 0.2.0.rc2 - December 04, 2013 (8.5 KB)
  3. 0.2.0.rc1 - December 04, 2013 (8.5 KB)
  4. 0.1.0 - May 31, 2013 (8.5 KB)
  5. 0.0.12 - December 01, 2012 (8.5 KB)
显示所有版本 (共 15 个)

Runtime 依赖 (2):

rails >= 3.1

业主:

作者:

  • Jesse House

SHA 256 校验和:

e8b33acf788f771f20a09ad5f182f775f69caf550ac396764e20ff3d8bbc0774

下载总量 47,871

这个版本 7,874

许可:

需要的 Ruby 版本:

链接: