github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

danwrong / low-pro-for-jquery

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 129
    • 10
  • Source
  • Commits
  • Network (10)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A jQuery plugin version of the Low Pro behavior framework. — Read more

  cancel

http://lowprojs.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

resolved conflicts with jason-o-matic pull 
danwrong (author)
Fri Apr 17 02:47:17 -0700 2009
commit  9ce82ed1c6ff027201888b00798a1b64ff037898
tree    7208510bdc8a4f2e571dcca8edfdcfbb7e63d7d4
parent  82906668050da3bae388dabddd8cff8a95620c8f parent  2490dff7fa24f8b67227c79363ce890e47ad4356
low-pro-for-jquery /
name age
history
message
file README Thu Jan 31 14:25:49 -0800 2008 updated URLs is README [danwrong]
directory src/ Fri Apr 17 02:47:17 -0700 2009 resolved conflicts with jason-o-matic pull [danwrong]
directory test/ Fri Feb 08 05:18:51 -0800 2008 added delegate method for easy event delegation [danwrong]
README
Low Pro JQ
----------

Author: Dan Webb (dan@danwebb.net)
GIT: github.com:danwrong/low-pro-for-jquery.git
Download: http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true

A jQuery port of the Low Pro behavior framework that was originally written for Prototype.



In brief
--------

Create a behavior as a class:

Testy = $.klass({
 initialize: function(arg) {
   alert('ive just been attached with the arg ' + arg);
 },
 onclick: function() {
   alert('ive been clicked');
 }
});

Btw, $.klass is a full port of Prototype's Class.create so youget that as a bonus and 
can use all the inheritance stuff in the same way.

Next, attach the behavior on DOM ready in the jQuery way:

jQuery(function($) {
 $('p').attach(Testy, 'My arg');
});

Alternatively, if you just need to attach behaviors and get references to the behavior instances
created then you can use:

$('a').attachAndReturn(Clicky, 45) //=> Array of behavior instances

Aside from this everything works the same as Low Pro for Prototype.
See http://www.danwebb.net/lowpro for details.



Livequery support
-----------------

If the livequery plugin is found then Low Pro will use it to automatically bind behaviors to
newly created content so if, taking the above example, you did something like:

$(document.body).append('<p>A new para</p>')

Then it too would get a behavior binded to it.



Acknowledgements
----------------

The $.klass code is a direct port of the Class.create code from Prototype (http://prototypejs.org).
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server