Skip to content
Browse files

Fixing build failures for docs

  • Loading branch information...
1 parent 211ca25 commit 05a91dc73883a8d75535d2dd5bb2803ab5627462 @CoreyKaylor CoreyKaylor committed Nov 24, 2013
View
1 .gitignore
@@ -27,4 +27,5 @@ logs
Gemfile.lock
bin/
src/jquery.continuations.Docs/pak-WebContent.zip
+src/jquery.continuations.Docs/snippets
docs
View
2 packaging/nuget/jquery.continuations.docs.nuspec
@@ -15,6 +15,6 @@
</dependencies>
</metadata>
<files>
- <file src="..\..\src\jquery.continuations.Docs\bin\Release\jquery.continuations.Docs.*" target="lib\net40" />
+ <file src="..\..\src\jquery.continuations.Docs\bin\Debug\jquery.continuations.Docs.*" target="lib\net40" />
</files>
</package>
View
5 ripple.config
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<ripple xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<ripple xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>jquery.continuations</Name>
<NugetSpecFolder>packaging/nuget</NugetSpecFolder>
<SourceFolder>src</SourceFolder>
@@ -17,5 +17,8 @@
<Dependency Name="Serenity" Mode="Float" />
</Nugets>
<Groups />
+ <References>
+ <IgnoreAssemblies />
+ </References>
<Nuspecs />
</ripple>
View
265 ....continuations.Docs/snippets/jquery.continuations/content/scripts/jquery.continuations.js
@@ -1,265 +0,0 @@
-// jquery.continuations v1.2.0
-//
-// Copyright (C)2011-2013 Joshua Arnold, Jeremy Miller
-// Distributed Under Apache License, Version 2.0
-//
-// https://github.com/DarthFubuMVC/jquery-continuations
-
-(function ($) {
-
- var CORRELATION_ID = 'X-Correlation-Id';
- var policies = [];
-
- function Continuation() {
- // SAMPLE: defaultProperties
- this.errors = [];
- this.success = false;
- this.refresh = false;
- this.contentType = 'application/json';
- this.correlationId = null;
- this.options = { };
- // ENDSAMPLE
- }
- Continuation.prototype = {
- isAjax: function() {
- return this.contentType.indexOf('json') != -1;
- },
- isHtml: function() {
- return this.contentType.indexOf('html') != -1;
- },
- matchOnProperty: function(prop, predicate) {
- return typeof(this[prop]) !== 'undefined' && predicate(this[prop]);
- },
- matchOnOption: function(prop, predicate) {
- },
- isCorrelated: function () {
- return this.matchOnProperty('correlationId', function(id) {
- return id != null;
- });
- },
- eachError: function(action) {
- if(!this.errors) return;
-
- for(var i = 0; i < this.errors.length; i++) {
- action(this.errors[i]);
- }
- }
- };
-
- var refreshPolicy = function () {
- this.matches = function (continuation) {
- return continuation.refresh && continuation.refresh.toString() === 'true';
- };
- this.execute = function (continuation) {
- $.continuations.windowService.refresh();
- };
- };
-
- var navigatePolicy = function () {
- this.matches = function (continuation) {
- return continuation.navigatePage != undefined && continuation.navigatePage != '';
- };
- this.execute = function (continuation) {
- $.continuations.windowService.navigateTo(continuation.navigatePage);
- };
- };
-
- var redirectPolicy = function () {
- this.matches = function (continuation) {
- // TODO -- Harden this against the proper statuses
- return continuation.matchOnProperty('statusCode', function(c) { return c != 200; })
- && continuation.matchOnProperty('response', function(r) { return r.getResponseHeader('Location'); });
- };
- this.execute = function (continuation) {
- var url = continuation.response.getResponseHeader('Location');
- $.continuations.windowService.navigateTo(url);
- };
- };
-
- var errorPolicy = function () {
- this.matches = function (continuation) {
- return continuation.errors && continuation.errors.length != 0;
- };
- this.execute = function (continuation) {
- $.continuations.trigger('ContinuationError', continuation);
- };
- };
-
- var httpErrorPolicy = function () {
- this.matches = function (continuation) {
- return continuation.matchOnProperty('statusCode', function(code) { return code != 200; });
- };
- this.execute = function (continuation) {
- $.continuations.trigger('HttpError', continuation);
- };
- };
-
- function continuations() {
- this.callbacks = {};
- this.setupDefaults();
- };
- continuations.prototype = {
- bind: function(topic, callback) {
- if( !this.callbacks[topic] ) {
- this.callbacks[topic] = [];
- }
-
- this.callbacks[topic].push(callback);
- },
- // Mostly public for testing
- trigger: function(topic, payload, context) {
- if(!payload) {
- payload = {};
- }
-
- if( !this.callbacks[topic] ) {
- this.callbacks[topic] = [];
- }
-
- if(!context) {
- context = {
- topic: topic
- };
- }
-
- var actions = this.callbacks[topic];
- for(var i = 0; i < actions.length; i++) {
- actions[i].call(context, payload);
- }
-
- if(topic != '*') {
- this.trigger('*', payload, {topic: topic});
- }
- },
- onSuccess: function(event, response, settings) {
- var continuation = this.parseContinuation(response);
-
- var options = settings.options;
- if(typeof(options) === 'undefined') {
- options = {};
- }
-
- continuation.options = options;
-
- if($.isFunction(settings.continuationSuccess)) {
- settings.continuationSuccess(continuation);
- }
-
- this.process(continuation);
- },
- setupDefaults: function () {
- this.applyPolicy(new refreshPolicy());
- this.applyPolicy(new navigatePolicy());
- this.applyPolicy(new redirectPolicy());
- this.applyPolicy(new errorPolicy());
- this.applyPolicy(new httpErrorPolicy());
- },
- onError: function(response, settings) {
- var continuation = this.parseContinuation(response);
- var process = true;
- if($.isFunction(settings.continuationError)) {
- process = !(settings.continuationError(continuation) === false);
- }
-
- if(process) {
- this.process(continuation);
- }
- },
- parseContinuation: function(response) {
- var continuation = new $.continuations.continuation();
- continuation.success = false;
-
- var header = response.getResponseHeader('Content-Type');
- if (header && header.indexOf('json') != -1) {
- continuation = JSON.parse(response.responseText);
- }
-
- // SAMPLE: additionalProperties
- continuation.contentType = header; // Content-Type HTTP header
- continuation.response = response; // jQuery XHR object
- continuation.statusCode = response.status;
- continuation.correlationId = response.getResponseHeader('X-Correlation-Id');
- // ENDSAMPLE
- return continuation;
- },
- // Keep this public for form correlation
- setupRequest: function (xhr, settings) {
- // this could come from the ajax options
- var id = settings.correlationId;
- if (typeof(id) === 'undefined') {
- id = new Date().getTime().toString();
- }
- xhr.setRequestHeader(CORRELATION_ID, id);
- $.continuations.trigger('AjaxStarted', {
- correlationId: id
- });
- },
- applyPolicy: function (policy) {
- policies.push(policy);
- return this;
- },
- // Mostly for testing
- reset: function() {
- policies.length = 0;
- this.setupDefaults();
- this.callbacks = {};
- },
- process: function (continuation) {
- continuation = $.continuations.create(continuation);
-
- var matchingPolicies = [];
- for (var i = 0; i < policies.length; ++i) {
- var p = policies[i];
- if (p.matches(continuation)) {
- matchingPolicies.push(p);
- }
- }
-
- for (var i = 0; i < matchingPolicies.length; ++i) {
- matchingPolicies[i].execute(continuation);
- }
- }
- };
-
- continuations.prototype.windowService = {
- refresh: function () {
- window.location.reload();
- },
- navigateTo: function (url) {
- window.location = url;
- }
- };
-
- var module = new continuations();
-
- $(document).ajaxSend(function(e, jqxhr, settings) {
- module.setupRequest(jqxhr, settings);
- });
-
- $(document).ajaxComplete(function(e, jqxhr) {
- module.trigger('AjaxCompleted', {
- correlationId: jqxhr.getResponseHeader(CORRELATION_ID)
- });
- });
-
- $(document).ajaxError(function(e, jqxhr, settings) {
- module.onError(jqxhr, settings);
- });
-
- $(document).ajaxSuccess(function(e, response, settings) {
- module.onSuccess(e, response, settings);
- });
-
-
- // Exports
- $.continuations = module;
-
- $.continuations.continuation = Continuation;
- $.continuations.fn = Continuation.prototype;
-
- $.continuations.create = function(values) {
- var continuation = new Continuation();
- return $.extend(true, continuation, values);
- };
-
-} (jQuery));
View
9 src/jquery.continuations/jquery.continuations.csproj
@@ -71,4 +71,13 @@
<Target Name="AfterBuild">
</Target>
-->
+ <ItemGroup>
+ <EmbeddedResource Include="pak-WebContent.zip" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="pak-Data.zip" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="pak-Config.zip" />
+ </ItemGroup>
</Project>
View
BIN src/jquery.continuations/pak-Config.zip
Binary file not shown.
View
BIN src/jquery.continuations/pak-Data.zip
Binary file not shown.
View
BIN src/jquery.continuations/pak-WebContent.zip
Binary file not shown.

0 comments on commit 05a91dc

Please sign in to comment.
Something went wrong with that request. Please try again.