Skip to content

jQuery Plugin API Reference

Erik Loyer edited this page Jan 14, 2017 · 23 revisions

Loading Content

There are a variety of ways to get content into Stepwise--all of which result in the delivery of Stepwise XML to the plugin.

Stepwise XML file or document

You can load a Stepwise XML file directly by specifying the path to the file and the appropriate data type:

$("#output").stepwise({source:"myscript.xml", dataType:"xmlfile"});

You can also pass a Stepwise XML document directly into the plugin by using the "xml" data type:

$("#output").stepwise({source:xmlDoc, dataType:"xml"});

Plain text file or document

Content creators will rarely want to author in XML directly, so Stepwise includes a plain text parser which converts every line into a discrete step. To load a text file, specify the path to the file and use the "textfile" data type:

$("#output").stepwise({source:"myscript.txt", datatype:"textfile"});

You can also load a string directly:

var str = "Hello" + "\n" + "world";
$("#output").stepwise({source:str, datatype:"text"});

Google Sheets document

A more robust option is the Google Sheets parser, which converts a specially formatted Sheets document into Stepwise XML. This is the fastest way to author sophisticated Stepwise content.

The Google Sheets document must first be published to the web in Google Sheets using File > Publish to the Web. You can pass in either the document's URL (it's actual URL, not its Publish to the Web link) or its id.

$.fn.stepwise.getXMLFromSheet(sheetURLOrId, function(xml) {
	$("#output").stepwise(source: xml, dataType: 'xml');
});

Handling Output

By default, Stepwise will output the visible content (if any) of individual steps to the DOM element referenced in the selector (in the examples above, the element with the id "output").

Core

  • Stepwise
  • Score
  • Step

Utilities

  • Sheets

Effects

  • AbstractEffect
  • Stepfade

Clone this wiki locally