Skip to content

Commit

Permalink
2.3.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
fredpalmer committed Jan 29, 2018
1 parent 390c69e commit a98bc10
Show file tree
Hide file tree
Showing 20 changed files with 168 additions and 112 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Durandal",
"version": "2.2.0",
"version": "2.3.0",
"dependencies": {
"jquery": "^1.9.1",
"jquery": ">=1.9.1",
"knockout": "^3.4.0",
"requirejs": "^2.1.11",
"requirejs-text": "^2.0.12"
Expand Down
4 changes: 2 additions & 2 deletions css/durandal.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!
/*!
* Durandal 2.1.0 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details
Expand Down Expand Up @@ -194,4 +194,4 @@
-moz-animation-name: fadeIn;
-o-animation-name: fadeIn;
animation-name: fadeIn;
}
}
9 changes: 2 additions & 7 deletions js/activator.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The activator module encapsulates all logic related to screen/component activation.
* An activator is essentially an asynchronous state machine that understands a particular state transition protocol.
* The protocol ensures that the following series of events always occur: `canDeactivate` (previous state), `canActivate` (new state), `deactivate` (previous state), `activate` (new state).
Expand Down Expand Up @@ -654,4 +649,4 @@ define(['durandal/system', 'knockout'], function (system, ko) {
};

return activator;
});
});
9 changes: 2 additions & 7 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The app module controls app startup, plugin loading/configuration and root visual display.
* @module app
* @requires system
Expand Down Expand Up @@ -169,4 +164,4 @@ define(['durandal/system', 'durandal/viewEngine', 'durandal/composition', 'duran
Events.includeIn(app);

return app;
});
});
7 changes: 1 addition & 6 deletions js/binder.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The binder joins an object instance and a DOM element tree by applying databinding and/or invoking binding lifecycle callbacks (binding and bindingComplete).
* @module binder
* @requires system
Expand Down
11 changes: 3 additions & 8 deletions js/composition.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
* The composition module encapsulates all functionality related to visual composition.
* @module composition
Expand Down Expand Up @@ -488,7 +483,7 @@ define(['durandal/system', 'durandal/viewLocator', 'durandal/binder', 'durandal/
context.composingNewView = true;
}

tryActivate(context, function () {
ko.ignoreDependencies(tryActivate, null, [context, function () {
if (context.parent.__composition_context == context) {
try {
delete context.parent.__composition_context;
Expand Down Expand Up @@ -540,7 +535,7 @@ define(['durandal/system', 'durandal/viewLocator', 'durandal/binder', 'durandal/
} else {
endComposition(context, element);
}
}, skipActivation, element);
}, skipActivation, element]);
},
/**
* Eecutes the default view location strategy.
Expand Down Expand Up @@ -734,4 +729,4 @@ define(['durandal/system', 'durandal/viewLocator', 'durandal/binder', 'durandal/
ko.virtualElements.allowedBindings.compose = true;

return composition;
});
});
9 changes: 2 additions & 7 deletions js/events.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* Durandal events originate from backbone.js but also combine some ideas from signals.js as well as some additional improvements.
* Events can be installed into any object and are installed into the `app` module by default for convenient app-wide eventing.
* @module events
Expand Down Expand Up @@ -213,4 +208,4 @@ define(['durandal/system'], function (system) {
};

return Events;
});
});
9 changes: 2 additions & 7 deletions js/plugins/dialog.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The dialog module enables the display of message boxes, custom modal dialogs and other overlays or slide-out UI abstractions. Dialogs are constructed by the composition system which interacts with a user defined dialog context. The dialog module enforced the activator lifecycle.
* @module dialog
* @requires system
Expand Down Expand Up @@ -509,7 +504,7 @@ define(['durandal/system', 'durandal/app', 'durandal/composition', 'durandal/act
};

setDialogPosition(child, theDialog);
loadables.load(function () {
loadables.on("load", function () {
setDialogPosition(child, theDialog);
});

Expand Down
15 changes: 6 additions & 9 deletions js/plugins/history.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* This module is based on Backbone's core history support. It abstracts away the low level details of working with browser history and url changes in order to provide a solid foundation for a router.
* @module history
* @requires system
Expand Down Expand Up @@ -186,18 +181,20 @@ define(['durandal/system', 'jquery'], function (system, $) {
*/
history.checkUrl = function() {
var current = history.getFragment();
if (current === history.fragment && history.iframe) {
var currentIsFragment = decodeURIComponent(current) === decodeURIComponent(history.fragment);

if (currentIsFragment && history.iframe) {
current = history.getFragment(history.getHash(history.iframe));
}

if (current === history.fragment) {
if (currentIsFragment) {
return false;
}

if (history.iframe) {
history.navigate(current, false);
}

history.loadUrl();
};

Expand Down
7 changes: 1 addition & 6 deletions js/plugins/http.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* Enables common http request scenarios.
* @module http
* @requires jquery
Expand Down
5 changes: 0 additions & 5 deletions js/plugins/observable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
* Enables automatic observability of plain javascript object for ES5 compatible browsers. Also, converts promise properties into observables that are updated when the promise resolves.
* @module observable
Expand Down
7 changes: 1 addition & 6 deletions js/plugins/router.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* Connects the history module's url and history tracking support to Durandal's activation and composition engine allowing you to easily build navigation-style applications.
* @module router
* @requires system
Expand Down
9 changes: 2 additions & 7 deletions js/plugins/serializer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* Serializes and deserializes data to/from JSON.
* @module serializer
* @requires system
Expand Down Expand Up @@ -145,4 +140,4 @@ define(['durandal/system'], function(system) {
return this.deserialize(this.serialize(obj, settings), settings);
}
};
});
});
9 changes: 2 additions & 7 deletions js/plugins/widget.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* Layers the widget sugar on top of the composition system.
* @module widget
* @requires system
Expand Down Expand Up @@ -192,4 +187,4 @@ define(['durandal/system', 'durandal/composition', 'jquery', 'knockout'], functi
};

