Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplified transitions implementation and added stylus for vendor pre…

…fix.
  • Loading branch information...
commit d40fa78f68e70bb72fe8a28abb8ea87f3fb0cee5 1 parent f63e258
@kmalakoff authored
Showing with 796 additions and 418 deletions.
  1. +1 −5 Bakefile.coffee
  2. +0 −13 README.md
  3. +1 −0  RELEASE_NOTES.md
  4. +39 −38 examples/vendor/knockback-core-stack-0.16.7.js
  5. +1 −0  index.html
  6. +1 −14 knockback-navigators.css
  7. +0 −1  knockback-page-navigator-panes.min.js
  8. +0 −1  knockback-page-navigator-simple.js
  9. +0 −1  knockback-page-navigator-simple.min.js
  10. +0 −1  knockback-pane-navigator.js
  11. +0 −1  knockback-pane-navigator.min.js
  12. +166 −26 knockback-transitions.css
  13. +42 −23 knockback-transitions.js
  14. +1 −2  knockback-transitions.min.js
  15. +0 −13 packages/npm/README.md
  16. +1 −14 packages/npm/knockback-navigators.css
  17. +0 −1  packages/npm/knockback-page-navigator-panes.js
  18. +0 −1  packages/npm/knockback-page-navigator-panes.min.js
  19. +0 −1  packages/npm/knockback-page-navigator-simple.js
  20. +0 −1  packages/npm/knockback-page-navigator-simple.min.js
  21. +0 −1  packages/npm/knockback-pane-navigator.js
  22. +0 −1  packages/npm/knockback-pane-navigator.min.js
  23. +166 −26 packages/npm/knockback-transitions.css
  24. +42 −23 packages/npm/knockback-transitions.js
  25. +1 −2  packages/npm/knockback-transitions.min.js
  26. +1 −14 packages/nuget/Content/Scripts/knockback-navigators.css
  27. +0 −1  packages/nuget/Content/Scripts/knockback-page-navigator-panes.js
  28. +0 −1  packages/nuget/Content/Scripts/knockback-page-navigator-panes.min.js
  29. +0 −1  packages/nuget/Content/Scripts/knockback-page-navigator-simple.js
  30. +0 −1  packages/nuget/Content/Scripts/knockback-page-navigator-simple.min.js
  31. +0 −1  packages/nuget/Content/Scripts/knockback-pane-navigator.js
  32. +0 −1  packages/nuget/Content/Scripts/knockback-pane-navigator.min.js
  33. +166 −26 packages/nuget/Content/Scripts/knockback-transitions.css
  34. +42 −23 packages/nuget/Content/Scripts/knockback-transitions.js
  35. +1 −2  packages/nuget/Content/Scripts/knockback-transitions.min.js
  36. +1 −1  src/knockback-pane-navigator/knockback-pane-navigator.coffee
  37. +2 −0  src/knockback-transitions/component-imports.coffee
  38. +4 −1 src/knockback-transitions/css-transition-fade-in.coffee
  39. +8 −5 src/knockback-transitions/fallback-transition-fade-in.coffee
  40. +0 −2  src/knockback-transitions/fallback-transition-helpers.coffee
  41. +6 −5 src/knockback-transitions/fallback-transition-slide-up.coffee
  42. +5 −3 src/knockback-transitions/fallback-transition-slide.coffee
  43. +15 −5 src/knockback-transitions/knockback-transitions.styl
  44. +4 −2 src/knockback-transitions/transition-helpers.coffee
  45. +1 −1  src/knockback-transitions/transition-saved-state.coffee
  46. +0 −18 src/shared/knockback-page-navigators.css
  47. +0 −18 src/shared/knockback-panes.css
  48. +39 −38 test/vendor/knockback-core-0.16.7.js
  49. +39 −38 test/vendor/knockback-core-stack-0.16.7.js
