Skip to content

Commit aaa03ee

Browse files
committed
Updated README
1 parent 5b6fdf8 commit aaa03ee

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jqfactory
1010
##Notable Features
1111
- Supports jQuery prototype namespacing and event namespacing
1212
- Includes an elegant, promises-based, solution for plugins that rely on asynchronous behavior on initialization
13+
- AMD support
1314
- Implements a simple inheritance paradigm that allows you to reuse methods/properties from other jqfactory plugins using mixins and prototypal inheritance to reuse jqfactory common methods
1415
- Saves all instance properties with the jQuery `data()` method to easily construct a public API
1516
- Provides over 10 public/private convenience methods/properties that are useful for plugin development
@@ -655,6 +656,12 @@ __Should I use this instead of the jQueryUI Widget Factory?__
655656

656657
_jqfactory_ - Does not allow a widget to directly inherit from another widget. To use another plugin's methods/properties, you must reference all plugin instance properties that are stored on the jQuery namespace. Every plugin inherits from `$.jqfactory.common`.
657658

659+
**AMD**:
660+
661+
_jQueryUI Widget Factory_ - Does not provide AMD support. **Note:** I talked to the jQueryUI Widget Factory core developer, Scott Gonzalez, recently and he said AMD support will be coming in a future release.
662+
663+
_jqfactory_ - AMD is supported. For more information about how to implement this, check out the other FAQ questions.
664+
658665
**Events**:
659666

660667
_jQueryUI Widget Factory_ - Allows you to add and remove plugin event handlers using the `_on()` and `_off()` methods. Also allows you to trigger events and their associated option callbacks by using the `_trigger()` method.
@@ -681,6 +688,21 @@ __When would I use the _superMethod method?__
681688

682689
- If you are creating more than one jQuery plugin, then you can place all of your plugins under one top-level namespace on the jQuery prototype object. This greatly reduces the possibility of running into a naming collision with another jQuery plugin. A great example would be the Twitter Bootstrap library; it would be great if the Bootstrap library placed all of their individual jQuery plugins under a common bootstrap() namespace.
683690

691+
__Do you provide AMD support?__
692+
693+
- Yes! jqfactory exports a named AMD module called, `jqfactory`, that allows plugin developers to provide AMD support by doing the following:
694+
695+
```javascript
696+
if (typeof define === 'function' && define.amd) {
697+
// An AMD loader is on the page. List jquery and the jqfactory as dependencies and register your plugin as an anonymous AMD module.
698+
define(['jquery', 'jqfactory'], function() {
699+
// Call your plugin
700+
});
701+
} else {
702+
// An AMD loader is not on the page. Call your plugin.
703+
}
704+
```
705+
684706
##Changelog
685707

686708
`0.2.0` - July 7, 2013

0 commit comments

Comments
 (0)