Coder Social home page Coder Social logo

hobo-jquery's Introduction

Hobo JQuery

This is a simple Rails plugin that works with Hobo.

It adds a bunch of tags to Hobo that instantiate various JQuery UI widgets.

Installing

Install with

rails plugin install git://github.com/bryanlarsen/hobo-jquery.git -r rails3

or add

gem "hobo-jquery", :git => "git://github.com/bryanlarsen/hobo-jquery.git", :branch => "rails3"

to your Gemfile.

Install the javascript and css files with

rails generate hobo_jquery:install

To use, you need to include hobo-jquery and add the assets to your page. In your application.dryml:

if you installed it as a plugin:

<include plugin="hobo-jquery" />

if you installed it as a gem:

<include gem="hobo-jquery" />

in both cases you must add also:

<extend tag="page">
  <old-page merge>
    <custom-scripts:>
      <hjq-assets/>
    </custom-scripts>
  </old-page>
</extend>

Notes

Hobo Jquery calls jQuery.noConflict() to avoid conflicts with prototype. $ is still bound to prototype.js. To use jQuery, use jQuery instead of $.

Documentation

Auto generated documentation on HoboCentral.

hobo-jquery's People

Contributors

blizz avatar bryanlarsen avatar ddnexus avatar tacid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hobo-jquery's Issues

Error in IE6 and IE7

I found out that with Rails 3 + Hobo 1.3 + the rails3 branch of this repository Hobo Jquery is not working with IE6 and IE7. With IE8 it works fine.

After some debugging I found out that the problem lies in hobo-jquery.js, from line 510 onwards. This lines are part of the combobox widget. As a workaround, commenting these lines makes the error disappear while datepicker still works.

hjq-input-many - bug in no-items message

Minor bug in the no-items message in hjq-input-many. It uses "humanize" which renders classes like AlternateNames as Alternatenames (omits the space). To fix, I'd change humanize to titleize, as with this line in my extend tag="hjq-input-many":

<empty-message:>No <%= this.class.class_name.titleize.downcase.pluralize %>.</empty-message:>

symlink() function is unimplemented on this machine

The problem :
Installation of the plugin with git clone : OK
Buf after I rake hobo_jquery :
"rake hobo_jquery:link_jquery"
I have this error :
symlink() function is unimplemented on this machine
C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:347:in symlink' C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:347:inblock in ln_s'
C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1437:in fu_each_src_dest0' C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:345:inln_s'
C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:368:in ln_sf' D:/develop/gatewayManagerHobo/vendor/plugins/hobo-jquery/lib/tasks/hobo-contrib. rake:30:inblock (3 levels) in <top (required)>'
D:/develop/gatewayManagerHobo/vendor/plugins/hobo-jquery/lib/tasks/hobo-contrib.
rake:30:in each' D:/develop/gatewayManagerHobo/vendor/plugins/hobo-jquery/lib/tasks/hobo-contrib. rake:30:inblock (2 levels) in <top (required)>'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in call' C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:inblock in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in each' C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:inexecute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in block in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:ininvoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in invoke_task' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:inblock (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in each' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:inblock in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in standard_exception_handling' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:intop_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in run' C:/Ruby192/bin/rake:31:in

'

Rails -v : "Rails 3.0.9"
Ruby -v : "ruby 1.9.2p180 (2011-02-18) [i386-mingw32]"
OS : Windows XP sp3
I see an identical issue with an other plugin : https://github.com/galetahub/rails-ckeditor/issues/3
But to correct the bug they change something in the plugin, or, I use the hobo-jquery plugin ?

Need help,
Thanks.

Regards,

Charléric

Selects don't work in <hjq-dialog-and-button>

The chosen value of a select tag in a will be ignored when the dialog is submitted. Instead the default value for the select is submitted.

This seems to be because the formlet is cloned before it is serialized. Apparently JQuery clone doesn't copy DOM values like currently selected item in a . See http://www.mail-archive.com/[email protected]/msg60449.html I've worked around it by serializing the original element instead of the clone which is, of course, a shameful and ugly hack but works because I don't happen to have any sub-forms or formlets.

Suggestion: add 'param' to <hjq-dialog-open-button> to allow passing id, class etc.

The tag call inside tag would benefit from being a param so that id, class etc could be passed.

E.g.

DEFINITION:

<% # we can't use jQuery traversal functions since the dialog will move around in the DOM %>
<% attributes["id"]="hjq-dialog-#{(rand*1000000000).to_i}" unless attributes.has_key?("id") %>




USAGE:

<hjq-dialog-open-button: id="..." class="..." />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.