Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

jQuery plugin generator


Generate the structure of jquery plugins easily. Manage library dependencies such as other jquery libraries or packing code on either mac or windows. Get jsspec testing baked in. Use the familiar rake tasks to manage your jquery code base.

Your project started and tested, running in a browser in one with rake first_time

Sorry, this isn't a plugin itself but is managed through ruby, gems and rake.

INSTALL:

From ruby environment

gem install jqueryplugingen

SYNOPSIS

Create in one simple line

jqp -p myplugin -v 0.0.1

jQuery plugin generator to help you kick start your plugin development with the following structure:

    plugin
      /src
        /css
        /images
        query.plugin.js
      /test
        spec_plugin.js
        acceptance_plugin.js
        specs.html
        acceptance.html
      /lib
       /jsspec
       jquery.min.js
       jquery-ui.js
       /themes
         /base
      example.html
      Rakefile
      History.txt
      README.txt

It will generate a base plugin of the structure:

;(function($) {
 
  $.jquery.test = {
VERSION: "0.0.1",
defaults: {
key: 'value'
}
};

$.fn.extend({  
  jquery.test: function(settings) {  
      settings = $.extend({}, $.jquery.test.defaults, settings);   
      return this.each( function(){
        self = this;
       
         // your plugin
       
      })
}
 
})
})(jQuery);

And a base set of jsspec tests all hooked into an html page ready to go:

describe('Basic plugin initialization', {
 
  'before': function() { 
    $('#jqplugin').jqplugin()
   },
  
   'after': function(){
   },

'should be able see that version of project': function(){
     value_of($.jqplugin.VERSION).should_be('0.0.1')
},

'should be able see that element is visible': function(){
    value_of($('#jqplugin').is(':visible')).should_be_true()
},

'should be able to override default settings': function(){
  // over to you!
},

})

Once you have written your code. You have three views of the plugin:

1. Acceptance: rake acceptance (compiles and loads tests in browser)
2. Specs: rake specs (loads tests in browser)
3. Example: rake show (compiles and loads the sample page in a browser)

Finally, package your plugin ready for uploading the plugins.jquery.com

REQUIREMENTS:

  • ruby and rake
  • jquery (installed with rake:jquery:add)
  • WINDO
    WS: 7zip (7z) on your path
  • gems: rss-simple, open-uri, tmpdir

Downloads



0
Your rating: None