Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

javascript_util_asset_pack

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript_util_asset_pack

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

== 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

  • spinner.gif generated using http://www.ajaxload.info

== License

The Unlicense (aka: public domain) http://unlicense.org

== Ruby Gems

FAQs

Package last updated on 04 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc