Skip to content

Commit

Permalink
Merge pull request #47 from UNC-Libraries/update_readme
Browse files Browse the repository at this point in the history
Update readme to let users know about custom error handling option.
  • Loading branch information
bbpennel committed Jun 5, 2015
2 parents 5dbfc91 + 3ecddb8 commit 3ed8169
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Configure the standard
There are two ways to configure buttons which show up in the status

##### xmlUploadPath
Default, single uplaod button. By providing an xmlUploadPath option, a "Submit Changes" button will appear.
Default, single upload button. By providing an xmlUploadPath option, a "Submit Changes" button will appear.

```javascript
{
Expand All @@ -121,6 +121,18 @@ An additional submitResponseHandler function can also be provided:

- submitResponseHandler - Function called after the document is submitted when there is no HTTP error. Passed AJAX response object as parameter. Return true if the upload was considered to be successful.

##### Custom errorHandler
You can specify a custom error handler function if you need something specific for your situation.
```javascript
{
$("#xml_editor").xmlEditor({
submitErrorHandler : function(jqXHR, exception) {
my custom error handling code here
};
});
}
```

##### submitButtonConfigs
Alternatively, any number of buttons can be created by providing the submitButtonConfigs option. It expects an array containing button configuration objects, each of which can contain the following options:

Expand Down Expand Up @@ -164,6 +176,7 @@ Providing a submitButtonConfigs option will override the creation of the standar

### Building the plugin yourself
If we wish to build the combined jquery.xmleditor.js yourself, you can use the provided rake script. With rake installed, simple type "rake" in the root directory of this project.
Note: You'll need the sprockets gem installed for the rake task to complete properly.

License Information
---------
Expand All @@ -187,6 +200,8 @@ Authors

[Mike Daines](https://github.com/mdaines)

[Dean Farrell](https://github.com/lfarrell)

Attribution
------

Expand Down

0 comments on commit 3ed8169

Please sign in to comment.