Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
379 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ src/packages | |
*.dotCover | ||
src/*/repositories.config | ||
.bottle-alias | ||
results | ||
results | ||
chromedriver.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2011 Joshua Arnold, Jeremy Miller | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# jQuery.continutions | ||
|
||
## Overview | ||
|
||
jQuery.continuations provides a standarized way of processing Ajax responses via [the Continuation object](https://github.com/DarthFubuMVC/jquery-continuations/wiki/Continuation-object). The idea is that for most cases, | ||
your server side code will be generated responses that are similar in structure and you want to build a conventional approach to processing those requests. | ||
|
||
## How it works | ||
|
||
jQuery.continuations hooks into jQuery via the $.ajaxSetup method and provides a global success callback. The callback that is registered kicks off the | ||
$.continuations.process pipeline. | ||
|
||
## Processing pipeline | ||
|
||
The processing pipeline is orchestrated through [continuation policies](https://github.com/DarthFubuMVC/jquery-continuations/wiki/Continuation-policy). jQuery.continuations comes with several policies that are registered by default: | ||
|
||
**errorPolicy** | ||
|
||
(_Matches when the error collection is not empty_) | ||
|
||
Publishes 'ContinuationError' topic through amplifyjs | ||
|
||
**refreshPolicy** | ||
|
||
(_Matches when the refresh property is true_) | ||
|
||
Simply refreshes the page | ||
|
||
**navigatePolicy** | ||
|
||
(_Matches when the url property is not empty_) | ||
|
||
Navigates the window to the specified url | ||
|
||
**payloadPolicy** | ||
|
||
(_Matches when the following properties exist: payload, topic_) | ||
|
||
Publishes the specified topic and payload through amplifyjs | ||
|
||
## Request Correlation | ||
|
||
Before each request is initiated, a custom header is appended (X-Correlation-Id). This value originates from one of two sources: 1) randomly assigned for a request 2) the id of the form responsible for the request. | ||
|
||
> Note: It's up to your web framework to handle setting the header into its response. | ||
Assuming that you are sending the header back down through your response, jquery.continuations handles it from there by doing two things: | ||
|
||
**The AjaxCompleted topic** | ||
|
||
This topic is published through the jquery.continuations event aggregator facade (we use amplify). The message that is published contains a correlationId property with the appropriate value. | ||
|
||
**The continuation processing pipeline** | ||
|
||
Before the continuation is processed, the correlationId property is set. | ||
|
||
> jQuery.continuations also integrates with jquery.form by providing a correlatedSubmit method to any form ($('#myForm').correlatedSubmit()) | ||
## Custom Policies | ||
|
||
An example of how to register a custom policy: | ||
|
||
> $.continuations.applyPolicy({ custom policy... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.