j-ulrich / jquery-simulate-ext

jQuery simulate extended
https://j-ulrich.github.io/jquery-simulate-ext/
Other
146 stars 48 forks source link
deprecated

Project Status: Abandoned
NOTE: jQuery Simulate Extended is not actively developed anymore. It may still work but chances are high that some features are broken in recent browsers. For more information, see issue #39.

jQuery Simulate Extended Plugin 1.3.0

The jQuery Simulate Extended plugin (a.k.a. jquery-simulate-ext) provides methods for simulating complex user interactions based on the jQuery.simulate() plugin. The plugin provides simulation of:

Additionally, the extended plugin includes documentation and fixes for the jQuery simulate plugin itself.

Table of Contents

Usage

To use the jquery-simulate-ext plugin, you need to include (in the given order):

  1. bililiteRange.js [if you want to use jquery.simulate.key-sequence.js or jquery.simulate.key-combo.js]
  2. jquery-x.y.z.js
  3. jquery.simulate.js
  4. jquery.simulate.ext.js
  5. jquery.simulate.drag-n-drop.js [if you want to simulate drag & drop]
  6. jquery.simulate.key-sequence.js [if you want to simulate key sequences]
  7. jquery.simulate.key-combo.js [if you want to simulate key combos]

The simulations are executed by calling the .simulate() function on a jQuery object. The simulation is then executed on all elements in the collection of the jQuery object (unless otherwise noted).

The types of simulated actions are:

Example:

$('input[name="testInput"]').simulate("key-sequence", {sequence: "asdf"});

Demos:

The demos folder contains a demonstration of most of the features of the simulate extended plugins.

Live demos can be found at jsFiddle and JS Bin where you can also play around with the plugin:

Documentation

The options and events for the different interactions are described in the files in the doc folder:

Global Options:

Options recognized by all jquery-simulate-ext plugins:

Requirements

The plugin requires

Compatibility

The plugins have been successfully tested with jQuery 1.7.2, 1.10.2, 2.1.0 and jQuery Simulate @485ca7192a, @25938de206. However, they should be compatible with other/future versions as well.

Quirk Detection

There are some issues with bililiteRange and some browsers. To workaround these issues, jquery-simulate-ext performs some quirk detections when the document is ready. Those quirk detections also contain temporary DOM manipulations. If you don't want those DOM manipulations to take place, you can disable the quirk detection by setting the flag ext_disableQuirkDetection in the jQuery.simulate object after jquery.simulate.js has been loaded but before any jquery-simulate-ext plugin is loaded. For example:

<!-- ... -->
<script type="text/javascript" src="https://github.com/j-ulrich/jquery-simulate-ext/raw/master/./libs/jquery.simulate.js"></script>
<script type="text/javascript">$.simulate.ext_disableQuirkDetection = true;</script>
<script type="text/javascript" src="https://github.com/j-ulrich/jquery-simulate-ext/raw/master/./src/jquery.simulate.ext.js"></script>
<script type="text/javascript" src="https://github.com/j-ulrich/jquery-simulate-ext/raw/master/./src/jquery.simulate.key-sequence.js"></script>
<!-- ... -->

For more information, see issue #9.

Licensing

Copyright © 2014 Jochen Ulrich https://github.com/j-ulrich/jquery-simulate-ext

Licensed under the MIT license.