return widget;
});
});
7 changes: 1 addition & 6 deletions js/system.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The system module encapsulates the most basic features used by other modules.
* @module system
* @requires require
Expand Down
9 changes: 2 additions & 7 deletions js/transitions/entrance.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Durandal 2.2.0 Copyright (c) 2010-2016 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
/**
* The entrance transition module.
* @module entrance
* @requires system
Expand Down Expand Up @@ -136,4 +131,4 @@ define(['durandal/system', 'durandal/composition', 'jquery'], function(system, c
};

return entrance;
});
});
90 changes: 90 additions & 0 deletions js/transitions/fade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
define(["jquery", "lodash", "durandal/system", "durandal/composition", "services/log"], function($, _, system, composition, Log) {
var log = Log.getLogger(this),
defaults = {
animateHeight: true,
fadeOutDuration: 100,
fadeInDuration: 100,
forceInitialFadeIn: false
};

var transition = function(context) {
return system.defer(function(deferred) {
var fadeOutDuration = context.fadeOutDuration || defaults.fadeOutDuration,
fadeInDuration = context.fadeInDuration || defaults.fadeInDuration,
animateHeight = _.isBoolean(context.animateHeight) ? context.animateHeight : defaults.animateHeight,
forceInitialFadeIn = !!context.forceInitialFadeIn || defaults.forceInitialFadeIn,
$child = $(context.child),
parentHeight = $(context.parent).height(),
targetHeight = $child.height(),
shouldFadeOut = !!context.activeView,
initialStyles = {
display: "block",
opacity: 0
};

if (!context.child) {
$(context.activeView).fadeOut(fadeOutDuration, endTransition);
return;
}

if (animateHeight) {
initialStyles.height = parentHeight || "auto";
}

if (shouldFadeOut) {
var $active = $(context.activeView),
$parent = $(context.parent);

$active.animate({ opacity: 0 }, {
duration: fadeOutDuration,
always: function() {
$parent.css("min-height", $active.height());
$active.css({
display: "none",
opacity: ""
});

$child.css(initialStyles);
$parent.css("min-height", "");

startTransition();
}
});
} else {
$child.css(initialStyles);
startTransition();
}

function startTransition() {
context.triggerAttach();

if (parentHeight === 0 && !forceInitialFadeIn) {
// This is a new view, so don't bother animating it in.
$child.css("opacity", 1);
endTransition();
} else {
var targetStyles = { opacity: 1 },
resetStyles = { opacity: "" };
if (animateHeight) {
targetStyles.height = targetHeight;
resetStyles.height = "auto";
}

$child.animate(targetStyles, {
duration: fadeInDuration,
always: function() {
$child.css(resetStyles);
endTransition();
}
});
}
}

function endTransition() {
deferred.resolve();
}
}).promise();
};

return transition;
});
Loading

0 comments on commit a98bc10

Please sign in to comment.