View
6 Bakefile.coffee
@@ -56,14 +56,10 @@ module.exports =
'src/knockback-transitions/fallback-transition-fade-in.coffee'
'src/knockback-transitions/fallback-transition-slide.coffee'
]
- commands: [
- 'stylus --use nib --out . src/knockback-transitions/knockback-transitions.styl'
- ]
knockback_navigators_css:
commands: [
- 'cat src/shared/knockback-page-navigators.css src/shared/knockback-panes.css > knockback-navigators.css'
- 'cp src/knockback-transitions/knockback-transitions.css knockback-transitions.css'
+ 'stylus --use nib --out . src/knockback-transitions/knockback-transitions.styl'
]
publishing:
View
13 README.md
@@ -121,19 +121,6 @@ router.route('', null, page_navigator.dispatcher(function(){
...
```
-With options:
-
-```
-...
-router.route('', null, page_navigator.dispatcher(function(){
- page_navigator.loadPage({
- el: kb.renderTemplate('page', new PageViewModel(pages.get('main'))),
- transition: {name: 'FadeIn', duration: 1000}
- });
-}));
-...
-```
-
With buttons (HTML):
```
View
1  RELEASE_NOTES.md
@@ -2,6 +2,7 @@ Please refer to the following release notes when upgrading your version of Knock
## 0.1.2
+* introduced css optimized transitions - now the transitions module is knockback-transitions instead of knockback-sample-transitions. Removed optoins from animations -> should all be possible to set using css classes.
* made pane navigator check for DOM changes using setInterval to ensure an active element is always present.
* introduced css transitions and renamed sample-transtions-jquery to default-transitions
* made TransitionSavedState internal to pane navigators and automatically save and restore
View
77 examples/vendor/knockback-core-stack-0.16.7.js
@@ -6475,7 +6475,7 @@ kb.Store = (function() {
return;
}
kb.utils.wrappedObject(observable, obj);
- options.no_share || obj || (observable.__kb_null = true);
+ obj || (observable.__kb_null = true);
creator = options.creator ? options.creator : (options.path && options.factory ? options.factory.creatorForPath(obj, options.path) : null);
if (!creator) {
creator = observable.constructor;
@@ -6871,7 +6871,7 @@ kb.Observable = (function() {
model_watcher = create_options.model_watcher;
delete create_options.model_watcher;
this.vo = ko.observable(null);
- this._mdl = ko.observable();
+ this._model = ko.observable();
observable = kb.utils.wrappedObservable(this, ko.dependentObservable({
read: function() {
var arg, args, current_model, new_value, _i, _len, _ref;
@@ -6887,7 +6887,7 @@ kb.Observable = (function() {
args.push(ko.utils.unwrapObservable(_this.args));
}
}
- if ((current_model = _this._mdl())) {
+ if ((current_model = _this._model())) {
new_value = _this.read ? _this.read.apply(_this.vm, args) : current_model.get.apply(current_model, args);
_this.update(new_value);
}
@@ -6910,7 +6910,7 @@ kb.Observable = (function() {
args.push(ko.utils.unwrapObservable(_this.args));
}
}
- if ((current_model = _this._mdl())) {
+ if ((current_model = _this._model())) {
if (_this.write) {
_this.write.apply(_this.vm, args);
} else {
@@ -6936,13 +6936,13 @@ kb.Observable = (function() {
observable.destroy = _.bind(this.destroy, this);
observable.model = this.model = ko.dependentObservable({
read: function() {
- return _this._mdl();
+ return _this._model();
},
write: function(new_model) {
- if (_this.__kb_destroyed || (_this._mdl() === new_model)) {
+ if (_this.__kb_destroyed || (_this._model() === new_model)) {
return;
}
- _this._mdl(new_model);
+ _this._model(new_model);
return _this.update();
}
});
@@ -6983,7 +6983,7 @@ kb.Observable = (function() {
Observable.prototype.valueType = function() {
var model, new_value;
- new_value = (model = this._mdl()) ? model.get(this.key) : null;
+ new_value = (model = this._model()) ? model.get(this.key) : null;
this.value_type || this._updateValueObservable(new_value);
return this.value_type;
};
@@ -6993,7 +6993,7 @@ kb.Observable = (function() {
if (this.__kb_destroyed) {
return;
}
- if ((model = this._mdl()) && !arguments.length) {
+ if ((model = this._model()) && !arguments.length) {
new_value = model.get(ko.utils.unwrapObservable(this.key));
}
(new_value !== void 0) || (new_value = null);
@@ -7031,7 +7031,7 @@ kb.Observable = (function() {
Observable.prototype._updateValueObservable = function(new_value) {
var create_options, creator, previous_value, value;
create_options = this.create_options;
- create_options.creator = kb.utils.inferCreator(new_value, create_options.factory, create_options.path, this._mdl(), this.key);
+ create_options.creator = kb.utils.inferCreator(new_value, create_options.factory, create_options.path, this._model(), this.key);
this.value_type = KB_TYPE_UNKNOWN;
creator = create_options.creator;
previous_value = this.__kb_value;
@@ -7296,18 +7296,18 @@ kb.CollectionObservable = (function() {
this.__kb._onCollectionChange = _.bind(this._onCollectionChange, this);
options = collapseOptions(options);
if (options.sort_attribute) {
- this.sorted_index_fn = ko.observable(this._sortAttributeFn(options.sort_attribute));
+ this._sorted_index = ko.observable(this._sortAttributeFn(options.sort_attribute));
} else {
if (options.sorted_index) {
legacyWarning(this, '0.16.3', 'use sorted_index_fn instead');
options.sorted_index_fn = options.sorted_index;
}
- this.sorted_index_fn = ko.observable(options.sorted_index_fn);
+ this._sorted_index = ko.observable(options.sorted_index_fn);
}
if (options.filters) {
- this.filters = ko.observableArray(_.isArray(options.filters) ? options.filters : options.filters ? [options.filters] : void 0);
+ this._filters = ko.observableArray(_.isArray(options.filters) ? options.filters : options.filters ? [options.filters] : void 0);
} else {
- this.filters = ko.observableArray([]);
+ this._filters = ko.observableArray([]);
}
create_options = this.create_options = {
store: kb.Store.useOptionsOrCreate(options, collection, observable)
@@ -7321,21 +7321,22 @@ kb.CollectionObservable = (function() {
}
observable.destroy = _.bind(this.destroy, this);
observable.shareOptions = _.bind(this.shareOptions, this);
- observable.viewModelByModel = _.bind(this.viewModelByModel, this);
+ observable.filters = _.bind(this.filters, this);
observable.sortedIndex = _.bind(this.sortedIndex, this);
observable.sortAttribute = _.bind(this.sortAttribute, this);
+ observable.viewModelByModel = _.bind(this.viewModelByModel, this);
observable.hasViewModels = _.bind(this.hasViewModels, this);
- this._col = ko.observable(collection);
+ this._collection = ko.observable(collection);
observable.collection = this.collection = ko.dependentObservable({
read: function() {
- return _this._col();
+ return _this._collection();
},
write: function(new_collection) {
var previous_collection;
- if ((previous_collection = _this._col()) === new_collection) {
+ if ((previous_collection = _this._collection()) === new_collection) {
return;
}
- _this._col(new_collection);
+ _this._collection(new_collection);
if (previous_collection) {
previous_collection.unbind('all', _this.__kb._onCollectionChange);
}
@@ -7353,12 +7354,12 @@ kb.CollectionObservable = (function() {
return;
}
observable = kb.utils.wrappedObservable(_this);
- current_collection = _this._col();
+ current_collection = _this._collection();
if (current_collection) {
models = current_collection.models;
}
- sorted_index_fn = _this.sorted_index_fn();
- filters = _this.filters();
+ sorted_index_fn = _this._sorted_index();
+ filters = _this._filters();
if (!models || (current_collection.models.length === 0)) {
view_models = [];
} else {
@@ -7396,7 +7397,7 @@ kb.CollectionObservable = (function() {
CollectionObservable.prototype.destroy = function() {
var array, collection, observable;
observable = kb.utils.wrappedObservable(this);
- collection = this._col();
+ collection = this._collection();
if (collection) {
collection.unbind('all', this.__kb._onCollectionChange);
array = observable();
@@ -7404,7 +7405,7 @@ kb.CollectionObservable = (function() {
}
this._mapper.dispose();
this.collection.dispose();
- kb.release(this.filters);
+ kb.release(this._filters);
observable.collection = null;
kb.utils.wrappedDestroy(this);
return !kb.statistics || kb.statistics.unregister('CollectionObservable', this);
@@ -7421,18 +7422,18 @@ kb.CollectionObservable = (function() {
CollectionObservable.prototype.filters = function(filters) {
if (filters) {
- return this.filters(_.isArray(filters) ? filters : [filters]);
+ return this._filters(_.isArray(filters) ? filters : [filters]);
} else {
- return this.filters([]);
+ return this._filters([]);
}
};
CollectionObservable.prototype.sortedIndex = function(sorted_index_fn) {
- return this.sorted_index_fn(sorted_index_fn);
+ return this._sorted_index(sorted_index_fn);
};
CollectionObservable.prototype.sortAttribute = function(sort_attribute) {
- return this.sorted_index_fn(sort_attribute ? this._sortAttributeFn(sort_attribute) : null);
+ return this._sorted_index(sort_attribute ? this._sortAttributeFn(sort_attribute) : null);
};
CollectionObservable.prototype.viewModelByModel = function(model) {
@@ -7498,19 +7499,19 @@ kb.CollectionObservable = (function() {
switch (event) {
case 'reset':
case 'resort':
- if (event === 'resort' && !this.sorted_index_fn()) {
+ if (event === 'resort' && !this._sorted_index()) {
return;
}
- return this._col.notifySubscribers(this._col());
+ return this._collection.notifySubscribers(this._collection());
case 'new':
case 'add':
if (this._modelIsFiltered(arg)) {
return;
}
observable = kb.utils.wrappedObservable(this);
- collection = this._col();
+ collection = this._collection();
view_model = this._createViewModel(arg);
- if ((sorted_index_fn = this.sorted_index_fn())) {
+ if ((sorted_index_fn = this._sorted_index())) {
add_index = sorted_index_fn(observable(), view_model);
} else {
add_index = collection.indexOf(arg);
@@ -7524,7 +7525,7 @@ kb.CollectionObservable = (function() {
case 'change':
if (this._modelIsFiltered(arg)) {
return this._onModelRemove(arg);
- } else if (this.sorted_index_fn()) {
+ } else if (this._sorted_index()) {
return this._onModelResort(arg);
}
}
@@ -7547,12 +7548,12 @@ kb.CollectionObservable = (function() {
observable = kb.utils.wrappedObservable(this);
view_model = this.models_only ? model : this.viewModelByModel(model);
previous_index = observable.indexOf(view_model);
- if ((sorted_index_fn = this.sorted_index_fn())) {
+ if ((sorted_index_fn = this._sorted_index())) {
sorted_view_models = _.clone(observable());
sorted_view_models.splice(previous_index, 1);
new_index = sorted_index_fn(sorted_view_models, view_model);
} else {
- new_index = this._col().indexOf(model);
+ new_index = this._collection().indexOf(model);
}
if (previous_index === new_index) {
return;
@@ -7570,7 +7571,7 @@ kb.CollectionObservable = (function() {
return;
}
observable = kb.utils.wrappedObservable(this);
- collection = this._col();
+ collection = this._collection();
if (!collection || (collection.models === models)) {
return;
}
@@ -7593,7 +7594,7 @@ kb.CollectionObservable = (function() {
});
}
}
- if (this.filters().length) {
+ if (this._filters().length) {
models = _.filter(models, function(model) {
return !_this._modelIsFiltered(model);
});
@@ -7633,7 +7634,7 @@ kb.CollectionObservable = (function() {
CollectionObservable.prototype._modelIsFiltered = function(model) {
var filter, filters, _i, _len;
- filters = this.filters();
+ filters = this._filters();
for (_i = 0, _len = filters.length; _i < _len; _i++) {
filter = filters[_i];
filter = ko.utils.unwrapObservable(filter);
View
1  index.html
@@ -8,6 +8,7 @@
<link rel="stylesheet" href="examples/vendor/normalize.css">
<link rel="stylesheet" href="examples/vendor/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="knockback-navigators.css">
+ <link rel="stylesheet" href="knockback-transitions.css">
<style type="text/css">
.pane-navigator.page {top: 80px;} /* offset the page to start after the fixed-position header */
View
15 knockback-navigators.css
@@ -1,5 +1,5 @@
/*
- knockback-page-navigators.css 0.1.1
+ knockback-navigators.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -9,19 +9,6 @@
position: relative;
}
-.pane-navigator.page {
- overflow: visible; /* will resize the browser window */
-}
-
-.pane-navigator.page.embed {
- overflow: hidden; /* will stay in its pane instead of resizing the page */
-}
-/*
- knockback-panes.css 0.1.1
- (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
- License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/
.pane {
padding: 0; margin: 0; width: 100%; /* panes take up their pane-navigator */
display: none; /* panes are not visible by default */
View
1  knockback-page-navigator-panes.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-panes.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-panes",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),r.PageNavigatorPanes=function(){function e(e,t){t==null&&(t={}),e||o(this,"el"),a.bindAll(this,"hasHistory","activePage","previousPage","activeUrl","loadPage","goBack","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.pane_navigator=new r.PaneNavigator(e,t)}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.pane_navigator.destroy(),this.pane_navigator=null},e.prototype.hasHistory=function(){return!this.pane_navigator.no_history},e.prototype.activePage=function(){return this.pane_navigator.activePane()},e.prototype.activeUrl=function(){var e;return(e=this.pane_navigator.activePane())?e.url:null},e.prototype.previousPage=function(){return this.pane_navigator.previousPane()},e.prototype.previousUrl=function(){var e;return(e=this.pane_navigator.previousPage())?e.url:null},e.prototype.loadPage=function(e){var t,n;return e||o(this,"page info"),n=r.popOverrideTransition(),this.activeUrl()===window.location.hash?(t=this.activePage(),t.el||pane_navigator.ensureElement(t),t.el.parentNode!==this.el&&this.el.appendChild(t.el),t):this.pane_navigator.push(new r.Pane(e,window.location.hash),n?{transition:n}:null)},e.prototype.goBack=function(){var e,t;return t=r.popOverrideTransition(),this.pane_navigator.pop(),!(e=this.pane_navigator.activePane())||r.loadUrl(e.url),e},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r,i,s;s=window.location.hash;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if((i=this.previousPage())&&i.url===s)return this.goBack();if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorPanes=r.PageNavigatorPanes),i&&i.bindingHandlers&&(i.bindingHandlers.PageNavigatorPanes={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PageNavigatorPanes(e,o),r.utils.wrappedPageNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),r.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.override_transitions=[],r.popOverrideTransition=function(){return r.override_transitions.length?r.override_transitions.pop():null},r.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},r.loadUrl=function(e,t){return r.override_transitions.push(t),r.dispatchUrl(e)},r.loadUrlFn=function(e,t){return function(n,i){r.loadUrl(e,t),!n||!n.stopPropagation||(i=n),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},r.utils||(r.utils={}),r.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
1  knockback-page-navigator-simple.js
@@ -2,7 +2,6 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  knockback-page-navigator-simple.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-simple",e):e.call(this)}(function(){var e,t,n,r,i,s;r=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is missing"},i=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(o){({})}this.kb||(this.kb=t||(t={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{n=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(o){({})}return n||(n={}),n.observable||(n.dataFor=function(e){return null},n.removeNode=function(e){return $(e).remove()},n.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},n.observableArray=function(e){var t;return t=n.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),s=this._?this._:t._?t._:{},s.bindAll||(e=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},s.bindAll=function(t,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],e(t,r)}),s.isElement||(s.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),t.PageNavigatorSimple=function(){function e(e,t){this.options=t!=null?t:{},e||r(this,"el"),s.bindAll(this,"hasHistory","activePage","activeUrl","loadPage","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.active_page=n.observable()}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.active_page=null},e.prototype.hasHistory=function(){return!1},e.prototype.activePage=function(){return this.active_page()},e.prototype.activeUrl=function(){var e;return(e=this.active_page())?e.url:null},e.prototype.loadPage=function(e){var n,i;return e||r(this,"page info"),this.activeUrl()===window.location.hash?(n=this.activePage(),n.el||pane_navigator.ensureElement(n),n.el.parentNode!==this.el&&this.el.appendChild(n.el),n):((i=this.activePage())&&i.destroy(this.options),n=new t.Pane(e,window.location.hash),n.activate(this.el),this.active_page(n),n)},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorSimple=t.PageNavigatorSimple),n&&n.bindingHandlers&&(n.bindingHandlers.PageNavigatorSimple={init:function(e,r,i,s){var o,u;return o=n.utils.unwrapObservable(r()),"no_remove"in o||(o.no_remove=!0),u=new t.PageNavigatorSimple(e,o),t.utils.wrappedPageNavigator(e,u),n.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),t.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),t.override_transitions=[],t.popOverrideTransition=function(){return t.override_transitions.length?t.override_transitions.pop():null},t.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},t.loadUrl=function(e,n){return t.override_transitions.push(n),t.dispatchUrl(e)},t.loadUrlFn=function(e,n){return function(r,i){t.loadUrl(e,n),!r||!r.stopPropagation||(i=r),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},t.utils||(t.utils={}),t.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},t.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(s.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||r(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||r(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(n.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=t.Pane),t})}).call(this);
View
1  knockback-pane-navigator.js
@@ -2,7 +2,6 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  knockback-pane-navigator.min.js
@@ -2,5 +2,4 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-pane-navigator",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
192 knockback-transitions.css
@@ -2,10 +2,10 @@
knockback-tranitions.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
+ Port of jQueryMobile transitions (https://github.com/jquery/jquery-mobile) to stylus for auto generation of vendor prefixes.
*/
.in-transition {
-/* pointer-events: none;*/
+ pointer-events: none;
position: absolute;
}
.in {
@@ -32,50 +32,60 @@
-ms-animation-duration: 225ms;
animation-duration: 225ms;
}
--keyframes fadein from {
+.fade.out {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadeout;
+ -moz-animation-name: fadeout;
+ -o-animation-name: fadeout;
+ -ms-animation-name: fadeout;
+ animation-name: fadeout;
}
--keyframes fadein to {
- opacity: 1;
- -ms-filter: none;
- filter: none;
-}
--keyframes fadeout from {
+.fade.in {
opacity: 1;
-ms-filter: none;
filter: none;
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadein;
+ -moz-animation-name: fadein;
+ -o-animation-name: fadein;
+ -ms-animation-name: fadein;
+ animation-name: fadein;
}
--keyframes fadeout to {
- opacity: 0;
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
- filter: alpha(opacity=0);
-}
-.fade.out {
+.fade.out.slow {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
- -webkit-animation-duration: 125ms;
- -moz-animation-duration: 125ms;
- -o-animation-duration: 125ms;
- -ms-animation-duration: 125ms;
- animation-duration: 125ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadeout;
-moz-animation-name: fadeout;
-o-animation-name: fadeout;
-ms-animation-name: fadeout;
animation-name: fadeout;
}
-.fade.in {
+.fade.in.slow {
opacity: 1;
-ms-filter: none;
filter: none;
- -webkit-animation-duration: 225ms;
- -moz-animation-duration: 225ms;
- -o-animation-duration: 225ms;
- -ms-animation-duration: 225ms;
- animation-duration: 225ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadein;
-moz-animation-name: fadein;
-o-animation-name: fadein;
@@ -392,6 +402,136 @@
-ms-animation-duration: 200ms;
animation-duration: 200ms;
}
+@-moz-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-webkit-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-o-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-ms-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-moz-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-webkit-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-o-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-ms-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
@-moz-keyframes popin {
0% {
-webkit-transform: scale(0.8);
View
65 knockback-transitions.js
@@ -2,7 +2,6 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
@@ -15,7 +14,7 @@
return factory.call(this);
}
})(function() {// Generated by CoffeeScript 1.3.3
-var FALLBACK_ANIMATION_DURATION, extractStyles, kb, wrapAnimCallback, _anim_fn;
+var extractStyles, isElement, kb, wrapAnimCallback, _anim_fn;
try {
this.kb = kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.kb;
@@ -25,10 +24,16 @@ try {
this.kb || (this.kb = kb || (kb = {}));
+isElement = function(obj) {
+ return obj && (obj.nodeType === 1);
+};
+
kb.transitions || (kb.transitions = {});
kb.fallback_transitions || (kb.fallback_transitions = {});
+kb.MAX_TRANSITION = 800;
+
kb.transitions.END_EVENT = (function() {
var END_EVENT_NAMES, el, event, style;
el = document.createElement('knockback');
@@ -61,10 +66,9 @@ $.fn.startTransition = function(classes, callback) {
_this.off(kb.transitions.END_EVENT, cleanupCallback);
return !callback || callback();
};
- this.removeClass(classes);
this.one(kb.transitions.END_EVENT, cleanupCallback);
this.addClass(classes);
- setTimeout(cleanupCallback, 300);
+ setTimeout(cleanupCallback, kb.MAX_TRANSITION);
};
$.fn.stopTransition = function() {
@@ -92,7 +96,7 @@ kb.TransitionSavedState = (function() {
this.el_states = [];
for (name in info) {
el = info[name];
- !_.isElement(el) || this.el_states.push({
+ !isElement(el) || this.el_states.push({
el: el,
className: el.className,
cssText: el.style.cssText
@@ -132,11 +136,16 @@ kb.transitions.SlideUp = function(info, options) {
};
kb.transitions.FadeIn = function(info, options) {
- var $to;
+ var $to, classes;
$to = $(info.to).css({
'min-height': $(info.container).height()
});
- $to.startTransition((options.forward ? 'on-top fade in' : 'on-top fade out'), info.callback);
+ classes = 'on-top fade';
+ classes += (options.forward ? ' in' : ' out');
+ if (options.slow) {
+ classes += ' slow';
+ }
+ $to.startTransition(classes, info.callback);
};
kb.transitions.Slide = function(info, options) {
@@ -161,8 +170,6 @@ kb.transitions.Slide = function(info, options) {
}
};
-FALLBACK_ANIMATION_DURATION = kb.FALLBACK_ANIMATION_DURATION = 300;
-
if (this.Zepto) {
wrapAnimCallback = function(el, properties, callback) {
el.__kb_zepto_endEvent = typeof properties === 'string' ? $.fx.animationEnd : $.fx.transitionEnd;
@@ -198,8 +205,10 @@ if (this.Zepto) {
};
}
+kb.SLIDE_UP_DURATION = 300;
+
kb.fallback_transitions.SlideUp = function(info, options) {
- var $to, callback, duration, height, top;
+ var $to, callback, height, top;
if (!info.from) {
info.callback();
return;
@@ -207,9 +216,9 @@ kb.fallback_transitions.SlideUp = function(info, options) {
$to = $(info.to);
callback = function() {
$to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
height = info.container.clientHeight;
top = info.to.clientTop;
if (options.forward) {
@@ -217,39 +226,48 @@ kb.fallback_transitions.SlideUp = function(info, options) {
top: top + height
}).animate({
top: top
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
} else {
$to.addClass('on-top').animate({
top: top + height
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
}
- $to.startTransition(callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.FADE_IN_DURATION = 300;
+
kb.fallback_transitions.FadeIn = function(info, options) {
- var $to, duration;
- $to = $(info.to).css({
+ var $to, callback;
+ $to = $(info.to);
+ callback = function() {
+ $to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
+ return info.callback();
+ };
+ $to.css({
'min-height': $(info.container).height()
});
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
if (options.forward) {
$to.css({
'opacity': 0
});
$to.animate({
'opacity': 1
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
} else {
$to.css({
'opacity': 1
});
$to.animate({
'opacity': 0
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
}
- $to.startTransition(info.callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.SLIDE_DURATION = 300;
+
kb.fallback_transitions.Slide = function(info, options) {
var $from, $to, callback, duration, from_left, to_left, width;
if (!info.from) {
@@ -259,12 +277,13 @@ kb.fallback_transitions.Slide = function(info, options) {
$to = $(info.to);
$from = $(info.from);
callback = function() {
- $from.stop();
$to.stop();
+ $from.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
width = $(info.container).width();
+ duration = kb.SLIDE_DURATION;
if (options.forward) {
$from.animate({
left: info.from.clientLeft - width
@@ -286,7 +305,7 @@ kb.fallback_transitions.Slide = function(info, options) {
left: info.to.clientLeft + width
}, duration, 'linear', callback);
}
- return $to.startTransition(callback);
+ return $to.one(kb.transitions.END_EVENT, callback);
};
return;
View
3  knockback-transitions.min.js
@@ -2,5 +2,4 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.removeClass(e),this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,300)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},t=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var t,n;this.el_states=[];for(n in e)t=e[n],!_.isElement(t)||this.el_states.push({el:t,className:t.className,cssText:t.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n;n=$(e.to).css({"min-height":$(e.container).height()}),n.startTransition(t.forward?"on-top fade in":"on-top fade out",e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},e=n.FALLBACK_ANIMATION_DURATION=300,this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.fallback_transitions.SlideUp=function(t,n){var r,i,s,o,u;if(!t.from){t.callback();return}r=$(t.to),i=function(){return r.stop(),t.callback()},s="duration"in n?n.duration:e,o=t.container.clientHeight,u=t.to.clientTop,n.forward?r.addClass("on-top").css({top:u+o}).animate({top:u},s,"linear",i):r.addClass("on-top").animate({top:u+o},s,"linear",i),r.startTransition(i)},n.fallback_transitions.FadeIn=function(t,n){var r,i;r=$(t.to).css({"min-height":$(t.container).height()}),i="duration"in n?n.duration:e,n.forward?(r.css({opacity:0}),r.animate({opacity:1},1e3,"swing",t.callback)):(r.css({opacity:1}),r.animate({opacity:0},1e3,"swing",t.callback)),r.startTransition(t.callback)},n.fallback_transitions.Slide=function(t,n){var r,i,s,o,u,a,f;if(!t.from){t.callback();return}return i=$(t.to),r=$(t.from),s=function(){return r.stop(),i.stop(),t.callback()},o="duration"in n?n.duration:e,f=$(t.container).width(),n.forward?(r.animate({left:t.from.clientLeft-f},o,"linear"),a=t.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=t.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:t.to.clientLeft+f},o,"linear",s)),i.startTransition(s)};return})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),t=function(e){return e&&e.nodeType===1},n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.MAX_TRANSITION=800,n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,n.MAX_TRANSITION)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},e=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var n,r;this.el_states=[];for(r in e)n=e[r],!t(n)||this.el_states.push({el:n,className:n.className,cssText:n.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n,r;n=$(e.to).css({"min-height":$(e.container).height()}),r="on-top fade",r+=t.forward?" in":" out",t.slow&&(r+=" slow"),n.startTransition(r,e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.SLIDE_UP_DURATION=300,n.fallback_transitions.SlideUp=function(e,t){var r,i,s,o;if(!e.from){e.callback();return}r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},s=e.container.clientHeight,o=e.to.clientTop,t.forward?r.addClass("on-top").css({top:o+s}).animate({top:o},n.SLIDE_UP_DURATION,"linear",i):r.addClass("on-top").animate({top:o+s},n.SLIDE_UP_DURATION,"linear",i),r.one(n.transitions.END_EVENT,i)},n.FADE_IN_DURATION=300,n.fallback_transitions.FadeIn=function(e,t){var r,i;r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},r.css({"min-height":$(e.container).height()}),t.forward?(r.css({opacity:0}),r.animate({opacity:1},n.FADE_IN_DURATION,"swing",e.callback)):(r.css({opacity:1}),r.animate({opacity:0},n.FADE_IN_DURATION,"swing",e.callback)),r.one(n.transitions.END_EVENT,i)},n.SLIDE_DURATION=300,n.fallback_transitions.Slide=function(e,t){var r,i,s,o,u,a,f;if(!e.from){e.callback();return}return i=$(e.to),r=$(e.from),s=function(){return i.stop(),r.stop(),i.off(n.transitions.END_EVENT,s),e.callback()},f=$(e.container).width(),o=n.SLIDE_DURATION,t.forward?(r.animate({left:e.from.clientLeft-f},o,"linear"),a=e.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=e.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:e.to.clientLeft+f},o,"linear",s)),i.one(n.transitions.END_EVENT,s)};return})}).call(this);
View
13 packages/npm/README.md
@@ -121,19 +121,6 @@ router.route('', null, page_navigator.dispatcher(function(){
...
```
-With options:
-
-```
-...
-router.route('', null, page_navigator.dispatcher(function(){
- page_navigator.loadPage({
- el: kb.renderTemplate('page', new PageViewModel(pages.get('main'))),
- transition: {name: 'FadeIn', duration: 1000}
- });
-}));
-...
-```
-
With buttons (HTML):
```
View
15 packages/npm/knockback-navigators.css
@@ -1,5 +1,5 @@
/*
- knockback-page-navigators.css 0.1.1
+ knockback-navigators.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -9,19 +9,6 @@
position: relative;
}
-.pane-navigator.page {
- overflow: visible; /* will resize the browser window */
-}
-
-.pane-navigator.page.embed {
- overflow: hidden; /* will stay in its pane instead of resizing the page */
-}
-/*
- knockback-panes.css 0.1.1
- (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
- License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/
.pane {
padding: 0; margin: 0; width: 100%; /* panes take up their pane-navigator */
display: none; /* panes are not visible by default */
View
1  packages/npm/knockback-page-navigator-panes.js
@@ -2,7 +2,6 @@
knockback-page-navigator-panes.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/npm/knockback-page-navigator-panes.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-panes.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-panes",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),r.PageNavigatorPanes=function(){function e(e,t){t==null&&(t={}),e||o(this,"el"),a.bindAll(this,"hasHistory","activePage","previousPage","activeUrl","loadPage","goBack","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.pane_navigator=new r.PaneNavigator(e,t)}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.pane_navigator.destroy(),this.pane_navigator=null},e.prototype.hasHistory=function(){return!this.pane_navigator.no_history},e.prototype.activePage=function(){return this.pane_navigator.activePane()},e.prototype.activeUrl=function(){var e;return(e=this.pane_navigator.activePane())?e.url:null},e.prototype.previousPage=function(){return this.pane_navigator.previousPane()},e.prototype.previousUrl=function(){var e;return(e=this.pane_navigator.previousPage())?e.url:null},e.prototype.loadPage=function(e){var t,n;return e||o(this,"page info"),n=r.popOverrideTransition(),this.activeUrl()===window.location.hash?(t=this.activePage(),t.el||pane_navigator.ensureElement(t),t.el.parentNode!==this.el&&this.el.appendChild(t.el),t):this.pane_navigator.push(new r.Pane(e,window.location.hash),n?{transition:n}:null)},e.prototype.goBack=function(){var e,t;return t=r.popOverrideTransition(),this.pane_navigator.pop(),!(e=this.pane_navigator.activePane())||r.loadUrl(e.url),e},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r,i,s;s=window.location.hash;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if((i=this.previousPage())&&i.url===s)return this.goBack();if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorPanes=r.PageNavigatorPanes),i&&i.bindingHandlers&&(i.bindingHandlers.PageNavigatorPanes={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PageNavigatorPanes(e,o),r.utils.wrappedPageNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),r.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.override_transitions=[],r.popOverrideTransition=function(){return r.override_transitions.length?r.override_transitions.pop():null},r.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},r.loadUrl=function(e,t){return r.override_transitions.push(t),r.dispatchUrl(e)},r.loadUrlFn=function(e,t){return function(n,i){r.loadUrl(e,t),!n||!n.stopPropagation||(i=n),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},r.utils||(r.utils={}),r.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
1  packages/npm/knockback-page-navigator-simple.js
@@ -2,7 +2,6 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/npm/knockback-page-navigator-simple.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-simple",e):e.call(this)}(function(){var e,t,n,r,i,s;r=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is missing"},i=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(o){({})}this.kb||(this.kb=t||(t={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{n=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(o){({})}return n||(n={}),n.observable||(n.dataFor=function(e){return null},n.removeNode=function(e){return $(e).remove()},n.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},n.observableArray=function(e){var t;return t=n.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),s=this._?this._:t._?t._:{},s.bindAll||(e=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},s.bindAll=function(t,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],e(t,r)}),s.isElement||(s.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),t.PageNavigatorSimple=function(){function e(e,t){this.options=t!=null?t:{},e||r(this,"el"),s.bindAll(this,"hasHistory","activePage","activeUrl","loadPage","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.active_page=n.observable()}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.active_page=null},e.prototype.hasHistory=function(){return!1},e.prototype.activePage=function(){return this.active_page()},e.prototype.activeUrl=function(){var e;return(e=this.active_page())?e.url:null},e.prototype.loadPage=function(e){var n,i;return e||r(this,"page info"),this.activeUrl()===window.location.hash?(n=this.activePage(),n.el||pane_navigator.ensureElement(n),n.el.parentNode!==this.el&&this.el.appendChild(n.el),n):((i=this.activePage())&&i.destroy(this.options),n=new t.Pane(e,window.location.hash),n.activate(this.el),this.active_page(n),n)},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorSimple=t.PageNavigatorSimple),n&&n.bindingHandlers&&(n.bindingHandlers.PageNavigatorSimple={init:function(e,r,i,s){var o,u;return o=n.utils.unwrapObservable(r()),"no_remove"in o||(o.no_remove=!0),u=new t.PageNavigatorSimple(e,o),t.utils.wrappedPageNavigator(e,u),n.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),t.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),t.override_transitions=[],t.popOverrideTransition=function(){return t.override_transitions.length?t.override_transitions.pop():null},t.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},t.loadUrl=function(e,n){return t.override_transitions.push(n),t.dispatchUrl(e)},t.loadUrlFn=function(e,n){return function(r,i){t.loadUrl(e,n),!r||!r.stopPropagation||(i=r),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},t.utils||(t.utils={}),t.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},t.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(s.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||r(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||r(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(n.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=t.Pane),t})}).call(this);
View
1  packages/npm/knockback-pane-navigator.js
@@ -2,7 +2,6 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/npm/knockback-pane-navigator.min.js
@@ -2,5 +2,4 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-pane-navigator",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
192 packages/npm/knockback-transitions.css
@@ -2,10 +2,10 @@
knockback-tranitions.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
+ Port of jQueryMobile transitions (https://github.com/jquery/jquery-mobile) to stylus for auto generation of vendor prefixes.
*/
.in-transition {
-/* pointer-events: none;*/
+ pointer-events: none;
position: absolute;
}
.in {
@@ -32,50 +32,60 @@
-ms-animation-duration: 225ms;
animation-duration: 225ms;
}
--keyframes fadein from {
+.fade.out {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadeout;
+ -moz-animation-name: fadeout;
+ -o-animation-name: fadeout;
+ -ms-animation-name: fadeout;
+ animation-name: fadeout;
}
--keyframes fadein to {
- opacity: 1;
- -ms-filter: none;
- filter: none;
-}
--keyframes fadeout from {
+.fade.in {
opacity: 1;
-ms-filter: none;
filter: none;
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadein;
+ -moz-animation-name: fadein;
+ -o-animation-name: fadein;
+ -ms-animation-name: fadein;
+ animation-name: fadein;
}
--keyframes fadeout to {
- opacity: 0;
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
- filter: alpha(opacity=0);
-}
-.fade.out {
+.fade.out.slow {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
- -webkit-animation-duration: 125ms;
- -moz-animation-duration: 125ms;
- -o-animation-duration: 125ms;
- -ms-animation-duration: 125ms;
- animation-duration: 125ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadeout;
-moz-animation-name: fadeout;
-o-animation-name: fadeout;
-ms-animation-name: fadeout;
animation-name: fadeout;
}
-.fade.in {
+.fade.in.slow {
opacity: 1;
-ms-filter: none;
filter: none;
- -webkit-animation-duration: 225ms;
- -moz-animation-duration: 225ms;
- -o-animation-duration: 225ms;
- -ms-animation-duration: 225ms;
- animation-duration: 225ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadein;
-moz-animation-name: fadein;
-o-animation-name: fadein;
@@ -392,6 +402,136 @@
-ms-animation-duration: 200ms;
animation-duration: 200ms;
}
+@-moz-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-webkit-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-o-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-ms-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-moz-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-webkit-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-o-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-ms-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
@-moz-keyframes popin {
0% {
-webkit-transform: scale(0.8);
View
65 packages/npm/knockback-transitions.js
@@ -2,7 +2,6 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
@@ -15,7 +14,7 @@
return factory.call(this);
}
})(function() {// Generated by CoffeeScript 1.3.3
-var FALLBACK_ANIMATION_DURATION, extractStyles, kb, wrapAnimCallback, _anim_fn;
+var extractStyles, isElement, kb, wrapAnimCallback, _anim_fn;
try {
this.kb = kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.kb;
@@ -25,10 +24,16 @@ try {
this.kb || (this.kb = kb || (kb = {}));
+isElement = function(obj) {
+ return obj && (obj.nodeType === 1);
+};
+
kb.transitions || (kb.transitions = {});
kb.fallback_transitions || (kb.fallback_transitions = {});
+kb.MAX_TRANSITION = 800;
+
kb.transitions.END_EVENT = (function() {
var END_EVENT_NAMES, el, event, style;
el = document.createElement('knockback');
@@ -61,10 +66,9 @@ $.fn.startTransition = function(classes, callback) {
_this.off(kb.transitions.END_EVENT, cleanupCallback);
return !callback || callback();
};
- this.removeClass(classes);
this.one(kb.transitions.END_EVENT, cleanupCallback);
this.addClass(classes);
- setTimeout(cleanupCallback, 300);
+ setTimeout(cleanupCallback, kb.MAX_TRANSITION);
};
$.fn.stopTransition = function() {
@@ -92,7 +96,7 @@ kb.TransitionSavedState = (function() {
this.el_states = [];
for (name in info) {
el = info[name];
- !_.isElement(el) || this.el_states.push({
+ !isElement(el) || this.el_states.push({
el: el,
className: el.className,
cssText: el.style.cssText
@@ -132,11 +136,16 @@ kb.transitions.SlideUp = function(info, options) {
};
kb.transitions.FadeIn = function(info, options) {
- var $to;
+ var $to, classes;
$to = $(info.to).css({
'min-height': $(info.container).height()
});
- $to.startTransition((options.forward ? 'on-top fade in' : 'on-top fade out'), info.callback);
+ classes = 'on-top fade';
+ classes += (options.forward ? ' in' : ' out');
+ if (options.slow) {
+ classes += ' slow';
+ }
+ $to.startTransition(classes, info.callback);
};
kb.transitions.Slide = function(info, options) {
@@ -161,8 +170,6 @@ kb.transitions.Slide = function(info, options) {
}
};
-FALLBACK_ANIMATION_DURATION = kb.FALLBACK_ANIMATION_DURATION = 300;
-
if (this.Zepto) {
wrapAnimCallback = function(el, properties, callback) {
el.__kb_zepto_endEvent = typeof properties === 'string' ? $.fx.animationEnd : $.fx.transitionEnd;
@@ -198,8 +205,10 @@ if (this.Zepto) {
};
}
+kb.SLIDE_UP_DURATION = 300;
+
kb.fallback_transitions.SlideUp = function(info, options) {
- var $to, callback, duration, height, top;
+ var $to, callback, height, top;
if (!info.from) {
info.callback();
return;
@@ -207,9 +216,9 @@ kb.fallback_transitions.SlideUp = function(info, options) {
$to = $(info.to);
callback = function() {
$to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
height = info.container.clientHeight;
top = info.to.clientTop;
if (options.forward) {
@@ -217,39 +226,48 @@ kb.fallback_transitions.SlideUp = function(info, options) {
top: top + height
}).animate({
top: top
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
} else {
$to.addClass('on-top').animate({
top: top + height
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
}
- $to.startTransition(callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.FADE_IN_DURATION = 300;
+
kb.fallback_transitions.FadeIn = function(info, options) {
- var $to, duration;
- $to = $(info.to).css({
+ var $to, callback;
+ $to = $(info.to);
+ callback = function() {
+ $to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
+ return info.callback();
+ };
+ $to.css({
'min-height': $(info.container).height()
});
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
if (options.forward) {
$to.css({
'opacity': 0
});
$to.animate({
'opacity': 1
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
} else {
$to.css({
'opacity': 1
});
$to.animate({
'opacity': 0
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
}
- $to.startTransition(info.callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.SLIDE_DURATION = 300;
+
kb.fallback_transitions.Slide = function(info, options) {
var $from, $to, callback, duration, from_left, to_left, width;
if (!info.from) {
@@ -259,12 +277,13 @@ kb.fallback_transitions.Slide = function(info, options) {
$to = $(info.to);
$from = $(info.from);
callback = function() {
- $from.stop();
$to.stop();
+ $from.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
width = $(info.container).width();
+ duration = kb.SLIDE_DURATION;
if (options.forward) {
$from.animate({
left: info.from.clientLeft - width
@@ -286,7 +305,7 @@ kb.fallback_transitions.Slide = function(info, options) {
left: info.to.clientLeft + width
}, duration, 'linear', callback);
}
- return $to.startTransition(callback);
+ return $to.one(kb.transitions.END_EVENT, callback);
};
return;
View
3  packages/npm/knockback-transitions.min.js
@@ -2,5 +2,4 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.removeClass(e),this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,300)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},t=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var t,n;this.el_states=[];for(n in e)t=e[n],!_.isElement(t)||this.el_states.push({el:t,className:t.className,cssText:t.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n;n=$(e.to).css({"min-height":$(e.container).height()}),n.startTransition(t.forward?"on-top fade in":"on-top fade out",e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},e=n.FALLBACK_ANIMATION_DURATION=300,this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.fallback_transitions.SlideUp=function(t,n){var r,i,s,o,u;if(!t.from){t.callback();return}r=$(t.to),i=function(){return r.stop(),t.callback()},s="duration"in n?n.duration:e,o=t.container.clientHeight,u=t.to.clientTop,n.forward?r.addClass("on-top").css({top:u+o}).animate({top:u},s,"linear",i):r.addClass("on-top").animate({top:u+o},s,"linear",i),r.startTransition(i)},n.fallback_transitions.FadeIn=function(t,n){var r,i;r=$(t.to).css({"min-height":$(t.container).height()}),i="duration"in n?n.duration:e,n.forward?(r.css({opacity:0}),r.animate({opacity:1},1e3,"swing",t.callback)):(r.css({opacity:1}),r.animate({opacity:0},1e3,"swing",t.callback)),r.startTransition(t.callback)},n.fallback_transitions.Slide=function(t,n){var r,i,s,o,u,a,f;if(!t.from){t.callback();return}return i=$(t.to),r=$(t.from),s=function(){return r.stop(),i.stop(),t.callback()},o="duration"in n?n.duration:e,f=$(t.container).width(),n.forward?(r.animate({left:t.from.clientLeft-f},o,"linear"),a=t.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=t.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:t.to.clientLeft+f},o,"linear",s)),i.startTransition(s)};return})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),t=function(e){return e&&e.nodeType===1},n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.MAX_TRANSITION=800,n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,n.MAX_TRANSITION)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},e=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var n,r;this.el_states=[];for(r in e)n=e[r],!t(n)||this.el_states.push({el:n,className:n.className,cssText:n.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n,r;n=$(e.to).css({"min-height":$(e.container).height()}),r="on-top fade",r+=t.forward?" in":" out",t.slow&&(r+=" slow"),n.startTransition(r,e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.SLIDE_UP_DURATION=300,n.fallback_transitions.SlideUp=function(e,t){var r,i,s,o;if(!e.from){e.callback();return}r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},s=e.container.clientHeight,o=e.to.clientTop,t.forward?r.addClass("on-top").css({top:o+s}).animate({top:o},n.SLIDE_UP_DURATION,"linear",i):r.addClass("on-top").animate({top:o+s},n.SLIDE_UP_DURATION,"linear",i),r.one(n.transitions.END_EVENT,i)},n.FADE_IN_DURATION=300,n.fallback_transitions.FadeIn=function(e,t){var r,i;r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},r.css({"min-height":$(e.container).height()}),t.forward?(r.css({opacity:0}),r.animate({opacity:1},n.FADE_IN_DURATION,"swing",e.callback)):(r.css({opacity:1}),r.animate({opacity:0},n.FADE_IN_DURATION,"swing",e.callback)),r.one(n.transitions.END_EVENT,i)},n.SLIDE_DURATION=300,n.fallback_transitions.Slide=function(e,t){var r,i,s,o,u,a,f;if(!e.from){e.callback();return}return i=$(e.to),r=$(e.from),s=function(){return i.stop(),r.stop(),i.off(n.transitions.END_EVENT,s),e.callback()},f=$(e.container).width(),o=n.SLIDE_DURATION,t.forward?(r.animate({left:e.from.clientLeft-f},o,"linear"),a=e.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=e.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:e.to.clientLeft+f},o,"linear",s)),i.one(n.transitions.END_EVENT,s)};return})}).call(this);
View
15 packages/nuget/Content/Scripts/knockback-navigators.css
@@ -1,5 +1,5 @@
/*
- knockback-page-navigators.css 0.1.1
+ knockback-navigators.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -9,19 +9,6 @@
position: relative;
}
-.pane-navigator.page {
- overflow: visible; /* will resize the browser window */
-}
-
-.pane-navigator.page.embed {
- overflow: hidden; /* will stay in its pane instead of resizing the page */
-}
-/*
- knockback-panes.css 0.1.1
- (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
- License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/
.pane {
padding: 0; margin: 0; width: 100%; /* panes take up their pane-navigator */
display: none; /* panes are not visible by default */
View
1  packages/nuget/Content/Scripts/knockback-page-navigator-panes.js
@@ -2,7 +2,6 @@
knockback-page-navigator-panes.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/nuget/Content/Scripts/knockback-page-navigator-panes.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-panes.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-panes",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),r.PageNavigatorPanes=function(){function e(e,t){t==null&&(t={}),e||o(this,"el"),a.bindAll(this,"hasHistory","activePage","previousPage","activeUrl","loadPage","goBack","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.pane_navigator=new r.PaneNavigator(e,t)}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.pane_navigator.destroy(),this.pane_navigator=null},e.prototype.hasHistory=function(){return!this.pane_navigator.no_history},e.prototype.activePage=function(){return this.pane_navigator.activePane()},e.prototype.activeUrl=function(){var e;return(e=this.pane_navigator.activePane())?e.url:null},e.prototype.previousPage=function(){return this.pane_navigator.previousPane()},e.prototype.previousUrl=function(){var e;return(e=this.pane_navigator.previousPage())?e.url:null},e.prototype.loadPage=function(e){var t,n;return e||o(this,"page info"),n=r.popOverrideTransition(),this.activeUrl()===window.location.hash?(t=this.activePage(),t.el||pane_navigator.ensureElement(t),t.el.parentNode!==this.el&&this.el.appendChild(t.el),t):this.pane_navigator.push(new r.Pane(e,window.location.hash),n?{transition:n}:null)},e.prototype.goBack=function(){var e,t;return t=r.popOverrideTransition(),this.pane_navigator.pop(),!(e=this.pane_navigator.activePane())||r.loadUrl(e.url),e},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r,i,s;s=window.location.hash;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if((i=this.previousPage())&&i.url===s)return this.goBack();if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorPanes=r.PageNavigatorPanes),i&&i.bindingHandlers&&(i.bindingHandlers.PageNavigatorPanes={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PageNavigatorPanes(e,o),r.utils.wrappedPageNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),r.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.override_transitions=[],r.popOverrideTransition=function(){return r.override_transitions.length?r.override_transitions.pop():null},r.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},r.loadUrl=function(e,t){return r.override_transitions.push(t),r.dispatchUrl(e)},r.loadUrlFn=function(e,t){return function(n,i){r.loadUrl(e,t),!n||!n.stopPropagation||(i=n),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},r.utils||(r.utils={}),r.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
1  packages/nuget/Content/Scripts/knockback-page-navigator-simple.js
@@ -2,7 +2,6 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/nuget/Content/Scripts/knockback-page-navigator-simple.min.js
@@ -2,5 +2,4 @@
knockback-page-navigator-simple.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-page-navigator-simple",e):e.call(this)}(function(){var e,t,n,r,i,s;r=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is missing"},i=function(e,t){throw""+(s.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(o){({})}this.kb||(this.kb=t||(t={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{n=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(o){({})}return n||(n={}),n.observable||(n.dataFor=function(e){return null},n.removeNode=function(e){return $(e).remove()},n.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},n.observableArray=function(e){var t;return t=n.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),s=this._?this._:t._?t._:{},s.bindAll||(e=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},s.bindAll=function(t,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],e(t,r)}),s.isElement||(s.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),t.PageNavigatorSimple=function(){function e(e,t){this.options=t!=null?t:{},e||r(this,"el"),s.bindAll(this,"hasHistory","activePage","activeUrl","loadPage","dispatcher"),this.el=e.length?e[0]:e,$(this.el).addClass("page"),this.active_page=n.observable()}return e.prototype.destroy=function(){return this.destroyed=!0,this.el=null,this.active_page=null},e.prototype.hasHistory=function(){return!1},e.prototype.activePage=function(){return this.active_page()},e.prototype.activeUrl=function(){var e;return(e=this.active_page())?e.url:null},e.prototype.loadPage=function(e){var n,i;return e||r(this,"page info"),this.activeUrl()===window.location.hash?(n=this.activePage(),n.el||pane_navigator.ensureElement(n),n.el.parentNode!==this.el&&this.el.appendChild(n.el),n):((i=this.activePage())&&i.destroy(this.options),n=new t.Pane(e,window.location.hash),n.activate(this.el),this.active_page(n),n)},e.prototype.dispatcher=function(e){var t;return t=this,function(){t.destroyed||t.routeTriggered(this,e,arguments)}},e.prototype.routeTriggered=function(e,t,n){var r;if((r=this.activePage())&&r.url===window.location.hash)return this.loadPage(r);if(t)return t.apply(e,n)},e}(),typeof exports!="undefined"&&(exports.PageNavigatorSimple=t.PageNavigatorSimple),n&&n.bindingHandlers&&(n.bindingHandlers.PageNavigatorSimple={init:function(e,r,i,s){var o,u;return o=n.utils.unwrapObservable(r()),"no_remove"in o||(o.no_remove=!0),u=new t.PageNavigatorSimple(e,o),t.utils.wrappedPageNavigator(e,u),n.utils.domNodeDisposal.addDisposeCallback(e,function(){return typeof o.unloaded=="function"&&o.unloaded(u),t.utils.wrappedPageNavigator(e,null)}),typeof o.loaded=="function"?o.loaded(u):void 0}}),t.override_transitions=[],t.popOverrideTransition=function(){return t.override_transitions.length?t.override_transitions.pop():null},t.dispatchUrl=function(e){window.location.hash=e;if(window.Backbone&&window.Backbone.History.started)return window.Backbone.history.loadUrl(e);if(window.Path)return window.Path.dispatch(e)},t.loadUrl=function(e,n){return t.override_transitions.push(n),t.dispatchUrl(e)},t.loadUrlFn=function(e,n){return function(r,i){t.loadUrl(e,n),!r||!r.stopPropagation||(i=r),!i||!i.stopPropagation||(i.stopPropagation(),i.preventDefault())}},t.utils||(t.utils={}),t.utils.wrappedPageNavigator=function(e,t){return arguments.length===1||e.__kb_page_navigator===t?e.__kb_page_navigator:(e.__kb_page_navigator&&e.__kb_page_navigator.destroy(),e.__kb_page_navigator=t,t)},t.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(s.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||r(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||r(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(n.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:n.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=t.Pane),t})}).call(this);
View
1  packages/nuget/Content/Scripts/knockback-pane-navigator.js
@@ -2,7 +2,6 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
View
1  packages/nuget/Content/Scripts/knockback-pane-navigator.min.js
@@ -2,5 +2,4 @@
knockback-pane-navigator.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-pane-navigator",e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a;o=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is missing"},u=function(e,t){throw""+(a.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"};try{this.kb=r=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(f){({})}this.kb||(this.kb=r||(r={})),this.Backbone||(this.Backbone=this.kb.Backbone);try{i=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko}catch(f){({})}return i||(i={}),i.observable||(i.dataFor=function(e){return null},i.removeNode=function(e){return $(e).remove()},i.observable=function(e){var t;return t=e,function(e){return arguments.length?t=e:t}},i.observableArray=function(e){var t;return t=i.observable(arguments.length?e:[]),t.push=function(){return t().push.apply(t(),arguments)},t.pop=function(){return t().pop.apply(t(),arguments)},t}),a=this._?this._:r._?r._:{},a.bindAll||(t=function(e,t){var n;return n=e[t],e[t]=function(){return n.apply(e,arguments)}},a.bindAll=function(e,n){var r,i,s,o;o=Array.prototype.slice.call(arguments,1);for(i=0,s=o.length;i<s;i++)r=o[i],t(e,r)}),a.isElement||(a.isElement=function(e){return e&&e.nodeType===1}),this.x$&&(this.$=this.x$),s=this,e=100,n=function(e){var t,n,i;if(n=e.activePane()){i=n.el.parentNode;while(i&&i!==e.el)i=i.parentNode;if(i)return;e.clear()}t=$(e.el).children().filter(".pane");if(t.length)return e.push(new r.Pane(t[0]))},r.PaneNavigator=function(){function e(e,t){var r,u,a=this;e||o(this,"el");for(r in t)u=t[r],this[r]=u;this.panes=i.observableArray(),this.el=e&&e.length?e[0]:e,$(this.el).addClass("pane-navigator"),this.interval=s.setInterval(function(){return n(a)})}return e.prototype.destroy=function(){return s.clearInterval(this.interval),this.interval=null,this.el=null,this.clear({silent:!0})},e.prototype.clear=function(e){var t,n,r,i;e==null&&(e={}),this.cleanupTransition(!0),(t=this.activePane())&&t.destroy(this),n=this.panes(),i=n.slice(),i.pop(),n.splice(0,n.length);while(r=i.pop())r.el&&r.destroy(this);return e.silent||this.panes([]),this},e.prototype.activePane=function(){return this.paneAt(-1)},e.prototype.previousPane=function(){return this.paneAt(-2)},e.prototype.paneAt=function(e){var t,n;return n=this.panes(),t=e<0?n.length+e:e,t>=0&&t<n.length?n[t]:null},e.prototype.push=function(e,t){var n,r,i,s=this;t==null&&(t={});if(!e)return;return this.cleanupTransition(!0),"transition"in t&&(e.transition=t.transition),e.ensureElement(this.el),t.silent?this.panes().push(e):this.panes.push(e),i=this.previousPane(),r=!1,n=function(){var e;if(r)return;r=!0,s.cleanupTransition();if(i)return s.no_history?(e=s.panes(),e.splice(a.indexOf(e,i),1),i.destroy(s)):i.deactivate(s)},e&&(e.transition||this.transition)?(this.startTransition(e,i,n,!0),e.activate(this.el)):(e.activate(this.el),n()),e},e.prototype.pop=function(e){var t,n,r,i,s=this;return e==null&&(e={}),i=this.previousPane(),i?(i.ensureElement(),this.cleanupTransition(!0),t=this.activePane(),"transition"in e&&(t.transition=e.transition),this.panes.pop(),r=!1,n=function(){if(r)return;r=!0,s.cleanupTransition();if(t)return t.destroy(s)},t&&(t.transition||this.transition)?(this.startTransition(t,i,n,!1),i.activate(this.el)):(i.activate(this.el),n()),i):null},e.prototype.startTransition=function(e,t,n,i){var s,u,a,f,l,c,h,p,d,v;if(!e)return;e.transition&&e.transition.options&&(h=e.transition.options.use_previous),h&&(d=[t,e],e=d[0],t=d[1],i=!i),c=e.transition?e.transition:this.transition;if(!c)return null;typeof c=="string"&&(c={name:c}),r.active_transitions[c.name]||o(this,"transition "+c.name),f={forward:i};for(a in c)p=c[a],f[a]=p;return f.inverse&&(v=[t,e],e=v[0],t=v[1],f.forward=!f.forward),delete f.inverse,e&&e.activate(this.el),t&&t.activate(this.el),u={container:this.el,from:t?t.el:null,to:e?e.el:null,callback:n},l=new r.TransitionSavedState(u),!u.to||$(u.to).addClass("in-transition"),!u.from||$(u.from).addClass("in-transition"),s=this.el.clientHeight,s||(s=u.from?Math.max(u.to.clientHeight,u.from.clientHeight):u.to.clientHeight),$(this.el).css({overflow:"hidden",height:s}),this.active_transition={callback:n,start_state:l,info:u},new r.active_transitions[c.name](u,f)},e.prototype.cleanupTransition=function(e){var t;if(!this.active_transition)return;return t=this.active_transition,this.active_transition=null,e&&(!t.info.to||$(t.info.to).stopTransition(),!t.info.from||$(t.info.from).stopTransition()),t.start_state.restore(),t.callback()},e}(),typeof exports!="undefined"&&(exports.PaneNavigator=r.PaneNavigator),r.transitions||(r.transitions={}),a.indexOf||(a.indexOf=function(e,t){var n,r;for(n in e){r=e[n];if(r===t)return n}return-1}),r.utils||(r.utils={}),r.utils.wrappedPaneNavigator=function(e,t){return arguments.length===1||e.__kb_pane_navigator===t?e.__kb_pane_navigator:(e.__kb_pane_navigator&&e.__kb_pane_navigator.destroy(),e.__kb_pane_navigator=t,t)},this.$&&$.fn&&($.fn.findByPath=function(e){var t,n,r,i,s,o,u,a,f,l;o=[];for(u=0,f=this.length;u<f;u++){s=this[u],r=e.split("/"),i=s;for(a=0,l=r.length;a<l;a++){n=r[a],n[0]==="^"?(e=n.substring(1),e?(t=$(i).closest(e),i=t.length?t[0]:null):i=i.parentNode):n===".."?i=i.parentNode:(t=$(i).find(n),i=t.length?t[0]:null);if(!i)break}i&&o.push(i)}return $(o)},$.fn.findPaneNavigator=function(){var e,t,n,i,s,o,u,a,f,l,c;for(u=0,f=this.length;u<f;u++){n=this[u];if(o=n.getAttribute("data-path"))return e=this.findByPath(o),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null;t=$(n).parent();while(t.length&&!t.is("div"))t=t.parent();c=t.parent().find(".pane-navigator");for(a=0,l=c.length;a<l;a++){s=c[a];if(i=r.utils.wrappedPaneNavigator(s))return i}return e=$(n).closest(".pane-navigator"),e.length&&(i=r.utils.wrappedPaneNavigator(e[0]))?i:null}}),r.nextPane=function(e,t){var n,i,s,o;i=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,o=$(i).findPaneNavigator();if(!o||!(n=o.activePane()))return;s=n.el;while(s=s.nextSibling)if(a.isElement(s)&&$(s).hasClass("pane"))break;if(s)return o.push(new r.Pane(s))},r.previousPane=function(e,t){var n,r;n=a.isElement(e)?e:e.currentTarget?e.currentTarget:t.currentTarget,r=$(n).findPaneNavigator();if(r&&r.activePane())return r.pop()},i.bindingHandlers&&(i.bindingHandlers.PaneNavigator={init:function(e,t,n,s){var o,u;return o=i.utils.unwrapObservable(t()),"no_remove"in o||(o.no_remove=!0),u=new r.PaneNavigator(e,o),r.utils.wrappedPaneNavigator(e,u),i.utils.domNodeDisposal.addDisposeCallback(e,function(){return r.utils.wrappedPaneNavigator(e,null)}),$(e).addClass("pane-navigator")}}),r.Pane=function(){function e(e,t){arguments.length&&(this.url=t),this.setInfo(e)}return e.prototype.destroy=function(e){return e==null&&(e={}),this.deactivate(e),this.removeElement(e,!0),this.create=null,this.el=null},e.prototype.setInfo=function(e){var t,n;if(a.isElement(e))this.el=e;else for(t in e)n=e[t],this[t]=n;this.el&&$(this.el).addClass("pane")},e.prototype.ensureElement=function(){var e;if(this.el)return this.el;this.create||o(this,"create"),e=this.create.apply(this,this.args),e&&this.setInfo(e),this.el||o(this,"element"),this.el&&$(this.el).addClass("pane")},e.prototype.removeElement=function(e,t){e==null&&(e={});if(!this.el)return this;if(e.no_remove)return;t||this.create&&!e.no_destroy?(i.removeNode(this.el),this.el=null):this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.activate=function(e){var t;this.ensureElement();if($(this.el).hasClass("active"))return;$(this.el).addClass("active"),this.el.parentNode!==e&&e.appendChild(this.el),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.activate&&t.activate(this)},e.prototype.deactivate=function(e){var t;e==null&&(e={});if(!this.el||!$(this.el).hasClass("active"))return;$(this.el).removeClass("active"),t=this.view_model?this.view_model:i.dataFor(this.el),t&&t.deactivate&&t.deactivate(this),this.removeElement(e)},e}(),typeof exports!="undefined"&&(exports.Pane=r.Pane),r})}).call(this);
View
192 packages/nuget/Content/Scripts/knockback-transitions.css
@@ -2,10 +2,10 @@
knockback-tranitions.css 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
+ Port of jQueryMobile transitions (https://github.com/jquery/jquery-mobile) to stylus for auto generation of vendor prefixes.
*/
.in-transition {
-/* pointer-events: none;*/
+ pointer-events: none;
position: absolute;
}
.in {
@@ -32,50 +32,60 @@
-ms-animation-duration: 225ms;
animation-duration: 225ms;
}
--keyframes fadein from {
+.fade.out {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadeout;
+ -moz-animation-name: fadeout;
+ -o-animation-name: fadeout;
+ -ms-animation-name: fadeout;
+ animation-name: fadeout;
}
--keyframes fadein to {
- opacity: 1;
- -ms-filter: none;
- filter: none;
-}
--keyframes fadeout from {
+.fade.in {
opacity: 1;
-ms-filter: none;
filter: none;
+ -webkit-animation-duration: 500ms;
+ -moz-animation-duration: 500ms;
+ -o-animation-duration: 500ms;
+ -ms-animation-duration: 500ms;
+ animation-duration: 500ms;
+ -webkit-animation-name: fadein;
+ -moz-animation-name: fadein;
+ -o-animation-name: fadein;
+ -ms-animation-name: fadein;
+ animation-name: fadein;
}
--keyframes fadeout to {
- opacity: 0;
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
- filter: alpha(opacity=0);
-}
-.fade.out {
+.fade.out.slow {
opacity: 0;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter: alpha(opacity=0);
- -webkit-animation-duration: 125ms;
- -moz-animation-duration: 125ms;
- -o-animation-duration: 125ms;
- -ms-animation-duration: 125ms;
- animation-duration: 125ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadeout;
-moz-animation-name: fadeout;
-o-animation-name: fadeout;
-ms-animation-name: fadeout;
animation-name: fadeout;
}
-.fade.in {
+.fade.in.slow {
opacity: 1;
-ms-filter: none;
filter: none;
- -webkit-animation-duration: 225ms;
- -moz-animation-duration: 225ms;
- -o-animation-duration: 225ms;
- -ms-animation-duration: 225ms;
- animation-duration: 225ms;
+ -webkit-animation-duration: 800ms;
+ -moz-animation-duration: 800ms;
+ -o-animation-duration: 800ms;
+ -ms-animation-duration: 800ms;
+ animation-duration: 800ms;
-webkit-animation-name: fadein;
-moz-animation-name: fadein;
-o-animation-name: fadein;
@@ -392,6 +402,136 @@
-ms-animation-duration: 200ms;
animation-duration: 200ms;
}
+@-moz-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-webkit-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-o-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-ms-keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@keyframes fadein {
+ 0% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+
+ 100% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+}
+@-moz-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-webkit-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-o-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@-ms-keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
+@keyframes fadeout {
+ 0% {
+ opacity: 1;
+ -ms-filter: none;
+ filter: none;
+ }
+
+ 100% {
+ opacity: 0;
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ filter: alpha(opacity=0);
+ }
+}
@-moz-keyframes popin {
0% {
-webkit-transform: scale(0.8);
View
65 packages/nuget/Content/Scripts/knockback-transitions.js
@@ -2,7 +2,6 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
*/
(function() {
return (function(factory) {
@@ -15,7 +14,7 @@
return factory.call(this);
}
})(function() {// Generated by CoffeeScript 1.3.3
-var FALLBACK_ANIMATION_DURATION, extractStyles, kb, wrapAnimCallback, _anim_fn;
+var extractStyles, isElement, kb, wrapAnimCallback, _anim_fn;
try {
this.kb = kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.kb;
@@ -25,10 +24,16 @@ try {
this.kb || (this.kb = kb || (kb = {}));
+isElement = function(obj) {
+ return obj && (obj.nodeType === 1);
+};
+
kb.transitions || (kb.transitions = {});
kb.fallback_transitions || (kb.fallback_transitions = {});
+kb.MAX_TRANSITION = 800;
+
kb.transitions.END_EVENT = (function() {
var END_EVENT_NAMES, el, event, style;
el = document.createElement('knockback');
@@ -61,10 +66,9 @@ $.fn.startTransition = function(classes, callback) {
_this.off(kb.transitions.END_EVENT, cleanupCallback);
return !callback || callback();
};
- this.removeClass(classes);
this.one(kb.transitions.END_EVENT, cleanupCallback);
this.addClass(classes);
- setTimeout(cleanupCallback, 300);
+ setTimeout(cleanupCallback, kb.MAX_TRANSITION);
};
$.fn.stopTransition = function() {
@@ -92,7 +96,7 @@ kb.TransitionSavedState = (function() {
this.el_states = [];
for (name in info) {
el = info[name];
- !_.isElement(el) || this.el_states.push({
+ !isElement(el) || this.el_states.push({
el: el,
className: el.className,
cssText: el.style.cssText
@@ -132,11 +136,16 @@ kb.transitions.SlideUp = function(info, options) {
};
kb.transitions.FadeIn = function(info, options) {
- var $to;
+ var $to, classes;
$to = $(info.to).css({
'min-height': $(info.container).height()
});
- $to.startTransition((options.forward ? 'on-top fade in' : 'on-top fade out'), info.callback);
+ classes = 'on-top fade';
+ classes += (options.forward ? ' in' : ' out');
+ if (options.slow) {
+ classes += ' slow';
+ }
+ $to.startTransition(classes, info.callback);
};
kb.transitions.Slide = function(info, options) {
@@ -161,8 +170,6 @@ kb.transitions.Slide = function(info, options) {
}
};
-FALLBACK_ANIMATION_DURATION = kb.FALLBACK_ANIMATION_DURATION = 300;
-
if (this.Zepto) {
wrapAnimCallback = function(el, properties, callback) {
el.__kb_zepto_endEvent = typeof properties === 'string' ? $.fx.animationEnd : $.fx.transitionEnd;
@@ -198,8 +205,10 @@ if (this.Zepto) {
};
}
+kb.SLIDE_UP_DURATION = 300;
+
kb.fallback_transitions.SlideUp = function(info, options) {
- var $to, callback, duration, height, top;
+ var $to, callback, height, top;
if (!info.from) {
info.callback();
return;
@@ -207,9 +216,9 @@ kb.fallback_transitions.SlideUp = function(info, options) {
$to = $(info.to);
callback = function() {
$to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
height = info.container.clientHeight;
top = info.to.clientTop;
if (options.forward) {
@@ -217,39 +226,48 @@ kb.fallback_transitions.SlideUp = function(info, options) {
top: top + height
}).animate({
top: top
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
} else {
$to.addClass('on-top').animate({
top: top + height
- }, duration, 'linear', callback);
+ }, kb.SLIDE_UP_DURATION, 'linear', callback);
}
- $to.startTransition(callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.FADE_IN_DURATION = 300;
+
kb.fallback_transitions.FadeIn = function(info, options) {
- var $to, duration;
- $to = $(info.to).css({
+ var $to, callback;
+ $to = $(info.to);
+ callback = function() {
+ $to.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
+ return info.callback();
+ };
+ $to.css({
'min-height': $(info.container).height()
});
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
if (options.forward) {
$to.css({
'opacity': 0
});
$to.animate({
'opacity': 1
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
} else {
$to.css({
'opacity': 1
});
$to.animate({
'opacity': 0
- }, 1000, 'swing', info.callback);
+ }, kb.FADE_IN_DURATION, 'swing', info.callback);
}
- $to.startTransition(info.callback);
+ $to.one(kb.transitions.END_EVENT, callback);
};
+kb.SLIDE_DURATION = 300;
+
kb.fallback_transitions.Slide = function(info, options) {
var $from, $to, callback, duration, from_left, to_left, width;
if (!info.from) {
@@ -259,12 +277,13 @@ kb.fallback_transitions.Slide = function(info, options) {
$to = $(info.to);
$from = $(info.from);
callback = function() {
- $from.stop();
$to.stop();
+ $from.stop();
+ $to.off(kb.transitions.END_EVENT, callback);
return info.callback();
};
- duration = 'duration' in options ? options.duration : FALLBACK_ANIMATION_DURATION;
width = $(info.container).width();
+ duration = kb.SLIDE_DURATION;
if (options.forward) {
$from.animate({
left: info.from.clientLeft - width
@@ -286,7 +305,7 @@ kb.fallback_transitions.Slide = function(info, options) {
left: info.to.clientLeft + width
}, duration, 'linear', callback);
}
- return $to.startTransition(callback);
+ return $to.one(kb.transitions.END_EVENT, callback);
};
return;
View
3  packages/nuget/Content/Scripts/knockback-transitions.min.js
@@ -2,5 +2,4 @@
knockback-transitions.js 0.1.1
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
- Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.removeClass(e),this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,300)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},t=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var t,n;this.el_states=[];for(n in e)t=e[n],!_.isElement(t)||this.el_states.push({el:t,className:t.className,cssText:t.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n;n=$(e.to).css({"min-height":$(e.container).height()}),n.startTransition(t.forward?"on-top fade in":"on-top fade out",e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},e=n.FALLBACK_ANIMATION_DURATION=300,this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.fallback_transitions.SlideUp=function(t,n){var r,i,s,o,u;if(!t.from){t.callback();return}r=$(t.to),i=function(){return r.stop(),t.callback()},s="duration"in n?n.duration:e,o=t.container.clientHeight,u=t.to.clientTop,n.forward?r.addClass("on-top").css({top:u+o}).animate({top:u},s,"linear",i):r.addClass("on-top").animate({top:u+o},s,"linear",i),r.startTransition(i)},n.fallback_transitions.FadeIn=function(t,n){var r,i;r=$(t.to).css({"min-height":$(t.container).height()}),i="duration"in n?n.duration:e,n.forward?(r.css({opacity:0}),r.animate({opacity:1},1e3,"swing",t.callback)):(r.css({opacity:1}),r.animate({opacity:0},1e3,"swing",t.callback)),r.startTransition(t.callback)},n.fallback_transitions.Slide=function(t,n){var r,i,s,o,u,a,f;if(!t.from){t.callback();return}return i=$(t.to),r=$(t.from),s=function(){return r.stop(),i.stop(),t.callback()},o="duration"in n?n.duration:e,f=$(t.container).width(),n.forward?(r.animate({left:t.from.clientLeft-f},o,"linear"),a=t.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=t.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:t.to.clientLeft+f},o,"linear",s)),i.startTransition(s)};return})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-transitions",e):e.call(this)}(function(){var e,t,n,r,i;try{this.kb=n=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb}catch(s){({})}this.kb||(this.kb=n||(n={})),t=function(e){return e&&e.nodeType===1},n.transitions||(n.transitions={}),n.fallback_transitions||(n.fallback_transitions={}),n.MAX_TRANSITION=800,n.transitions.END_EVENT=function(){var e,t,n,r;t=document.createElement("knockback"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};for(r in e){n=e[r];if(t.style[r]!==void 0)return n}return"kbTransitionEnd"}(),n.active_transitions=n.transitions.END_EVENT==="kbTransitionEnd"?n.fallback_transitions:n.transitions,$.fn.startTransition=function(e,t){var r,i=this;typeof e=="function"&&(t=e,e=null),r=function(){return i.off(n.transitions.END_EVENT,r),!t||t()},this.one(n.transitions.END_EVENT,r),this.addClass(e),setTimeout(r,n.MAX_TRANSITION)},$.fn.stopTransition=function(){this.trigger(n.transitions.END_EVENT)},e=function(e){var t,n,r,i;r={},i=e.style;for(t in i){n=i[t];if(!n)continue;r[t]=n}return r},n.TransitionSavedState=function(){function e(e){var n,r;this.el_states=[];for(r in e)n=e[r],!t(n)||this.el_states.push({el:n,className:n.className,cssText:n.style.cssText});return}return e.prototype.restore=function(){var e,t,n,r,i;i=this.el_states;for(n=0,r=i.length;n<r;n++)t=i[n],e=t.el,e.className=t.className,e.style.cssText=t.cssText;this.el_states=null},e}(),typeof exports!="undefined"&&(exports.TransitionSavedState=n.TransitionSavedState),n.transitions.SlideUp=function(e,t){if(!e.from){e.callback();return}$(e.to).css({height:$(e.container).height()}).startTransition(t.forward?"on-top slideup in":"on-top slideup out reverse",e.callback)},n.transitions.FadeIn=function(e,t){var n,r;n=$(e.to).css({"min-height":$(e.container).height()}),r="on-top fade",r+=t.forward?" in":" out",t.slow&&(r+=" slow"),n.startTransition(r,e.callback)},n.transitions.Slide=function(e,t){var n,r,i;if(!e.from){e.callback();return}i=$(e.container).width(),n=$(e.from).css({width:i}),r=$(e.to).css({width:i}),t.forward?(n.startTransition("slide out"),r.startTransition("slide in",e.callback)):(r.startTransition("slide out reverse"),n.startTransition("slide in reverse",e.callback))},this.Zepto&&(r=function(e,t,n){return e.__kb_zepto_endEvent=typeof t=="string"?$.fx.animationEnd:$.fx.transitionEnd,e.__kb_zepto_callback=function(){if(!e.__kb_zepto_endEvent)return;return delete e.__kb_zepto_endEvent,delete e.__kb_zepto_callback,!n||n.call(this)},e.__kb_zepto_callback},i=$.fn.anim,$.fn.anim=function(e,t,n,s){var o,u,a,f;for(a=0,f=this.length;a<f;a++)o=this[a],u=r(o,e,s);return i.call(this,e,t,n,u),this},$.fn.stop=function(){var e,t,n;for(t=0,n=this.length;t<n;t++)e=this[t],e.__kb_zepto_endEvent&&$(e).trigger(e.__kb_zepto_endEvent);return this}),n.SLIDE_UP_DURATION=300,n.fallback_transitions.SlideUp=function(e,t){var r,i,s,o;if(!e.from){e.callback();return}r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},s=e.container.clientHeight,o=e.to.clientTop,t.forward?r.addClass("on-top").css({top:o+s}).animate({top:o},n.SLIDE_UP_DURATION,"linear",i):r.addClass("on-top").animate({top:o+s},n.SLIDE_UP_DURATION,"linear",i),r.one(n.transitions.END_EVENT,i)},n.FADE_IN_DURATION=300,n.fallback_transitions.FadeIn=function(e,t){var r,i;r=$(e.to),i=function(){return r.stop(),r.off(n.transitions.END_EVENT,i),e.callback()},r.css({"min-height":$(e.container).height()}),t.forward?(r.css({opacity:0}),r.animate({opacity:1},n.FADE_IN_DURATION,"swing",e.callback)):(r.css({opacity:1}),r.animate({opacity:0},n.FADE_IN_DURATION,"swing",e.callback)),r.one(n.transitions.END_EVENT,i)},n.SLIDE_DURATION=300,n.fallback_transitions.Slide=function(e,t){var r,i,s,o,u,a,f;if(!e.from){e.callback();return}return i=$(e.to),r=$(e.from),s=function(){return i.stop(),r.stop(),i.off(n.transitions.END_EVENT,s),e.callback()},f=$(e.container).width(),o=n.SLIDE_DURATION,t.forward?(r.animate({left:e.from.clientLeft-f},o,"linear"),a=e.to.clientLeft,i.css({left:a+f}).animate({left:a},o,"linear",s)):(u=e.from.clientLeft,r.css({left:u-f}).animate({left:u},o,"linear"),i.animate({left:e.to.clientLeft+f},o,"linear",s)),i.one(n.transitions.END_EVENT,s)};return})}).call(this);
View
2  src/knockback-pane-navigator/knockback-pane-navigator.coffee